Skip to content

Instantly share code, notes, and snippets.

@HentschelT
Created December 8, 2017 10:21
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 HentschelT/36c870ffca2649b5ae8f80f94bb5a5a5 to your computer and use it in GitHub Desktop.
Save HentschelT/36c870ffca2649b5ae8f80f94bb5a5a5 to your computer and use it in GitHub Desktop.
Rainforest Eagle 200 -> Node-Red
[{"id":"75dfb95e.2cacb8","type":"tab","label":"Rainforest Eagle Basics","disabled":false,"info":""},{"id":"e281bcec.3a64c","type":"http request","z":"75dfb95e.2cacb8","name":"","method":"POST","ret":"txt","url":"http://<enter.eagle.ip.address>/cgi-bin/post_manager","tls":"","x":510,"y":300,"wires":[["8c096319.ef5ae"]]},{"id":"b86c17aa.3d3578","type":"function","z":"75dfb95e.2cacb8","name":"wifi status","func":"msg.payload = \"<Command><Name>wifi_status</Name></Command>\";\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":180,"wires":[["e281bcec.3a64c"]]},{"id":"f0b5e640.030dc8","type":"inject","z":"75dfb95e.2cacb8","name":"trigger","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"x":130,"y":180,"wires":[["b86c17aa.3d3578"]]},{"id":"165a0fc9.437d8","type":"debug","z":"75dfb95e.2cacb8","name":"","active":true,"console":"false","complete":"false","x":730,"y":420,"wires":[]},{"id":"9324e3d1.99a44","type":"function","z":"75dfb95e.2cacb8","name":"device list","func":"msg.payload = \"<Command><Name>device_list</Name></Command>\";\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":240,"wires":[["e281bcec.3a64c"]]},{"id":"ada48257.28479","type":"inject","z":"75dfb95e.2cacb8","name":"trigger","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"x":130,"y":240,"wires":[["9324e3d1.99a44"]]},{"id":"8c096319.ef5ae","type":"xml","z":"75dfb95e.2cacb8","name":"to JS","attr":"","chr":"","x":690,"y":300,"wires":[["165a0fc9.437d8"]]},{"id":"c9c89a4f.699da8","type":"function","z":"75dfb95e.2cacb8","name":"device details","func":"msg.payload = \"<Command><Name>device_details</Name><DeviceDetails><HardwareAddress>0x00135001000b3736</HardwareAddress></DeviceDetails></Command>\";\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":300,"wires":[["e281bcec.3a64c"]]},{"id":"f3d7fc9a.8ebf7","type":"inject","z":"75dfb95e.2cacb8","name":"trigger","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"x":130,"y":300,"wires":[["c9c89a4f.699da8"]]},{"id":"bf5d6f09.711bf","type":"function","z":"75dfb95e.2cacb8","name":"device values","func":"msg.payload = \"<Command><Name>device_query</Name><DeviceDetails><HardwareAddress>0x00135001000b3736</HardwareAddress></DeviceDetails><Components><All>Y</All></Components></Command>\";\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":360,"wires":[["e281bcec.3a64c"]]},{"id":"b9aed51f.c7e588","type":"inject","z":"75dfb95e.2cacb8","name":"trigger","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"x":130,"y":360,"wires":[["bf5d6f09.711bf"]]},{"id":"20b7cbaf.878974","type":"inject","z":"75dfb95e.2cacb8","name":"every 60 seconds","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":true,"x":166,"y":478,"wires":[["72be1f24.28682"]]},{"id":"72be1f24.28682","type":"function","z":"75dfb95e.2cacb8","name":"power demand","func":"msg.payload = \"<Command>\" +\n\"<Name>device_query</Name> <DeviceDetails>\" +\n\"<HardwareAddress>0x00135001000b3736</HardwareAddress>\" +\n\"</DeviceDetails>\" +\n\"<Components><Component><Name>Main</Name>\" +\n\"<Variables><Variable>\" +\n\"<Name>zigbee:InstantaneousDemand</Name>\" +\n\"</Variable></Variables></Component>\" +\n\"</Components>\" +\n\"</Command>\";\nreturn msg;","outputs":1,"noerr":0,"x":160,"y":560,"wires":[["5334e7d4.ade088"]]},{"id":"5334e7d4.ade088","type":"http request","z":"75dfb95e.2cacb8","name":"","method":"POST","ret":"txt","url":"http://<enter.eagle.ip.address>/cgi-bin/post_manager","tls":"","x":150,"y":660,"wires":[["9fd4220.028c6e"]]},{"id":"9fd4220.028c6e","type":"xml","z":"75dfb95e.2cacb8","name":"to JS","attr":"","chr":"","x":130,"y":740,"wires":[["7b23df8f.59f29"]]},{"id":"7b23df8f.59f29","type":"function","z":"75dfb95e.2cacb8","name":"grab demand value","func":"var component = msg.payload.Device.Components[0];\nvar variable = component.Component[0].Variables[0].Variable;\nvar demand = variable[0].Value[0];\nmsg.payload = demand;\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":740,"wires":[["165a0fc9.437d8"]]},{"id":"654cfcd7.7fd2d4","type":"comment","z":"75dfb95e.2cacb8","name":"just hit trigger to see the JS values in the debug tab","info":"","x":229,"y":110,"wires":[]},{"id":"cf5a82b0.732a8","type":"comment","z":"75dfb95e.2cacb8","name":"get power consumption once a minute","info":"","x":210,"y":420,"wires":[]},{"id":"34ed052e.abbcea","type":"comment","z":"75dfb95e.2cacb8","name":"for configuration, see details in the 'info' tab","info":"in each 'http request' node:\n* enter the correct IP address (or host name) for your eagle\n* mark the check mark \"basic authentication\"\n* in the \"user\" field enter your eagle's cloud id\n* in the \"password\" field enter your eagle's installation code (IN)","x":210,"y":60,"wires":[]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment