Page 1 of 1

Battery level reporting from Android

Posted: Friday 24 February 2017 17:06
by pvoj
Hi,
I read through several topics in the forum and found a simple solution to send battery information from Android to Domoticz. I use Automate on Android to get the data and create the json url. You can download the Flow from the Automate community Flow library. It is named: Battery level reporting tool for Domoticz. The battery level is sent over json like this: ../json.htm?type=command&param=udevice&idx=92&svalue=55.1
In Domoticz I created a dummy percentage sensor. The ID of the sensor is set in the Automate flow as well as the url and the ssid of the wifi.
Peter

Re: Battery level reporting from Android

Posted: Friday 13 October 2017 14:24
by DAVIZINHO
hi,
This is very interesting for me.
Can you tell us more details?

Re: Battery level reporting from Android

Posted: Tuesday 17 October 2017 20:12
by kluczus
It is simple. I'm using a tasker. In my configuration I have:
- scene: two conditions - near wifi with specific ssid and time betwen 0:01am and 12:59 pm every 10 minutes,
- task: Net->http get, in server domoticzip:port, in path

Code: Select all

json.htm?type=command&param=udevice&idx=IDX&svalue=%BATT

Re: Battery level reporting from Android

Posted: Thursday 26 October 2017 9:50
by drbytes
Try Wall All, posted about here in the forum. I wrote it, .. it allows you to post battery info to MQTT of pull it via HTTP GET.
There's alot more data it can gather.

I've posted a bunch of codes to test it out, but give me some feedback, I'm always looking to improve or add features

Re: Battery level reporting from Android

Posted: Tuesday 07 November 2017 8:07
by Freemann
I just posted this;
http://www.domoticz.com/forum/viewtopic ... 20#p156694

Would be great if its implemented into the Android app and Domoticz itself.

I'm using this Automate flow;
Batterij vol (_70%).png
Batterij vol (_70%).png (18.57 KiB) Viewed 4858 times

Code: Select all

"Catch error?" >No> Loop every 1 minutes > Get BatteryLevel > Put BatteryLevel in Variable > Post the Automate Variable to an Domoticz UserVariable.
"Catch error?" >Yes> Delay 2 min.
This is working great for about an year now. Based on "Android AccuBattery" the battery of my OnePlus 3t only lost 100mAh(~5%) of capacity :)
Where my previous Nexus5 lost >10% after 1 year.

Also on safety its great; No charging Lithium device in the house while sleeping :D