Import data from Glow MQTT IHD

Continued from Glow IHD with Local MQTT

I’m eventually getting round to doing this, and have noticed a few oddities with the data;

In trying to decode the MQTT data in Node-RED, I discovered several things with the gas data;

  1. The timestamp only changes every 3 messages (aprox just over 30s) (sometimes 4 messages)
  2. The difference between the 2 timestamps is not consistent (between 28 and 32 seconds)
22/08/2022, 21:58:30node: eab876118987fe3a glow/441793526184/SENSOR/gasmeter : msg.payload.gasmeter.timestamp : string[20] "2022-08-22T20:58:07Z" 
22/08/2022, 21:58:40node: eab876118987fe3a glow/441793526184/SENSOR/gasmeter : msg.payload.gasmeter.timestamp : string[20] "2022-08-22T20:58:07Z" 
22/08/2022, 21:58:50node: eab876118987fe3a glow/441793526184/SENSOR/gasmeter : msg.payload.gasmeter.timestamp : string[20] "2022-08-22T20:58:39Z" 
22/08/2022, 21:59:00node: eab876118987fe3a glow/441793526184/SENSOR/gasmeter : msg.payload.gasmeter.timestamp : string[20] "2022-08-22T20:58:39Z" 
22/08/2022, 21:59:10node: eab876118987fe3a glow/441793526184/SENSOR/gasmeter : msg.payload.gasmeter.timestamp : string[20] "2022-08-22T20:58:39Z" 
22/08/2022, 21:59:20node: eab876118987fe3a glow/441793526184/SENSOR/gasmeter : msg.payload.gasmeter.timestamp : string[20] "2022-08-22T20:59:12Z" 
22/08/2022, 21:59:30node: eab876118987fe3a glow/441793526184/SENSOR/gasmeter : msg.payload.gasmeter.timestamp : string[20] "2022-08-22T20:59:12Z" 
22/08/2022, 21:59:40node: eab876118987fe3a glow/441793526184/SENSOR/gasmeter : msg.payload.gasmeter.timestamp : string[20] "2022-08-22T20:59:12Z"

I also noticed taking over 30s to change timestamp.

If anyone want to import this data I suggest the following Node-RED function

var newmsg = {};
newmsg.payload = {};

newmsg.payload.time = msg.payload.gasmeter.timestamp.replace("Z", "+00:00");
newmsg.payload.gasm3 = msg.payload.gasmeter.energy.import.cumulativevol
newmsg.topic = "emon/octopusmeter"

return newmsg;

Process the input every minute to avoid gaps.

The GSME only reports every 30 minutes so you could even make it more than a minute.

The IHD also gives a kWh figure (which you can add) but I’d be a little wary of the conversion factor for calorific value it uses.

Also note some of the data is listed as vol, but is in fact kWh.