Automate Z-Wave JS Re-Interview?

I have my Home Assistant server on a UPS so in the event of a power failure it does not go down. I am finding that when the power comes back on there are several ZWave devices that to not reconnect and become unavailable.
Rebooting home assistant works but is not really acceptable. Re-interviewing the nodes also works but I am not sure how to do that automatically.

Do you need to re-interview or would a ping work? I now have automations like this to help spot poorly nodes and try to bring them back to life. Even with this I find that some nodes need more help.

alias: Ping Garage Lights when Node 38 dead
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.node_38_node_status_node_status
    for:
      hours: 0
      minutes: 1
      seconds: 0
    to:
      - dead
      - unavailable
      - unknown
condition: []
action:
  - service: button.press
    data: {}
    target:
      entity_id:
        - button.node_38_ping
mode: parallel

I’ve been having this issue for over a year, sometimes once or twice a week but lately just 2 or 3 times a month with mostly kitchen blind 2 and 3. At first, I was taking the drastic step of removing & re-including the problem node(s). Then I discovered that a simple interview would fix it. I’ve been doing that manually for several months now. This morning it was blind 3 and garage door lock & a re-interview brough them back. I grown tired of this and did a different google search and ended up here. I’ve set up your automation to ping the problem node and we’ll see how it fairs. Unfortunately, there’s no Z-Wave service call to execute a re-interview…Z-Wave Frown

alias: Z-Wave - Ping when node is dead
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.kitchen_blind_2_hidden_node_status
    id: Kitchen Blind 2
    for:
      hours: 0
      minutes: 1
      seconds: 0
    to:
      - dead
      - unavailable
      - unknown
  - platform: state
    entity_id:
      - sensor.kitchen_blind_3_hidden_node_status
    id: Kitchen Blind 3
    for:
      hours: 0
      minutes: 1
      seconds: 0
    to:
      - dead
      - unavailable
      - unknown
  - platform: state
    entity_id:
      - sensor.garage_door_lock_node_status
    id: Garage Door Lock
    for:
      hours: 0
      minutes: 1
      seconds: 0
    to:
      - dead
      - unavailable
      - unknown
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: Kitchen Blind 2
        sequence:
          - service: button.press
            data: {}
            target:
              entity_id: button.kitchen_blind_2_hidden_ping
      - conditions:
          - condition: trigger
            id: Kitchen Blind 3
        sequence:
          - service: button.press
            data: {}
            target:
              entity_id: button.kitchen_blind_3_hidden_ping
      - conditions:
          - condition: trigger
            id: Garage Door Lock
        sequence:
          - service: button.press
            data: {}
            target:
              entity_id: button.garage_door_lock_ping
mode: single

Hi Team

I have some nodes Aoetec GPO’s and a few of them end up with weird/extra power entities and the primary entities start reporting crazy numbers. eg. My office desk reported I used 120,000kW/h yesterday. :\ It breaks the energy dashboard pretty hard. :slight_smile:

I find to resolve it I have to reinterview and then the new weird entities disappear and the primary ones start reporting properly again.

So, I wanted to put this into an automation and found this thread but I pushed on and I found a way to do it if you are using ZWave JS UI (formally ZwaveJS2mqtt) and have a MQTT server setup.

Go into the UI and turn on the MQTT server:

Once you hit save it will restart ZWaveJS, watch it logs and you will see the API topic string you need to send messages to hit the ZwaveJS API.

2023-02-17 16:04:33.184 INFO MQTT: Subscribed to zwave/_CLIENTS/ZWAVE_GATEWAY-zwavejs2mqtt/api/#

As per the ZWaveJS documentation to send a reinterview/refresh the command is:

https://zwave-js.github.io/zwave-js-ui/#/guide/mqtt?id=refreshinfo

or more simply (I am using mosquitto) and the node I wish to reset is node 31.

mosquitto_pub -u <user> -P <password> -p 1883 -t 'zwave/_CLIENTS/ZWAVE_GATEWAY-zwavejs2mqtt/api/refreshInfo/set' -m '{ "args": [ 31 ] }'

Victory!!! This took a bit of trial and error for me having never used MQTT in such a fashion before:

So, lastly let’s run it in an automation!

- alias: reinterview jurgens desk zwave node
  trigger:
    - platform: time
      at: '3:30:00'
  condition:
    - condition: state
      entity_id: input_boolean.zwave_up
      state: 'on'
  action:
    - service: system_log.write
      data:
        message: 'zwave reinterviewing jurgens desk'
        level: warning
    - service: mqtt.publish
      data:
        payload: '{ "args": [ 31 ] }'
        topic: 'zwave/_CLIENTS/ZWAVE_GATEWAY-zwavejs2mqtt/api/refreshInfo/set'

I hope this helps you all!

1 Like

I’ve seen some elements of this also, there is a nasty bug somewhere. This really shouldn’t happen.

I just double checked, the reinterview worked over night. :slight_smile:

I don’t even care if the device has gone offline - I know it will every day or so - I just want to automate a re-interview but it’s not an option. I can automate a ping, but that doesn’t fix it

I have the same recurring problem. After every update to HA, one or more Z-Wave devices needs to be re-interviewed to get its correct state. Have to do it manually which is time consuming.

Home Assistant 2023.4.2
Supervisor 2023.04.0
Operating System 9.5
Frontend 20230406.1 - latest

