Python Plugin: Battery Levels
Moderator: leecollings
Python Plugin: Battery Levels
I create a new Python plugin to monitor the battery levels of ALL Domoticz devices. This plugin is based on:
Battery Level for Z-Wave Devices
and the latest Domoticz API/JSON URL's
The plugin Battery Level for Z-Wave Devices works great, but is limited to only Z-Wave devices. This plugin tries to find all Domoticz battery devices, like the Philips Hue Dimmer Switch, and display the current battery level.
This plugin has a modular structure to be able to support other battery devices then the standard Domoticz and Z-Wave devices. Originally there was a module to get the Philips Hue battery levels, but since Domoticz 2020.01 devices like the Philips Hue Dimmer Switch are now standard available.
Plugin available at https://github.com/Xorfor/Domoticz-BatteryLevels-Plugin
Battery Level for Z-Wave Devices
and the latest Domoticz API/JSON URL's
The plugin Battery Level for Z-Wave Devices works great, but is limited to only Z-Wave devices. This plugin tries to find all Domoticz battery devices, like the Philips Hue Dimmer Switch, and display the current battery level.
This plugin has a modular structure to be able to support other battery devices then the standard Domoticz and Z-Wave devices. Originally there was a module to get the Philips Hue battery levels, but since Domoticz 2020.01 devices like the Philips Hue Dimmer Switch are now standard available.
Plugin available at https://github.com/Xorfor/Domoticz-BatteryLevels-Plugin
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Python Plugin: Battery Levels
You just served me the ticket to migrate to 2020.2 tnx. 

Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 375
- Joined: Sunday 29 November 2015 21:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: UK
- Contact:
Re: Python Plugin: Battery Levels
Luckly I tested this on a "test system" I have so no harm done however unless I did somthing wrong the plugin created a new device in the Utility's tab for EVERY device it could see not just the ones that are actually in use, so all devices in the "not used" list now have an entry under utility's
Was it just me ?
Was it just me ?
-
- Posts: 375
- Joined: Sunday 29 November 2015 21:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: UK
- Contact:
Re: Python Plugin: Battery Levels
Obviously only battery powered devices, I just didn't think to select the "not used" tab and delete everthing that had been seen that wasn't mine !
I now have about 110 devices for battery value that i need to delete
I now have about 110 devices for battery value that i need to delete

-
- Posts: 70
- Joined: Monday 14 December 2015 22:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Mierlo
- Contact:
Re: Python Plugin: Battery Levels
Hi Xorfor,
I would like to try this one out, but i seem to mis a config option.
I enabeled the hardware and in my log is :
This error is correct because my domoticz runs on port 8880
I there a way to configure the domoticz port for the plugin ?
Regards
Peer
I would like to try this one out, but i seem to mis a config option.
I enabeled the hardware and in my log is :
Code: Select all
Error: (Battery Levels) Error calling 'http://192.168.0.31:8080/json.htm?type=devices&displayhidden=1'
I there a way to configure the domoticz port for the plugin ?
Regards
Peer
Re: Python Plugin: Battery Levels
The latest version only creates Battery Level devices for a 'used' devices with battery.Dave21w wrote: ↑Monday 27 April 2020 13:11 Luckly I tested this on a "test system" I have so no harm done however unless I did somthing wrong the plugin created a new device in the Utility's tab for EVERY device it could see not just the ones that are actually in use, so all devices in the "not used" list now have an entry under utility's
Was it just me ?
Re: Python Plugin: Battery Levels
The latest version allows you to configure the port number of Domoticz, because I didn't find a way to retrieve that.peerkersezuuker wrote: ↑Monday 27 April 2020 14:16
I there a way to configure the domoticz port for the plugin ?
-
- Posts: 327
- Joined: Thursday 15 November 2018 21:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: Netherlands
- Contact:
Re: Python Plugin: Battery Levels
Thanks Xorfor, this plugin is great
I can even track the battery levels on my slave domoticz.

-
- Posts: 70
- Joined: Monday 14 December 2015 22:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Mierlo
- Contact:
Re: Python Plugin: Battery Levels
Excelent, that did the trick.Xorfor wrote: ↑Tuesday 28 April 2020 8:23The latest version allows you to configure the port number of Domoticz, because I didn't find a way to retrieve that.peerkersezuuker wrote: ↑Monday 27 April 2020 14:16
I there a way to configure the domoticz port for the plugin ?
Thanks for this awesome plugin
Regards
Peer
-
- Posts: 591
- Joined: Sunday 01 November 2015 22:45
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Location: Twente
- Contact:
Re: Python Plugin: Battery Levels
You can have a look at the very simple dzVents script @waaren showed in this post. , it warns with a notification if any device is low on battery, no display of the devices in Domoticz.
Bugs bug me.
Re: Python Plugin: Battery Levels
The main reason I created this plugin is for the history. I want to know whether a device is using a battery for one or two years, or even 3 months!!! A notification from Domoticz or other script was not enough for me.HvdW wrote: ↑Tuesday 28 April 2020 22:38 You can have a look at the very simple dzVents script @waaren showed in this post. , it warns with a notification if any device is low on battery, no display of the devices in Domoticz.
Who is online
Users browsing this forum: No registered users and 1 guest