Home Automation - Battery Polling

Discussions about RaZberry - Z-Wave board for Raspberry computer
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Home Automation - Battery Polling

Post by pz1 »

I have activated the battery polling via the HA interface. It correctly detected one of my StellaZ Radiator Valves to have a level below 5%. In the HA Preferences/Widgets interface I see a Battery Digest 6 which has ID BatteryPolling_6.
Can I somehow read the result from that virtual device from my third party client (=OpenRemote using http call)
Is this virtual device a persistent device as long as I keep the polling configured?
Since 29-12-2016 I am no longer a moderator for this forum
n0ahg
Posts: 87
Joined: 08 May 2013 23:41

Re: Home Automation - Battery Polling

Post by n0ahg »

Look under http://RASPBERRY_IP:8083/ZAutomation/api/v1/devices/BatteryPolling_6
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Home Automation - Battery Polling

Post by pz1 »

This is what I get no indication of which device

Code: Select all

{"data":{"id":"BatteryPolling_6","metrics":{"probeTitle":"Battery","scaleTitle":"%","level":0,"icon":"","title":"Battery digest 6"},"tags":[],"location":null,"deviceType":"battery","updateTime":1400936759},"code":200,"message":"200 OK","error":null}
The HA had warning message:

Code: Select all

24/05/14 - 15:5Can not init module BatteryPolling: ReferenceError: dev is not defined
Since 29-12-2016 I am no longer a moderator for this forum
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Re: Home Automation - Battery Polling

Post by PoltoS »

this was fixed in the latest github code.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Home Automation - Battery Polling

Post by pz1 »

Have to dive a bit deeper into this. While playing I noted that after removing the battery polling from the automation, the created vDev continued to exist. On the other hand with the OpenWeather automation, the Openweather vDev was removed after removing OpenWeather from the automation.

The Warnings list does not disappear from the GUI. Can I force that somewhere?

Pieter
Since 29-12-2016 I am no longer a moderator for this forum
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Home Automation - Battery Polling

Post by pz1 »

pz1 wrote:While playing I noted that after removing the battery polling from the automation, the created vDev continued to exist. On the other hand with the OpenWeather automation, the Openweather vDev was removed after removing OpenWeather from the automation.
Only after a complete power-down-restart, the battery vDev has disappeared. After an earlier soft reboot it was still there.
EDIT:In a subsequent third soft reboot the vDev was removed after a insert/delete of the battery polling.
The Warnings list does not disappear from the GUI. Can I force that somewhere?
I just learned that the hide makes them disappear from the screen
Last edited by pz1 on 26 May 2014 10:55, edited 1 time in total.
Since 29-12-2016 I am no longer a moderator for this forum
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Home Automation - Battery Polling

Post by pz1 »

PoltoS wrote:this was fixed in the latest github code.
The index.js that I have installed matches the code found in the develop branch (dated 7 May). (As I don't know how to deal with GiT, I did compare the code using Notepad++). Problem is still there.
Since 29-12-2016 I am no longer a moderator for this forum
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Re: Home Automation - Battery Polling

Post by PoltoS »

Forgot to push in git ;) Now pushed.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Home Automation - Battery Polling

Post by pz1 »

PoltoS wrote:Forgot to push in git ;) Now pushed.
That's a relief, thought my brain had left me :mrgreen:

Edit: In the code some weekdays spelling should be corrected
"Monday", "Thuesday", "Wednesday", "Thurstday", "Friday", "Satrunday", "Sunday"
"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
Last edited by pz1 on 28 May 2014 10:47, edited 2 times in total.
Since 29-12-2016 I am no longer a moderator for this forum
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Home Automation - Battery Polling

Post by pz1 »

PoltoS wrote:Forgot to push in git ;) Now pushed.
This morning I stopped Z-Way, removed the automation directory and reinstalled as instructed on the HA page.

Unfortunately I still get the same warning error on the HA screen:

Code: Select all

28/05/14 - 9:37Can not init module BatteryPolling: ReferenceError: dev is not defined
Just restarted RaZberry got the same error again. This is what the log days:

Code: Select all

[2014-05-28 10:54:26.495] --- Starting module Weather Informer
[2014-05-28 10:54:26.529] Instantiating module 5 from class BatteryPolling
[2014-05-28 10:54:26.554] --- Starting module Battery Polling
[2014-05-28 10:54:26.584] Creating device battery BatteryPolling_5
[2014-05-28 10:54:26.748] Notification: error (core): Can not init module BatteryPolling: ReferenceError: dev is not defined
[2014-05-28 10:54:26.844] ReferenceError: dev is not defined
    at BatteryPolling.onMetricUpdated (automation/modules/BatteryPolling/index.js:63:68)
    at BatteryPolling.init (automation/modules/BatteryPolling/index.js:87:10)
    at AutomationController.instantiateModule (automation/classes/AutomationController.js:224:22)
    at automation/classes/AutomationController.js:251:18
    at Array.forEach (native)
    at AutomationController.instantiateModules (automation/classes/AutomationController.js:250:24)
    at AutomationController.start (automation/classes/AutomationController.js:72:10)
    at automation/main.js:127:16
[2014-05-28 10:54:26.851] Instantiating module 6 from class LightScene
[2014-05-28 10:54:26.855] --- Starting module Light scene
Since 29-12-2016 I am no longer a moderator for this forum
Post Reply