Page 1 of 1

Heating.Timers.Presence Button=on

Posted: Friday 02 December 2016 14:25
by TimH
Hello,

i have a question.
We have the follow timers for our Heaters:
05:45 on Weekdays = ON
07:30 on Weekdays = OFF
12:45 on Weekdays = ON
21:45 on Mon,Tue,Wed,Thurs = OFF

07:00 on Weekends = ON
22:30 on Fri.Sat.Sun = OFF

We have a good working presence detection,too.
Can we control by a script that if the Presence is on and it is between the switching times, the Domoticz put the heating on?
As an example, someone is at home on weekdays, Domoticz is to switch off the heating at 07:30 or not switch off.

I Hope you understand me what I want.
Thanks.

Re: Heating.Timers.Presence Button=on

Posted: Monday 05 December 2016 10:30
by emme
you cannot interact with timers, but you can use the events to trigger a script:
a simple LUA example for a Device Event:

Code: Select all

if (devicechanged['HEATERS'] and otherdevices['HEATER'] == 'Off') and (otherdevices['PRESENCE DETECTION'] == 'On') then
    commandArray['HEATER'] = 'On AFTER 3'
end
the 'On AFTER 3' is a switch fault prevention... because it will move ON-OFF-ON in less than 1 sec... it's better to pause it for a while to prevent shocks...
so it will be ON->OFF->wait 3 secs->ON
ciao
M