Need help with an iOS battery monitoring rule

So I have an iPad mini always on for HomeKit and shortcuts etc. I also have Life360 battery monitoring working perfectly. Iā€™d like a rule

ā€œEvery two days check the battery. If under 40% charge to 85% then stopā€

I also have a smart plug. How would i do this?

There is almost no chance that Apple exposes the battery level to anything external.

And a smart plug won't help you as at best ti can tell you if it's charging or not (as long as the plug has energy monitoring), it won't reveal what the battery level is.

Are you talking battery level of the iPad? Nothing is going to do that.

If you're talking battery level of your smart devices I suggest Device Watchdog.

It is exposed to Life360, so in theory one could just poll the Life360 device on Hubitat repeatedly and turn off a smart plug when the battery charge reaches 85%

[RELEASE] Life360 with States - Track all attributes with app and driver. Also supports RM4 and Dashboards! It track iOS battery

For some reason, this didnā€™t work

That's pretty slick that Life360 exposes that value.

As for your rule, it's tough to tell with your redaction there, but it appears you have the rule backwards, You want "If battery level < 45 is true then turn on plug". From what I can read you are turning on the plug if it'snot less than 45 (you'd also need to expand the rule to turn off at your desired level of 85%)

So

Trigger:

  • each 10 mins

Action

  • if battery level is < 45 then turn plug on
  • else if battery level is > 85 then turn plug off

Yea they had my name in them. Also for them, is 10 minutes too much? Since itā€™s idle, the battery should last 3 days

Also, I canā€™t trade that false to true, I always have trouble with that

I'm not exactly what the trouble is or what the "can't" stuff is about, but having "false" instead of "true" is giving you the opposite behavior of what you are after. The rule screenshot says "if the power is less than 45 percent is not true then turn on" and what you want is "if the power level is less than 45 percent then turn off else if power is greater than 85 then turn off"

The iOS Shortcuts App has Get Battery Level as a script function, Im guessing it could quite easily be http post'ed to an endpoint.