weird trigger  [Solved]

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

Moderator: leecollings

Post Reply
hestia
Posts: 361
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

weird trigger

Post by hestia »

Hi
I've only 2 scripts Enabled (for the test I've Disabled all other scripts to be sure)
One that toggle 2 dummy switches

Code: Select all

local LIGHTS= {460, 202} 

return {
    on = {timer   = { "every minute" }
         },

      logging =   {level = domoticz.LOG_DEBUG,
 },    

    execute = function(dz, item)
        _G.logMarker =  dz.moduleLabel -- set logmarker to scriptname  
        local LOG_LEVEL = dz.LOG_DEBUG  -- LOG_INFO, LOG_DEBUG, LOG_ERROR, LOG_FORCE
        local zwaveDevice

            for i, d in ipairs(LIGHTS) do
                zwaveDevice = dz.devices(d)
                if not zwaveDevice.active then
                    zwaveDevice.switchOn().afterSec(i)
                dz.log(d .. ' Device: '.. zwaveDevice.name .. " : " .. zwaveDevice.id .. " : " ..  zwaveDevice.state .. " to ON", LOG_LEVEL)
                else
                    zwaveDevice.switchOff().afterSec(i)
                    dz.log(d .. ' Device: '.. zwaveDevice.name .. " : " .. zwaveDevice.id .. " : " ..  zwaveDevice.state .. " to OFF", LOG_LEVEL)
                end
        end
         
    end
} 
Another that is triggered by a zwave switch (so another device!)

Code: Select all

local LIGHT = {1023} 

return {
    logging = {level = domoticz.LOG_DEBUG,
	},
	on = {
		devices = LIGHT
	},
	execute = function(dz, device)
    	_G.logMarker =  dz.moduleLabel -- set logmarker to scriptname  
    	local LOG_LEVEL = dz.LOG_DEBUG  -- LOG_INFO, LOG_DEBUG, LOG_ERROR, LOG_FORCE  - normal = LOG_INFO
		
	dz.log('Device TRIGGERED ' .. device.id .. ' ' ..  device.name .. '  '.. device.state .. ' ' .. device.deviceType, dz.LOG_ERROR)

	end
}
The 2nd script is triggered by the zwave switch while nothing is common between both.

the log is the following

Code: Select all

2020-07-01 22:10:00.390 Status: dzVents: Info: ------ Start internal script: zTestOn:, trigger: "every minute"
2020-07-01 22:10:00.407 Status: dzVents: Debug: zTestOn: Processing device-adapter for test inter 460: Switch device adapter
2020-07-01 22:10:00.407 Status: dzVents: Debug: zTestOn: Constructed timed-command: On
2020-07-01 22:10:00.408 Status: dzVents: Debug: zTestOn: Constructed timed-command: On AFTER 1 SECONDS
2020-07-01 22:10:00.408 Status: dzVents: Debug: zTestOn: 460 Device test inter 460 : 460 : Off to ON
2020-07-01 22:10:00.410 Status: dzVents: Debug: zTestOn: Processing device-adapter for test detecteur 202: Switch device adapter
2020-07-01 22:10:00.411 Status: dzVents: Debug: zTestOn: Constructed timed-command: On
2020-07-01 22:10:00.411 Status: dzVents: Debug: zTestOn: Constructed timed-command: On AFTER 2 SECONDS
2020-07-01 22:10:00.411 Status: dzVents: Debug: zTestOn: 202 Device test detecteur 202 : 202 : Off to ON
2020-07-01 22:10:00.411 Status: dzVents: Info: zTestOn: ------ Finished zTestOn
2020-07-01 22:10:00.414 Status: EventSystem: Script event triggered: /home/pi/PROD_domoticz/dzVents/runtime/dzVents.lua
2020-07-01 22:10:01.472 (Dummy1) Light/Switch (test inter 460)
2020-07-01 22:10:01.632 Status: dzVents: Info: ------ Start internal script: zTestTriggered: Device: "s/Balcon (Z-Wave Plus Z-Stick Gen5)", Index: 1023
2020-07-01 22:10:01.633 Status: dzVents: Info: zTestTriggered: ------ Finished zTestTriggered
2020-07-01 22:10:01.633 Error: dzVents: Error: (3.0.9) zTestTriggered: Device TRIGGERED 1023 s/Balcon On Light/Switch
2020-07-01 22:10:02.472 (Dummy1) Light/Switch (test detecteur 202)
2020-07-01 22:10:06.550 (Dummy1) Light/Switch (test inter 460)
2020-07-01 22:10:06.771 Status: dzVents: Info: ------ Start internal script: zTestTriggered: Device: "s/Balcon (Z-Wave Plus Z-Stick Gen5)", Index: 1023
2020-07-01 22:10:06.772 Status: dzVents: Info: zTestTriggered: ------ Finished zTestTriggered
2020-07-01 22:10:06.772 Error: dzVents: Error: (3.0.9) zTestTriggered: Device TRIGGERED 1023 s/Balcon Off Light/Switch
I've rebooted the server in case of anything, but the issue is still there
Version: 2020.2 (build 12192)
Build Hash: 8f82b73ff-modified
Compile Date: 2020-06-29 16:15:42
dzVents Version: 3.0.9
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: weird trigger

Post by waaren »

hestia wrote: Wednesday 01 July 2020 22:49 I've rebooted the server in case of anything, but the issue is still there
I checked with your scripts but cannot replicate the issue. Maybe if you enable full debug you will see something more?
Happy to help further but that would require a copy of your database.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
hestia
Posts: 361
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

Re: weird trigger  [Solved]

Post by hestia »

Thanks for your help
cannot replicate the issue
I understand you can't replicate because there is no link between both scripts. I was testing a device with a script and another was switching on, after I could isolate those both scripts to have something simple to post
I've sent you a link to download the db
Which parameter do you want for a "full debug" when I have time
hestia
Posts: 361
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

Re: weird trigger

Post by hestia »

waaren's diagnostic was quick:
The device 1023 had a sub/slave device, the 460.
So when the 460 was switched on, the 1023 was also switched on.
Nothing weird in fact, a feature!
I’ve deleted the sub/slave device in 1023 and there was no longer any weird triggering.
I didn't remember having declared it, but it was there!

Thanks waaren again
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest