Skip to content
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

Z-Wave JS value_updated triggers do not work after add-on restarted #88643

Closed
atx32 opened this issue Feb 23, 2023 · 12 comments · Fixed by #94383 or #94702
Closed

Z-Wave JS value_updated triggers do not work after add-on restarted #88643

atx32 opened this issue Feb 23, 2023 · 12 comments · Fixed by #94383 or #94702

Comments

@atx32
Copy link

atx32 commented Feb 23, 2023

The problem

Whenever the Z-Wave JS add-on is restarted (such as when a version update is performed) while Home Assistant is running, any value_updated triggers in automations stop working. I have to restart Home Assistant after the Z-Wave JS add-on to get the triggers to work again. In the zwave_js integration debug logs I always see the same messages whether the automation is triggered or not, and I've pasted those in the logs section. In developer tools I tried subscribing to events, and only see the event below when Home Assistant starts after the Z-Wave JS add-on.

event_type: automation_triggered
data:
name: Start Back Yard Timer
entity_id: automation.start_back_yard_timer
source: Z-Wave value 3-38-0-targetValue updated on In-Wall 600W Dimmer
origin: LOCAL
time_fired: "2023-02-23T03:58:25.266744+00:00"
context:
id: 01GSY6R6ZHWDFQD6JD4DD1HG2G
parent_id: null
user_id: null

What version of Home Assistant Core has the issue?

2023.2.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

zwave_js

Link to integration documentation on our website

No response

Diagnostics information

config_entry-zwave_js-df74f956572afe21ee1a9a59e999b3ec.json.txt

Example YAML snippet

trigger:
  - platform: zwave_js.value_updated
    device_id: 1ad599f3cd18298ab0fc3bef72ecbae8
    command_class: 38
    property: targetValue
    endpoint: "0"
    to: "99"
condition:
  - condition: or
    conditions:
      - condition: sun
        after: sunset
      - condition: sun
        before: sunrise
action:
  - service: timer.start
    data:
      duration: "{{ state_attr('timer.backyard','duration') }}"
    target:
      entity_id: timer.backyard
mode: single

Anything in the logs that might be useful for us?

2023-02-22 21:16:20.834 DEBUG (MainThread) [zwave_js_server] Publishing message:
{'command': 'node.set_value',
 'messageId': '52ba20aa5730415b93dd501daddecb0f',
 'nodeId': 3,
 'options': {'transitionDuration': 'default'},
 'value': 99,
 'valueId': {'commandClass': 38, 'endpoint': 0, 'property': 'targetValue'}}

2023-02-22 21:16:20.872 DEBUG (MainThread) [zwave_js_server] Received message:
WSMessage(type=<WSMsgType.TEXT: 1>, data='{"type":"event","event":{"source":"controller","event":"statistics updated","statistics":{"messagesTX":10,"messagesRX":49,"messagesDroppedRX":0,"NAK":0,"CAN":0,"timeoutACK":0,"timeoutResponse":0,"timeoutCallback":0,"messagesDroppedTX":0}}}', extra='')

2023-02-22 21:16:20.910 DEBUG (MainThread) [zwave_js_server] Received message:
WSMessage(type=<WSMsgType.TEXT: 1>, data='{"type":"event","event":{"source":"node","event":"statistics updated","nodeId":3,"statistics":{"commandsTX":6,"commandsRX":4,"commandsDroppedRX":0,"commandsDroppedTX":0,"timeoutResponse":0,"rtt":47.3,"rssi":-72,"lwr":{"protocolDataRate":2,"repeaters":[],"rssi":-72,"repeaterRSSI":[]}}}}', extra='')

2023-02-22 21:16:20.916 DEBUG (MainThread) [zwave_js_server] Received message:
WSMessage(type=<WSMsgType.TEXT: 1>, data='{"type":"event","event":{"source":"node","event":"value updated","nodeId":3,"args":{"commandClassName":"Multilevel Switch","commandClass":38,"property":"currentValue","endpoint":0,"newValue":99,"prevValue":99,"propertyName":"currentValue"}}}', extra='')

2023-02-22 21:16:20.916 DEBUG (MainThread) [homeassistant.components.zwave_js] [light.in_wall_600w_dimmer_2] Value currentValue/None changed to: 99
2023-02-22 21:16:20.919 DEBUG (MainThread) [zwave_js_server] Received message:
WSMessage(type=<WSMsgType.TEXT: 1>, data='{"type":"event","event":{"source":"node","event":"value updated","nodeId":3,"args":{"commandClassName":"Multilevel Switch","commandClass":38,"endpoint":0,"property":"targetValue","newValue":99,"prevValue":99,"propertyName":"targetValue"}}}', extra='')

2023-02-22 21:16:20.922 DEBUG (MainThread) [zwave_js_server] Received message:
WSMessage(type=<WSMsgType.TEXT: 1>, data='{"type":"result","success":true,"messageId":"52ba20aa5730415b93dd501daddecb0f","result":{"success":true}}', extra='')

