Is it possible to start a dzVents timer from domoticz API with a variables?
Code: Select all
/json.htm?type=command¶m=customevent&event=TIMER&data=XModerator: leecollings
Code: Select all
/json.htm?type=command¶m=customevent&event=TIMER&data=XNot with a timer( that's driven by the domoticz event system) but starting from dzVents 3.0.0 (domoticz V4.11687) you can trigger dzVents scripts with customEvents. See the wiki chapterDewGew wrote: Monday 09 March 2020 17:18 I want to start a timer device Q for X mins from domoticz api.
Is it possible to start a dzVents timer from domoticz API with a variables?Code: Select all
/json.htm?type=command¶m=customevent&event=TIMER&data=X
Code: Select all
return
{
on =
{
customEvents = { 'TIMER' },
},
execute = function(domoticz, item)
-- your code here
end
}Code: Select all
return
{
on =
{
customEvents = { 'TIMER' },
},
execute = function(domoticz, item)
domoticz.devices(item.data.IDX).switchOn().forSec(item.data.T)
end
}
Code: Select all
/json.htm?type=command¶m=customevent&event=TIMER&data={IDX=12,T=30}Close ..
Code: Select all
return
{
on =
{
customEvents = { 'TIMER' },
},
execute = function(dz, item)
dz.devices(item.data.IDX).switchOn().forSec(item.data.T)
end
}Code: Select all
/json.htm?type=command¶m=customevent&event=TIMER&data={"IDX":12,"T":30}Do I cancel the time if I send a switchOn() or switchOff() within the time?waaren wrote: Tuesday 10 March 2020 8:28Close ..
Code: Select all
return { on = { customEvents = { 'TIMER' }, }, execute = function(dz, item) dz.devices(item.data.IDX).switchOn().forSec(item.data.T) end }Code: Select all
/json.htm?type=command¶m=customevent&event=TIMER&data={"IDX":12,"T":30}
NoDewGew wrote: Tuesday 10 March 2020 11:39 Do I cancel the time if I send a switchOn() or switchOff() within the time?
Do I update time if I send a forSec() within the time?
Users browsing this forum: No registered users and 1 guest