harobinson
(Harobinson)
January 3, 2023, 4:06pm
#1
Background: I am trying to track down an event from an unnamed handler. It looks like I can get the information by registering the error field. I don’t understand the required syntax for adding the error field to the zwave_handler table.
The documentation states: In addition there are 2 extra keys that can be added to the zwave_handlers table. The fallback
and error
fields can be set to be used as the special handlers for the [Dispatchers]"
What is the correct syntax to specify the error field and am I correct that this would result in my being able to get the event information to construct the handler?
Thanks
nayelyz
(Developer Support Team)
January 3, 2023, 4:41pm
#2
Hi, @harobinson
I’m linking this here: ZWave Handler for ManufacturerProprietary Command Class - #3 by harobinson as I think it’s related.
Can you share the log of the incoming message that you’re trying to handle, please? You should receive the Z-Wave message and it should appear in the logs despite not being handled yet.
In the meantime, I’ll ask the team for more info about those fields and the handler for that CC, maybe it behaves differently than others I’ve seen.
csstup
(Corey Stup)
January 3, 2023, 5:59pm
#3
harobinson:
fallback
and error
error
and fallback
just need to point to functions, and would get similar parameters to the other zwave handlers.
local function error_handler(driver, device, cmd)
...
end
and in your template:
zwave_handlers = {
error = error_handler
}
harobinson
(Harobinson)
January 3, 2023, 6:41pm
#4
Here is the log that is generated. No ZWAVE message in log other than the comment.
2023-01-03T18:36:49.728731806+00:00 TRACE Z-Wave Leviton 4-Button Scene Controller Received event with handler unnamed
2023-01-03T18:36:49.913798139+00:00 INFO Z-Wave Leviton 4-Button Scene Controller <ZwaveDevice: 4e5febe7-adcc-4cbc-b4eb-0c21a001b19c [32] (Leviton 4 Button Switch)> received Z-Wave command: {args={dimming_duration="default", scene_id=1}, cmd_class="SCENE_ACTIVATION", cmd_id="SET", dst_channels={}, encap="NONE", payload="\x01\xFF", src_channel=0, version=1}
2023-01-03T18:36:49.974413806+00:00 TRACE Z-Wave Leviton 4-Button Scene Controller Found ZwaveDispatcher handler in Z-Wave Leviton 4-Button Scene Controller
2023-01-03T18:36:49.998242139+00:00 DEBUG Z-Wave Leviton 4-Button Scene Controller Leviton 4 Button Switch device thread event handled
2023-01-03T18:36:50.027209139+00:00 TRACE Z-Wave Leviton 4-Button Scene Controller Received event with handler unnamed
2023-01-03T18:36:50.062154806+00:00 INFO Z-Wave Leviton 4-Button Scene Controller <ZwaveDevice: 4e5febe7-adcc-4cbc-b4eb-0c21a001b19c [32] (Leviton 4 Button Switch)> received Z-Wave command: {args={dimming_duration="default", scene_id=1}, cmd_class="SCENE_ACTIVATION", cmd_id="SET", dst_channels={}, encap="NONE", payload="\x01\xFF", src_channel=0, version=1}
2023-01-03T18:36:50.137267139+00:00 TRACE Z-Wave Leviton 4-Button Scene Controller Found ZwaveDispatcher handler in Z-Wave Leviton 4-Button Scene Controller
2023-01-03T18:36:50.170119139+00:00 DEBUG Z-Wave Leviton 4-Button Scene Controller Leviton 4 Button Switch device thread event handled
2023-01-03T18:36:50.185533806+00:00 TRACE Z-Wave Leviton 4-Button Scene Controller Received event with handler unnamed
2023-01-03T18:36:50.207081139+00:00 INFO Z-Wave Leviton 4-Button Scene Controller <ZwaveDevice: 4e5febe7-adcc-4cbc-b4eb-0c21a001b19c [32] (Leviton 4 Button Switch)> received Z-Wave command: {args={dimming_duration="default", scene_id=1}, cmd_class="SCENE_ACTIVATION", cmd_id="SET", dst_channels={}, encap="NONE", payload="\x01\xFF", src_channel=0, version=1}
2023-01-03T18:36:50.247053473+00:00 TRACE Z-Wave Leviton 4-Button Scene Controller Found ZwaveDispatcher handler in Z-Wave Leviton 4-Button Scene Controller
2023-01-03T18:36:50.252635806+00:00 DEBUG Z-Wave Leviton 4-Button Scene Controller Leviton 4 Button Switch device thread event handled
2023-01-03T18:36:50.259696473+00:00 TRACE Z-Wave Leviton 4-Button Scene Controller Received event with handler unnamed
2023-01-03T18:36:50.297091806+00:00 INFO Z-Wave Leviton 4-Button Scene Controller <ZwaveDevice: 4e5febe7-adcc-4cbc-b4eb-0c21a001b19c [32] (Leviton 4 Button Switch)> received Z-Wave command: {args={dimming_duration="default", scene_id=1}, cmd_class="SCENE_ACTIVATION", cmd_id="SET", dst_channels={}, encap="NONE", payload="\x01\xFF", src_channel=0, version=1}
2023-01-03T18:36:50.338286806+00:00 TRACE Z-Wave Leviton 4-Button Scene Controller Found ZwaveDispatcher handler in Z-Wave Leviton 4-Button Scene Controller
2023-01-03T18:36:50.358538806+00:00 DEBUG Z-Wave Leviton 4-Button Scene Controller Leviton 4 Button Switch device thread event handled
Thanks for the help.