Z-wave Switches only toggle 1 way?

I’ve been swapping out my dumb light switches with z-wave switches and am up to 11 total switches. I installed the hassio image on a raspberry pi, added Mosquitto Broker and Open Z-Wave to MQTT configured it all and it’s been working for weeks. However recently my light switches started only toggling 1 way. If I look at the switch in lovelace or under devices/entities they will be either marked as on or off regardless of the true state of the switch. Hassio can only switch them to the opposite of what they are showing, so if it’s marked as on I can shut it off but can’t turn it off again, and the state never changes in hassio.

For example, hassio shows my office light as “on” all the time, if the light is off and I try to turn it on from hassio nothing happens. If the light is on(because I pushed the wall button) and I hit the button in hassio the light will turn off, the status in hassio goes to “off” for a second then flips back to “on” but the light itself stays off. It’s exactly the same for switches that show as “off”, I can turn the light on, but can’t turn it back off again, and the state only changes for a second in hassio before going back to “off” again.

Everything was working until a few days ago and the recent changes I made to it were as follows:

  • Added a couple more switches.
  • Installed NodeRed and started playing with flows for automation
  • Renamed most of my entity ID’s in hassio to make them more recognizable in NodeRed.

I’m assuming it’s the entity ID renaming that did it, but I’m not sure how to fix that. I’ve rebooted the whole system multiple times, restarted the various services(HA, MQTT, Z-wave hub) and it keeps happening. If I hop into the Z-Wave to MQTT web gui, the switches all work fine, I can toggle them to any state I want, the lights themselves turn off/on, and they show the correct state in the web gui, so z-wave appears good, so it’s either Mosquitto or Hassio where the disconnect is happening.

Any ideas what went wrong and how i can fix it?

Ok, it figures, after finally posting the question I think I found the answer, though I have no idea why this worked. I have a couple of very simple scripts in hassio that control my outside lights, and I just noticed that each switch section of the script had action set to “unknown”, previously they were set to turn them on or off. I reconfigured the scripts to have the intended action, restarted hassio, and now everything appears to be working. So either the unkown actions in the scripts caused this, or it was the Nth reboot that finally fixed it.

So either this is all coincidence, or the moral of the story is to rename your entities prior to creating any scripts in hassio that utilize them.