Change float value

Hi,

i want to convert values that I read from my PV system and receive as e.g. fl_450FF801 so that a correct value is displayed. fl_450FF801 should become something like 0.34 kW.
How can i change this values and what means fl_ is it a float value? and to which value must i change it to become the real values behind it? same with value u8, what to do with this value?
i read many topics here but didn't find the right solution, if it's already there please tell me where to find it :wink:

values

Thanks for your help, regards, Andre

It would help if you told us the make and model of the device. What does the manual say about values?

Hi Steve,

its a SENEC Home v3 and i got these values from an website (http://ipaddress/lala.cgi):


i want to work with the values and automat something...

This page gives info on types Query the hidden API of your SENEC photovoltaic appliances
According to this site this should work] for fl_ and u8_

msg.payload.fl = Buffer.from("fl_42A2E5E4".split("_")[1], 'hex').readFloatBE() // fl_
msg.payload.u8 = Buffer.from("u8_64".split("_")[1], 'hex').readUInt8() //u8_

Test flow

[{"id":"18144789e95d8588","type":"inject","z":"366a43adb328cf95","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"fl\":\"fl_450FF801\",\"u8\":\"u8_64\"}","payloadType":"json","x":110,"y":460,"wires":[["8a5128bec0bd3db6"]]},{"id":"aefc713a35661715","type":"debug","z":"366a43adb328cf95","name":"debug 11","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":920,"y":380,"wires":[]},{"id":"8a5128bec0bd3db6","type":"function","z":"366a43adb328cf95","name":"function 11","func":"msg.payload.float = Buffer.from(msg.payload.fl.split(\"_\")[1], 'hex').readFloatBE() // fl_\nmsg.payload.uint = Buffer.from(msg.payload.u8.split(\"_\")[1], 'hex').readUInt8() //u8_\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":500,"wires":[["aefc713a35661715"]]}]

Hi E1cid, thanks for your help, ok that worked for me.. but only if i have a fixed value in this function node, how can i change this to a variable..

i tried:
msg.payload.fl = Buffer.from("msg.payload.ENERGY.GUI_HOUSE_POW".split("")[1], 'hex').readFloatBE() // fl

but this didn't work?

Try without quotes

msg.payload.fl = Buffer.from(msg.payload.ENERGY.GUI_HOUSE_POW.split("_")[1], 'hex').readFloatBE()

small mistake big effect :wink:

Now it's working, thanks so much.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.