Skip to content

Instantly share code, notes, and snippets.

@tomashora
Created April 10, 2015 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomashora/4aa7ddad87f20f92031f to your computer and use it in GitHub Desktop.
Save tomashora/4aa7ddad87f20f92031f to your computer and use it in GitHub Desktop.
UniPi
[{"id":"a3c2ed71.5c3d1","type":"websocket-client","path":"ws://127.0.0.1/ws","wholemsg":"false"},{"id":"4072282f.bf8dd8","type":"websocket out","name":"","server":"","client":"a3c2ed71.5c3d1","x":761,"y":324,"z":"166cb75.fe99349","wires":[]},{"id":"e09a01a9.1f66","type":"inject","name":"R1 ON","topic":"","payload":"{\"dev\":\"relay\", \"circuit\":\"1\", \"value\":\"1\"}","payloadType":"string","repeat":"","crontab":"","once":false,"x":461,"y":322,"z":"166cb75.fe99349","wires":[["4072282f.bf8dd8"]]},{"id":"afe6d4fc.501928","type":"inject","name":"R1 OFF","topic":"","payload":"{\"dev\":\"relay\", \"circuit\":\"1\", \"value\":\"0\"}","payloadType":"string","repeat":"","crontab":"","once":false,"x":461,"y":358,"z":"166cb75.fe99349","wires":[["4072282f.bf8dd8"]]},{"id":"b69e1c4b.4961e","type":"inject","name":"AO set 5V a","topic":"","payload":"{\"dev\":\"ao\", \"circuit\":\"1\", \"value\":\"5\"}","payloadType":"string","repeat":"","crontab":"","once":false,"x":447,"y":284,"z":"166cb75.fe99349","wires":[["4072282f.bf8dd8"]]},{"id":"dc4842e8.23b7c","type":"websocket in","name":"","server":"","client":"a3c2ed71.5c3d1","x":237,"y":466,"z":"166cb75.fe99349","wires":[["7bf07b0c.840f84","6dd388d.f922c78"]]},{"id":"7bf07b0c.840f84","type":"debug","name":"","active":true,"console":"false","complete":"payload","x":481,"y":560,"z":"166cb75.fe99349","wires":[]},{"id":"6dd388d.f922c78","type":"function","name":"IN 1-7 -> RELAY 1-7","func":"var status = JSON.parse(msg.payload);\nvar msg = {};\nif (status.dev == \"input\" && status.circuit<8) {\n\t//leave the relay 8 to the temp control node\n\tif (status.value == 0) {\n\t\tmsg.payload = {\"dev\":\"relay\", \"circuit\":\"\", \"value\":\"0\"};\n\t\tmsg.payload[\"circuit\"] = status.circuit;\n\t}\n\telse {\n\t\tmsg.payload = {\"dev\":\"relay\", \"circuit\":\"\", \"value\":\"1\"};\n\t\tmsg.payload[\"circuit\"] = status.circuit;\n\t}\n\treturn msg;\n}\nelse return;\n","outputs":1,"x":499,"y":466,"z":"166cb75.fe99349","wires":[["4072282f.bf8dd8"]]}]
@chrigui
Copy link

chrigui commented Apr 10, 2016

any idea how to add 1W-8R extension board to node-red please ?
i already added the unipi but not sure how to add the extension board.

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment