I need get a battery status in percentage from my battery powered devices - via some API (JSON, XML,...)
it is possible ? I couldn't find this battery level in any JSON answer from my devices..
;(
Get the Battery Status via API
Re: Get the Battery Status via API
This is how I've done it in JS in OpenRemoteHelpers.
Don't call it to often! Once a week should be quite enough.
Update 14:57:
If you use SmartHome, battery polling App is installed by default to run only once a week.
Then you only need:
To get your data
Code: Select all
// Battery is never in instances
zway.devices[N].Battery.Get();
return zway.devices[N].Battery.data.last.value;
Update 14:57:
If you use SmartHome, battery polling App is installed by default to run only once a week.
Then you only need:
Code: Select all
zway.devices[N].Battery.data.last.value;
Re: Get the Battery Status via API
why it is so important to call it not too often ?
Re: Get the Battery Status via API
Because it has takes "airtime" to send. Sending data takes much more energy than receiving. Battery devices are optimised to make the send (and awake) period as short as possible.
As an example: most of my 12 Thermostatic Radiator Vlaves are 100% OK according to the timing info in ExpertUI. Two that are at awkward places which apparantly require many transmissions are at 97%. The batteries of those two drain much faster than the others. I had to replace those after some 6 months or so while others have served me around 18 months or more.
As an example: most of my 12 Thermostatic Radiator Vlaves are 100% OK according to the timing info in ExpertUI. Two that are at awkward places which apparantly require many transmissions are at 97%. The batteries of those two drain much faster than the others. I had to replace those after some 6 months or so while others have served me around 18 months or more.