Page 1 of 1

No trigger for device

Posted: Saturday 25 December 2021 22:47
by hestia
Hi,
I've devices with zwavejs2mqtt and some of them do not trigger dzVents scripts (neither a Blockly).
Even though the state is updated in dz. From the widget in dz and from the real switch.
The script

Code: Select all

local LIGHTS= {
1976	,
1980	,
1981	,
1984	,
1988	,
1995	,
1999	,
2000	,
2009	,
2019	,
2028	,
2029	,
2032	,
2033	,
2038	,
2039	,
2041	,
2042	,
2043	,
2044	,
2045	,
2046	,
2052	,
2055	,
2056	,
2057	,
2060	,
2065	,
2066	,
2067	,
2068	,
2069	,
2090	,
2094	,
2097	,
2098	,
2099	,
2102	,
2149	,
2152	,
2156	,
2162	,
2172	,
2176	,
2185	,
2199	,
2202	,
2204	,
2211	,
2212	,
2216	,
2217	,
2223	,
2225
}

return {
        logging =   {   level =
                            domoticz.LOG_ERROR,
                    },
            
        on =        {   devices = LIGHTS ,
                    },

    execute = function(dz, item, triggerInfo)
        _G.logMarker =  dz.moduleLabel
        local LOG_LEVEL = dz.LOG_FORCE
        
        local function logWrite(str, level)
            if level == nil then
                level = LOG_LEVEL
            end
            dz.log(tostring(str), level)
        end
    
        local zwaveDevice = item
        logWrite('==>> Device: '.. zwaveDevice.name .. " : " .. zwaveDevice.id .. " : " ..  zwaveDevice.state .. ' / ' .. zwaveDevice.levelVal)
                
    end
} 
Some log, with OKs and KOs
Spoiler: show

Code: Select all

2021-12-25 22:36:55.025 Status: User: admin (IP: 192.168.9.201) initiated a switch command (2000/Allée Dim/Set Level)
2021-12-25 22:36:55.484 Status: User: Admin (IP: 127.0.0.1) initiated a switch command (2052/Portillon/On)

2021-12-25 22:37:25.253 Status: User: admin (IP: 192.168.9.201) initiated a switch command (2000/Allée Dim/Off)
2021-12-25 22:37:25.663 Status: User: Admin (IP: 127.0.0.1) initiated a switch command (2052/Portillon/Off)
2021-12-25 22:37:33.149 Status: User: admin (IP: 192.168.9.201) initiated a switch command (1976/Portail Dim/On)

2021-12-25 22:37:40.666 Status: User: admin (IP: 192.168.9.201) initiated a switch command (1976/Portail Dim/Off)
2021-12-25 22:37:50.572 Status: User: admin (IP: 192.168.9.201) initiated a switch command (2217/Haut escalier/On)
2021-12-25 22:37:51.106 Status: dzVents: Info: Handling events for: "Haut escalier", value: "On"
2021-12-25 22:37:51.107 Status: dzVents: !Info: zTestOnOff: ==>> Device: Haut escalier : 2217 : On / 99

2021-12-25 22:38:11.582 Status: User: admin (IP: 192.168.9.201) initiated a switch command (2217/Haut escalier/Off)
2021-12-25 22:38:11.997 Status: dzVents: Info: Handling events for: "Haut escalier", value: "Off"
2021-12-25 22:38:11.999 Status: dzVents: !Info: zTestOnOff: ==>> Device: Haut escalier : 2217 : Off / 0

2021-12-25 22:38:21.834 Status: User: admin (IP: 192.168.9.201) initiated a switch command (2028/Entrée/On)
2021-12-25 22:38:22.373 Status: dzVents: Info: Handling events for: "Entrée", value: "On"
2021-12-25 22:38:22.391 Status: dzVents: !Info: zTestOnOff: ==>> Device: Entrée : 2028 : On / 0

2021-12-25 22:38:25.625 Status: User: admin (IP: 192.168.9.201) initiated a switch command (2028/Entrée/Off)
2021-12-25 22:38:26.069 Status: dzVents: Info: Handling events for: "Entrée", value: "Off"
2021-12-25 22:38:26.084 Status: dzVents: !Info: zTestOnOff: ==>> Device: Entrée : 2028 : Off / 0

