Zwave2mqtt - Inconsistent Device Behavior

I have recently torn down my Standard HA ZWave Integation network, and I installed the Mosquitto MQTT add-on and the zwave2mqtt addon. I’ve added a number of ZWave Switches and Dimmers, with interesting results.

One device works fine through HA and Lovelace. One.

All of the devices work fine if I interact them through the zwave2mqtt control panel. If I open the zwave2mqtt Control Panel, select ANY device, find the controls under the User section, it works, and it responds quickly.

The MQTT Integration sees all of the devices. I can click on a device and see it’s Entity (or entities, in some cases), but the entity state is often wrong. Attempting to change the entity state through the Configuration > Devices interface has no effect. The state switch in the UI will often toggle, then immediately toggle back.

In the zwave2mqtt Control Panel, I selected the single working device started Debug, then toggled the power state through Lovelace. Many messages scrolled by and the device responded quickly. If I choose any other device and attempt this, I get nothing on the Debug screen.

I also have some WiFi outlets flashed with Tasmota running on MQTT that work really well.

I am running HA via the image for the RPi3:
HA Core 0.108.1
HA OS 3.13
zwave2mqtt add-on 0.6.0
Mosquitto MQTT add-on 5.1
Z-Wave Adapter is a HUSBZB-1 connected to the RPi via an extension cable.
I am running the HA database on a separate MySQL server, so as to ease the load on the Pi and the SD card.

I’ve tried to do everything right. I’ve been using HA for a few months now, after moving off of Wink. I have a bunch of ZigBee devices that work very well, despite all of this Z-Wave non-sense.

I am very happy with how much easier the whole Z-Wave thing has been with zwave2mqtt, but this speed bump has got me puzzled. HASS restarts quickly, the devices join the ZWave network very quickly, it’s been a very pleasurable experience until the past few days.

I tried to do my research before posting this as a last resort. I have also tried to include as much information as possible, but please let me know if there is anything critical I omitted.

Thanks - Jonesie

Well i’m still new at this too, but zwave2mqtt has been a lot of my last week so…

couple things to check; are you using autodiscover ?
mqtt settings: prefix: “homeassistant”
my zwave2mqtt gateway settings:
type: validID topics
payload: Entire z-wave object
and three options set; ignore location, hass discover, and retained discovery.

on the HA side, autodiscover enabled.

when i was first getting things setup and renaming, a couple times i just removed and re-added the mqtt integration just to clear out devices.

oh yea… and somewhere along the way, i found a specific “you should have it setup this way” type article, sorry dont have a link, but now on the HA side, my mqtt is setup in config file vs the GUI
my mqtt looks like this:

mqtt:
  discovery: true
  discovery_prefix: homeassistant
  broker: 10.10.1.84
  birth_message:
    topic: 'hass/status'
    payload: 'online'
  will_message:
    topic: 'hass/status'
    payload: 'offline'

outside of all of that, my only other piece of advice is when you initially add a new zwave device, as all the autodiscover stuff is on, it immediately shows up in HA as a node_xx device.
Delete that device before you update the name in zwave2mqtt. that way, the newly discovered device (after you change name and do a “rediscover device” in zwave2mqtt) in HA has all it’s entities named properly as well. if you forget to delete, the main device name will update, but all the entities will still have node_xx names.

Thanks for the info, Jared! I really appreciate the help!

Z-Wave has been extremely frustrating for me. I have about 10 Z-Wave switches, 6 plug-in modules, and a couple of sensors. I’m on the verge of just ripping them all out and replacing them with Tasmota WiFi devices. I struggled with the Home Assistant native Z-Wave Integration, then excluded every device from my Z-Wave network before standing up zwave2mqtt last week. Now I’m having these issues. Its just frustrating trying to get everything to do the basics. ZigBee has been no trouble at all, with the exception of the fan in my son’s room which simply won’t join, but that’s another topic for another day.

I reviewed my settings. I’m using the Mosquitto Broker Add-On, so I made the adjustments you provided and I rebooted HA.

I removed the HA Device/Entity for one of my zwave2mqtt switches, but now I can’t seem to figure out how to rediscover it without having to exclude/include it. That’s my next step, I guess. If you have any recommendations on an easier way, I would appreciate not having to exclude/include every one of my devices for the second time in about a week.

Thanks - Jonesie

I’m working to document the procedure that seemed to work for most of my devices. I am still struggling with zwave2mqtt (and ZWave in general), but I’m making progress.

All of my wall switches (from various manufacturers) are in and working consistently. I’m struggling with my light and appliance outlet modules, but they’re slowly going in, despite requiring multiple pairing attempts.

I have a Door/Window sensor (WADWAZ-1) that appears to be paired, is always in sleep mode, and never updates its value.

I have a garage door opener (GD00Z-4) that offers two sensors (both Unknown at the moment), and no option to open/close the door.

I don’t even want to think about how difficult my Schlage ZWave door lock is going to be.

I’ve started a list of devices that will replace all of my ZWave with WiFi equivalent. This is how frustrated I am with this: I’m prepared to throw money at the problem.

Jonesie

After spending all day Saturday trying to get one last ZWave Outlet Module working, I’ve found a blindspot. I can see and operate the ZWave Device via the zwave2mqtt Control Panel just fine. It works in a pure-ZWave capacity. It’s the link between MQTT and ZWave that seems to be the problem.

I have a couple of these devices, and I copied the Hass Device JSON general flow (with the names replaced) and it still isn’t working. I have no insight into MQTT. No log files, no history, all I have is brief flashes of highlights in MQTT Explorer. I got frustrated and walked away from it last night.

This morning I tried creating a YAML Switch configuration for it, using the command and state topics from the HAss Device JSON. No luck. There is clearly a missing link between Mosquitto and Zwave, but I’m really struggling to figure that out. It seems that using the values in the Hass Device JSON from zwave2mqtt should work, but for whatever reason, it doesn’t.

If any one has any advice on troubleshooting or gaining insight into the workings of Mosquitto Broker addon or zwave2mqtt, I would be greatful. My Google-Fu seems to be lacking in this area.

Also, thank you for staying with my ramblings. Typing this out helps me articulate my thought process and often leads to additional ideas.

Thanks - Jonesie

Guys, sorry to ask I am also new into zwave2mqtt since this weekend. But if you are talking and referring to “mqtt” is there a difference between hass and/or mosquitto one? I installed the addon “Mosquitto broker” and configured as below:


Then I configured zwave2mqtt to use that? I think it works but I have some sort of same behaviour as Jonesie above. The zwave part always seems to work but sometimes the hass devices become “greyed out” and saying something about orphan devices and the I must do rediscover node to get them back… is there a difference in my setup and could I have this same issue?

I’m using the Mosquitto Home Assistant Add-On as my MQTT Broker, so yes, that should be correct.

I highly recommend you download MQTT Explorer. It really helps in troubleshooting this stuff.

Somehow, I ended up with several MQTT topics for one device. I would have a Home Assistant Device that would not respond to commands. What I did was delete the device in HA, then using MQTT Explorer, I searched for all topics containing that name and deleted them. Then I rediscovered the MQTT Devices by clicking Rediscover for each “entitiy” on the ZWave Device in the zwave2mqtt Control Panel. Basically, what got my final device working was to:

  1. Set the name I wanted for it, hit the Arrow next to name.
  2. Set the Location, hit the Arrow.
  3. Click Rediscover Node
  4. Review the Hass Device JSON for each object (entity) on the Device and click Rediscover.
  5. Once all entities on the device have been “Rediscovered”, click Store to save them permanently.

That SHOULD do it. I’m no expert, but I’ve spent most of this weekend elbow-deep in MQTT and ZWave. I’m happy to provide more help, if you need it.

Jonesie

1 Like

Jonesie, I had discovered the option of “store” as well, will try if that solves the ghosts. How and where have you installe that mqtt explorer?

Edit: restart homeassistant and still greyed out devices…

I descibed it here:

sender

1

21h

So I got it running and installed… works but a LOT of questions… let’s start with the first 3:

  1. Can I update this?

  1. It seems I can set parameters as I am used in Vera
    But where can I do this? I have a test device like this one:
    I should be able to add/change parameters below configuration?

3.I have an issue… my device is unavailable in hass after restart of hass:
image
image

After pressing

REDISCOVER NODE

they are back:
image

What is causing this?

This holds me back MAJORLY because I am not sure what happens with 50 devices included… will I have to do this 50x after each hass reboot ?!

I also found this:


But clicking on the link brings me to:

And I run mosquitto… thus I think this is not my issue?

Please I need an answer… restart homeassistant does my devices greyed out. Then discover or restart the add-on makes them available. After a night device is greyed out. In this way I am not bale to control a zwave device via home assistant if it is greyed out. I really need a tip or thing to work on.

Appreciated!

I am not an expert on this, just someone who has been battling with it recently.

I am able to reboot my Home Assistant without losing connectivity to all of my ZWave devices. I am running the following all on the same Raspberry Pi 3b+:

I am running HA via the image for the RPi3:

  • HA Core 0.108.1
  • HA OS 3.13
  • zwave2mqtt add-on 0.6.0
  • Mosquitto MQTT add-on 5.1
  • Z-Wave Adapter is a HUSBZB-1 connected to the RPi via an extension cable.

I am running the HA database on a separate MySQL server, so as to ease the load on the Pi and the SD card.

The first thing I would check is to make sure your MQTT Broker (Mosquitto?) aand ZWave2MQTT add-ons are configured to start on boot.

