is it possible tio see which dzvents script activated device

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

Moderator: leecollings

Post Reply
Gravityz
Posts: 652
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2025.1
Location: Netherlands
Contact:

is it possible tio see which dzvents script activated device

Post by Gravityz »

Hello,

yesterday i had one of the weirdest things.
I had a zwave device(pump) which aparently activated on it's own

looking at the log it seems it was activated by a dzvents script.
the thing is this script does not have the pump device in it


is there a way to tell what activated this device
so it looks like pir sensor triggered dzvents script which turned on switch 19(veranda) and then also triggered Tuinsproeier

Code: Select all

2020-05-04 22:05:57.801  Status: OpenZWave: Alarm received (Home Security: Motion Detected at Unknown Location), NodeID: 16 (0x10)
2020-05-04 22:05:57.802  (Aeonlabs Z-wave stick Gen5) Light/Switch (Sensor)
2020-05-04 22:05:57.804  (Aeonlabs Z-wave stick Gen5) General/Alarm (Alarm Type: Burglar 7 (0x07))
2020-05-04 22:05:57.807  (Aeonlabs Z-wave stick Gen5) Light/Switch (PIR sensor)
2020-05-04 22:05:57.858  Status: EventSystem: Script event triggered: /usr/local/domoticz/dzVents/runtime/dzVents.lua
2020-05-04 22:05:57.895  OpenZWave: Domoticz has send a Switch command! NodeID: 19 (0x13)
2020-05-04 22:05:57.897  (Aeonlabs Z-wave stick Gen5) Light/Switch (Veranda)
2020-05-04 22:05:58.326  MQTT: Topic: domoticz/in, Message: {"idx":339,"RSSI":10,"nvalue":0,"svalue":"22.1"}
2020-05-04 22:05:59.475  (Aeonlabs Z-wave stick Gen5) Usage (Watt Tuinlampen)
2020-05-04 22:05:59.479  (Aeonlabs Z-wave stick Gen5) General/kWh (kWh Tuinlampen)
2020-05-04 22:05:59.662  (Aeonlabs Z-wave stick Gen5) Light/Switch (Tuinsproeier)
2020-05-04 22:05:59.713  Status: EventSystem: Script event triggered: /usr/local/domoticz/dzVents/runtime/dzVents.lua
2020-05-04 22:05:59.741  Status: Notification: Domoticz
2020-05-04 22:05:59.742  Notification sent (email) => Success
2020-05-04 22:05:59.742  Notification sent (browser) => Success
2020-05-04 22:05:59.874  Notification sent (telegram) => Success
this is the script which turned on 2 seconds before the pump but it has no pump device in it
so in my situation it turned on device veranda at 22:05:57 and turned on device tuinsproeier at 22:05:59

Code: Select all

-- Script wat er voor zorgt dat de veranda verlichting automatisch aan gaat bij beweging
-- PIR sensor staat zelf ingesteld dat deze alleen werkt bij minder dan 5 lux
return {
    active = true,
    on = {
        devices = {
            ['PIR sensor'] = {'between sunset and 00:00'}
        }
    },
    execute = function(domoticz, beweging)
            if beweging.state == 'On'  then
            domoticz.devices('Veranda').switchOn().checkFirst().forMin(5)
            
            end
    end
}
this is the script which turns of the Tuinsproeier after 50 minutes
they both have dependency in it regarding timeframe.

Code: Select all

-- Script zorgt er voor dat de tuinsproeier na inschakeling altijd weer uit gaat na 50 minuten
return {
    active = true,
    on = {
       devices = { ['Tuinsproeier'] = {'on 01/04-30/09'} }
    
    },
    execute = function(domoticz, switch)
        local timestamp=domoticz.time.rawTime
        if (switch.state == 'On') then
            local results = domoticz.helpers.addRollingTextLine(domoticz, 'Status', 'Tuinsproeier ingeschakeld', '4')
           domoticz.devices('Tuinsproeier').switchOff().afterMin(50)
           --domoticz.notify("Domoticz", timestamp.."\r\n".."Tuinsproeier ingeschakeld", "telegram")
            domoticz.globalData.tuinsproeierlaststatus = 'On'
        end
    
        if (switch.state == 'Off') then
            --tuinsproeierlaststatus wordt gebruikt om geen onnodige off meldingen via telegram te krijgen
            if domoticz.globalData.tuinsproeierlaststatus == 'On' then
            local results = domoticz.helpers.addRollingTextLine(domoticz, 'Status', 'Tuinsproeier uitgeschakeld', '4')
            --domoticz.notify("Domoticz", timestamp.."\r\n".."Tuinsproeier uitgeschakeld", "telegram")
            domoticz.globalData.tuinsproeierlaststatus = 'Off'
            end
        end    
        
    end
}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: is it possible tio see which dzvents script activated device

Post by waaren »

Gravityz wrote: Tuesday 05 May 2020 14:17 looking at the log it seems it was activated by a dzvents script.
This (relatively new) user field in the log cannot be trusted yet.
see this forum post and this github issue
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Gravityz
Posts: 652
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2025.1
Location: Netherlands
Contact:

Re: is it possible tio see which dzvents script activated device

Post by Gravityz »

ok, we can not trust the log but any idea how this could have happened.

the pump switched on 2 seconds after my outside veranda lights so that is not a coincindence i think
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest