Landscape Light Control

use bigtimer and MQTT broker to control landscape lights

[{"id":"42317d62.9cf2d4","type":"tab","label":"Flow 1"},{"id":"10abbf93.0b6e1","type":"mqtt-broker","z":"","broker":"test.mosquitto.org","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"523a0b55.fe2bec","type":"ui_tab","z":"","name":"Light Test","icon":"dashboard","order":"1"},{"id":"4cb4eab9.8836e4","type":"mqtt in","z":"42317d62.9cf2d4","name":"Landscape light Status","topic":"AlliedTest","qos":"2","broker":"10abbf93.0b6e1","x":171,"y":108,"wires":[["e353d669.ac606","141762b5.7de68d"]]},{"id":"b1edfbfd.9d1958","type":"mqtt out","z":"42317d62.9cf2d4","name":"Landscape Light Control","topic":"AlliedTest","qos":"","retain":"false","broker":"10abbf93.0b6e1","x":816,"y":470,"wires":[]},{"id":"5d8a8984.17e3","type":"ui_button","z":"42317d62.9cf2d4","tab":"523a0b55.fe2bec","name":"Light On","payload":"on_override","topic":"","group":"Landscape Light Control","order":1,"x":162,"y":349,"wires":[["bc28caed.9852d"]]},{"id":"6f9f1e33.63dd08","type":"ui_button","z":"42317d62.9cf2d4","tab":"523a0b55.fe2bec","name":"Light Off","payload":"off_override","topic":"","group":"Landscape Light Control","order":1,"x":159,"y":441,"wires":[["bc28caed.9852d"]]},{"id":"2afc7f4a.25f3b","type":"debug","z":"42317d62.9cf2d4","name":"","active":true,"console":"false","complete":"false","x":781,"y":385,"wires":[]},{"id":"e764eda.c1a141","type":"e-mail","z":"42317d62.9cf2d4","server":"smtp.mail.att.net","port":"465","secure":true,"name":"[email protected]","dname":"","x":808,"y":127,"wires":[]},{"id":"e353d669.ac606","type":"ui_template","z":"42317d62.9cf2d4","tab":"523a0b55.fe2bec","name":"On-Off Indicator","group":"Landscape Light Feedback","order":1,"format":"<div layout=\"row\" layout-align=\"space-between center\">\n<p flex>&nbsp;</p>\n    <ng-md-icon icon=\"wb_incandescent\" ng-style=\"{fill:msg.payload=='1' ?'red':'black'}\" size=\"32\"></ng-md-icon>\n</div>","storeOutMessages":true,"fwdInMessages":true,"x":399,"y":187,"wires":[[]]},{"id":"a774ca2c.923e3","type":"ui_switch","z":"42317d62.9cf2d4","tab":"523a0b55.fe2bec","name":"Enable Send SMS Status Message","topic":"AlliedTest","group":"Landscape Light Feedback","order":1,"onvalue":"true","offvalue":"false","x":505,"y":53,"wires":[["439941ab.462798"]]},{"id":"739dca52.c58074","type":"debug","z":"42317d62.9cf2d4","name":"","active":false,"console":"false","complete":"false","x":801,"y":222,"wires":[]},{"id":"439941ab.462798","type":"function","z":"42317d62.9cf2d4","name":"Switchvariable","func":"global.set(\"Sendsms\",msg.payload);\n","outputs":1,"noerr":0,"x":806,"y":58,"wires":[[]]},{"id":"3b8b8ac5.729086","type":"function","z":"42317d62.9cf2d4","name":"SendSMS","func":"var Sendmessage=global.get(\"Sendsms\");\nif (Sendmessage==\"true\")\n{\nreturn msg;\n}\nelse\n{\n    return null;\n}","outputs":1,"noerr":0,"x":600,"y":125,"wires":[["e764eda.c1a141","739dca52.c58074"]]},{"id":"141762b5.7de68d","type":"function","z":"42317d62.9cf2d4","name":"Format Status Text","func":"m = msg.payload;\nif (m == \"1\")\n{\n    return {payload:\"Landscape Lights On\"};\n}\nelse if (m == \"0\")\n{\n    return {payload:\"Landscape Lights Off\"};\n}","outputs":1,"noerr":0,"x":423,"y":125,"wires":[["3b8b8ac5.729086"]]},{"id":"bc28caed.9852d","type":"bigtimer","z":"42317d62.9cf2d4","outtopic":"","outpayload1":"1","outpayload2":"0","name":"Landscape Lights","lat":"36.797025","lon":"-119.670181","starttime":"5001","endtime":"1335","startoff":0,"endoff":0,"offs":0,"outtext1":"1","outtext2":"0","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"suspend":false,"random":false,"repeat":true,"atstart":true,"odd":false,"even":false,"x":407,"y":406.5,"wires":[["b1edfbfd.9d1958","2afc7f4a.25f3b"],[],[]]},{"id":"7b44b42.e9a3ccc","type":"ui_button","z":"42317d62.9cf2d4","tab":"523a0b55.fe2bec","name":"Auto","payload":"auto","topic":"","group":"Landscape Light Control","order":1,"x":151,"y":396,"wires":[["bc28caed.9852d"]]}]

Flow Info

Created 6 years, 11 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • debug (x2)
  • function (x3)
  • mqtt in (x1)
  • mqtt out (x1)
  • mqtt-broker (x1)
Other
  • bigtimer (x1)
  • e-mail (x1)
  • tab (x1)
  • ui_button (x3)
  • ui_switch (x1)
  • ui_tab (x1)
  • ui_template (x1)

Tags

  • Lighting
  • MQTT
  • HomeAutomation
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option