The goal was for the charger of an e-bike to be automatically disconnected from the power source via a smart plug once the e-bike is fully charged. I achieved this using a Tasmota smart plug, which I programmed with a special ‘rule’.
Goto to “Console” and enter:
Rule1
ON System#Boot DO Power1 0; ruletimer1 20 ENDON
ON Power1#State=1 DO ruletimer1 10 ENDON
ON ENERGY#Power>5 do RuleTimer1 15 ENDON
ON Rules#Timer=1 DO power1 0; ruletimer1 30 ENDON
to define Rule1, then
Rule1 1
to enable Rule1.
“Power>5” seems to be best for my usecase. While the attached charger uses more then 5 Watts the plug stays on, otherwise it toggles to OFF. That’s all !! ;-)
I’m using a Refoss P11 Tasmota mini plug ESP826 with power meter on Tasmota 15.0.1 !
I had some trouble with a plug with ESP32. Got stuck in “Safe Mode” after tying to update the firmware and had to return it to the seller. Twice!