Page 1 of 1
dzVents device update always triggers actions?
Posted: Friday 24 August 2018 11:39
by heggink
Sorry of this has been addressed before but is my understanding correct that dzvents has no udevice-type update mechanism i.e. updates ALWAYS trigger any scripts defined in actions?
I have some bash scripts that I would like to convert to dzvents that update devices through udevice such that any scripts are not executed and the device state is only updated (these are dummy devices where the state sometimes gets out of sync).
I can't seem to find how to replicate this other than through a os.execute(json) call

.
H
Re: dzVents device update always triggers actions?
Posted: Friday 24 August 2018 12:11
by waaren
heggink wrote: Friday 24 August 2018 11:39
Sorry of this has been addressed before but is my understanding correct that dzvents has no udevice-type update mechanism i.e. updates ALWAYS trigger any scripts defined in actions?
I have some bash scripts that I would like to convert to dzvents that update devices through udevice such that any scripts are not executed and the device state is only updated (these are dummy devices where the state sometimes gets out of sync).
When using the command option silent() , no follow-up action is triggered. Would this help you ?
Re: dzVents device update always triggers actions?
Posted: Friday 24 August 2018 13:11
by heggink
Ideally yes but if a device is configured with executing a (non dzvents) script (e.g.bash) then these still get executed

!
Re: dzVents device update always triggers actions?
Posted: Friday 24 August 2018 15:07
by waaren
heggink wrote: Friday 24 August 2018 13:11
Ideally yes but if a device is configured with executing a (non dzvents) script (e.g.bash) then these still get executed

!
Not a real native solution but maybe this will help ?
Code: Select all
-- udevice.lua
return {
on = { devices = {"your trigger device"}}, -- trigger
execute = function(dz,trigger)
local myDeviceIDX = 249 -- myDevice = idx of myDevice
local function updateDeviceSilent(idx,parm)
local api = dz.settings['Domoticz url'] .. "/json.htm?type=command¶m=udevice&idx=".. idx ..
"&nvalue=" .. parm .. "&svalue=0"
dz.openURL({ url = api, method = "GET" }).silent()
end
updateDeviceSilent(myDeviceIDX,1)
end
}
Re: dzVents device update always triggers actions?
Posted: Friday 24 August 2018 15:39
by heggink
It's a bit more elegant than my os.execute (some curl command) so I will adopt that (thanks!).