Change from dashboard

#1

Hello !! I would like an explanation of how to change a value from the dashboard to a node. I am working on a heating system where I have a ds18b20 sensor. I want to control a relay with a value that I can adjust from the dashboard.

[{"id":"d7109f27.6f97a","type":"ui_gauge","z":"e015b069.cdf7e","name":"","group":"4cdb6fb8.45dd3","order":1,"width":"5","height":"5","gtype":"gage","title":"Temp","label":"°C","format":"{{value | number:0}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":229,"y":162,"wires":[]},{"id":"7c15649e.03a3bc","type":"sensor-ds18b20","z":"e015b069.cdf7e","name":"","sensorid":"28-800000041908","timer":"1","repeat":true,"x":249,"y":262,"wires":[["d7109f27.6f97a","8ec3dc0a.ae0a2","f8beb67f.59c928","f126bd45.13d63"]]},{"id":"b52b52d.6e024b","type":"rpi-gpio out","z":"e015b069.cdf7e","name":"","pin":"12","set":"","level":"0","freq":"","out":"out","x":799,"y":262,"wires":[]},{"id":"9206f1e3.92f7b","type":"debug","z":"e015b069.cdf7e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","x":669,"y":122,"wires":[]},{"id":"8ec3dc0a.ae0a2","type":"switch","z":"e015b069.cdf7e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"55.1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":449,"y":222,"wires":[["9206f1e3.92f7b","b2ce80cf.17498"]]},{"id":"b2ce80cf.17498","type":"change","z":"e015b069.cdf7e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":619,"y":222,"wires":[["b52b52d.6e024b","2772ed1e.0e1692"]]},{"id":"6cad896b.0fcd88","type":"change","z":"e015b069.cdf7e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":619,"y":282,"wires":[["b52b52d.6e024b","62d80610.423a48"]]},{"id":"f8beb67f.59c928","type":"debug","z":"e015b069.cdf7e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","x":449,"y":102,"wires":[]},{"id":"f126bd45.13d63","type":"switch","z":"e015b069.cdf7e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"55","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":449,"y":282,"wires":[["6cad896b.0fcd88"]]},{"id":"e71d79e.a400188","type":"ui_text","z":"e015b069.cdf7e","group":"4cdb6fb8.45dd3","order":2,"width":0,"height":0,"name":"","label":"","format":"{{value | uppercase}}","layout":"col-center","x":929,"y":262,"wires":[]},{"id":"2772ed1e.0e1692","type":"change","z":"e015b069.cdf7e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Low temp","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":799,"y":182,"wires":[["e71d79e.a400188"]]},{"id":"62d80610.423a48","type":"change","z":"e015b069.cdf7e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"High temp","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":799,"y":322,"wires":[["e71d79e.a400188"]]},{"id":"897590eb.2ac9d","type":"ui_numeric","z":"e015b069.cdf7e","name":"","label":"Set value","group":"4cdb6fb8.45dd3","order":0,"width":0,"height":0,"passthru":true,"topic":"","format":"{{value}}","min":0,"max":"100","step":1,"x":253.90003204345703,"y":374.20000553131104,"wires":[["f126bd45.13d63"]]},{"id":"4cdb6fb8.45dd3","type":"ui_group","z":"","name":"Default","tab":"aea29739.fc4858","disp":true,"width":"6","collapse":false},{"id":"aea29739.fc4858","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

0 Likes

#2

if you want to set a temperature in the dashboard, the way I would approach this is to save the temperature you set as a global value using a change node.

Then in your sensor flow you can check if msg.payload is greater of less than your set global value, using an if statement in a function node

0 Likes

#3

Please wrap code in triple or single back-ticks so that it can be copied and read more easily. Thanks.

0 Likes