Python plugin: Battery Level for Z-Wave Devices

Python and python framework
User avatar
Phantom
Posts: 74
Joined: Saturday 31 December 2016 15:47
Target OS: Raspberry Pi
Domoticz version: 3.8034
Location: The Netherlands
Contact:

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

Post by Phantom » 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

Logread
Posts: 141
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi
Domoticz version:
Location: France
Contact:

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

Post by Logread » 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

User avatar
Phantom
Posts: 74
Joined: Saturday 31 December 2016 15:47
Target OS: Raspberry Pi
Domoticz version: 3.8034
Location: The Netherlands
Contact:

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

Post by Phantom » Tuesday 22 August 2017 19:33

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: 16
Joined: Monday 14 December 2015 17:51
Target OS: Raspberry Pi
Domoticz version: 3.5893
Location: Colomiers, France
Contact:

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

Post by PBdA » Tuesday 03 October 2017 11:27

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: 16
Joined: Monday 14 December 2015 17:51
Target OS: Raspberry Pi
Domoticz version: 3.5893
Location: Colomiers, France
Contact:

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

Post by PBdA » Tuesday 03 October 2017 14:16

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: 141
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi
Domoticz version:
Location: France
Contact:

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

Post by Logread » Wednesday 04 October 2017 11:07

@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: 837
Joined: Thursday 11 July 2013 22:21
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands
Contact:

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

Post by remb0 » Wednesday 04 October 2017 20:51

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 758 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: 141
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi
Domoticz version:
Location: France
Contact:

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

Post by Logread » Wednesday 04 October 2017 23:30

@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: 291
Joined: Friday 26 September 2014 9:33
Target OS: Windows
Domoticz version:
Location: Heerlen, The Netherlands
Contact:

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

Post by Brutus » Thursday 23 November 2017 20:31

Thnx for this great plugin!
1x Intel NUC D54250WYK (Windows 7)
1x Aeon Labs USB Z-Stick S2
1x P1 Smart Meter USB
17x Fibaro Modules

dextm80
Posts: 51
Joined: Tuesday 24 October 2017 18:32
Target OS: Linux
Domoticz version: 3.8153
Contact:

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

Post by dextm80 » Monday 01 January 2018 20:32

Great plugin!
Domoticz on AsRock j3455-ITX 8gb ram - Aeotec ZWave Usb Stick - RFLink 433Mhz
1x Fibaro Wall Plug
1x Fibaro Motion Sensor
2x NeoCoolcam Wall Plug
Netatmo Weather Station - Netatmo Thermostat
Philips Hue Bridge

anton
Posts: 5
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 » Friday 12 January 2018 13:07

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: 141
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi
Domoticz version:
Location: France
Contact:

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

Post by Logread » Friday 12 January 2018 14:56

anton wrote:
Friday 12 January 2018 13: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: 574
Joined: Monday 29 December 2014 16:47
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands - Zoutkamp (gn)
Contact:

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

Post by Siewert308SW » Friday 12 January 2018 15:16

Just came by to say thx...
Naamloos.png
Naamloos.png (55.67 KiB) Viewed 152 times
Setup:
- RPi3 - PIco hv3.0A Plus / Domoticz Beta Custom 3.8XXX / RFXtrx433E / Aeotec Gen5
- RPi3 - PIco hv3.0A Plus / PiHole / Youless Elec/Gas
- FI9803P Cams
- KD101 detectors
- KaKu/z-wave stuff

Domoticz scripts: @ GitHub
pico_installer: @ GitHub

Logread
Posts: 141
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi
Domoticz version:
Location: France
Contact:

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

Post by Logread » Friday 12 January 2018 22:44

Siewert308SW wrote:
Friday 12 January 2018 15:16
Just came by to say thx...
Naamloos.png
Appreciate :D

anton
Posts: 5
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 » Saturday 13 January 2018 17:13

Logread wrote:
Friday 12 January 2018 14:56
anton wrote:
Friday 12 January 2018 13: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

Post Reply

Who is online

Users browsing this forum: kniazio and 4 guests