Automatically reboot Wemo Bridge when it loses connection to HomeKit

This flow automatically reboots the Wemo Bridge when it loses connection to HomeKit. It uses the node-red-contrib-arp and node-red-contrib-homekit-bridged modules to poll the Wemo Bridge web page and detect when it has lost connection to HomeKit. Requires the MAC address of the Wemo Bridge and the HomeKit code as the password.

Details available here

http://community.wemo.com/t5/WEMO-Hardware/WEMO-Bridge-web-interface-did-we-know-about-this-already/td-p/44707

[{"id":"a361ae7e.43fa78","type":"http response","z":"3f9ad57a.2181fa","name":"","statusCode":"","headers":{},"x":895.5,"y":1368,"wires":[]},{"id":"5eb15bd3.eed4cc","type":"debug","z":"3f9ad57a.2181fa","name":"Wemo Bridge Reboot","active":true,"console":"false","complete":"payload","x":934.5,"y":1406,"wires":[]},{"id":"b6f47c8e.c08958","type":"http request","z":"3f9ad57a.2181fa","name":"","method":"GET","ret":"txt","url":"http://admin:23245148@{{payload}}/reboot.shtml","tls":"","x":738.5,"y":1349,"wires":[["a361ae7e.43fa78","5eb15bd3.eed4cc"]]},{"id":"68efcfb1.813b2","type":"arp","z":"3f9ad57a.2181fa","name":"ARP","macs":"58:EF:68:BA:94:67","x":366.5,"y":1294,"wires":[["b45d1b1f.eb76f8"]]},{"id":"6b7d842c.32ce64","type":"inject","z":"3f9ad57a.2181fa","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":187,"y":1294,"wires":[["68efcfb1.813b2"]]},{"id":"841c12ec.e0a14","type":"debug","z":"3f9ad57a.2181fa","name":"wemo bridge IP","active":true,"console":"false","complete":"payload","x":780,"y":1295,"wires":[]},{"id":"b45d1b1f.eb76f8","type":"change","z":"3f9ad57a.2181fa","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0].ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":559,"y":1295,"wires":[["b6f47c8e.c08958","841c12ec.e0a14"]]},{"id":"a66e13ac.c681e","type":"http response","z":"3f9ad57a.2181fa","name":"","statusCode":"","headers":{},"x":897.9999961853027,"y":1528.6666831970215,"wires":[]},{"id":"251528b4.079d8","type":"debug","z":"3f9ad57a.2181fa","name":"Wemo Bridge Main","active":true,"console":"false","complete":"payload","x":926.9999961853027,"y":1566.6666831970215,"wires":[]},{"id":"62e3b038.b20068","type":"http request","z":"3f9ad57a.2181fa","name":"","method":"GET","ret":"txt","url":"http://admin:23245148@{{payload}}/generic/index.shtml","tls":"","x":740.9999961853027,"y":1509.6666831970215,"wires":[["a66e13ac.c681e","251528b4.079d8"]]},{"id":"96d5da33.e4b398","type":"arp","z":"3f9ad57a.2181fa","name":"ARP","macs":"58:EF:68:BA:94:67","x":368.99999618530273,"y":1454.6666831970215,"wires":[["2ae86417.c2c29c"]]},{"id":"201bc2cf.f00c76","type":"inject","z":"3f9ad57a.2181fa","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":189.49999618530273,"y":1454.6666831970215,"wires":[["96d5da33.e4b398"]]},{"id":"a4035de0.340eb8","type":"debug","z":"3f9ad57a.2181fa","name":"wemo bridge IP","active":true,"console":"false","complete":"payload","x":782.4999961853027,"y":1455.6666831970215,"wires":[]},{"id":"2ae86417.c2c29c","type":"change","z":"3f9ad57a.2181fa","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0].ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":561.4999961853027,"y":1455.6666831970215,"wires":[["62e3b038.b20068","a4035de0.340eb8"]]},{"id":"df63ea75.2dcdb8","type":"http response","z":"3f9ad57a.2181fa","name":"","statusCode":"","headers":{},"x":893,"y":1707,"wires":[]},{"id":"fce75af6.e59dd","type":"debug","z":"3f9ad57a.2181fa","name":"Wemo Bridge Internet Status","active":true,"console":"false","complete":"payload","x":952,"y":1745,"wires":[]},{"id":"401f7795.24f97","type":"http request","z":"3f9ad57a.2181fa","name":"","method":"GET","ret":"txt","url":"http://admin:23245148@{{payload}}/goform/getInternetStatus","tls":"","x":736,"y":1688,"wires":[["df63ea75.2dcdb8","fce75af6.e59dd"]]},{"id":"bcb3da68.e53ff8","type":"arp","z":"3f9ad57a.2181fa","name":"ARP","macs":"58:EF:68:BA:94:67","x":364,"y":1633,"wires":[["5ed04a70.9b584c"]]},{"id":"69ba926c.da229c","type":"inject","z":"3f9ad57a.2181fa","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":184.5,"y":1633,"wires":[["bcb3da68.e53ff8"]]},{"id":"ee310193.bd2bc8","type":"debug","z":"3f9ad57a.2181fa","name":"wemo bridge IP","active":true,"console":"false","complete":"payload","x":777.5,"y":1634,"wires":[]},{"id":"5ed04a70.9b584c","type":"change","z":"3f9ad57a.2181fa","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0].ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":556.5,"y":1634,"wires":[["401f7795.24f97","ee310193.bd2bc8"]]},{"id":"d0139f5.f6c9d6","type":"http response","z":"3f9ad57a.2181fa","name":"","statusCode":"","headers":{},"x":899,"y":1877,"wires":[]},{"id":"da3eb154.81b1f8","type":"debug","z":"3f9ad57a.2181fa","name":"Wemo Bridge HomeKit Status","active":true,"console":"false","complete":"payload","x":968,"y":1915,"wires":[]},{"id":"4e2caec7.060508","type":"http request","z":"3f9ad57a.2181fa","name":"","method":"GET","ret":"txt","url":"http://admin:23245148@{{payload}}/goform/isAlive","tls":"","x":742,"y":1858,"wires":[["d0139f5.f6c9d6","da3eb154.81b1f8","6708899a.108ec8","65316a4d.a64b8c"]]},{"id":"454beccd.eb948c","type":"arp","z":"3f9ad57a.2181fa","name":"ARP","macs":"58:EF:68:BA:94:67","x":370,"y":1803,"wires":[["f5a7526a.34254"]]},{"id":"6c46b2d1.60f7ec","type":"inject","z":"3f9ad57a.2181fa","name":"","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":true,"x":200.5,"y":1803,"wires":[["454beccd.eb948c"]]},{"id":"aa11234a.d3d228","type":"debug","z":"3f9ad57a.2181fa","name":"wemo bridge IP","active":true,"console":"false","complete":"payload","x":783.5,"y":1804,"wires":[]},{"id":"f5a7526a.34254","type":"change","z":"3f9ad57a.2181fa","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0].ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":562.5,"y":1804,"wires":[["4e2caec7.060508","aa11234a.d3d228"]]},{"id":"ffac3202.1e85b8","type":"http response","z":"3f9ad57a.2181fa","name":"","statusCode":"","headers":{},"x":904,"y":2051,"wires":[]},{"id":"88e28ba.d96e3f8","type":"debug","z":"3f9ad57a.2181fa","name":"Wemo Bridge Wemo Device Status","active":true,"console":"false","complete":"payload","x":983,"y":2089,"wires":[]},{"id":"80614d4.4bbe0b","type":"http request","z":"3f9ad57a.2181fa","name":"","method":"GET","ret":"txt","url":"http://admin:23245148@{{payload}}/goform/getWemoStatus","tls":"","x":747,"y":2032,"wires":[["ffac3202.1e85b8","88e28ba.d96e3f8"]]},{"id":"c5d361bb.3bf97","type":"arp","z":"3f9ad57a.2181fa","name":"ARP","macs":"58:EF:68:BA:94:67","x":375,"y":1977,"wires":[["aba2e70c.318"]]},{"id":"4cdef67e.9c916","type":"inject","z":"3f9ad57a.2181fa","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":195.5,"y":1977,"wires":[["c5d361bb.3bf97"]]},{"id":"9354d26c.0f1858","type":"debug","z":"3f9ad57a.2181fa","name":"wemo bridge IP","active":true,"console":"false","complete":"payload","x":788.5,"y":1978,"wires":[]},{"id":"aba2e70c.318","type":"change","z":"3f9ad57a.2181fa","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0].ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":567.5,"y":1978,"wires":[["80614d4.4bbe0b","9354d26c.0f1858"]]},{"id":"990dfd1d.83436","type":"http response","z":"3f9ad57a.2181fa","name":"","statusCode":"","headers":{},"x":902.5,"y":2217,"wires":[]},{"id":"710586ff.046fc","type":"debug","z":"3f9ad57a.2181fa","name":"Wemo Bridge Syslog1","active":true,"console":"false","complete":"payload","x":941.5,"y":2255,"wires":[]},{"id":"6dca0d65.d04fdc","type":"http request","z":"3f9ad57a.2181fa","name":"","method":"GET","ret":"txt","url":"http://admin:23245148@{{payload}}/goform/syslog1","tls":"","x":745.5,"y":2198,"wires":[["990dfd1d.83436","710586ff.046fc"]]},{"id":"89308697.2e996","type":"arp","z":"3f9ad57a.2181fa","name":"ARP","macs":"58:EF:68:BA:94:67","x":373.5,"y":2143,"wires":[["8d21d4bd.222d8"]]},{"id":"c96e2aaf.f5bd1","type":"inject","z":"3f9ad57a.2181fa","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":194,"y":2143,"wires":[["89308697.2e996"]]},{"id":"fea25e15.a329e8","type":"debug","z":"3f9ad57a.2181fa","name":"wemo bridge IP","active":true,"console":"false","complete":"payload","x":787,"y":2144,"wires":[]},{"id":"8d21d4bd.222d8","type":"change","z":"3f9ad57a.2181fa","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0].ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":566,"y":2144,"wires":[["6dca0d65.d04fdc","fea25e15.a329e8"]]},{"id":"30db03a1.cff264","type":"http response","z":"3f9ad57a.2181fa","name":"","statusCode":"","headers":{},"x":898,"y":2391,"wires":[]},{"id":"db2e21a.1833c6","type":"debug","z":"3f9ad57a.2181fa","name":"Wemo Bridge Syslog2","active":true,"console":"false","complete":"payload","x":937,"y":2429,"wires":[]},{"id":"ac123d90.00cb58","type":"http request","z":"3f9ad57a.2181fa","name":"","method":"GET","ret":"txt","url":"http://admin:23245148@{{payload}}/goform/syslog2","tls":"","x":741,"y":2372,"wires":[["30db03a1.cff264","db2e21a.1833c6"]]},{"id":"64b3ed0b.2d3c34","type":"arp","z":"3f9ad57a.2181fa","name":"ARP","macs":"58:EF:68:BA:94:67","x":369,"y":2317,"wires":[["7255f7f9.784d"]]},{"id":"6fee493f.91812","type":"inject","z":"3f9ad57a.2181fa","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":189.5,"y":2317,"wires":[["64b3ed0b.2d3c34"]]},{"id":"8fdb24ef.60b1f8","type":"debug","z":"3f9ad57a.2181fa","name":"wemo bridge IP","active":true,"console":"false","complete":"payload","x":782.5,"y":2318,"wires":[]},{"id":"7255f7f9.784d","type":"change","z":"3f9ad57a.2181fa","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0].ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":561.5,"y":2318,"wires":[["ac123d90.00cb58","8fdb24ef.60b1f8"]]},{"id":"8c1ca40f.8a3778","type":"function","z":"3f9ad57a.2181fa","name":"Wemo Bridge Status","func":"msg.payload=\n{ContactSensorState:\"1\"}\nreturn msg;\n","outputs":1,"noerr":0,"x":1191.2678298950195,"y":1785.7142305374146,"wires":[["5781d3dc.843d1c","50e01c1c.919a6c"]]},{"id":"5781d3dc.843d1c","type":"debug","z":"3f9ad57a.2181fa","name":"Wemo Bridge HomeKit ","active":true,"console":"false","complete":"payload","x":1429.0475616455078,"y":1829.2855777740479,"wires":[]},{"id":"85e4f1ea.a921f","type":"function","z":"3f9ad57a.2181fa","name":"Wemo Bridge Status","func":"msg.payload=\n{ContactSensorState:\"0\"}\nreturn msg;\n","outputs":1,"noerr":0,"x":1192.142822265625,"y":1874.047526359558,"wires":[["5781d3dc.843d1c","50e01c1c.919a6c"]]},{"id":"6708899a.108ec8","type":"switch","z":"3f9ad57a.2181fa","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","outputs":1,"x":990.625,"y":1802.5,"wires":[["8c1ca40f.8a3778"]]},{"id":"65316a4d.a64b8c","type":"switch","z":"3f9ad57a.2181fa","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"}],"checkall":"true","outputs":1,"x":992.5,"y":1843.75,"wires":[["85e4f1ea.a921f","38221f5.ffb1ce","ec060bc5.a040e"]]},{"id":"50e01c1c.919a6c","type":"homekit-service","z":"3f9ad57a.2181fa","bridge":"3630d6d3.3ba4c2","name":"Wemo Bridge HomeKit","serviceName":"ContactSensor","manufacturer":"HomeAuto","model":"Wemo Bridge HomeKit","serialNo":"1234567867","characteristicProperties":"{}","x":1188.5,"y":1827,"wires":[["5781d3dc.843d1c"]]},{"id":"10c1afe2.106e6","type":"homekit-service","z":"3f9ad57a.2181fa","bridge":"3630d6d3.3ba4c2","name":"Wemo Bridge Reset","serviceName":"Switch","manufacturer":"HomeAuto","model":"Wemo Bridge Reset","serialNo":"12345678968","characteristicProperties":"{}","x":206.5,"y":1162,"wires":[["68efcfb1.813b2","ceca9e10.58406"]]},{"id":"d8a0c024.540a9","type":"inject","z":"3f9ad57a.2181fa","name":"","topic":"","payload":"0","payloadType":"str","repeat":"","crontab":"","once":false,"x":683.5,"y":1910,"wires":[["65316a4d.a64b8c"]]},{"id":"ceca9e10.58406","type":"function","z":"3f9ad57a.2181fa","name":"Switch On Toggle","func":"if(msg.payload.On === true){\n    msg.payload = \"1\";\nreturn msg;\n}\n","outputs":1,"noerr":0,"x":444,"y":1162,"wires":[["b7434282.6fbe3","7b11aacb.cc98ec"]]},{"id":"b7434282.6fbe3","type":"delay","z":"3f9ad57a.2181fa","name":"Toggle Off","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":181,"y":1210,"wires":[["3d93a4a1.be7b84"]]},{"id":"3d93a4a1.be7b84","type":"function","z":"3f9ad57a.2181fa","name":"Switch Off","func":"var characteristic = {};\n\ncharacteristic.On = false;\n\nmsg.payload = characteristic;\nreturn msg;\n","outputs":1,"noerr":0,"x":175,"y":1116,"wires":[["10c1afe2.106e6"]]},{"id":"7b11aacb.cc98ec","type":"debug","z":"3f9ad57a.2181fa","name":"Wemo Bridge Reset","active":true,"console":"false","complete":"payload","x":460.5,"y":1202,"wires":[]},{"id":"38221f5.ffb1ce","type":"file","z":"3f9ad57a.2181fa","name":"","filename":"/home/pi/wemohomekitreset.txt","appendNewline":true,"createDir":false,"overwriteFile":"false","x":1480.833351135254,"y":1873.333246231079,"wires":[]},{"id":"ec060bc5.a040e","type":"mqtt out","z":"3f9ad57a.2181fa","name":"","topic":"/wemohomekit/reset","qos":"","retain":"","broker":"53723d70.f11a54","x":1444.5,"y":1916,"wires":[]},{"id":"3630d6d3.3ba4c2","type":"homekit-bridge","z":"","bridgeName":"Wemo Bridge Node","pinCode":"111-11-111","port":"","manufacturer":"HomeAuto","model":"Wemo Bridge Node","serialNo":"12345678966"},{"id":"53723d70.f11a54","type":"mqtt-broker","z":"","broker":"10.1.1.246","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":""}]

Flow Info

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

Owner

Actions

Rate:

Node Types

Core
  • change (x7)
  • debug (x16)
  • delay (x1)
  • file (x1)
  • function (x4)
  • http request (x7)
  • http response (x7)
  • inject (x8)
  • mqtt out (x1)
  • mqtt-broker (x1)
  • switch (x2)
Other
  • arp (x7)
  • homekit-bridge (x1)
  • homekit-service (x2)

Tags

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