Amazon Dash Button Toggle Switch ON/OFF with Traffic-Node

This flow makes it possible to switch the Node-Red traffic light to "Allow" and "Stop" with an Amazon Dash Button. You need t install:

node-red-contrib-amazondash

If you have questions contact me: http://www.imakeyouintelligent.com/

[{"id":"d492b466.1a368","type":"ButtonPressed","z":"493a3d1f.c5ee64","name":"DB_NoName","mac":"18:74:2E:29:A9:EE","x":234.44444274902344,"y":492.2221984863281,"wires":[["a198b195.cc8f98"]]},{"id":"a198b195.cc8f98","type":"function","z":"493a3d1f.c5ee64","name":"Toogle","func":"let state = context.get('state');\nlet out = \"\";\nif(state == null){\n    context.set('state',false);\n}\n\nif(state == true){\n    state   = false;\n    output = \"STOP\";\n}else{\n    state   = true;\n    output = \"GO\"\n}\n\ncontext.set('state',state);\nreturn { \"payload\":output };","outputs":"1","noerr":0,"x":642.4444427490234,"y":490.2221984863281,"wires":[["8d131091.83c2c"]]},{"id":"8d131091.83c2c","type":"traffic","z":"493a3d1f.c5ee64","name":"","property_allow":"payload","filter_allow":"GO","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"STOP","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":false,"differ":false,"x":975.4444427490234,"y":424.2221984863281,"wires":[[]]}]
heydemar

Flow Info

created 3 weeks, 2 days ago

Node Types

Core
  • function (x1)
Other

Tags

  • Amazon
  • Dash
  • Button
  • Dash-Button
  • Trafficlight
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option