I am trying the solution in this thread: ZWave JS not updating state of devices - #6 by dzonn. Not sure it will work but it applies more to my problem than the solution given by jurgenweber here since I am mainly concerned with updating a state and not actually losing a device completely. In other words, my thermostat is turning on and off but not telling Home Assistant when it does to activate an automation to turn on or off a fan. I know I said it had gone offline - my mistake. Not sure if the solution in the other thread will work for you, but it might

I have the same issue which has plagued my HA for a while now. Every HA or Z-Wave JS update and 16 of 66 nodes go down and I have to re-interview them one by one.

I went searching for a fix as this process is getting old and came across this thread. Subscribing in the hopes a fix, or at least bulk re-interview option, show up one day. Thanks to anyone looking into it!

my post Automate Z-Wave JS Re-Interview? - #21 by jurgenweber has a solution for you then.

Nice find, could be a good temporary workaround, but it really shouldn’t be necessary.

I’m in the same boat as the other posters here. My ZWave doorlock periodically goes ‘offline’, most often after an HA update. Re-interviewing the device gets it back online.

Did anyone ever file a bug report on github for it like @cgarwood suggested?

Edit: Couldn’t find a bug report, so filed one myself. Feel free to add any additional relevant info there, like logs from when the issue is present.

What happens if you do not re-interview? Because I too have devices unavailable for a while after updates. Not pe se always from core updates, but usually related to z-wave JS updates. This resolves itself given some time. In very rare occasions (after a full OS reboot or when I get impatient), unplugging the z-wave stick and plugging it back in, or just pressing the button on it, makes things resolve faster.

And just the other day, when I opened the z-wave JS UI shortly after a reboot, I witnessed it interviewing all nodes itself. The minute that was ready all devices were in normal state. So it appears the devices seem unavailable because you’re waiting for z-wave js to complete a full interview cycle. For battery operareds it that may take a while, and it seems the addon is not updating states until it is all done.

Thanks @hapklaar for filing an official bug report. I’m hopeful every upgrade that it is fixed :slight_smile:.

Thanks @Edwin_D for the reply. For me I can say it always seems to be the same 16 powered switches of various models. I have many others that come back just fine and so do all my battery devices such as door locks.

The issue does not happen just after upgrades either but any reboots of HA. I have left them alone for weeks and they do not ever connect back. Only the re-interview brings them back online. Now my last handful of upgrades/reboots I have re-interviewed quickly afterwards, I am getting good at it :stuck_out_tongue:, but maybe something has changed there, and I can try waiting again next time.

I have 66 Z-wave devices and it is 16 that always do not connect. Just curios, is there anything to the theory this happens after 50 devices?

If you don’t, the nodes are effectively offline, so any automation to/from them won’t work. You can’t command them with voice assistant stuff, etc. Local control still works, but we didn’t set all this up to just have local control switches. :smiley:

I have had success just “pinging” them too - reinterview isn’t usually necessary. Same end result though - until you ping them, they’re just not usable to HA. Pinging them is a quick/easy fix, but it has to be noticed (via something not working right) then start the hunt for which device needs pinging, etc. Not the kind of setup I want my family to have to deal with.

Nope, I have 64 all coming back up, mostly fibaro, vesternet, qubino and some aeotec. Any specific brands that misbehave? And how about firmware versions for those devices?

So, I upgraded and rebooted, and the issue did not happen :open_mouth:. This is the first time in a year or more. Here are the few things that changed (in this order):

  • Fixed electrical issue causing several switches (outside back patio) to be offline (has been this way for a long time, don’t know exactly)
    • Re-interviewed the switches, one connected the other not (tried several times)
    • Healed the Z-Wave network
    • Re-interviewed the other switch and it connected
    • Removed several orphaned entities tied to Z-Wave devices (no more exist now)
  • Updated Z-Wave JS from 0.1.86 to 0.1.87
    • Rebooted, all devices came back online
  • Updated HA from 2023.8.0 to 2023.8.2
    • Rebooted, all devices came back online
  • Tried one more reboot, all devices came back online

So, I am a happy camper, but would like to know what fixed it. Those of you that have this issue, do you have Z-Wave devices that you know/expect to be offline? Maybe those are holding things up for the other working devices… just a wild guess. I wish I knew exactly when my electrical issue happened vs. this Z-Wave issue but unfortunately do not know the exact dates. But they were in the same ballpark so very well might be the cause.

Unfortunately, I don’t have an answer. There are etiquette rules for forums that you may want to look into if you want your question answered. Here are some basics Group & Discussion Forum Etiquette - Net M@nners

For instance your reply has little to nothing to do with the OP’s (original poster, I think that is what it means lol) question: “Automat z-wave JS Re-interview.”

What you are doing (unknowingly, and not on purpose) is called hijacking a thread. basically asking a question or taking the thread away from original topic of the OP.

Happy posting and welcome to the forum, I hope you can get your problem figured out.

I didn’t check to see if anyone responded to your post, but if someone already explained this sorry to repeat.

Thank you for your hard work on this, I am trying to setup the same thing. I have Zwavejs and mosquito MQTT broker already setup and being used. How do I get to the first settings screen in your instructions?

Thank you for any help you can provide.
Rich

Hi, it is the web interface of the zwavejs server. I DiY in docker so I am unsure how it works if you are using HASS OS / zwavejs addon.

Once you are in it, you can go to settings → mqtt

but yeah, it has been working fine for me ever since I did it.