Easiest way to export insight data to local NAS storage

I guess there is no silver bullet. The question is how many time are you willing to put into it to get the results you want.

I solved this using a docker image running Node-Red, influxDB and Grafana. From Homey I trigger on device changes and send the data to Node-Red. For this I have a bunch of flows in place.

Maybe a solution with MQTT Hub would have been easier but at the time there was no MQTT Hub yet.

Anyways returning back to Node-Red, it sorts out the data and stores the data in influxDB.
While this seems like overkill and a lot of work the payoff is immense. Total freedom to vizualize your data as you see fit. Below you can see my dashboard to vizualize the data. You can even visualize binary data (on/off, true/false) and if you want you can store your data forever :smile: Awesome!!!


You can even visualize cpu load and memory usage of your Homey device and apps.

This simple node-red flow is the workhorse feeding the data to influxDB.

Below the “parse event data” function block containing javascript

newmsg = {}
newmsg.payload = {}
var local_time =  new Date().toLocaleTimeString();
newmsg.measurement = msg.payload.event.trim();

switch(newmsg.measurement) {
  case "temperature":
  case "luminance":
  case "humidity":
  case "battery":
  case "current":
  case "power":
  case "power_meter":
    newmsg.payload.value = parseFloat(msg.payload.value.trim());
    break;
  case "contact":
  case "motion":
  case "generic":
  case "onoff":
    newmsg.payload.value = (msg.payload.value.trim() == 'true'?1:0);
    break;
  default:
    newmsg.payload.value = msg.payload.value.trim();
}

newmsg.payload = [ newmsg.payload, { "name": msg.payload.name.trim()} ];
newmsg.payload[1].zone = msg.payload.hasOwnProperty('zone')?msg.payload.zone.trim():'unknown';
newmsg.payload[1].class = msg.payload.class.trim();

node.status({text:msg.payload.name.trim() + ' ' + newmsg.measurement +  ' ' + msg.payload.value.trim()  + ' (' + local_time + ')' });

return newmsg;

I’d be happy to share my node-red flows if you are interested.

1 Like