Page 1 of 3

Home Automation - Battery Polling

Posted: 24 May 2014 15:02
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?

Re: Home Automation - Battery Polling

Posted: 24 May 2014 15:15
by n0ahg
Look under http://RASPBERRY_IP:8083/ZAutomation/api/v1/devices/BatteryPolling_6

Re: Home Automation - Battery Polling

Posted: 24 May 2014 16:12
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

Re: Home Automation - Battery Polling

Posted: 25 May 2014 00:39
by PoltoS
this was fixed in the latest github code.

Re: Home Automation - Battery Polling

Posted: 25 May 2014 17:29
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

Re: Home Automation - Battery Polling

Posted: 26 May 2014 10:30
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

Re: Home Automation - Battery Polling

Posted: 26 May 2014 10:43
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.

Re: Home Automation - Battery Polling

Posted: 27 May 2014 16:24
by PoltoS
Forgot to push in git ;) Now pushed.

Re: Home Automation - Battery Polling

Posted: 27 May 2014 17:19
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"

Re: Home Automation - Battery Polling

Posted: 28 May 2014 10:43
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