Python Plugin: Add/Fix ZWave devices Domoticz can't handle
Posted: Sunday 19 December 2021 3:11
ZwaveJS Websocket Bridge
I created a new simple plugin (so far) using the Websocket server provided by ZWaveJS2MQTT. Why Websockets? Well I'm more familiar with them than MQTT. The plugin is more of a low level plugin to make data available for scripts and other plugins inside of Domoticz.
What it does:
It takes updates from ZWaveJS2MQTT via it's Websockets server capability and turns them into devices in Domoticz as defined in an ini file. Use cases would be instances where updates are output by a Zwave device that Domoticz ignores or doesn't handle the way you would prefer. For instance Domoticz has NEVER been able to get the thermostat state as a device properly and tell you that it was calling for heat. It also allows you to get updates from Zwave devices that are outputting things out of spec. For instance I have a zwave deadbolt that outputs the user number as alarmlevel. Domoticz doesn't understand this and I can use this plugin to translate that to a device type that can show the information in Domoticz.
How to use it:
IMPORTANT: You need to turn on websockets from your ZWaveJS2MQTT control panel before this plugin will work! There is a devices.ini file (which contains some examples) you use to create new devices for the plugin in Domoticz. It's used to tell Domoticz what kind of device you want and how you want to translate the output data from the websocket update and input it as and s or n value in Domoticz. A the moment only s and n value inputs are supported! Once it receives the 1st update from the Zwave device the plugin attempts to create the device as defined in the devices.ini.
You have been warned:
It's pretty much an alpha at the moment and may cause you're Domoticz to hang, especially when restarting the plugin. It uses the asyncio and threads libraries in Python. These libraries already don't play well alone with Domoticz, so together they play like two step children who hate each other. It seems like they're always tripping over each other to find a new way to make Domoticz hang up. I've got it so it works smoothly on my setup but that's not a guarantee for your's.
Help:
If you'd like to help create you're own forks. Pull requests are welcome!
Github for the plugin: https://github.com/Ittiz/ZWaveJSWSBridge
Edit:
Some examples of what this plugin is good for. I have a 1st Alert Fire Alarm/CO Detector. It's never worked with Domoticz because it only sends into the Notification Command Class. So Domoticz never knew what to do with the alarm. Basically making integration impossible. With this plugin I can take the alarmType and alarmLevel Notification updates the fire alarm sends and turn them into devices I can attach stuff like push notifications to.
I created a new simple plugin (so far) using the Websocket server provided by ZWaveJS2MQTT. Why Websockets? Well I'm more familiar with them than MQTT. The plugin is more of a low level plugin to make data available for scripts and other plugins inside of Domoticz.
What it does:
It takes updates from ZWaveJS2MQTT via it's Websockets server capability and turns them into devices in Domoticz as defined in an ini file. Use cases would be instances where updates are output by a Zwave device that Domoticz ignores or doesn't handle the way you would prefer. For instance Domoticz has NEVER been able to get the thermostat state as a device properly and tell you that it was calling for heat. It also allows you to get updates from Zwave devices that are outputting things out of spec. For instance I have a zwave deadbolt that outputs the user number as alarmlevel. Domoticz doesn't understand this and I can use this plugin to translate that to a device type that can show the information in Domoticz.
How to use it:
IMPORTANT: You need to turn on websockets from your ZWaveJS2MQTT control panel before this plugin will work! There is a devices.ini file (which contains some examples) you use to create new devices for the plugin in Domoticz. It's used to tell Domoticz what kind of device you want and how you want to translate the output data from the websocket update and input it as and s or n value in Domoticz. A the moment only s and n value inputs are supported! Once it receives the 1st update from the Zwave device the plugin attempts to create the device as defined in the devices.ini.
You have been warned:
It's pretty much an alpha at the moment and may cause you're Domoticz to hang, especially when restarting the plugin. It uses the asyncio and threads libraries in Python. These libraries already don't play well alone with Domoticz, so together they play like two step children who hate each other. It seems like they're always tripping over each other to find a new way to make Domoticz hang up. I've got it so it works smoothly on my setup but that's not a guarantee for your's.
Help:
If you'd like to help create you're own forks. Pull requests are welcome!
Github for the plugin: https://github.com/Ittiz/ZWaveJSWSBridge
Edit:
Some examples of what this plugin is good for. I have a 1st Alert Fire Alarm/CO Detector. It's never worked with Domoticz because it only sends into the Notification Command Class. So Domoticz never knew what to do with the alarm. Basically making integration impossible. With this plugin I can take the alarmType and alarmLevel Notification updates the fire alarm sends and turn them into devices I can attach stuff like push notifications to.