sincze wrote:please have a look on the example files e.g. _cron60.php
Look for an example with function past(60) in it.
And issue the sw function but now off.
Dit you implement cron.sh the Domoticz monitor and also used for pass2php crons??
Ok great! Will look into it! I am getting more and more excited
Euh no I didn’t where do I need to put it?
Is it also automatically restarting Domoticz when it crashes?
Sent from my iPhone using Tapatalk
Yes it restarts Domoticz when it crashes. Beautiful does not happen often luckily
.
I put it in /home/pi/domoticz/scripts/pass2php
I automatically backup the Domoticz directory to a NAS so if I keep everything in this directory it is automatically backupped.
Now edit
sudo nano /etc/crontab
Add the script here to run every minute and. Voila a working keep Domoticz alive Monitor.
Sent from my ONEPLUS A6003 using Tapatalk
ok, put the script in the /home/pi/domoticz/scripts/pass2php folder and gave it the 777 rights.
is this crontab filled in correctly(as it looks different).
2019-05-05 12_37_18-192.168.1.200.png (156.87 KiB) Viewed 775 times
Usually you pipe the output to something with the > But don't know that by heart. Give it a Google search what the best option would be. This could work.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Usually you pipe the output to something with the > But don't know that by heart. Give it a Google search what the best option would be. This could work.
I got it to pipe the output to a cronlog.log file in the same directory but now my Domoticz is restarting every minute. Do I have to change the cron.sh file? When I open the file I see it is looking at different Cron.php files and a smappeepower.php file in the secure directory. I don’t have those files in there
Usually you pipe the output to something with the > But don't know that by heart. Give it a Google search what the best option would be. This could work.
I got it to pipe the output to a cronlog.log file in the same directory but now my Domoticz is restarting every minute. Do I have to change the cron.sh file? When I open the file I see it is looking at different Cron.php files and a smappeepower.php file in the secure directory. I don’t have those files in there
Sent from my iPhone using Tapatalk
Ok, putting the cron.php file in the right directory did the trick I am not sure how the cron is working for switching the light off after x seconds. As I see multiple variables doing lots of things. Where do I put in the number of seconds the switch has to turn off?
I have my cron scripts just in the secure folder, take a look at the file/folder structure at github.
I just added a comment to the cron.sh script with my crontab:
Egregius wrote:I have my cron scripts just in the secure folder, take a look at the file/folder structure at github.
I just added a comment to the cron.sh script with my crontab:
sincze wrote: ↑Sunday 05 May 2019 23:34
Interesting never heard of;
/usr/bin/nice
What is the catch
Never to old to learn new tricks.
nice is a program that handles priorities.
Priorities are from 0 to 39 on linux. Default is 20.
A positief nice number lowers the priority (but the number is raised so it's kind of reversed). This way you make sure that less important stuff doesn't get in the way of the more important stuff. You can see this in top in the columns PR and NI.
sincze wrote: ↑Sunday 05 May 2019 23:30
Make 1 typo in a crucial place... And it is back to the Apache/nginx logs.
True! Forget one ' ) ; } and it's done, no more reaction.
But then there's logs.php and log.php to the rescue. log.php is a script that reads in realtime a logfile and show it in the browser.
You should always have the apache error log open while changing stuff.