2021-12-25 22:38:48.388 Status: User: admin (IP: 192.168.9.201) initiated a switch command (2052/Portillon/On)

2021-12-25 22:39:07.050 Status: User: admin (IP: 192.168.9.201) initiated a switch command (2000/Allée Dim/On)

2021-12-25 22:39:07.478 Status: User: Admin (IP: 127.0.0.1) initiated a switch command (2052/Portillon/On)

2021-12-25 22:39:08.406 Status: User: admin (IP: 192.168.9.201) initiated a switch command (2000/Allée Dim/Off)

2021-12-25 22:39:08.845 Status: User: Admin (IP: 127.0.0.1) initiated a switch command (2052/Portillon/Off)

Re: No trigger for device

Posted: Saturday 22 January 2022 23:20
by hestia
It seems I'm alone on this issue
To add info on this point
An example on a node
Screenshot 2022-01-22 225503.png
Screenshot 2022-01-22 225503.png (43.84 KiB) Viewed 691 times
Screenshot 2022-01-22 225649.png
Screenshot 2022-01-22 225649.png (71.72 KiB) Viewed 691 times
Screenshot 2022-01-22 231135.png
Screenshot 2022-01-22 231135.png (46.98 KiB) Viewed 691 times
last log:

Code: Select all

2022-01-22 23:10:56.293 Status: dzVents: !Info: zTestOnOff: ==>> Device: Détecteur Salon : 2170 : Off / 0
For this device the trigger is not activated when the device is switch on.

Re: No trigger for device

Posted: Sunday 23 January 2022 10:28
by jvdz
Status is looking good right? 99 = Off in ZWAVE.
Could you records the MQTT messages using the script available here and supply the output log, so we can "play them back" and see what is happening?
Something like this should do the trick:

Code: Select all

bash mqtt_ad_record.sh -s "65e_59-38-0"
Jos

Re: No trigger for device

Posted: Sunday 23 January 2022 11:07
by hestia
With the real switch I could get trigger for the 'Off' but not for the 'On' even though the widget in dz is updated.
With dz GUI I could get both triggers
Here is the log

Code: Select all

"id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
"id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
"id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
"id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
"id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
"id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
It seems there are few info?
I should have missed something :cry:
I run this: bash mqtt_ad_record.sh -s "65e_59-38-0"

Re: No trigger for device

Posted: Sunday 23 January 2022 11:22
by jvdz
hestia wrote: Sunday 23 January 2022 11:07 With the real switch I could get trigger for the 'Off' but not for the 'On' even though the widget in dz is updated.
With dz GUI I could get both triggers
Here is the log

Code: Select all

"id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
"id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
"id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
"id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
"id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
"id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
Is this the content of logfile mqtt_ad_record_65e_59-38-0.log from the script I pointed you to?

Jos

Re: No trigger for device

Posted: Sunday 23 January 2022 13:13
by hestia
yes!
mqtt_ad_record_65e_59-38-0.log
(1.31 KiB) Downloaded 22 times

Re: No trigger for device

Posted: Sunday 23 January 2022 16:26
by jvdz
mmm strange .... for example this is what I see in the console and log when running it:

Code: Select all

