directly on the home assistant host as /dev/ttyACM or /dev/zwave (with udev rules)
remotely over the network via socat / ser2net mapped to /dev/zwave
One of the things I haven’t figgured out is how can i detect the serial connection is broken (network down, stick unplugged, etc). Is there an automation I can create to “ping” the zwave chip and if it does not reply in a certain timeframe restart everything?
You can’t “ping” a chip, but you can monitor the status of your mesh and see if it’s hung. That’s what I do with this sensor and this automation.
The values I use are based upon the behaviour of the devices on my mesh. You may need to work with the values in the sensor to find one that works for you, without causing false alarms.
Sorry to revive this old thread but apart from monitoring the usage with lsof or netstat (and both are kinda a hack) is there any way? Can I ping a node or a second zwave stick or run a zwave command that fails when the serial connection is broken?
I presume you are running a Pi with a Z-Wave stick remotely. It is not clear to me if you want to test the connection between the remote pi and the local (master) pi(?) or between the remote pi and the attached Z-Wave stick?
I am not 100% sure on this,but I did look at my Z-stick in the HA gui. There are definitely some parameters there that show the controller is “alive”. Not sure how easy it is to poll these parameters using an automation, but here is what I am referring to:
Data path:
zwave stick - pi - socat - vm - ser2net - home assistant
Zwave stick is plugged in a pi, sharing the /dev/zwave with socat to the network.
In a VM i run ser2net that maps the network port to /dev/zwave and then i point home assistant (that runs in the same VM) to /dev/zwave.