UI_Control_LED

Control bright level of LED & On-Off with switch

[{"id":"644936e0.a627c","type":"ui_slider","z":"1c0fcd1a.59ad53","tab":"970d711c.5a9948","name":"Slider","topic":"","group":"Control LED","order":"2","min":"0","max":10,"x":198,"y":71,"wires":[["277b2398.7ece34","51eb2d66.6df4ec","f5d9f552.efe358","6d336fd7.4ccaa8"]]},{"id":"277b2398.7ece34","type":"ui_gauge","z":"1c0fcd1a.59ad53","tab":"970d711c.5a9948","name":"Gauge","group":"Control LED","order":"3","format":"{{value}}","min":0,"max":10,"x":611,"y":159,"wires":[]},{"id":"51eb2d66.6df4ec","type":"ui_chart","z":"1c0fcd1a.59ad53","tab":"970d711c.5a9948","name":"","group":"Control LED","order":"4","interpolate":"linear","nodata":"No Data","removeOlder":1,"removeOlderUnit":"86400","x":611,"y":265,"wires":[[],[]]},{"id":"f5d9f552.efe358","type":"rpi-gpio out","z":"1c0fcd1a.59ad53","name":"LED","pin":"40","set":"","level":"0","out":"pwm","x":614,"y":81,"wires":[]},{"id":"51345861.ba0cf8","type":"function","z":"1c0fcd1a.59ad53","name":"Function","func":"if(msg.payload == \"true\"){\n msg.payload = 1;\n}\nelse{\n msg.payload = 0;\n} \nreturn msg;","outputs":"1","noerr":0,"x":416,"y":346,"wires":[["644936e0.a627c"]]},{"id":"4c7181e0.39bbc8","type":"ui_switch","z":"1c0fcd1a.59ad53","tab":"970d711c.5a9948","name":"Switch","topic":"","group":"Control LED","order":1,"onvalue":"true","offvalue":"false","x":181,"y":348,"wires":[["51345861.ba0cf8"]]},{"id":"6d336fd7.4ccaa8","type":"function","z":"1c0fcd1a.59ad53","name":"SetSwitch","func":"if(msg.payload > 0)\n msg.payload = 1;\nelse \n msg.payload = 0;\n \nreturn msg;\n","outputs":1,"noerr":0,"x":190,"y":221,"wires":[["4c7181e0.39bbc8"]]},{"id":"970d711c.5a9948","type":"ui_tab","z":"","name":"TEST1","icon":"dashboard","order":"1"}]
SChinnaphat

Flow Info

created 5 months, 1 week ago

Node Types

Core
  • function (x2)
  • rpi-gpio out (x1)
Other
  • ui_chart (x1)
  • ui_gauge (x1)
  • ui_slider (x1)
  • ui_switch (x1)
  • ui_tab (x1)

Tags

  • LED
  • UI
  • Switch
  • GPIO
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option