-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: node_notification event parameter 2 is always null #2382
Comments
Notifications are catched here: https://github.com/zwave-js/zwavejs2mqtt/blob/master/lib/ZwaveClient.ts#L3543 The third parameter in my case is args: https://github.com/zwave-js/zwavejs2mqtt/blob/master/lib/ZwaveClient.ts#L3355 In case of amultilevel switch notification data is parsed using args.eventData so if that is null it means that field is empty: https://github.com/zwave-js/zwavejs2mqtt/blob/master/lib/ZwaveClient.ts#L3381 cc @AlCalzone |
* fix: correctly parse MultilevelSwitchCC notifications Fixes #2382 * fix: better typescript support * fix: use ZWaveNotificationCallback * fix: let TS do the work Co-authored-by: Dominic Griesel <dominic.griesel@nabucasa.com>
Checklist
Deploy method
Docker
Zwavejs2Mqtt version
6.7.2
ZwaveJS version
9.0.2
Describe the bug
I'm trying to handle MultilevelSwitchChange notifications from ZwaveJS by subscribing to the
node_notification
MQTT topic.I receive an object like this (pruned for clarity):
That
null
is the problem. It should be an object containing an object with eventType and direction fields as can be seen in the last parameter of the call toemit()
in ZwaveJS.Without having read too deeply into ZwaveJS2MQTT, I suspect this parameter is not being serialized properly when the MQTT message is generated, resulting in a null instead of an object.
To Reproduce
Interact with a Zwave device that generates mutlilevel switch change messages. In my case, press the up or down arrow buttons on a VRCS4 or VRCZ4.
Expected behavior
The second parameter should contain an object with the event data that was supplied in the call to
emit()
, not null.Additional context
Here's the pull request that added this feature to ZwaveJS in case it's of use to you: zwave-js/node-zwave-js#4282
The text was updated successfully, but these errors were encountered: