Python plugin: Battery Level for Z-Wave Devices

Python and python framework

Moderator: leecollings

Post Reply
User avatar
Phantom
Posts: 87
Joined: Saturday 31 December 2016 14:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11652
Location: The Netherlands
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by Phantom »

Hey, thanks for the update but it is not shown in git: https://github.com/999LV/BatteryLevel/ there i still see version 0.4.3
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by Logread »

Phantom wrote: Tuesday 22 August 2017 19:13 Hey, thanks for the update but it is not shown in git: https://github.com/999LV/BatteryLevel/ there i still see version 0.4.3
Good pick... forgot to sync my local development folder... should be ok now
User avatar
Phantom
Posts: 87
Joined: Saturday 31 December 2016 14:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11652
Location: The Netherlands
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by Phantom »

Logread wrote: Tuesday 22 August 2017 19:20
Phantom wrote: Tuesday 22 August 2017 19:13 Hey, thanks for the update but it is not shown in git: https://github.com/999LV/BatteryLevel/ there i still see version 0.4.3
Good pick... forgot to sync my local development folder... should be ok now
Yes thanks up to date again :)
PBdA
Posts: 15
Joined: Monday 14 December 2015 16:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5893
Location: Colomiers, France
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by PBdA »

Domoticz 3.8153 + Battery level plugin 4.4 on Rasbian Jessie

I have a strange problem with the plugin. My polling interval is 60 mn. I monitor updates in an LUA script. Each hour battery level of my 6 devices are updated but there are several updates. In log file I see:

Code: Select all

2017-10-03 11:12:28.503  LUA: --> Piles - Remote Fibaro:55
2017-10-03 11:12:28.549  LUA: --> Piles - Remote Fibaro:55
2017-10-03 11:12:28.594  LUA: --> Piles - Remote Fibaro:55
2017-10-03 11:12:28.640  LUA: --> Piles - Remote Fibaro:55
2017-10-03 11:12:28.685  LUA: --> Piles - Remote Fibaro:55
2017-10-03 11:12:28.731  LUA: --> Piles - Remote Fibaro:55
It appears that each hour there is one more line:

Code: Select all

# grep '06:12.*Remote Fibaro:' domoticz.log | wc -l
156
# grep '07:12.*Remote Fibaro:' domoticz.log | wc -l
157
# grep '08:12.*Remote Fibaro:' domoticz.log | wc -l
158
# grep '09:12.*Remote Fibaro:' domoticz.log | wc -l
159
# grep '10:12.*Remote Fibaro:' domoticz.log | wc -l
160
# grep '11:12.*Remote Fibaro:' domoticz.log | wc -l
161
My uptime is 6 days + 16 hours -> 160 updates

The plugin is working well otherwise.

Any idea ?
PBdA
PBdA
Posts: 15
Joined: Monday 14 December 2015 16:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5893
Location: Colomiers, France
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by PBdA »

Looking at the code, I think that self.BatteryNodes should be reset at in pollnodes(self).

Code: Select all

# diff plugin.py.sv plugin.py
133a134
>                 self.BatteryNodes = []
That works for me but I don't know about side effects.
PBdA
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by Logread »

@PBdA,
You are correct. Thanks for uncovering the bug. Currently testing the simple fix you suggested. I'll commit to GitHub later today hopefully.

EDIT: Version 0.4.5 is available from GitHub.
Existing users please upgrade (besides issues with the events system, memory usage was building up over time due to the bug uncovered by @PBdA). First post in the thread has been updated accordingly as well.
User avatar
remb0
Posts: 499
Joined: Thursday 11 July 2013 22:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by remb0 »

thanks! great work!
maybe an idea to make a compatible list?
I have:
Neo CoolCam Power plug 12A+
Aeotec ZW089 Recessed Door Sensor Gen5+
Aeotec ZW089 Recessed Door Sensor Gen5+
Neo CoolCam Battery Powered PIR Sensor+
Neo CoolCam Water Leakage Detector+
Schlage Link Mini Keypad RFID
Philio Technology Corporation PST02-A 4 in 1 Multi-Sensor+
Danfoss Z Thermostat 014G0013
battery.png
battery.png (30.38 KiB) Viewed 3819 times
as you can see in my screenshot ony the danfoss is working:) the battery was really empty.
the zipato keypad mini in domoticz known as (Schlage Link Mini Keypad RFID) is 64. but this is already a few months so I don't believe it's right.
and in openzwave panel there is no info about the battery stats of the zipato.

are the other devices not compatible with battery info or do I have them wrong configured?
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by Logread »

