I have an unrooted GrapheneOS phone. I was surprised that it doesn’t offer a native option to limit battery charging to a specific upper limit (e.g., 80%) to preserve battery health and prolong the battery’s life.
To work around this, I decided to implement a charging limit feature using automation software and a Wi-Fi-controllable plug. After some research, I bought a Shelly Plug S for this purpose. I’m trying to keep things open-source, so I avoid Google Play apps when possible. The closest Tasker alternative I found on F-Droid is Easer. Unfortunately, Easer seems to lack some crucial features that would make this process easier, such as switching Wi-Fi networks or starting external apps.
Here’s my plan so far:
However, Easer seems to have some limitations that make this more challenging than expected:
At the moment, I’m stuck with these limitations and was wondering if anyone has experience with similar setups or has already written code to implement something like this. Specifically:
Has anyone written or seen code to automate switching off a Shelly Plug once a certain battery level is reached? Are there any workarounds for Easer’s limitations, or should I consider switching to a different automation tool that fits my FOSS preference?
I would greatly appreciate any tips, code snippets, or discussions around best practices for this type of setup. Ideally, I’d love to make this work while keeping the setup local and portable, but I’m open to suggestions!
Thanks in advance for your help!
Welcome to the droidymcdroidface-iest, Lemmyest (Lemmiest), test, bestest, phoniest, pluckiest, snarkiest, and spiciest Android community on Lemmy (Do not respond)! Here you can participate in amazing discussions and events relating to all things Android.
The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:
1. All posts must be relevant to Android devices/operating system.
2. Posts cannot be illegal or NSFW material.
3. No spam, self promotion, or upvote farming. Sources engaging in these behavior will be added to the Blacklist.
4. Non-whitelisted bots will be banned.
5. Engage respectfully: Harassment, flamebaiting, bad faith engagement, or agenda posting will result in your posts being removed. Excessive violations will result in temporary or permanent ban, depending on severity.
6. Memes are not allowed to be posts, but are allowed in the comments.
7. Posts from clickbait sources are heavily discouraged. Please de-clickbait titles if it needs to be submitted.
8. Submission statements of any length composed of your own thoughts inside the post text field are mandatory for any microblog posts, and are optional but recommended for article/image/video posts.
Community Resources:
We are Android girls*,
In our Lemmy.world.
The back is plastic,
It’s fantastic.
*Well, not just girls: people of all gender identities are welcomed here.
Our Partner Communities:
In that case, a reverse proxy on your “main” network that can access the Shelly Plug on the “restricted” network should work.
Yes, it should. I hope someone has already implemented this setup and can confirme that it works as we think it does.
Should be pretty easy if you use Nginx. You can just proxy the full URI and params.
As long as your reverse proxy (Nginx) on your main network can reach 10.10.10.5 port 80 on the restricted VLAN, it should work, and you should be able to use call the api from your main network at
http://shellyplug.lan (or http://192.168.1.10)
just as you would to it directly to the plug on its restricted network.HTH