Display value in Gauge node

Hello all. I'm having a spot of bother with gauges: I created a dashboard with gauges that work perfectly well, but some do not display the value in text. That is to say, the needle points to the right value, but the gauge has no value displayed in its center.
I'm no expert at any of this so I might be overlooking something very simple, but I just can't seem to get it to display the value. Any insight is appreciated.

[{"id":"9050d6b3.1b2e88","type":"function","z":"17f58ba3.b32a44","name":"Fetch Temp/RH","func":"msg.topic=\"SELECT MAX(Temp) FROM environment WHERE date >= now() - INTERVAL 1 DAY\";\nmsg.payload=[msg.payload];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":300,"y":720,"wires":[["4bb902a4.a8642c"]]},{"id":"4bb902a4.a8642c","type":"mysql","z":"17f58ba3.b32a44","mydb":"dc5d34f2.4b5a38","name":"","x":490,"y":720,"wires":[["eecd5348.5ee3"]]},{"id":"eecd5348.5ee3","type":"ui_gauge","z":"17f58ba3.b32a44","name":"","group":"4d6914d4.9bd17c","order":3,"width":3,"height":3,"gtype":"gage","title":"Max 24h","label":"°C","format":"{{msg.payload[0].MAX(Temp)}}","min":"-15","max":"35","colors":["#ff0000","#00ff00","#ff0000"],"seg1":"-5","seg2":"25","x":660,"y":720,"wires":[]},{"id":"dc5d34f2.4b5a38","type":"MySQLdatabase","name":"","host":"","port":"3306","db":"eggs","tz":"UTC","charset":"UTF8"},{"id":"4d6914d4.9bd17c","type":"ui_group","name":"Gauges","tab":"e9a5a1f6.5b716","order":1,"disp":false,"width":"8","collapse":false},{"id":"e9a5a1f6.5b716","type":"ui_tab","name":"Chicken Coop","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Have a look to these gauges ... they are amazing

Your flow only includes one gauge, and beside can't test with the actual data you are feeding it... but perhaps break the data down in a multi-output function node first, so that each gauge gets a clean integer/float instead of something like {{msg.payload[0].MAX(Temp)}}

OK your sql query is giving you a property name that has illegal/non-standard characters in, which is giving the gauge a bad time

msg.topic="SELECT MAX(Temp) AS maxTemp FROM environment WHERE date >= now() - INTERVAL 1 DAY";

then the path would be

1 Like

Indeed, that's what it was. It threw me off because the gauge "reads" the proper value to display the graphic, but for some reason won't display the actual number. The other thing being that I had tried what you suggested but must have bungled it because it didn't work back then. It's sorted now and the gauge displays both in graphic and in text format. Appreciate the help.

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