Well, you can check the trigger info (third parameter to the execute function) and see if the reason was timer or a device. See
documentation. Thing is that in your script when Sensor_SK_PenM changes, your script is triggered as well. So if your if-statement renders true then you have things happening on every day.
So, there are several things you can do. You can check the triggerInfo parameter as mentioned above or you can put a day-check in your execute function or add a rule to the device trigger:
Code: Select all
return {
active = true,
on = {
devices = {
'Sensor_SK_PenM' = { 'on mon, tue, wed, thu, fri' }
},
timer = {
'every minute on mon,tue,wed,thu,fri'
},
},
...
Now changes in Sensor_SK_PenM will only trigger the execute function on weekdays.
Unless of course there's a bug in the timer rule code but first check if anything mentioned above is going on.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.