Battery check plugin

I have my zwave based bali blinds and schlage door locks working using openzwave driver to mqtt. Works fine with nymea. The mqtt topic as set up is zwave/location/device/command.

I see there is a generic interface plugin called battery. How would I connect these blinds and locks (13 devices) so as to display battery level for each blind and lock.

Hi.

The generic things don’t support the battery interface and it’s not really an option to add that, given that most use cases for them won’t support that. So it would leave users with a non working battery icon.

You could achieve this by creating a plugin though. You could create your custom generic things with battery states (and whatever else you’d desire). The plugin code would not really need to do anything this way. Just return ok in setupThing() and a one-liner in executeAction() to store the values.

Of course, depending on your programming skills, you could directly connect to mqtt from there and not need the nymea script any more at all. This way it could even evolve into a proper openzwave plugin eventually.

I do not understand your third paragraph about an openzwave plugin. I currently use zwave2mqtt which transfers messages between the nymea internal broker and the zwave devices. Example, One of the many topics is …/128/1/0 which has the message ‘zwave/PlantRoom/Plant-RM-blind-remote/128/1/0 {“time”:1630180521627,“value”:30}’

If I switch to the zwavejs2mqtt the command 128/1/0 is changed to 128/1/level. So what are you suggesting as a plugin or is this already accomplished by zwavejs2mqtt (even though it does not say battery)?

PS I will be changing to zwavejs2mqtt as the other is no longer supported. unfortunately all of my magic needs to be changed due to the command structure change difference.

Ok, let me try again :slight_smile:

So I would recommend you to create a nymea plugin. You can directly to connect to the mqtt broker there. Given that moving from zwave2mqtt to zwavejs2mqtt will break all your scripts anyways, this would be a good time.

With the 3rd paragraph I only meant that this could become an actual zwave plugin if done right, but it doesn’t have to.

Anyhow, if all of this sounds too complicated to you, you may still create your own “generic things” in a plugin which should be really easy. In that case you’d still need the nymea scripts to handle the mqtt stuff.