2023-02-22 21:16:21.006 DEBUG (MainThread) [zwave_js_server] Received message:
WSMessage(type=<WSMsgType.TEXT: 1>, data='{"type":"event","event":{"source":"node","event":"value updated","nodeId":3,"args":{"commandClassName":"Multilevel Switch","commandClass":38,"property":"targetValue","endpoint":0,"newValue":99,"prevValue":99,"propertyName":"targetValue"}}}', extra='')

2023-02-22 21:16:21.011 DEBUG (MainThread) [zwave_js_server] Received message:
WSMessage(type=<WSMsgType.TEXT: 1>, data='{"type":"event","event":{"source":"node","event":"value updated","nodeId":3,"args":{"commandClassName":"Multilevel Switch","commandClass":38,"property":"duration","endpoint":0,"newValue":{"value":0,"unit":"seconds"},"prevValue":{"value":0,"unit":"seconds"},"propertyName":"duration"}}}', extra='')

2023-02-22 21:16:21.014 DEBUG (MainThread) [zwave_js_server] Received message:
WSMessage(type=<WSMsgType.TEXT: 1>, data='{"type":"event","event":{"source":"node","event":"value updated","nodeId":3,"args":{"commandClassName":"Multilevel Switch","commandClass":38,"property":"currentValue","endpoint":0,"newValue":99,"prevValue":99,"propertyName":"currentValue"}}}', extra='')

2023-02-22 21:16:21.015 DEBUG (MainThread) [homeassistant.components.zwave_js] [light.in_wall_600w_dimmer_2] Value currentValue/None changed to: 99
2023-02-22 21:16:21.123 DEBUG (MainThread) [zwave_js_server] Received message:
WSMessage(type=<WSMsgType.TEXT: 1>, data='{"type":"event","event":{"source":"controller","event":"statistics updated","statistics":{"messagesTX":10,"messagesRX":52,"messagesDroppedRX":0,"NAK":0,"CAN":0,"timeoutACK":0,"timeoutResponse":0,"timeoutCallback":0,"messagesDroppedTX":0}}}', extra='')

2023-02-22 21:16:21.160 DEBUG (MainThread) [zwave_js_server] Received message:
WSMessage(type=<WSMsgType.TEXT: 1>, data='{"type":"event","event":{"source":"node","event":"statistics updated","nodeId":3,"statistics":{"commandsTX":7,"commandsRX":6,"commandsDroppedRX":0,"commandsDroppedTX":0,"timeoutResponse":0,"rtt":45,"rssi":-72,"lwr":{"protocolDataRate":2,"repeaters":[],"rssi":-74,"repeaterRSSI":[]}}}}', extra='')

Additional information

No response

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@atx32
Copy link
Author

atx32 commented May 24, 2023

This issue is still happening even with the current 2023.5.4 build.

@github-actions github-actions bot removed the stale label May 24, 2023
@kurdybanek
Copy link

And with 2023.6.1 as well

@home-assistant
Copy link

Hey there @home-assistant/z-wave, mind taking a look at this issue as it has been labeled with an integration (zwave_js) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of zwave_js can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign zwave_js Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


zwave_js documentation
zwave_js source
(message by IssueLinks)

@atx32
Copy link
Author

atx32 commented Jun 16, 2023

I have updated to 2023.6.2 which is supposed to have this fix, however I am still experiencing the same issue.

@raman325
Copy link
Contributor

have you tried subscribing to the events again to confirm you are not getting the event?

@raman325 raman325 reopened this Jun 16, 2023
@atx32
Copy link
Author

atx32 commented Jun 16, 2023

Yes, I subscribed to events and only see it when HA starts after the Z-Wave JS add-on. Let me know if any other logs are needed.

@raman325
Copy link
Contributor

raman325 commented Jun 16, 2023

@MartinHjelmare any thoughts on why this could be occurring? I can't find a thread to pull.

EDIT: I think I figured it out. We are attaching the new listener to the old node instances we stored before the disconnect which have been replaced with new ones, so the new listener will never get called because the node instance it's attached to will not receive the event.

@raman325
Copy link
Contributor

PR submitted ^ I will reopen this after that inevitably closes this issue until we can confirm that it's resolved

@atx32
Copy link
Author

atx32 commented Jun 25, 2023

Verified fixed in 2023.6.3. Thank you.

@kurdybanek
Copy link

kurdybanek commented Jul 2, 2023

Please Reopen the ticket - The problem still persist on 2023.6.3 (HaOS installed on VirtualBox)
It was better for short period of time, but now every few hours automation doesn't react to trigger based on z-wave js value update.
It helps to go into automation change anything in the trigger (like remove the endpoint and add it back) and save, but after another few hours the automation stops working again

@MartinHjelmare
Copy link
Member

Please open a new issue with your automation and all the information you can provide.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants