BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Battery percentage on blynk app

is it possible we have the battery percentage of the phone and send to server and show that?

1 Like

that is not available but there is workaround , you can use Tasker or Automate to grab the battery level and use Blynk restful API to sent that value to Blynk server which will reflect to the App.

EDIT

assuming you are an android user for IOS i have no idea how you can achieve that

2 Likes

can you tell app name that do it for me?[quote=“scropion86, post:2, topic:16725”]
sent that value
[/quote]

if you search it you will find it easily , i provided the links below

Tasker
Automate

1 Like

Does anybody know where can I find an example on how to use Automate App with Blynk? I cannot find an example anywhere. I am trying to export battery level do Blynk. I have already created a flow, but don’t know how to connecr to Blynk server. Thanks a lot.

you need to send HTTP request from Automate to Blynk Restfull API here is the Docs

it’s like to send the Batter percentage for example every 30 minutes by calling the API from Automate

Things are improving. I have already made Automate HTTP Request GET method working, but PUT method seems not working. I changed the value using GET method instead, but I do not know how to include the battery level variable value in the GET method. I do not know even if it is possible.

Example: http://blynk-cloud.com/auth_token/update/v41?value=battery_level

How to substitute battery_level variable with the current value in HTTP Request block? It is not clear in the Automate documentation.

Blynk RESTful API is working great!!! Congratulations!

Thanks for your help

It worked!!! Put the variable name between { } in the http command.

Example: http://blynk-cloud.com/auth_token/update/v41?value={battery_level}

Thanks to all of.you including Automate dev team, who helped me in their forum.

1 Like

@PQuintao

that very good , you can help the community back by creating a new tutorial Post here as " How to integrate Blynk API with Automate android App" , so you will save a lot of users the hassles.:grinning:

I will make a tutorial in the next few days, explaning the entire process to integrate Blynk and Automate to get battery level. Until then few free to ask any urgent questions. The main dificulties are already discussed here. Thanks to everybody for the help!

@scropion86 @PQuintao

Guys, what functionality do you want in the Automate plugin?

just to add the current battery percentage value to a virtual pin which you can implement in Blynk App as one of the sensors reading value.

Sorry, but I don’t think we will create such widget.

I want just export the battery level to Blynk using Automate. I used Battery level? and HTTP request blocks in Automate to write battery level to my project virtual pin V41.

The HTTP GET request block in Automate uses the following Request URL:

http://blynk-cloud.com/auth_token/update/v41?value={battery_level}

Note that battery_level is the Automate variable that stores the value of my phone current battery level. I intend to use this value to keep my phone battery level between 30 to 80 % charging. The phone will start charging when battery reaches 30% charging and stops when reach 80%. I think this is a good charging strategy to maximize battery life.

I am also planing to include this feature in a tablet dedicated to my home automation project that runs Android Blynk App 24/7.

Everything is working perfectly. Thanks @scropion86

1 Like

Hi. I’ve been trying to follow the metod in this thread, to send battery level from Automate to blynk-clout.com. I’m a little confused. In the “HTTP request” block in Automate: should i use GET or PUT?

I put this in “request url”: http://blynk-cloud.com/auth_token/update/v0?value=battery_level
(substituted with my blynk auth token)

The data does not show up in blynk, and I get an error message in Automate: android.system.ErrnoExeption: android_getaddrinfo failed: EACCES (Permission denied)

Now it works! Turned out to be missing network privileges. I guess that’s what the error message says, although in a cryptic way :stuck_out_tongue:

1 Like

Hi
I would also like to control my phone charging between 50 & 80%.

Is there any existing documentation which shows me how to use Blynk to export the phone charge status ?
I have never used Blynk before and would only start if there is some good material to explain this.
I would use an Arduino to switch the charging and I have some experience with those.

[Note: I’m not interested in any replies which tell me to leave the phone charge to 100%. I’ve had swollen batteries on 3 branded devices and having read up on the subject, have decided I prefer to restrict charge in future, as repeatedly charging to 100% has not worked well. That’s my decision irrespective of whether anyone else agrees or not. I am only interested in replies which help me towards restricting charging. Thank you for your understanding :slightly_smiling_face:.]

J

Blynk isn’t able to export the phone charge status, which is why the discussion in this topic discusses the use of 3rd party apps such as Tasker and Automate for Android.
These are then used to send the data to the Blynk server via an API call, which can then accessed via the hardware running Blynk code, such as a hacked ESP8266 based smart switch.

Are you using an Android device?

Pete.

Yes. I am using an Android device. My intention is to somehow export the charge percentage & use an ESP8266 device to switch the charger on & off.
Whatever I use to export the phone charge status needs to be either quick & intuitive, or fully documented, so I can simply copy some prior work.

Thank you for your advice.

Well, as I said, whatever tool you use to export the data won’t be Blynk.
You will be using that tool to talk to Blynk, and this topic shows some examples of how to do that and the Blynk API documentation is here:
https://blynkapi.docs.apiary.io/#projecthelp

However, unlike the example in post #15 you should use the IP address of the server where your project is located, rather than blynk-cloud.com

You may however want to do this project using Blynk.365, in which case the API call will be different…
https://docs.blynk.io/en/https-api/update-virtual-datastream-value

Pete.