To answer the qestions in your post:

  1. No, I think the only way upgrade your OpenZWave version is for the devs of ZWave2MQTT to upgrade it within the docker container and release an updated add-on. I do bot believe you can upgrade OpenZWave independent of ZWave2MQTT.

  2. To set parameters like you would in Vera, select the device selected in the Zwve2MQTT control panel and expand the Configuration section. Change the value of the setting, then click the arrow icon next to that field to send the new value to the device. Your screenshot shows the correct screen.

  3. I THINK I may know what’s going on here. After you hit Rediscover Node, click Store so that all of the device settings are saved. This should ensure they survive a reboot. The Persistent column should say Yes for all objects in a device (like it does in your screenshot). Then click each object (light_dimmer and switch_switch) in your screenshot above, and click the Rediscover that is above the JSON. I belive this triggers MQTT to create a subscription to the Topic for that device, thus creating the Devices and Entities in Home Assistant. At this point, I believe your devices should survive a reboot of Home Assitant.

Let me know if this helps. Good luck! :slight_smile:

Jonesie

1 Like

Hi Joneise,

thank you for taking the time to help me!

  1. ok, pity but true.
  2. parameters not visible… might not be there for my specific device? have some new devices in delivery, will let know if delivered.
  3. no… this is the biggest drawback. tha rediscover works to enable them or "restart"the zwave2mqtt addon will do as well. but then when homeassitant is restarted greyed out… every time again.

I am now trying this setting:
I think this was the issue… when I now restart homeassitant my device is still available. I’ll monitor.

1 Like

Nice catch! That is enabled on mine as well.

how about the rest?

1 Like

This is what I have. I redacted some of the sensitive information, but this is my configuration.

I do have some issues I can’t figure out yet, so I’m not saying this is 100% correct. For example, I cannot get sensors to update. I have a door/window sensor that never updates its status when I open or close the door. I have a door lock that doesn’t update its locked/unlocked status. I had to hack together a software-defined lock device that reads the true/false Value attribute in the physical lock device to get that working. My door/window sensor shows Sleep state 100% of the time and doesn’t even update it’s Value attribute. I also have a couple of ZWave Garage Door openers that only expose 2x sensors each, and they also never update their status, much less allow me to open or close the garage door.

Overall, this is a pretty frustrating experience. I’ve already ordered WiFi sensors to replace the door/window and motion sensors that I plan to flash with Tasmota. I’m researching replacement options for my door lock and garage door openers that aren’t Z-Wave. All of my Z-Wave light switches and outlet modules are working, so I don’t plan to replace those, but I am not going to install any more Z-Wave devices in my home. It’s all way too frustrating.

Jonesie

Yes, I agree that is sensors or states are not update in zwave and hass that is not workable… this should be working and having this topic is not in favour of zwave and mqtt and zwave2mqtt there… I think we need professional help here :slight_smile:

I believe I have found a large source of the frustration with the above procedure. While nothing above is incorrect or wrong, there is a procedure that you should probably incorporate when adding nodes to your zwave network.

Above, Jonesie stated the process should be:

  1. Set the name I wanted for it, hit the Arrow next to name.
  2. Set the Location, hit the Arrow.
  3. Click Rediscover Node
  4. Review the Hass Device JSON for each object (entity) on the Device and click Rediscover.
  5. Once all entities on the device have been “Rediscovered”, click Store to save them permanently.

This process does work, but there is one fatal flaw. After the node has been added into the network, it is very quickly (seconds maybe) updated via MQTT to Home Assistant. In my testing I found that it was given a name like “homeassistant/node19”. When you then subsequently use the above procedure to change the name and the location, you are effectively changing the name of the node to something like, “home assistant/Dining_Room_Light-Dining_Room”. So here is the conflict:

  • HASSIO sees the node as “homeassistant/node19” - the name that was transmitted first.
  • Zwave2Mqtt sees the node as “home assistant/Dining_Room_Light-Dining_Room” - the name that it was changed to.

Because the two are using different names, nothing is getting accomplished. To fix this problem, I have come up with the following procedure change from above:

  1. Go to Settings tab in Zwave2Mqtt app, go to the MQTT section, and deselect the “Auth” slider and hit save. This effectively cuts the connection to HASSIO.
  2. Perform your node addition procedure, as usual.
  3. Set the name you want for the new node, hit the Arrow next to name.
    (No change from before)
  4. Set the Location, hit the Arrow.
    (No change from before)
  5. Click Rediscover Node
    (No change from before)
  6. Review the Hass Device JSON for each object (entity) on the Device and click Rediscover.
    (No change from before)
  7. Once all entities on the device have been “Rediscovered”, click Store to save them permanently.
    (No change from before)
  8. Complete 2-7 above for subsequent devices.
  9. Once complete with adding/editing nodes, return to Settings tab in Zwave2Mqtt app, go to the MQTT section, and re-select the “Auth” slider and hit save. Your password should still be there when you re-select “Auth”. This will allow ZWave2Mqtt to reconnect and you’re new nodes will now be transmitted to HASSIO with the correct names.

I hope this helps.

2 Likes