Hi All,
I am EXTREMELY new to MQTT, Node Red and this world. But I want to learn and I thought this would be the best place for advise?
I have a MQTT Broker and Node Red set up on a pi and that is running perfectly. I have already created a few timers for items around the house (pool pump and borehole pump). These are running perfectly.
I found the Dashboard yesterday and want to create a gauge and donut for Voltage and Current respectively - and then play around more, but I need to start somewhere.
I have searched high and low but don't know how to "decode" the
stat/borehole/STATUS8
message and "convert" or extract the Voltage and Current from this message?
10:25:19 MQT: stat/borehole/STATUS8 = {"StatusSNS":{"Time":"2019-10-06T10:25:19","ENERGY":{"TotalStartTime":"2019-10-03T14:05:46","Total":5.731,"Yesterday":2.616,"Today":2.453,"Power":0.0,"ApparentPower":0.0,"ReactivePower":0.0,"Factor":0.00,"Voltage":236,"Current":0.00}}}
I have seen an example here with putting the MQTT INPUT --> FUNCTION NODE --> DASHBOARD GAUGE and adding this code
var msg1 = {};
var msg2 = {};
msg1.payload = msg.payload.Voltage;
msg1.topic = 'Voltage';
msg2.payload = msg.payload.Current;
msg2.topic = 'Current';
return [msg1, msg2];
to the FUNCTION NODE.
When I use a debug node to see the message, the only thing that shows is "Voltage" and "Current" in the 2 debug messages.
I understand that the values need to be read from
stat/borehole/STATUS8
From what I understand from searching the web, I think I need to use
$.StatusSNS.ENERGY.Voltage
and
$.StatusSNS.ENERGY.Current
to point to the value, but something just isn't tying up for me.
Im really struggling.. Any help will be greatly appreciated.
Im sure I have left some info out that is needed for you all to help
Thanks in advance everyone..