Page 3 of 9

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

Posted: Thursday 18 May 2017 16:47
by Egregius
In my case the XML isn't good either.
I replaced all batteries of my smoke sensors yesterday. All battery levels went to 100%.
Today, one reports as 0%. So I looked at the devices table, all devices from that node just have a - as battery level...

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

Posted: Thursday 18 May 2017 17:03
by Logread
Egregius wrote:In my case the XML isn't good either.
I replaced all batteries of my smoke sensors yesterday. All battery levels went to 100%.
Today, one reports as 0%. So I looked at the devices table, all devices from that node just have a - as battery level...
Not clear to me if you are saying the domoticz/Config/zwcfg_0x????????.xml file on your system does not hold an accurate COMMAND_CLASS_BATTERY data for that node, or if my plugin has a bug ?
That being said, you may want to try to manually wake up the culprit smoke sensor and see what happens (may have to wait for one hour to see any change though) ?

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

Posted: Thursday 18 May 2017 17:13
by Egregius
Yes, the /Config/zwcfg_0x????????.xml contains value="0" for that node.
Or maybe it's a faulty battery, haven't received temps in the last 6 hours... Damn, up to the attic that is.

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

Posted: Saturday 27 May 2017 9:39
by capman
A tryded the script , but got a error in my log.

2017-05-27 09:38:25.534 (Baterijen Z-Wave) Initialized version 0.4.0, author 'logread'
2017-05-27 09:38:25.590 (Baterijen Z-Wave) Debug log level set to: 'true'.
2017-05-27 09:38:25.590 (Baterijen Z-Wave) 'Key':'BatteryLevel'
2017-05-27 09:38:25.590 (Baterijen Z-Wave) 'Mode6':'Debug'
2017-05-27 09:38:25.590 (Baterijen Z-Wave) 'Port':'0'
2017-05-27 09:38:25.590 (Baterijen Z-Wave) 'HardwareID':'55'
2017-05-27 09:38:25.590 (Baterijen Z-Wave) 'Version':'0.4.0'
2017-05-27 09:38:25.590 (Baterijen Z-Wave) 'Author':'logread'
2017-05-27 09:38:25.590 (Baterijen Z-Wave) 'Name':'Baterijen Z-Wave'
2017-05-27 09:38:25.590 (Baterijen Z-Wave) 'HomeFolder':'/usr/local/domoticz/var/plugins/BatteryLevel/'
2017-05-27 09:38:25.590 (Baterijen Z-Wave) 'Mode1':'60'
2017-05-27 09:38:25.590 (Baterijen Z-Wave) Device count: 0
2017-05-27 09:38:25.591 (Baterijen Z-Wave) Number of icons loaded = 4
2017-05-27 09:38:25.591 (Baterijen Z-Wave) Icon 120 batterylevelok
2017-05-27 09:38:25.591 (Baterijen Z-Wave) Icon 118 batterylevelfull
2017-05-27 09:38:25.591 (Baterijen Z-Wave) Icon 119 batterylevellow
2017-05-27 09:38:25.591 (Baterijen Z-Wave) Icon 117 batterylevelempty
2017-05-27 09:38:25.591 (Baterijen Z-Wave) Using polling interval of 60 minutes

Error: (Baterijen Z-Wave) Enable to find a zwave controller configuration file !

And all 10 seconds get this message
2017-05-27 09:38:45.459 (Baterijen Z-Wave) Calling message handler 'onHeartbeat'.

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

Posted: Saturday 27 May 2017 10:05
by Logread
@capman,

I assume that indeed you have a zwave stick connected and functional ? If so, what is the platform you are running Domoticz on (Linux, Windows, ...) ? Can you locate the zwcfg_0x????????.xml file on your system (where ???????? is the unique homeid of your zwave controller)... it should be in the Config subfolder of the Domoticz install folder. If it is not there, then please report on where that file is on your system (you might have a non standard directory setup ?)

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

Posted: Saturday 27 May 2017 11:10
by capman
Logread wrote:@capman,

I assume that indeed you have a zwave stick connected and functional ? If so, what is the platform you are running Domoticz on (Linux, Windows, ...) ? Can you locate the zwcfg_0x????????.xml file on your system (where ???????? is the unique homeid of your zwave controller)... it should be in the Config subfolder of the Domoticz install folder. If it is not there, then please report on where that file is on your system (you might have a non standard directory setup ?)
I have it installed on synology beta 3.7468

