Tablet battery percentage trigger

Hi all

I would like to use the battery percentage as trigger to switch a relay that will power up or not the tablet.

My wish is to switch on the relay if battery is lower than 15%, and switch on if battery is higher than 90%.

Is there a way to do it?

I can have Macrodroid or Tasker on it, but is there any other way?

Thanks

do those pieces of information exist inside HA? If so, what are the entity_id’s & attributes.

The relay switch exist in HA, the battery value is my doubt.

How can I get this value from the tablet?

You can use Owntracks, Zanzito, or Google Location tracking (if Android)

If iOS, you can use Owntracks or the HA app.

Thanks to @123 and to his post, I have solved in minutes, since I was already using MQTT and Nodered and also Macrodroid on my Android tablet.