Page 1 of 1

.afterSec(xx) not working? :(

Posted: Friday 22 November 2024 21:35
by BarryT
hi all,

can somebody help me out why my delay does not work?
i'm trying to make a heating script with zones, a buffertank with pump and an weather temperature based heatpump with an on/off input.
the rest of the scripts works (with thermostats, heatcommand to heatpump and opening the valves,
but i want to have my tankpump to have a delay of 3 minutes before it goes ON due opening of the valves that takes some minutes before they are open...

This code

Code: Select all

local heating if hp.heater ~= nil then heating = dz.devices(hp.heater) end 
works correctly but does not have any delay. when one of the valves has turned ON the pump is also going ON directly.

The next code does NOT work :(

Code: Select all

local Delay = 30
local heating if hp.heater ~= nil then heating = dz.devices(t.heater).afterSec(Delay) end
I was hoping this would do the trick, but then i'm getting an error:

Code: Select all

 attempt to call a nil value (field 'afterSec')
Why does this delay not work?

Many thanks!

Re: .afterSec(xx) not working? :(

Posted: Friday 22 November 2024 22:37
by Fredom
BarryT wrote: Friday 22 November 2024 21:35 hi all,

can somebody help me out why my delay does not work?
i'm trying to make a heating script with zones, a buffertank with pump and an weather temperature based heatpump with an on/off input.
the rest of the scripts works (with thermostats, heatcommand to heatpump and opening the valves,
but i want to have my tankpump to have a delay of 3 minutes before it goes ON due opening of the valves that takes some minutes before they are open...

This code

Code: Select all

local heating if hp.heater ~= nil then heating = dz.devices(hp.heater) end 
works correctly but does not have any delay. when one of the valves has turned ON the pump is also going ON directly.

The next code does NOT work :(

Code: Select all

local Delay = 30
local heating if hp.heater ~= nil then heating = dz.devices(t.heater).afterSec(Delay) end
I was hoping this would do the trick, but then i'm getting an error:

Code: Select all

 attempt to call a nil value (field 'afterSec')
Why does this delay not work?

Many thanks!
Hi
I use

Code: Select all

local Delay = 30
local heating if hp.heater ~= nil then heating = dz.devices(t.heater).switchOff().afterSec(Delay) end

Re: .afterSec(xx) not working? :(

Posted: Friday 22 November 2024 22:43
by waltervl
AfterSec() is a command option so should be used in combination with a supported command like .switchOn() .switchOff() etc

In the wiki there is a general availability table https://wiki.domoticz.com/DzVents:_next ... ailability

Also per device command it is noted in the wiki if it supports by command options.

Re: .afterSec(xx) not working? :(

Posted: Saturday 23 November 2024 18:08
by BarryT
waltervl wrote: Friday 22 November 2024 22:43 AfterSec() is a command option so should be used in combination with a supported command like .switchOn() .switchOff() etc

In the wiki there is a general availability table https://wiki.domoticz.com/DzVents:_next ... ailability

Also per device command it is noted in the wiki if it supports by command options.
Ahh i see, so thats why it doesnt work..
Any idea to get it working?
Thanks!

Re: .afterSec(xx) not working? :(

Posted: Saturday 23 November 2024 21:19
by waltervl
Use something like
domoticz.devices('tankpump').switchOn().afterMin(3)