Re: No Domoticz running afther restart
Posted: Wednesday 10 May 2017 8:26
@gordon, any news ? is the problem solved ? i want to try it next month but a little affraid it wil hang again 

Open source Home Automation System
https://forum.domoticz.com/
Code: Select all
sudo /etc/init.d/domoticz.sh restart
Code: Select all
[{"id":"164a1bfe.b39294","type":"tab","label":"Domoticz WatchDog","disabled":false,"info":""},{"id":"8d6c1aee.0aa468","type":"inject","z":"164a1bfe.b39294","name":"Get Domoticz Status","topic":"","payload":"","payloadType":"date","repeat":"120","crontab":"","once":true,"onceDelay":"200","x":160,"y":180,"wires":[["db1ddb77.5beca8"]]},{"id":"db1ddb77.5beca8","type":"http request","z":"164a1bfe.b39294","name":"Get Domoticz Status","method":"GET","ret":"obj","paytoqs":false,"url":"http://127.0.0.1:8080/json.htm?type=command¶m=getversion","tls":"","proxy":"","authType":"","x":380,"y":180,"wires":[["b81479dd.131218"]]},{"id":"b81479dd.131218","type":"switch","z":"164a1bfe.b39294","name":"Check Domoticz Status","property":"payload.status","propertyType":"msg","rules":[{"t":"eq","v":"OK","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":640,"y":180,"wires":[["f7f59c2b.631e2"],["be046eb4.dad9d"]]},{"id":"5c5c0a7f.4ed6e4","type":"debug","z":"164a1bfe.b39294","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1070,"y":360,"wires":[]},{"id":"be046eb4.dad9d","type":"function","z":"164a1bfe.b39294","name":"Count","func":"// initialise the counter to 0 if it doesn't exist already\nvar count = flow.get('count')||0;\ncount += 1;\n// store the value back\nflow.set('count',count);\n// make it part of the outgoing msg object\nmsg.count = count;\nreturn msg;","outputs":1,"noerr":0,"x":470,"y":320,"wires":[["9f1855ae.33ef88"]]},{"id":"f7f59c2b.631e2","type":"function","z":"164a1bfe.b39294","name":"Count Reset","func":"// Reset the counter\nvar count = 0;\nflow.set('count',count);\n// make it part of the outgoing msg object\nmsg.count = count;\nreturn msg;","outputs":1,"noerr":0,"x":890,"y":160,"wires":[[]]},{"id":"9f1855ae.33ef88","type":"switch","z":"164a1bfe.b39294","name":"Count Evaluation","property":"count","propertyType":"msg","rules":[{"t":"gte","v":"2","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":650,"y":320,"wires":[["2507089c.b0e388","cf61f6f4.113808"]]},{"id":"2507089c.b0e388","type":"exec","z":"164a1bfe.b39294","command":"sudo /etc/init.d/domoticz.sh","addpay":false,"append":"stop","useSpawn":"false","timer":"30","oldrc":false,"name":"Domoticz stop","x":840,"y":320,"wires":[["5c5c0a7f.4ed6e4"],[],["6e96dba9.a52054"]]},{"id":"6e96dba9.a52054","type":"exec","z":"164a1bfe.b39294","command":"sudo /etc/init.d/domoticz.sh","addpay":false,"append":"start","useSpawn":"false","timer":"","oldrc":false,"name":"Domoticz start","x":840,"y":400,"wires":[["5c5c0a7f.4ed6e4"],["d8073b27.559448"],["d8073b27.559448"]]},{"id":"d8073b27.559448","type":"function","z":"164a1bfe.b39294","name":"Count Reset","func":"// Reset the counter\nvar count = 0;\nflow.set('count',count);\n// make it part of the outgoing msg object\nmsg.count = count;\nreturn msg;","outputs":1,"noerr":0,"x":1070,"y":420,"wires":[[]]},{"id":"cf61f6f4.113808","type":"exec","z":"164a1bfe.b39294","command":"sudo /home/pi/domoticz/scripts/domorestartmess.sh","addpay":false,"append":"","useSpawn":"false","timer":"30","oldrc":false,"name":"Send Message","x":840,"y":260,"wires":[[],[],[]]}]
Code: Select all
#!/bin/bash
curl -s -X POST https://api.telegram.org/botID:API-Key/sendMessage -d chat_id=-YourChatid -d text="@Reutlingen Domorestarted by Nodered"