Because of some health issues I got myself an emtb (electric mountainbike).
Lots of people, and manufacturers, advocates for keeping the battery at around 30-80% charge for storing. And to only top it up to 100% before a ride.
It makes sense to care for the battery as it is one of the most expensive parts of the bike and obviously I started thinking of how to make it smart.
So I created 4 different advanced flows to add 25%, 50%, 75% and 100% charge. I will show the 50% flow as the others are the same except the calculation.
If I return from a ride and have 30% battery left, and know I´m not going to ride for a while - I just start the 50% flow to top it up to 80%.
Tips for improvements are welcomed!
What is needed?:
- A smart plug or relay with metering to plug the charger to (I am using a Shelly Plus 1PM)
How the flow works - Start
You can use your preferred trigger to start the flow.
-
I use a start block and favorite the flow so I can voice start it from the Google speaker in my garage.
-
When the flow is started it takes a reading from the meter and stores it in a Variable (To use later in step 7 for calculating how much is charged).
-
It then sets a Yes/No variable to Yes. This variable is to keep track of if the socket is used for charging or something else (see step 6). Without it, the shut off trigger later on would shut the socket off when using the socket for other things.
-
At the same time it turns the socket on that the charger is plugged into.
How the flow works - Stop
Next som calculations are needed to stop charging at the right time.
The battery for my bike is 720Wh capacity, so if I want to top it up with 50% that is 360Wh.
-
The trigger for stopping the charging is that the meter of the socket changed.
-
It then continues by checking if I´m using the socket to charge the battery (the variable that was set in step 3).
-
If the variable in step 6 is yes it continues to check, with Logic, if it has charged 360Wh.
This happens by comparing the current meter with the Variable from step 2 plus 360Wh.
The Shelly meter uses Kwh and that is why I add 0,36. -
When 360Wh has been added it:
- Turns the socket off.
- Sets the charging Variable to No
- Creates a timeline message saying the charging is done as well as how much it charged with and how much the cost for the electricity was. The electricity cost is achieved by pulling the current price from my provider and calculating with how much electricity was used during the charge.