Battery level reporting from Android

Post Reply
pvoj
Posts: 12
Joined: Saturday 03 October 2015 22:32
Target OS: Raspberry Pi
Domoticz version: 3.5964
Location: Hungary
Contact:

Battery level reporting from Android

Post by pvoj » Friday 24 February 2017 18:06

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

DAVIZINHO
Posts: 151
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Spain
Contact:

Re: Battery level reporting from Android

Post by DAVIZINHO » Friday 13 October 2017 14:24

hi,
This is very interesting for me.
Can you tell us more details?

kluczus
Posts: 23
Joined: Tuesday 12 September 2017 14:39
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Battery level reporting from Android

Post by kluczus » Tuesday 17 October 2017 20:12

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
........................................................................................
RPi2 + sonoff + 433MHz + Xiaomi Gateway + EQ-3 MAX!

User avatar
drbytes
Posts: 2
Joined: Sunday 22 October 2017 9:32
Target OS: Linux
Domoticz version:
Contact:

Re: Battery level reporting from Android

Post by drbytes » Thursday 26 October 2017 9:50

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

Freemann
Posts: 88
Joined: Thursday 24 November 2016 15:55
Target OS: Raspberry Pi
Domoticz version: >=Béta
Location: Netherlands
Contact:

Re: Battery level reporting from Android

Post by Freemann » Tuesday 07 November 2017 9:07

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 1182 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
Domotica/graphs "freak" :)
Rpi3
Amazon Alexa (2 Echo Dots)
Aeotec Z-Stick S2(Gen5)
HarmonyElite
ETHRelayBoard
HUE(5 bulbs, 2 blooms)
NetAtmo(complete setup)
MiLight iboxV6(2 MiLightBulbs)
IP-Cam

https://www.frijduurzaam.nl

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests