Before creating the topic
- Done. No similar topics.
- Done. Can’t find any documentation relevant.
- Add details :
• ESP-01S + WiFi
• Smartphone OS (Android) + 10.0
• Blynk server
• Blynk Library version = 1.1
• Add your sketch code.
Code should be formatted as example below.
#no code - generic question.
void loop()
Hi, I have a Blynk IOT project working well. It’s a simple relay switch using a ESP-01S and I can control it from my phone. I have added some automations like turn it off and on at a specific time.
*This next paragraph is an explanation of my need. You can skip it if needed. *
However, now I want to expand its functionality. What I need is to have a second phone to provide the WiFi connection to the ESP-01S, along with Blynk IOT app running in it. I want to add the relay switch to the charger, and automate it so that the charger turns on when the battery is at say, 20%, and turns off at 90%. This would ensure the phone battery stays charged, as well as the battery won’t be damaged from keeping it constantly plugged in.
So back to the question.
What I simply need is a way to automate using the phone battery state of the phone. I see several automation methods in the app like sun set sun rise, specific time, manual etc, but none seem to have any option to do this using phone battery percentage.
Any ideas how this can be done? Or if it’s not currently possible, where can I request this feature in a future update? Is there any other workaround where I can use phone battery percentage to trigger a Blynk device?
Thanks in advance. 

You’d need to use a 3rd party automation utility such as Tasker.
The problem with adding this as a Blynk feature is that it is difficult to implement in the same manner with both Android and iOS and it’s also something that is likely to vary with OS versions, so I doubt that it will happen.
Pete.
Really? That’s sad to hear. However, are you sure that’s the reason? I can name any number of apps for both Android and iOS that does things based on battery percentage (readers that turn on dark mode etc)
Also, I’m no app developer, but I searched and it looks like one simple line of code can get the battery level in both iOS and Android as a variable. What’s so difficult after that? 
Well, I’ve looked at ways to do this in iOS and it seems that the method changed considerably around the iOS 14 release, so I doubt that it’s that simple.
Admittedly, I wasn’t looking to do this at app level, but by using calls to the iCloud service, but it’s clear that a major re-write of battery level code took place at some point.
Anyway, Blynk have gone in the opposite direction with Blynk IoT, dropping the widgets that used mobile device sensors like Accelerometer, Barometer/Pressure, Gravity, Humidity, Light, Proximity, Temperature, GPS Trigger and GPS stream that were available in Legacy (but only actually worked with some devices).
I guess that if a white label customer was willing to pay for one of these widgets to be re-developed, or new widgets such as battery percentage to be developed - provided that it’s possible to do in a cross-platform and multi OS environment.
Blynk clearly has a lengthy roadmap already, so I can’t see this type of thing being something that they’d look at as even a medium term project - unless it’s already on the roadmap to meet a particular customer’s requirement.
Pete.