only run once
Posted: Wednesday 18 November 2020 7:51
Hello, i have this script to check if light is on every first, second, third hours and after send mail notification, but the problems is a "time trigger" and run every minutes.
is it possible run this script only run once, not every minutes!
thanks a lot.

is it possible run this script only run once, not every minutes!
thanks a lot.
Code: Select all
if (otherdevices['S1 - Antibagno - 192.168.20.73'] == 'On' and difference > 3600 and difference < 7200) then
commandArray['SendNotification']='Luce Antibagno#Attenzione, Luce accesa da più di 1 ora!'
print('Luce Antibagno accesa da più di 1 ora')
elseif (otherdevices['S1 - Antibagno - 192.168.20.73'] == 'On' and difference > 3600 and difference < 10800) then
commandArray['SendNotification']='Luce Antibagno#Attenzione, Luce accesa da più di 2 ore!'
print('Luce Antibagno accesa da più di 2 ora')
elseif (otherdevices['S1 - Antibagno - 192.168.20.73'] == 'On' and difference > 3600 and difference < 14400) then
commandArray['SendNotification']='Luce Antibagno#Attenzione, Luce accesa da più di 3 ore!'
print('Luce Antibagno accesa da più di 3 ore')
end