Page 1 of 1
Python Plugin: Battery Levels
Posted: Sunday 26 April 2020 20:30
by Xorfor
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
Re: Python Plugin: Battery Levels
Posted: Monday 27 April 2020 11:24
by sincze
You just served me the ticket to migrate to 2020.2 tnx.

Re: Python Plugin: Battery Levels
Posted: Monday 27 April 2020 13:11
by Dave21w
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
Posted: Monday 27 April 2020 13:47
by Xorfor
Dave21w wrote: ↑Monday 27 April 2020 13:11
... so all devices in the "not used" list now have an entry under utility's...
The plugin will create a device for every battery device, also if they are not used.
Can you be more specific? What kind of devices? From specific hardware?
Re: Python Plugin: Battery Levels
Posted: Monday 27 April 2020 13:56
by Dave21w
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

Re: Python Plugin: Battery Levels
Posted: Monday 27 April 2020 14:16
by peerkersezuuker
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 :
Code: Select all
Error: (Battery Levels) Error calling 'http://192.168.0.31:8080/json.htm?type=devices&displayhidden=1'
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
Re: Python Plugin: Battery Levels
Posted: Tuesday 28 April 2020 8:22
by Xorfor
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 ?
The latest version only creates Battery Level devices for a 'used' devices with battery.
Re: Python Plugin: Battery Levels
Posted: Tuesday 28 April 2020 8:23
by Xorfor
peerkersezuuker wrote: ↑Monday 27 April 2020 14:16
I there a way to configure the domoticz port for the plugin ?
The latest version allows you to configure the port number of Domoticz, because I didn't find a way to retrieve that.
Re: Python Plugin: Battery Levels
Posted: Tuesday 28 April 2020 10:07
by ronaldbro
Thanks Xorfor, this plugin is great

I can even track the battery levels on my slave domoticz.
Re: Python Plugin: Battery Levels
Posted: Tuesday 28 April 2020 15:26
by peerkersezuuker
Xorfor wrote: ↑Tuesday 28 April 2020 8:23
peerkersezuuker wrote: ↑Monday 27 April 2020 14:16
I there a way to configure the domoticz port for the plugin ?
The latest version allows you to configure the port number of Domoticz, because I didn't find a way to retrieve that.
Excelent, that did the trick.
Thanks for this awesome plugin
Regards
Peer
Re: Python Plugin: Battery Levels
Posted: Tuesday 28 April 2020 22:38
by HvdW
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.
Re: Python Plugin: Battery Levels
Posted: Tuesday 28 April 2020 23:36
by Xorfor
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.
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.