pi@PIHK ~ $ bash mqtt_ad_record.sh -s kerst
=================================================================================================================
MQTT_IP   : '127.0.0.1'
MQTT_PORT : '1883'
MQTT_Param: ''
Recordtime: '600'
Search For: 'kerst'
Start Capture for 600 seconds of MQTT messages containing kerst to Console and file: mqtt_ad_record_kerst.log
2022-01-23T16:24:47+0100        1       homeassistant/switch/192A8A_RL_1/config {"name":"TuinKerst","stat_t":"tele/tasmota_192A8A/STATE","avty_t":"tele/tasmota_192A8A/LWT","pl_avail":"Online","pl_not_avail":"Offline","cmd_t":"cmnd/tasmota_192A8A/POWER","pl_off":"OFF","pl_on":"ON","val_tpl":"{{value_json.POWER}}","uniq_id":"192A8A_RL_1","dev":{"ids":["192A8A"]}}
2022-01-23T16:24:47+0100        1       zwaveauto/switch/Kerstboom/switch/config        {"payload_off":false,"payload_on":true,"value_template":"{{ value_json.value }}","command_topic":"zwave/Kerstboom/37/0/targetValue/set","state_topic":"zwave/Kerstboom/37/0/currentValue","device":{"identifiers":["zwavejs2mqtt_0xf8a2feab_node47"],"manufacturer":"Everspring","model":"Everspring Lamp Holder / Lamp Module (AN142/ AN145 / AN148 / AN157)","name":"Kerstboom","sw_version":"1.2"},"name":"Kerstboom_switch","unique_id":"zwavejs2mqtt_0xf8a2feab_47-37-0-currentValue"}
2022-01-23T16:24:47+0100        1       tasmota/discovery/70039F192A8A/config   {"ip":"192.168.0.85","dn":"TuinKerst","fn":["TuinKerst",null,null,null,null,null,null,null],"hn":"tasmota-192A8A-2698","mac":"70039F192A8A","md":"NOUS A1","ty":0,"if":0,"ofln":"Offline","onln":"Online","state":["OFF","ON","TOGGLE","HOLD"],"sw":"10.1.0","t":"tasmota_192A8A","ft":"%prefix%/%topic%/","tp":["cmnd","stat","tele"],"rl":[1,0,0,0,0,0,0,0],"swc":[-1,-1,-1,-1,-1,-1,-1,-1],"swn":[null,null,null,null,null,null,null,null],"btn":[0,0,0,0,0,0,0,0],"so":{"4":0,"11":0,"13":0,"17":1,"20":0,"30":0,"68":0,"73":0,"82":0,"114":0,"117":0},"lk":0,"lt_st":0,"sho":[0,0,0,0],"ver":1}
^C** CTRL-C pressed.
Capture interrupted, check file: mqtt_ad_record_kerst.log

Re: No trigger for device

Posted: Sunday 23 January 2022 17:45
by hestia
any trace to add or get?

Code: Select all

./mqtt_ad_record.sh -s "65e_59-38-0"
=================================================================================================================
MQTT_IP   : '127.0.0.1'
MQTT_PORT : '1883'
MQTT_Param: ''
Recordtime: '600'
Search For: '65e_59-38-0'
Start Capture for 600 seconds of MQTT messages containing 65e_59-38-0 to Console and file: mqtt_ad_record_65e_59-38-0.log
        "id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
        "id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
        "id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
        "id" : "zwavejs2mqtt_0xe236465e_59-38-0-currentValue",
For all messages, not better!

Code: Select all

 ./mqtt_ad_record.sh
=================================================================================================================
MQTT_IP   : '127.0.0.1'
MQTT_PORT : '1883'
MQTT_Param: ''
Recordtime: '600'
Search For: ''
Start Capture for 600 seconds of all MQTT messages to Console and file: mqtt_ad_record_all.log
My broker is on the same server as dz
Screenshot 2022-01-23 174410.png
Screenshot 2022-01-23 174410.png (39.95 KiB) Viewed 643 times

Re: No trigger for device

Posted: Sunday 23 January 2022 18:15
by jvdz
What does the logfile look for all messages, without and -s paramater, as I guess the payload is spread over multiple lines?

Re: No trigger for device

Posted: Sunday 23 January 2022 18:27
by jvdz
Could you else run this command and send me the output file so I can see what the raw records are from mosquitto_sub?

Code: Select all

mosquitto_sub -h 127.0.0.1 -t "#" -v -W 10 -F "%I\t%r\t%t\t%p"> "mqtt_ad_records_raw.log"
This will capture all MQTT messages for 10 seconds plus show all retained messages.
We could also work on this via SLACK in case you are there as well ... :) look for @Jos

Re: No trigger for device

Posted: Sunday 23 January 2022 19:15
by hestia
result posted on slack...