Re: Python plugin: Battery Level for Z-Wave Devices
Posted: Thursday 26 September 2019 11:32
Thanks ! Working like a charm.
Open source Home Automation System
https://forum.domoticz.com/
Thanks ! Working like a charm.
Code: Select all
2019-09-28 18:08:11.186 (Battery) Node 1 Controller has battery level of 255%
2019-09-28 18:08:11.187 (Battery) Node 11 Pi has battery level of 255%
2019-09-28 18:08:11.188 (Battery) Node 12 Wasmachine has battery level of 255%
2019-09-28 18:08:11.188 (Battery) Node 13 Droger has battery level of 255%
2019-09-28 18:08:11.188 (Battery) Node 15 Lamp bij Spiegel has battery level of 255%
2019-09-28 18:08:11.189 (Battery) Node 17 Designlamp bij TV has battery level of 255%
2019-09-28 18:08:11.189 (Battery) Node 19 Lichtknopje voorkamer has battery level of 255%
2019-09-28 18:08:11.189 (Battery) Node 33 Rookmelder Max has battery level of 255%
2019-09-28 18:08:11.190 (Battery) Node 35 Houten Lamp bij TV has battery level of 255%
2019-09-28 18:08:11.190 (Battery) Node 39 Lichtknopje gang buitenlamp has battery level of 255%
2019-09-28 18:08:11.190 (Battery) Node 40 Vaatwasser has battery level of 255%
2019-09-28 18:08:11.191 (Battery) Node 42 Ongebruikt has battery level of 255%
2019-09-28 18:08:11.191 (Battery) Node 44 ZwolleLamp has battery level of 255%
2019-09-28 18:08:11.191 (Battery) Node 46 niet meer in gebruik has battery level of 255%
2019-09-28 18:08:11.192 (Battery) Node 47 Vriezer has battery level of 255%
2019-09-28 18:08:11.192 (Battery) Node 50 Lamp garage OUd has battery level of 255%
2019-09-28 18:08:11.193 (Battery) Node 51 PIR Garage has battery level of 255%
2019-09-28 18:08:11.193 (Battery) Node 54 Luchtontvochtiger has battery level of 255%
2019-09-28 18:08:11.193 (Battery) Node 55 Meterkast has battery level of 255%
2019-09-28 18:08:11.194 (Battery) Node 56 PIR Carport has battery level of 255%
2019-09-28 18:08:11.194 (Battery) Node 57 PIR Woonkamer has battery level of 255%
2019-09-28 18:08:11.194 (Battery) Node 58 Vloerverwarming has battery level of 255%
2019-09-28 18:08:11.195 (Battery) Node 65 Rookmelder garage has battery level of 255%
2019-09-28 18:08:11.195 (Battery) Node 69 Heiman humtemp has battery level of 255%
2019-09-28 18:08:11.195 (Battery) Node 70 Ventilatie has battery level of 255%
2019-09-28 18:08:11.195 (Battery) Node 71 Badkamer HumTemp has battery level of 255%
2019-09-28 18:08:11.196 (Battery) Node 72 Badkamer Boven HumTemp has battery level of 255%
2019-09-28 18:08:11.196 (Battery) Node 77 Niet meer in gebruik has battery level of 255%
2019-09-28 18:08:11.196 (Battery) Node 78 VanMoof has battery level of 255%
2019-09-28 18:08:11.197 (Battery) Node 82 Deurbel has battery level of 255%
2019-09-28 18:08:11.197 (Battery) Node 83 Tulplamp has battery level of 255%
2019-09-28 18:08:11.197 (Battery) Node 84 Lamp garage has battery level of 255%
2019-09-28 18:08:11.198 (Battery) Node 85 BuitenTempHum has battery level of 255%
2019-09-28 18:08:11.198 (Battery) Node 86 Buitenverlichting Achterkamer has battery level of 255%
2019-09-28 18:08:11.198 (Battery) Node 87 Buitenverlichting Keuken has battery level of 255%
2019-09-28 18:08:11.199 (Battery) Node 88 NEO Coolcam hangt in garage has battery level of 255%
2019-09-28 18:08:11.199 (Battery) Node 89 Smoke detector 1 has battery level of 255%
2019-09-28 18:08:11.199 (Battery) Node 90 Smoke detector 2 has battery level of 255%
Let it run for hours or day (the instructions call for your patience... devices need to communicate their battery levels so at the plugin gets these). Please report thenakamming wrote: Saturday 28 September 2019 18:19 For me it's not working. No devices are created.
If i understand the code correctly everything with a level below 255% should result in a device being created, but in my case it thinks all devices, including the battery reported devices report 255. I checked.... This URL gives (http://localhost:80/json.htm?type=comma ... vels&idx=9) gives the same output (all devices, including the battery powered devices give a value of 255)
yep that was it... running ok nowLogread wrote: Saturday 28 September 2019 20:35 Let it run for hours or day (the instructions call for your patience... devices need to communicate their battery levels so at the plugin gets these). Please report then
Good points.akamming wrote: Sunday 29 September 2019 9:18 I did notice a small security issue:
- The password is logged to the logfile when debug is on
- The password is also stored unencrypted in the database
Not a big thing, cause normally someone will not have access to the database or the log. But still better not to store unencrypted passwords anywhere..
I set as IP 127.0.0.1 and put this address in the trusted ip of domoticz settings. In this way it works without password.Labtec wrote: Saturday 28 September 2019 14:32 Problem solved, need to fill in username and password![]()
Thanks for your appreciation.andreasm80 wrote: Friday 17 January 2020 11:55 Discovered this brilliant plugin yesterday, worked out of the box.
My setup consists of a RPi with Domoticz and the ZwaveController installed doing all the actual zwave commands etc and updates my second Domoticz server which is a Ubuntu VM. This Ubuntu VM is my "main" Domoticz server where all my logic is configured and all switches/actions are defined and used. All new devices from the RPi Domoticz is synced to this one, except a limitation when it comes to Python plugin devices.
What I am looking to do is read the status from all the BatteryMonitor devices createad by the BatteryPlugin and update dummy devices on my main Domoticz server respectively. I get the status from the devices by running curl command from my main Domoticz server command line and get all the expected data.


Code: Select all
2020-02-11 11:06:31.903 Status: Domoticz V4.11674 (c)2012-2020 GizMoCuz
2020-02-11 11:06:31.903 Status: Build Hash: 91c3475ac, Date: 2020-02-09 10:00:09
2020-02-11 11:06:31.904 Status: Startup Path: /home/pi/domoticz/
2020-02-11 11:07:26.609 Status: PluginSystem: Started, Python version '3.7.3'.
2020-02-11 11:07:26.691 Status: WebServer(HTTP) started on address: :: with port 8080
2020-02-11 11:07:26.775 Status: WebServer(SSL) started on address: :: with port 443
2020-02-11 11:07:26.781 Status: Proxymanager started.
2020-02-11 11:07:26.783 Status: Camera: settings (re)loaded
2020-02-11 11:07:26.788 Status: RxQueue: queue worker started...
2020-02-11 11:07:26.788 Status: TCPServer: shared server started...
2020-02-11 11:07:27.080 Status: PROXY: Authenticate result: success.
2020-02-11 11:07:28.789 Status: (EDF) Teleinfo device uses serial port: /dev/ttyUSB-EDF at 1200 bauds
2020-02-11 11:07:28.795 Status: (EDF) CRC checks will be performed on incoming data
2020-02-11 11:07:28.797 Status: Pinger: Worker started...
2020-02-11 11:07:28.797 Status: (chauffage sol) Started.
2020-02-11 11:07:28.797 Status: (controle batterie zwave) Started.
2020-02-11 11:07:28.797 Status: Harmony Hub: Worker thread started...
2020-02-11 11:07:28.798 Status: EventSystem: reset all events...
2020-02-11 11:07:28.813 Status: EventSystem: reset all device statuses...
2020-02-11 11:07:28.992 Status: RFLink: Using serial port: /dev/ttyUSB-RFX433
2020-02-11 11:07:29.122 Status: (EDF) Teleinfo CRC check mode set to 1
2020-02-11 11:07:29.235 Status: PluginSystem: Entering work loop.
2020-02-11 11:07:29.289 Status: OpenZWave: using config in: /home/pi/domoticz/Config/
2020-02-11 11:07:29.433 Status: OpenZWave: Starting...
2020-02-11 11:07:29.433 Status: OpenZWave: Version: 1.6-1020-g67c46b68
2020-02-11 11:07:30.255 Status: (chauffage sol) Entering work loop.
2020-02-11 11:07:30.255 Status: (chauffage sol) Initialized version 0.4.7, author 'logread'
2020-02-11 11:07:31.029 Status: (controle batterie zwave) Entering work loop.
2020-02-11 11:07:31.031 Status: (controle batterie zwave) Initialized version 0.6.0, author 'logread'
2020-02-11 11:07:31.042 Status: (chauffage sol) This version of domoticz allows status logging by the plugin (in verbose mode)
2020-02-11 11:07:31.097 Status: Incoming connection from: ::1
2020-02-11 11:07:32.109 Status: Harmony Hub: Connected to Hub.
2020-02-11 11:07:32.294 Status: Python EventSystem: Initalizing event module.
2020-02-11 11:07:32.296 Status: EventSystem: Queue thread started...
2020-02-11 11:07:32.303 Status: EventSystem: Started
2020-02-11 11:07:36.818 Status: OpenZWave: User Alert - Manufacturer_specific.xml out of Date
2020-02-11 11:07:36.818 Status: OpenZWave: Received unhandled notification type (30) from HomeID: 0, NodeID: 0 (0x00)
2020-02-11 11:07:36.818 Status: OpenZWave: User Alert - Manufacturer_specific.xml out of Date
2020-02-11 11:07:36.818 Status: OpenZWave: ManufacturerSpecificDB Ready
2020-02-11 11:07:37.561 Status: OpenZWave: Driver ReadyIt is on the github repo for the plugin. The file is called ‘ plugin legacy OZW 1.4 version.py ‘ and needs to be renamed to ’ plugin.py ‘ manuallySolderbro wrote: Sunday 16 February 2020 12:37 Short question.
Where to get the latest version for Domoticz Stable? My install seems to have some trouble and the archive is lost.
Probably not completely comparable because I compile locally and on a Intel NUC(Debian buster) but on the same application versions.ronaldbro wrote: Sunday 08 March 2020 12:05 2020-03-08 01:07:13.535 Error: (Z-wave battery monitor) Error calling
http://Localhost:8080/json.htm?type=com ... vels&idx=5