Scheduled Reboot of Obi202 VoIP ATA

This node-red flow allows you to restart an Obi202 Voip Analog Telephone Adaptor (and likely other Obi ATAs) on a preset schedule. You must edit the URL in the www-request node to use the IP address of your Obi device, and provide basic http-auth information for this flow to work.

Updated 1/8/2017. Now checks for calls in progress. Will skip this reboot attempt if there is a call in progress, such as a late night 911 call.

Enjoy.

[{"id":"cc44fd6a.aa718","type":"inject","z":"89f05404.787d18","name":"Set Schedule","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"57 03 * * *","once":false,"x":120,"y":40,"wires":[["c72c5578.a42348"]]},{"id":"6b061f09.d7afe","type":"debug","z":"89f05404.787d18","name":"Debug Output","active":true,"console":"false","complete":"payload","x":792,"y":292,"wires":[]},{"id":"1ff33aa4.8ae8d5","type":"www-request","z":"89f05404.787d18","name":"No: Obi 202 Reboot URL","method":"GET","ret":"txt","url":"http://192.168.1.129/rebootgetconfig.htm","tls":"","x":764,"y":169,"wires":[["6b061f09.d7afe"]]},{"id":"c72c5578.a42348","type":"www-request","z":"89f05404.787d18","name":"Check Obi202 Calls Status Page","method":"GET","ret":"txt","url":"http://192.168.1.129/callstatus.htm","tls":"","x":176,"y":118,"wires":[["143e801a.413b1"]]},{"id":"143e801a.413b1","type":"html","z":"89f05404.787d18","name":"Check TD Element for Calls In Prograess","tag":"td","ret":"text","as":"multi","x":195,"y":182,"wires":[["a8ad6dad.cde94"]]},{"id":"a8ad6dad.cde94","type":"switch","z":"89f05404.787d18","name":"No/Yes","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"Number of Active Calls: 0","vt":"str"},{"t":"regex","v":"Number of Active Calls: 1|Number of Active Calls: 2","vt":"str","case":false},{"t":"else"}],"checkall":"true","outputs":3,"x":504,"y":183,"wires":[["1ff33aa4.8ae8d5"],["f0192208.561a4"],[]]},{"id":"f0192208.561a4","type":"change","z":"89f05404.787d18","name":"Yes:  Set Failure Message","rules":[{"t":"set","p":"payload","pt":"msg","to":"Failed:  Call in progress","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":537.5,"y":293,"wires":[["6b061f09.d7afe"]]}]
tomlynn

Flow Info

created 2 months ago
updated 1 month, 2 weeks ago

Node Types

Core
  • change (x1)
  • debug (x1)
  • html (x1)
  • inject (x1)
  • switch (x1)
Other

Tags

  • voip
  • obihai
  • obi202
  • reboot
  • restart
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option