hi. I'm relativly new to NodeRed. I like what i know it can do but i'm just trying to wrap my head around it.
My current basic goal is to parse my Json correctly so i can enter it into an InfluxDB to read. I've got a SONOFF that i get power/energy readings from and want to add to a database. I've got the db connection working.
I can take my payload, but i'm struggling to split it down to just the ENERGY values, not the time aspect - as influx will stamp time when it inserts anyway. I belive i need to use a change node but i cant seem to get it working when i change payload to payload.ENERGY.Total for example.
JSON data from SonOFF
object
topic: "tele/SonoffPOW1/SENSOR"
payload: "{"Time":"2019-04-14T16:02:10","ENERGY":{"TotalStartTime":"2018-11-10T23:29:04","Total":53.260,"Yesterday":2.762,"Today":0.669,"Power":246,"ApparentPower":281,"ReactivePower":137,"Factor":0.87,"Voltage":245,"Current":1.149}}"
qos: 0
retain: false
_topic: "tele/SonoffPOW1/SENSOR"
_msgid: "7e33adbb.05cac4"
any help would be appreciated. sorry if i've posted in the wrong place. I did a lookup on the forum but couldnt find any results that i could use that quite matched my issue.
cheers Andrew