I apologise in advance for previous, this and future posts where I ask for some newbie guidance. But I hope you can help.
I’ve searched the forums (not exhaustively, but for some time) to see if there is any guidance. And there’s a lot of talk which is way above my head. NodeRED-this/JSON-that/config file here there and everywhere
By any chance, has a guide been drafted by those with bigger brains than me which clearly guides through the setup of an MQTT feed from a GLOW IHD to emonCMS (in my case on a Pi)?
I have connected the IHD via MQTT and the Inputs picked it up (or so I thought). NULL values came through. The forum posts I came across start to go into levels of coding, etc. which are far beyond my pay grade, hence the ask here.
Hello @rashdown_online Im not aware of such a guide, have you been able to subscribe to the IHD MQTT message in any other way? Just to see what the IHD is providing?
Im guessing that the reason you are seeing NULL values is due to a need to translate the messages send by the IHD into a format that emoncms can read…
Yes, I’ve had to do translation when trying to get MQTT messages into EmonCMS from Evogateway. Shunted them through HA and then used Node-red to convert text to numeric, and sometimes TRUE/FALSE to 0/1. Perhaps the same could be done using a template in HA.
Perhaps you need to do the same with the IHD. I’m looking at purchasing that same IHD soon.
I use an Application called MQTT Explorer to help see what messages are available from a device and to get an idea of the format. http://mqtt-explorer.com/
Thanks for the note. I have MQTT explore too. However, the real purpose of it is lost on me
The bit that you mention above is where I really do come unstuck.
I’m new on my HA journey, too. I’m aware of Node-RED but never used it as I don’t have any automations at all (yet). I’ve literally got one “smart” device (Shelly Plus1 PM) that I’ve been testing on a light! I’ve been using it really to build up a whole-house energy energy consumption profile in readiness for SolarPV and battery installation.
Are you saying that is should follow this logic: GLOW (mqtt) → HA (sensor in configuration.yaml) → Node-RED → ???. It’s that last bit I’ve no idea about.
What I was hoping to do was use emon as the main “hub” for all things energy monitoring, and then have an integration in HA for emon (which I’m lead to believe creates sensors for all the emon devices/inputs within HA.)
It might all be a moot point as I’m hoping to have an SDM230 Modbus meter installed, just after the SMETS2, which will feed emon. I just was hoping to test emon out a bit before diving in with the expense of SDMs through out my configuration. And leveraging the power of the feeds in emon to really see what’s going down.
It’s the room window open status and its value isn’t numeric, and when I get it into HA it’ll be the text “true” or “false” and if I pass that to EmonPI it’ll be ‘nan’ or some problem. I’m sure there’s another way of doing this but this is what I do.
Evogateway already has an MQTT connection HA but I still have to create my Entity in the HA /config/configuration.yaml MQTT section.
The trigger block will pass on the status of the entity only when it changes.
The function block changes “true” to 1 and “false” to 0.
The MQTT send block passes it on to EmonPI.
The MQTT node needs to have the details of your EmonPI added as a server.
The function block can contain any code you need. It could be coded to rescale an analog value. If its a calculation that I struggle to do within the EmonPI I sometimes pass the input from EmonPI to HA and then pass the result back to EmonPI.
And here is the input that appeared in Emon PI in a format I could use on say a dashboard.
This is exceptionally helpful! Thank you. I’m now a lot clearer on the logic. I’ve never used NodeRED before so this has helped clear things up a lot for this specific scenario.
I’ve already got a bunch of MQTT sensors in my configuration.yaml for the GLOW meter/integration. And this works really quite well. So I’ll leverage those.
I noticed that you’re about to get a GLOW IHD. If it helps, here’s the info I’ve got in my yaml (I don’t have gas, so have excluded the gas meter elements. If you have gas, too, then add a lot of the same for gas but change the “state_topic” from “electricity meter” to “gasmeter”:
I’ll let you know how I get on, and if it’s OK I might need to ask some more questions specifically around the pulling together of teh appropriate sensor data and preparing it to be published to emon.
Wouldn’t it be easier just to use the EmonPI with a CT to collect the usage figures, they’re more or less in real-time.
I only wanted the new IHD to gain access to gas figures because I’m having to carry out some cunning calculations in the EmonPI to estimate it at the moment.