Update
Adding this update a few months later in case it is helpful to those finding this in the future. Athom has improved the functionality of their built-in generic Z-Wave driver so that it now allows the use of both power and energy metering, and this is working great with my Zooz Zen15 switches. Even advanced flow triggers like detecting power changes instantly are working. I hope this means they have fixed the underlying issues I was having while trying to create my own app, but it also eliminates the need for me to create an app at all, so I won’t be trying to fix it. Thanks Athom!
Original post below
Hi Homeys,
(I have no idea if that’s how Homey fans refer to each other but I really hope so)
I am attempting to write an app to connect some of my Zooz Z-Wave devices to my Homey Pro (2023). There is not yet an official Zooz app yet, so I am happy to publish this app for others to use once it’s working (or add my drivers to another Zooz community app like the one by @Johan_Rossouw ), but have run into some difficulties.
The device I am trying to integrate first is the Zooz Zen15 Power Switch. This is a basic Z-Wave smart plug and the on-off function does actually work with the built-in generic driver, but I would like to enable energy metering and power-based flow triggering, of which the device should be capable. I have been able to get the device connected and on-off and energy metering functionality working, but can’t get the power metering to work.
It looks like it should be pretty simple - Athom provides easy-to-use abstractions for all the ZWave command classes. I used the Homey CLI to create a new Homey app and a new Z-Wave driver. I made a couple basic changes like updating the manufacturer and product IDs, and added a few lines of code to register the capabilities of the device following the model of several examples (here’s one for a Fibaro switch).
I also verified the advanced settings with the Zooz manual and they all seem identical to the default settings in Athom’s template.
The Homey app recognizes the capabilities claimed by the device driver and the energy metering seems to work, but no number is reported for power. The only hint I can find for why this might be is an error on the console output:
2023-09-29T03:42:34.278Z [err] [ManagerDrivers] [Driver:zen15-power-switch] [Device:4daffcc8-83db-4758-8c57-c1d70ccf20f5] CommandClass: SENSOR_MULTILEVEL in main node undefined
But I have no idea why SENSOR_MULTILEVEL would be undefined, if it works in all the examples and the other command classes seem to work fine. Anyone have any ideas on what I might be doing wrong here? Has anyone else gotten power metering to work in a custom app?
Here is my device.js file in case that is helpful to see.
Thanks,
JD