On my config folder a have a file called 'zwcfg.xsd'. It's located in /volume1/@appstore/domoticz/Config/zwcfg.xsd
Code showing under.
Spoiler: show
<?xml version='1.0'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://code.google.com/p/open-zwave/'
xmlns:Driver='http://code.google.com/p/open-zwave/'
elementFormDefault='qualified'>

<xs:element name='Driver'>
<xs:complexType>
<xs:sequence>
<xs:element ref='Driver:Node' minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attribute name='version' type='xs:string' use='required'/>
<xs:attribute name='home_id' type='xs:string' use='required'/>
<xs:attribute name='node_id' type='xs:string' use='required'/>
<xs:attribute name='api_capabilities' type='xs:string' use='required'/>
<xs:attribute name='controller_capabilities' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>

<xs:element name='Node'>
<xs:complexType>
<xs:sequence>
<xs:element ref='Driver:Manufacturer'/>
<xs:element ref='Driver:CommandClasses'/>
</xs:sequence>
<xs:attribute name='id' type='xs:string' use='required'/>
<xs:attribute name='name' type='xs:string' use='required'/>
<xs:attribute name='location' type='xs:string' use='optional'/>
<xs:attribute name='basic' type='xs:string' use='optional'/>
<xs:attribute name='generic' type='xs:string' use='optional'/>
<xs:attribute name='specific' type='xs:string' use='optional'/>
<xs:attribute name='type' type='xs:string' use='optional'/>
<xs:attribute name='listening' use='optional'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:enumeration value='true'/>
<xs:enumeration value='false'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='frequentListening' use='optional'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:enumeration value='true'/>
<xs:enumeration value='false'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='beaming' use='optional'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:enumeration value='true'/>
<xs:enumeration value='false'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='routing' use='optional'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:enumeration value='true'/>
<xs:enumeration value='false'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='max_baud_rate' type='xs:string' use='optional'/>
<xs:attribute name='version' type='xs:string' use='optional'/>
<xs:attribute name='query_stage' type='xs:string' use='optional'/>
<xs:attribute name='security' use='optional'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:enumeration value='true'/>
<xs:enumeration value='false'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='nodeinfosupported' use='optional'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:enumeration value='true'/>
<xs:enumeration value='false'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:element name='Manufacturer'>
<xs:complexType>
<xs:sequence>
<xs:element ref='Driver:Product'/>
</xs:sequence>
<xs:attribute name='id' type='xs:string' use='required'/>
<xs:attribute name='name' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>

<xs:element name='Product'>
<xs:complexType>
<xs:attribute name='type' type='xs:string' use='required'/>
<xs:attribute name='id' type='xs:string' use='required'/>
<xs:attribute name='name' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>

<xs:element name='CommandClasses'>
<xs:complexType>
<xs:sequence>
<xs:element ref='Driver:CommandClass' minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name='CommandClass'>
<xs:complexType>
<xs:sequence>
<xs:element ref='Driver:Instance' minOccurs='0' maxOccurs='unbounded'/>
<xs:element ref='Driver:Value' minOccurs='0' maxOccurs='unbounded'/>
<xs:element ref='Driver:Associations' minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attribute name='id' type='xs:string' use='required'/>
<xs:attribute name='name' type='xs:string' use='required'/>
<xs:attribute name='version' type='xs:string' use='required'/>
<xs:attribute name='after_mark' use='optional'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:enumeration value='true'/>
<xs:enumeration value='false'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='create_vars' use='optional'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:enumeration value='true'/>
<xs:enumeration value='false'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='getsupported' use='optional'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:enumeration value='true'/>
<xs:enumeration value='false'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='request_flags' type='xs:string' use='optional'/>
<xs:attribute name='base' type='xs:string' use='optional'/>
<xs:attribute name='override_precision' type='xs:string' use='optional'/>
</xs:complexType>
</xs:element>

<xs:element name='Instance'>
<xs:complexType>
<xs:attribute name='index' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>

