Hi, I've entered a name in the label field of a gauge node but it does not display in the UI when there is a data value in the value format field ie: {{payload.data.dps.20}}. If the value format field is left as default {{value}} it does display the lable...is this a bug ??
I think the payload
you send it only needs the value (number).
I'm not sure the gauge supports what you are sending it.
For the sake of it, just put an inject
node and make it inject..... 30
(given that the range is greater than 30
for the gauge) and see what happens.
The gauge does not like 20 as a property name in dot notation.
try
{{msg.payload.data.dps[20]}}
Not to detract from what @E1cid said, but I'm confused.
Why/how is your message
made to be {{payload.data.dps.20}}
?
(Ok and it doesn't work)
Be it you change it to {{msg.payload.data.dps[20]}}
or simply 20
.... You are going to have to change the message's format.
Hi, thank you for your reply. The 20 is not a number but part of the dot notation. However, I did try as you suggested but it threw errors...
Does an inject
node with simply with 20
(number) work?
The result does work and the gauge shows correct represenation of the value...only the label is not working on the UI screen..
please supply the flow and the input data.
[edit] Your original post you are missing the msg.
at the beginning.
test flow
[{"id":"e4b45c94.552bb8","type":"ui_gauge","z":"9a86d59e88442f2c","name":"","group":"2d4fe667.28f8ba","order":10,"width":0,"height":0,"gtype":"gage","title":"bracket","label":"units","format":"{{msg.payload.test[20]}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":380,"y":160,"wires":[]},{"id":"3878e41.0ccab9c","type":"inject","z":"9a86d59e88442f2c","name":"","props":[{"p":"payload.test.20","v":"5","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":120,"y":140,"wires":[["53b2dff6.ded2","e4b45c94.552bb8"]]},{"id":"53b2dff6.ded2","type":"ui_gauge","z":"9a86d59e88442f2c","name":"","group":"2d4fe667.28f8ba","order":10,"width":0,"height":0,"gtype":"gage","title":"dot","label":"units","format":"{{msg.payload.test.20}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":370,"y":120,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":1,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
Ok, suggestion:
Change the entire message's format.
Rather than {{msg.payload.data.dps.20}}
make the message:
{{msg.payload:20,"name":"data"}}
Then in the gauge
put/leave {{value}}
where it is, and put {{name}}
in the units
field.
That may work better.
But as @E1cid said, it may be better to post that part of the flow.
[{"id":"6dde75c9dce66091","type":"tab","label":"Flow 6","disabled":false,"info":"","env":[]},{"id":"5e2ac92c9212ab1d","type":"tuya-smart-device","z":"6dde75c9dce66091","deviceName":"go sun two","disableAutoStart":false,"deviceId":"bf31180c9cd880efXXXXXX","deviceKey":"d52be9a279XXXXXX","deviceIp":"","retryTimeout":"1001","findTimeout":"2000","tuyaVersion":"3.1","eventMode":"event-both","x":730,"y":320,"wires":[["49cfbff6055a752d","fe4aabddf99b3e6f","d445c5771977b952"],["f7ada266744d4150"]]},{"id":"a4f09cdcc3da9cac","type":"function","z":"6dde75c9dce66091","name":"","func":"const dps = 1\nlet SwitchState = msg.payload\n\nmsg.payload = { set: SwitchState }\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":320,"wires":[["5e2ac92c9212ab1d"]]},{"id":"85878bf67576dd88","type":"inject","z":"6dde75c9dce66091","name":"Turn On","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"dps\": 1, \"set\": true}","payloadType":"json","x":350,"y":280,"wires":[["5e2ac92c9212ab1d"]]},{"id":"3f487e4ffae70919","type":"inject","z":"6dde75c9dce66091","name":"Turn Off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"dps\": 1, \"set\": false}","payloadType":"json","x":350,"y":360,"wires":[["5e2ac92c9212ab1d"]]},{"id":"49cfbff6055a752d","type":"debug","z":"6dde75c9dce66091","name":"Device Data","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":920,"y":260,"wires":[]},{"id":"f7ada266744d4150","type":"debug","z":"6dde75c9dce66091","name":"Node State","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":920,"y":360,"wires":[]},{"id":"c3d87edee956357e","type":"inject","z":"6dde75c9dce66091","name":"Turn On","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":200,"y":240,"wires":[["a4f09cdcc3da9cac"]]},{"id":"c3f50e5468305801","type":"inject","z":"6dde75c9dce66091","name":"Turn Off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":200,"y":400,"wires":[["a4f09cdcc3da9cac"]]},{"id":"557cf37d175db73c","type":"inject","z":"6dde75c9dce66091","name":"RECONNECT ACTION","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"operation\":\"CONTROL\",\"action\":\"RECONNECT\"}","payloadType":"json","x":420,"y":520,"wires":[["5e2ac92c9212ab1d"]]},{"id":"189afa2918968d21","type":"inject","z":"6dde75c9dce66091","name":"DISCONNECT ACTION","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"operation\":\"CONTROL\",\"action\":\"DISCONNECT\"}","payloadType":"json","x":420,"y":460,"wires":[["5e2ac92c9212ab1d"]]},{"id":"ec65850d4ac501bd","type":"function","z":"6dde75c9dce66091","name":"","func":"const dps = 1\nlet SwitchState = msg.payload\nmsg.payload = { operation: 'GET', dps: 1 }\n\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":720,"y":200,"wires":[["5e2ac92c9212ab1d"]]},{"id":"fe4aabddf99b3e6f","type":"ui_gauge","z":"6dde75c9dce66091","name":"","group":"4dfceab38ed323b2","order":0,"width":0,"height":0,"gtype":"gage","title":"tuya","label":"%","format":"{{payload.data.dps.17}}","min":0,"max":"52","colors":["#b50200","#00e6d5","#8dca38"],"seg1":"20","seg2":"80","x":930,"y":160,"wires":[]},{"id":"d445c5771977b952","type":"ui_gauge","z":"6dde75c9dce66091","name":"Tuya","group":"4dfceab38ed323b2","order":0,"width":0,"height":0,"gtype":"gage","title":"Tuya","label":"%","format":"{{payload.data.dps.20}}","min":0,"max":"2502","colors":["#b50200","#00e6d5","#8dca38"],"seg1":"20","seg2":"80","x":930,"y":220,"wires":[]},{"id":"180308bab7ae5903","type":"inject","z":"6dde75c9dce66091","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":540,"y":200,"wires":[["ec65850d4ac501bd"]]},{"id":"4dfceab38ed323b2","type":"ui_group","name":"Tuya","tab":"7ec12690599d16c0","order":1,"disp":true,"width":"6","collapse":false},{"id":"7ec12690599d16c0","type":"ui_tab","name":"Tuya","icon":"dashboard","disabled":false,"hidden":false}]
{"payload":{"data":{"dps":{"1":false,"9":0,"18":0,"19":0,"20":2306,"21":1,"22":757,"23":31968,"24":21580,"25":964,"38":"memory","39":"relay","40":false,"41":"","42":"","43":""}},"deviceId":"bf31180c9cd880ef8egtmh","deviceName":"go sun two"},"_msgid":"48f376ce4e9376f0"}
What i said in my first post works for me
[{"id":"d218ead8.09878","type":"inject","z":"6dde75c9dce66091","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"data\":{\"dps\":{\"1\":false,\"9\":0,\"18\":0,\"19\":0,\"20\":2306,\"21\":1,\"22\":757,\"23\":31968,\"24\":21580,\"25\":964,\"38\":\"memory\",\"39\":\"relay\",\"40\":false,\"41\":\"\",\"42\":\"\",\"43\":\"\"}},\"deviceId\":\"bf31180c9cd880ef8egtmh\",\"deviceName\":\"go sun two\"}","payloadType":"json","x":550,"y":440,"wires":[["87fe6c2d.e32938"]]},{"id":"87fe6c2d.e32938","type":"ui_gauge","z":"6dde75c9dce66091","name":"Tuya","group":"4dfceab38ed323b2","order":0,"width":0,"height":0,"gtype":"gage","title":"Tuya","label":"%","format":"{{payload.data.dps[20]}}","min":0,"max":"2502","colors":["#b50200","#00e6d5","#8dca38"],"seg1":"20","seg2":"80","className":"","x":770,"y":440,"wires":[]},{"id":"4dfceab38ed323b2","type":"ui_group","name":"Tuya","tab":"7ec12690599d16c0","order":1,"disp":true,"width":"6","collapse":false},{"id":"7ec12690599d16c0","type":"ui_tab","name":"Tuya","icon":"dashboard","disabled":false,"hidden":false}]
You should put the payload
also in the </>
format.
Yikes, that is a complex message.
But - just putting it out there....
A change
node would work for you.
You send that into it and extract (move?) the desired values to new parts of the message
(NOT the payload
) and send it into the gauge
with the correct/needed values ({{ }}
) to parse the needed parts of the message.
Hi, thanks for your reply. I never removed the dot {{payload.data.dps.[17]}} and removing the dot by copying your example correctly this time {{payload.data.dps[17]}} worked.
Many thanks for your help with the correct solution...must open my eyes better next time LOL....
Hi, thanks for your help trying_to_learn and the solution offered by El Cid works for me. Really appreciate your help with the solution...
All good.
The main thing is you worked out the problem. That's the important thing.
Good luck in the future.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.