Any sneaky way to check and send over MQTT if the Z-Wave network is still up and running?

In my house have a network with around 15 devices, five of them thermostats. In the cabin I have only five, with one thermostat. I use the thermostats to check if the network is still up. That happens when I send an MQTT message to a special running control system every time they report in. That sets a timer, and if the timer runs out, it restarts Home Assistant with a special Python script (also receiving MQTT messages) or hard resets the Pi (with a power plug on a special running control Z-Wave-network) if the script doesn’t respond, assuming that network is out or the PI has locked up. That hard reset has happened once or twice in the last year, because of SD Card errors, which is why all my Pi’s are now running on SSD’s.

I use 433mHz as well, but that’s never a problem because I have a difficult house, so I have three or four different Pi’s so if one goes out (and is restarted) thre will always be one other within range of whatever’s done. But the annoying part is of course that Z-Wave can’t really have a fallback system since I can’t have more than one controller.

The problem is that sometimes the thermostats shuts up for a long time (like 10 minutes, it seems like they only send when there’s a change in something), and that’s too long for my timers. If the network is out, I want to know about it after max two minutes, so the people in the house or cabin won’t notice that something’s wrong before it’s fixed. Is there a way to ask the network if it’s still running, or do I need to put up a dummy power plug that I turn off and on every two minutes and set the timer on the feedback from that plug?

looking at the events in the zwave section of the docs it only looks like the “network ready” triggers an event but “network not ready” doesn’t.

If you don’t find another way to do it then you might want to submit a feature request.

OK, thanks! How do I actually try that? I don’t see network ready as a service, so I’m a bit at a loss. Sorry.

Here is an automation I use to turn on an input boolean. Which I then use to indicate the network status in Lovelace.

ex

until the network is ready after a restart it will be in red and say “NOT ready”.

The problem I haven’t solved (and since it has never happened I honestly haven’t been concerned enough about it to try…) is to find a way to indicate if the network becomes subsequently not ready after it has been ready.

Interesting! Wouldn’t that be possible to do by running the same automation every minute, triggered by for instance MQTT message from the running control system? And what does the automation look like?

No that wouldn’t help because it’s not checking for the actual state of the z wave network. it’s listening for the event that the z wave network is ready which only happens when the z wave network goes from some state other than ready to ready. As far as I can see there is no “not ready” event.

here is the automation:

- alias: 'Indicate Z Wave Network is Ready'
  trigger:
    platform: event
    event_type: zwave.network_ready
  action:
    service: input_boolean.turn_on
    entity_id: input_boolean.zwave_ready

then in my lovelace card I have this:

- type: 'custom:card-templater'
  entities:
    - input_boolean.zwave_ready
  card:
    type: markdown
    content_template: >
      {% if is_state('input_boolean.zwave_ready', 'on') %}
        <font size='+1' color='green'>The Z-Wave Network is Ready</font>
      {% else %}
        <font size='+1' color='red'>The Z-Wave Network is NOT Ready</font> 
      {% endif %}
1 Like

OK, thanks a lot! :slight_smile: As @123 shows in the other thread I can at least use this to trigger a network test to fix dead nodes that aren’t really dead.

And of course it’s not working for me. :frowning: This is not my week… I first tried the code to do it directly, but nothing happened. So I changed it to a message code:

- id: '15358326889'
  alias: 'Indicate Z Wave Network is Ready'
  trigger:
  - platform: event
    event_type: zwave.network_ready
  action:
  - data:
      topic: eg/Z-Wave-nettverket er oppe
    service: mqtt.publish


This should trigger a message on MQTT when the network is ready, but it doesn’t. It works when I trigger it manually from the UI, so it is something with the trigger. Can you see any mistakes I’ve made in copying and pasting? The formatting of the action should be correct when it works with a manual triggering. But I’m wondering if this warning has something to do with it:

Z-Wave not ready after 300 seconds, continuing anyway
9:46 components/zwave/init.py (WARNING)

In that case, do you know if there is a way to extend the waiting time for the Z-Wave to be ready?

Edit: I found the way to change that, in the file srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/zwave/const.py there’s the value NETWORK_READY_WAIT_SECS = 300 wich I changed to 500. So now I don’t get that error message. But still no trigger some minutes after the panel in the GUI shows “Ready” or dead on all the devices. Do you know when your code triggers compared to the panel showing everything ready? It works when I use zwave.network_start as the trigger. But that of course doesn’t help in this instance.

Edit 2: Found one that worked in that const.py file! zwave.network_complete works. I’m going to experiment with zwave.network_complete_some_dead too, maybe I can use that to only fire my test service when it’s necessary. :slight_smile:

Edit 3: Yep! The some dead approach worked perfectly! So now I can fire the test only when necessary. :grin: Thanks for the help!