<xs:element name='Value'>
<xs:complexType>
<xs:sequence>
<xs:element ref='Driver:Help' minOccurs='0' maxOccurs='1'/>
<xs:element ref='Driver:Item' minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attribute name='type' type='xs:string' use='required'/>
<xs:attribute name='genre' type='xs:string' use='required'/>
<xs:attribute name='instance' type='xs:string' use='required'/>
<xs:attribute name='index' type='xs:string' use='required'/>
<xs:attribute name='label' type='xs:string' use='required'/>
<xs:attribute name='units' type='xs:string' use='required'/>
<xs:attribute name='read_only' use='required'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:enumeration value='true'/>
<xs:enumeration value='false'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='write_only' use='required'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:enumeration value='true'/>
<xs:enumeration value='false'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='verify_changes' use='required'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:enumeration value='true'/>
<xs:enumeration value='false'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='poll_intensity' type='xs:string' use='required'/>
<xs:attribute name='min' type='xs:string' use='required'/>
<xs:attribute name='max' type='xs:string' use='required'/>
<xs:attribute name='value' type='xs:string' use='optional'/>
<xs:attribute name='vindex' type='xs:string' use='optional'/>
<xs:attribute name='affects' type='xs:string' use='optional'/>
<xs:attribute name='size' type='xs:string' use='optional'/>
</xs:complexType>
</xs:element>

<xs:element name='Help'>
<xs:complexType mixed='true'>
</xs:complexType>
</xs:element>

<xs:element name='Item'>
<xs:complexType>
<xs:attribute name='label' type='xs:string' use='required'/>
<xs:attribute name='value' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>

<xs:element name='Associations'>
<xs:complexType>
<xs:sequence>
<xs:element ref='Driver:Group' minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attribute name='num_groups' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>

<xs:element name='Group'>
<xs:complexType>
<xs:sequence>
<xs:element name='Node' minOccurs='0' maxOccurs='unbounded'>
<xs:complexType>
<xs:attribute name='id' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name='index' type='xs:string' use='required'/>
<xs:attribute name='max_associations' type='xs:string' use='required'/>
<xs:attribute name='label' type='xs:string' use='required'/>
<xs:attribute name='auto' use='required'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:enumeration value='true'/>
<xs:enumeration value='false'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
And a screenshot from my zwave device. I hope you can do something with it (or not) ;)

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

Posted: Saturday 27 May 2017 12:19
by Logread
@capman,

The .xsd file is of no use for the plugin... only the zwcfg_0x????????.xml file (where ???????? is the unique homeid of your zwave controller) is required for the plugin to work... I note your zwave stick is a Vision one, while I tested on a Aeotec, so may be openzwave works differently with that controller ? Not sure. Can you send me by pm a directory listing of your domoticz/Config folder ?

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

Posted: Saturday 27 May 2017 12:36
by capman
Logread wrote:@capman,

The .xsd file is of no use for the plugin... only the zwcfg_0x????????.xml file (where ???????? is the unique homeid of your zwave controller) is required for the plugin to work... I note your zwave stick is a Vision one, while I tested on a Aeotec, so may be openzwave works differently with that controller ? Not sure. Can you send me by pm a directory listing of your domoticz/Config folder ?
I search in my domoticz structure folders to 'zwcfg' , but nothing found. I send you a pm. Thanks 4 looking :)

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

Posted: Friday 02 June 2017 14:02
by Derik
m,mmm

Did have this plugin working.
Only need to upgrade my cb to a Xu4...[ more power needed.. :-) ]
Now i do the [ same ] trick..
Only no plugin in domoticz hardware section......

Code: Select all

linaro@odroidxu4:~/domoticz/plugins/BatteryLevel$ sudo chmod +x plugin.py
linaro@odroidxu4:~/domoticz/plugins/BatteryLevel$
linaro@odroidxu4:~/domoticz/plugins/BatteryLevel$ sudo apt-get install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
git is already the newest version (1:2.7.4-0ubuntu1.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
linaro@odroidxu4:~/domoticz/plugins/BatteryLevel$ sudo chmod +x plugin.py
linaro@odroidxu4:~/domoticz/plugins/BatteryLevel$ sudo /etc/init.d/domoticz.sh restart
[ ok ] Restarting domoticz.sh (via systemctl): domoticz.service.
linaro@odroidxu4:~/domoticz/plugins/BatteryLevel$ cd
linaro@odroidxu4:~$ cd ~/domoticz/plugins/BatteryLevel
linaro@odroidxu4:~/domoticz/plugins/BatteryLevel$ git reset --hard
HEAD is now at dd0d29b Version 0.4.2
linaro@odroidxu4:~/domoticz/plugins/BatteryLevel$ git pull --force
Already up-to-date.
linaro@odroidxu4:~/domoticz/plugins/BatteryLevel$ sudo chmod +x plugin.py
And in the ftp area is see everything i need...
Do i need to start the script or??

Where do i go wrong..


Thanks

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

Posted: Friday 02 June 2017 15:53
by Logread
Derik wrote:m,mmm

Did have this plugin working.
Only need to upgrade my cb to a Xu4...[ more power needed.. :-) ]
Now i do the [ same ] trick..
Only no plugin in domoticz hardware

Thanks
I think the sequence of shell commands you send is not finished... you need to restart domoticz AFTER you update the plugin and make the script executable...
This should do it

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

Posted: Friday 02 June 2017 18:01
by Derik
strange,

Do everything i need to do for the 3 time.
No plugin
ast beta..
Do the thing as subscribe here in the topic...


see the map an all the stuff.
Reboot
Refresh hardware list
no plugin

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

Posted: Friday 02 June 2017 18:21
by Logread
Derik wrote:strange,

Do everything i need to do for the 3 time.
No plugin
ast beta..
Do the thing as subscribe here in the topic...


see the map an all the stuff.
Reboot
Refresh hardware list
no plugin
Which version of Domoticz are you running ? I saw on the forum that some of the recent beta builds had python disabled... do you have other python plugins installed and working (or not)... If no plugin works, then definitely a domoticz issue

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

Posted: Friday 02 June 2017 18:30
by Derik
Last beta..
New hardware xu4 ..
With other kernell perhaps that??

Or can i mananual install python

Or check the versions

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

Posted: Tuesday 06 June 2017 10:26
by Logread
A new version (0.4.3) is available from the GitHub repository. The plugin should now work on Synology platforms (different location of the openzwave files compared to "standard" Linux or Windows installs). Thanks to @capman for raising the issue and testing the new version :)

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

Posted: Saturday 10 June 2017 22:39
by TakeAway
I have the same problem as derik, also latest beta. Can't see the plugin in the hardware list.

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

Posted: Sunday 11 June 2017 11:16
by TakeAway
Problem solved by installing python from the wiki:https://www.domoticz.com/wiki/Using_Python_plugins

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

Posted: Sunday 11 June 2017 15:16
by Derik
Not by me:

Code: Select all

linaro@odroidxu4:~/domoticz$ dpkg -l | grep libpython3
ii  libpython3-dev:armhf                 3.5.1-3                                                                                        armhf        header files and a static library for Python (default)
ii  libpython3-stdlib:armhf              3.5.1-3                                                                                        armhf        interactive high-level object-oriented language (default python                                                    3 version)
ii  libpython3.5:armhf                   3.5.2-2ubuntu0~16.04.1                                                                         armhf        Shared Python runtime library (version 3.5)
ii  libpython3.5-dev:armhf               3.5.2-2ubuntu0~16.04.1                                                                         armhf        Header files and a static library for Python (v3.5)
ii  libpython3.5-minimal:armhf           3.5.2-2ubuntu0~16.04.1                                                                         armhf        Minimal subset of the Python language (version 3.5)
ii  libpython3.5-stdlib:armhf            3.5.2-2ubuntu0~16.04.1                                                                         armhf        Interactive high-level object-oriented language (standard libra                                                    ry, version 3.5)
linaro@odroidxu4:~/domoticz$ cd
linaro@odroidxu4:~$ sudo apt-get install python3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-dev is already the newest version (3.5.1-3).
The following packages were automatically installed and are no longer required:
  gir1.2-javascriptcoregtk-3.0 gir1.2-soup-2.4 gir1.2-webkit-3.0 inxi
  libarchive13 libboost-python1.58.0 libexiv2-14 libgd3 libgdata-common
  libgdata22 libglib2.0-bin libgoa-1.0-0b libgoa-1.0-common libgphoto2-6
  libgphoto2-port12 libimobiledevice6 libjavascriptcoregtk-3.0-0 libmate-menu2
  libmtp-common libmtp9 liboauth0 libpcre16-3 libpcre3-dev libpcre32-3
  libpcrecpp0v5 libplist3 libusbmuxd4 libwebkitgtk-3.0-0
  libwebkitgtk-3.0-common python3-polib
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
linaro@odroidxu4:~$
And instal the plugin
reboot
check and double ..
No hardware in my list for the battery

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

Posted: Sunday 11 June 2017 23:43
by Phantom
Thanks for the plugin.
I have installed it today and works great.

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

Posted: Monday 12 June 2017 10:04
by TakeAway
Works for some time, but domoticz crashes. Is there a solution for this?

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

Posted: Monday 12 June 2017 19:10
by bdormael
TakeAway wrote:Works for some time, but domoticz crashes. Is there a solution for this?
Same issue here, 2 times a day Domoticz crashes now, when disabling the plugin, no crashes anymore


Verzonden vanaf mijn iPad met Tapatalk