Display string values as floats
Posted: 28 Dec 2020, 13:53
Hi,
I have a P1 gatway that sends information to Domoticz to a device I named Energy.
I created also a node red script that is subscribed to domoticz/out. It receives the packages from Energy, but te data I need is in svalue format
"Battery: 255
RSSI: 12
description: ""
dtype: "P1 Smart Meter"
hwid: "84"
id: "1"
idx: 651
name: "Energy"
nvalue: 0
stype: "Energy"
svalue1: "1970425"
svalue2: "1212286"
svalue3: "555504"
svalue4: "1361336"
svalue5: "411"
svalue6: "0"
unit: 1
I would like to sum svalue1 and svalue2 with 3 decimals and display it on a Oled display.
I want to do the same with svalue3 and svalue4. So I need to convert the values to floats, I think.
To test the setup I have a MQTT import device, that actually gets data and a OLED device that displays it. But the normal formula's do not work here.
How can I format the data as described above?
I have a P1 gatway that sends information to Domoticz to a device I named Energy.
I created also a node red script that is subscribed to domoticz/out. It receives the packages from Energy, but te data I need is in svalue format
"Battery: 255
RSSI: 12
description: ""
dtype: "P1 Smart Meter"
hwid: "84"
id: "1"
idx: 651
name: "Energy"
nvalue: 0
stype: "Energy"
svalue1: "1970425"
svalue2: "1212286"
svalue3: "555504"
svalue4: "1361336"
svalue5: "411"
svalue6: "0"
unit: 1
I would like to sum svalue1 and svalue2 with 3 decimals and display it on a Oled display.
I want to do the same with svalue3 and svalue4. So I need to convert the values to floats, I think.
To test the setup I have a MQTT import device, that actually gets data and a OLED device that displays it. But the normal formula's do not work here.
How can I format the data as described above?