Control Sonoff Basic with ESPurna firmware

These are just a few sets of nodes I used in my video to show how to control a Sonoff Basic running the ESPurna firmware.

Video is here: https://www.youtube.com/watch?v=EYeOX4J4yEk

[{"id":"3d2af170.d7067e","type":"mqtt in","z":"7d39deb7.b2d9e","name":"","topic":"/Sonoff2/#","qos":"0","broker":"cea5258a.b34038","x":120,"y":2100,"wires":[["feb4a252.2bf67"]]},{"id":"feb4a252.2bf67","type":"debug","z":"7d39deb7.b2d9e","name":"","active":true,"console":"false","complete":"false","x":350,"y":2100,"wires":[]},{"id":"b72940e6.80edc","type":"mqtt out","z":"7d39deb7.b2d9e","name":"","topic":"/Sonoff2/relay/0/set","qos":"0","retain":"","broker":"cea5258a.b34038","x":370,"y":2180,"wires":[]},{"id":"19b1d8de.da20c7","type":"inject","z":"7d39deb7.b2d9e","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"x":150,"y":2180,"wires":[["b72940e6.80edc"]]},{"id":"8a72f15a.2c7de","type":"inject","z":"7d39deb7.b2d9e","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":150,"y":2220,"wires":[["b72940e6.80edc"]]},{"id":"47af7789.135bc8","type":"inject","z":"7d39deb7.b2d9e","name":"","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"x":150,"y":2260,"wires":[["b72940e6.80edc"]]},{"id":"1a63cdb1.7dba22","type":"inject","z":"7d39deb7.b2d9e","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":160,"y":2340,"wires":[["2b2f71c0.abe56e"]]},{"id":"2b2f71c0.abe56e","type":"http request","z":"7d39deb7.b2d9e","name":"Relay off","method":"GET","ret":"txt","url":"http://192.168.1.129/api/relay/0?apikey=9ADA0C102B8390D7&value=0","tls":"","x":360,"y":2340,"wires":[[]]},{"id":"364b3d9c.f7a0f2","type":"inject","z":"7d39deb7.b2d9e","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":160,"y":2380,"wires":[["b7632f8e.f73f7"]]},{"id":"b7632f8e.f73f7","type":"http request","z":"7d39deb7.b2d9e","name":"Relay on","method":"GET","ret":"txt","url":"http://192.168.1.129/api/relay/0?apikey=9ADA0C102B8390D7&value=1","tls":"","x":360,"y":2380,"wires":[[]]},{"id":"f277afc3.987db","type":"http request","z":"7d39deb7.b2d9e","name":"Relay toggle","method":"GET","ret":"txt","url":"http://192.168.1.129/api/relay/0?apikey=9ADA0C102B8390D7&value=2","tls":"","x":370,"y":2420,"wires":[[]]},{"id":"aa4f6a3a.3f9478","type":"inject","z":"7d39deb7.b2d9e","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":160,"y":2420,"wires":[["f277afc3.987db"]]},{"id":"acf92e00.44f4b","type":"http request","z":"7d39deb7.b2d9e","name":"Status","method":"GET","ret":"txt","url":"http://192.168.1.129/api/relay/0?apikey=9ADA0C102B8390D7","tls":"","x":350,"y":2480,"wires":[["ddcb772c.a981c8"]]},{"id":"1a56052.f2444fb","type":"inject","z":"7d39deb7.b2d9e","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":160,"y":2480,"wires":[["acf92e00.44f4b"]]},{"id":"ddcb772c.a981c8","type":"debug","z":"7d39deb7.b2d9e","name":"","active":true,"console":"false","complete":"false","x":550,"y":2480,"wires":[]},{"id":"cea5258a.b34038","type":"mqtt-broker","z":"","broker":"192.168.1.80","port":"1883","clientid":"node-red","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""}]
nygma2004

Flow Info

created 3 weeks ago

Node Types

Core
  • debug (x2)
  • http request (x4)
  • inject (x7)
  • mqtt in (x1)
  • mqtt out (x1)
  • mqtt-broker (x1)

Tags

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