Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding battery level widget by device #145

Open
BabaIsYou opened this issue Feb 7, 2023 · 2 comments
Open

Adding battery level widget by device #145

BabaIsYou opened this issue Feb 7, 2023 · 2 comments

Comments

@BabaIsYou
Copy link
Contributor

Hi Smanar,

What do you thing about reusing some parts of this Domoticz plugin Battery level for Z-Wave to have the same option for Zigbee devices ?

As you already parse the whole zigbee devices could it be "easy" to create a battery level widget per Deconz device, (and not one per sensor of course if they share the same battery attribute) ?

Could be a nice integrated and optionnal (by configuration options) feature that could help to get notification per custom battery level and not for the same treshold for whole Domoticz.

@Smanar
Copy link
Owner

Smanar commented Feb 9, 2023

You mean a special device like the one for alarm system ?
An alert widget to display battery error message ? Because I m not sure 1 more widget for all devices will be a good idea, it mean lot of widget for something already usable in domoticz on actual one ?

@BabaIsYou
Copy link
Contributor Author

I mean, the same behavior than the existing plugin I reference. This one create a unique widget per z-wave device that have a battery. Then you can get notification per device if you want instead of a global parameter in Domoticz. It's usefull when you have a device that have trouble to update battery level in Domoticz via OZW but you don't wnat a useless warning each day. Or you can manage individual threshold by "battery device" because some devices are more tolerant to battery variation than other.

It could be a nice option than could be enabled using your optional special parameter. You already have the heart of it because you already parse all the existing ressources at startup.

Another way for me could be to adapt the existing plugin by selecting directly in DeConz DB the information with a SELECT like this one :

SELECT D.mac, S.name, RI.value
FROM devices D
JOIN sub_devices SD ON D.id = SD.device_id
JOIN resource_items RI ON SD.id = RI.sub_device_id
JOIN sensors S ON SD.uniqueid = S.uniqueid
WHERE RI.item LIKE '%/battery'
GROUP BY D.id

that gives something like this
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants