dzVents device update always triggers actions?

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
User avatar
heggink
Posts: 989
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

dzVents device update always triggers actions?

Post 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
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzVents device update always triggers actions?

Post 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 ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
heggink
Posts: 989
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: dzVents device update always triggers actions?

Post by heggink »

Ideally yes but if a device is configured with executing a (non dzvents) script (e.g.bash) then these still get executed :-(!
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzVents device update always triggers actions?

Post 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&param=udevice&idx=".. idx ..
                            "&nvalue=" .. parm .. "&svalue=0"
                dz.openURL({ url = api, method = "GET" }).silent()
        end
        
        updateDeviceSilent(myDeviceIDX,1)
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
heggink
Posts: 989
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: dzVents device update always triggers actions?

Post by heggink »

It's a bit more elegant than my os.execute (some curl command) so I will adopt that (thanks!).
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest