Automate charging devices based on time and power level

Hi I'm looking for a way to automate turning on some sockets so that they come on at night time when electricity is cheaper and then when the power level drops down indicating that my device is changed then power it off. I'd also like to be able to easily decide during the day if the device should be turned on at night.

I did a bit of searching about power sockets and associated apps for them but I haven't managed to find what I'm looking for.

Currently I have this implemented on ST and it's basically the last devices that I still have connected to ST, everything else is on Hubitat and if I was able to switch my 10 sockets from around the house I'm sure it would also improve my mesh.

On ST I'm using a power management app to monitor the power level and when they measure below a certain threshold consistently for 5 minutes I turn off the socket. I'm sure I could achieve this with rule machine if I really tried, but implementing it in code would be much easier especially if there's an app already there.

The second thing that I'm missing from ST is that in their app you can very easily go to a device and set it to turn on and off at a certain time and it will do that once off.
I know I could do the same thing by creating a new rule every time, but that seems like it would take a few more steps than it does in ST. Is there a user friendly way of achieving that as I'd like my partner to be able to set up these automations easily too.

Thanks Very much for any help

To answer part of my own question. I managed to find this app to do some of what I'm looking for

I must start another thread with some screenshots of what ST provides in terms of once off scheduling a task to start at a certain time. I'd be curious if anyone knows if that's available at all in Hubitat

An app would be nice, but I chose to include one more thing into my two rules that handle keeping my Yoga tablet charged. While I was targeting ~20-80% charge, I also wanted to have enough at certain times of the day when I often use the tablet to watch YouTube (meal times).

To turn on a device after a set amount of time, I don't believe there is anything built-in as such, only that you could probably get creative with a dashboard or someone could write a custom app to do it.

While Bryan isn't maintaining his apps anymore, this may be of use for you...

I have a use case for charging my phone as well but I do that without a power monitoring outlet. Similar to yourself I'm interested in the phone percentage not going above 80% so I use the maker API combined with tasker on my phone. So it's actually the phone that decides when to stop charging overnight.

For this other charging idea that I'm thinking of and currently using on ST it's for my electric bike, for my powertool batteries and other things that I'd like to schedule during the night but also don't want to leave the charger on all night. I just want to turn it off when the devices are charged, but the devices are too dumb to report power levels themselves hence relying on an outlet/socket.

On the scheduling side this is what ST has available which is very quick to get to and quickly set it up. I'll have a look at that kitchen timer app, it does look like it might do what I'd like it to do.



I need to try a few things out, but the more I think and read possibly a virtual switch with a simple rule might also allow me to schedule things. I don't think it's very important to me to be able to decide every time when things should power on. As long as it's during cheap electricity times I can decide the time once and use that same timing every other time

1 Like

Yes, that's what I'm using here as well, the fact it is an em plug is actually not relevant in this case.

Sometimes a simpler set of logic / setup can achieve the same outcome as something slightly more complicated to setup.

not that it makes much difference but I'm using the maker API to control a socket.
From what I can tell you're using maker API to set a variable and then hubitat decides when to turn on and off right?

Tasker, using maker API, is setting the battery percentage on a HE virtual device that represents the battery for my tablet, then the rules I posted are controlling a Kasa outlet using Dave's version of the Kasa integration.

FYI for iOS users...

You can use Shortcuts to create an automation that watches your battery level. If the level rises above a value, you can then have it get contents of a URL. If that URL happens to be a Rule Machine rule trigger endpoint, it will trigger that rule, and you can make Hubitat turn off a smart switch.

I use this to only charge my iPad battery to 80%.

-alk

1 Like