@remb0,
Thanks for your insight and feedback. The plugin gets its data from openzwave, no more no less. And I noticed as well some zwave devices have an erratic battery level reporting behaviour. But nothing I can do about it in the scope of the plugin.
For non zwave devices, this is definitively out of scope but may be someone can contribute ?
User avatar
Brutus
Posts: 249
Joined: Friday 26 September 2014 9:33
Target OS: Windows
Domoticz version:
Location: Netherlands
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by Brutus »

Thnx for this great plugin!
1x Intel NUC8i5BEK (Windows 10 x64) Domoticz on Virtualbox with DietPi.
1x Aeon Labs USB Z-Stick S2
1x P1 Smart Meter USB
28x Fibaro Modules
SMA Solar System
Daikin Airco / Heating
Denon DHT-S716H & DSW-1H
dextm80
Posts: 117
Joined: Tuesday 24 October 2017 18:32
Target OS: Linux
Domoticz version: 4.10159
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by dextm80 »

Great plugin!
Domoticz on AsRock j3455-ITX 8gb ram - Aeotec ZWave Usb Stick - RFLink 433Mhz
1x Fibaro Wall Plug
1x Fibaro Motion Sensor
x NeoCoolcam Wall Plug
Netatmo Weather Station - Netatmo Thermostat
Philips Hue Bridge
anton
Posts: 6
Joined: Wednesday 30 August 2017 16:15
Target OS: Windows
Domoticz version:
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by anton »

Hi,

I did everything what is write in the manual.
I don’t see the the plug-in by the hardware.

Gr.
Anton
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by Logread »

anton wrote: Friday 12 January 2018 12:07 Hi,

I did everything what is write in the manual.
I don’t see the the plug-in by the hardware.

Gr.
Anton
Domoticz version ? Platform ?
User avatar
Siewert308SW
Posts: 288
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by Siewert308SW »

Just came by to say thx...
Naamloos.png
Naamloos.png (55.67 KiB) Viewed 3213 times
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by Logread »

Siewert308SW wrote: Friday 12 January 2018 14:16 Just came by to say thx...
Naamloos.png
Appreciate :D
anton
Posts: 6
Joined: Wednesday 30 August 2017 16:15
Target OS: Windows
Domoticz version:
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by anton »

Logread wrote: Friday 12 January 2018 13:56
anton wrote: Friday 12 January 2018 12:07 Hi,

I did everything what is write in the manual.
I don’t see the the plug-in by the hardware.

Gr.
Anton
Domoticz version ? Platform ?
Raspberry Pi 2
Domoticz 3,885
shturm
Posts: 8
Joined: Wednesday 14 October 2015 2:46
Target OS: Linux
Domoticz version:
Location: San Jose, CA
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by shturm »

anton wrote: Friday 12 January 2018 12:07 Hi,

I did everything what is write in the manual.
I don’t see the the plug-in by the hardware.

Gr.
Anton
I'm having the same problem.
Ubuntu 14.04
Domoticz 3.8153
It's installed in ~/git/domoticz

Any idea why I don't see plugin in the list?
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by Logread »

@shturm,

Did you try other plugins ? I suspect this is a domoticz plugin framework issue rather than an issue with this particular plugin.
shturm
Posts: 8
Joined: Wednesday 14 October 2015 2:46
Target OS: Linux
Domoticz version:
Location: San Jose, CA
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by shturm »

Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by Derik »

Dear Developer.....
cannot install from the github..
Is there something changed from the wiki?
Everytime i get this error:

Code: Select all

root@odroid:/home/root/domoticz/plugins/BatteryLevel# git clone https://github.com/999LV/BatteryLevel.git BatteryLevel
fatal: could not create work tree dir 'BatteryLevel': No such file or directory
root@odroid:/home/root/domoticz/plugins/BatteryLevel#
And i am sure the map BatteryLevel is in the plugin section..
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
User avatar
Phantom
Posts: 87
Joined: Saturday 31 December 2016 14:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11652
Location: The Netherlands
Contact:

Re: Python plugin: Battery Level for Z-Wave Devices

Post by Phantom »

Derik wrote: Saturday 17 February 2018 20:57 Dear Developer.....
cannot install from the github..
Is there something changed from the wiki?
Everytime i get this error:

Code: Select all

root@odroid:/home/root/domoticz/plugins/BatteryLevel# git clone https://github.com/999LV/BatteryLevel.git BatteryLevel
fatal: could not create work tree dir 'BatteryLevel': No such file or directory
root@odroid:/home/root/domoticz/plugins/BatteryLevel#
And i am sure the map BatteryLevel is in the plugin section..
I think you need to go back 1 folder as you are already in the BatteryLevel map and trying to create the BatteryLevel in there again.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest