dingo35 / ha-SmartEVSEv3

Integrate SmartEVSEv3 with HomeAssistant through custom component
13 stars 8 forks source link

Feature Request: Switch to toggle between OFF and last used mode #2

Closed Xnygra closed 1 year ago

Xnygra commented 1 year ago

A switch to toggle between OFF and last used Mode would be a great addition. That is so the SmartEvse can easily be controlled by another integration, like find the cheapest hours to charge etc.

This can be done with an physical switch connected to the SmartEVSE unit or through some Automatations that do the same, but it would be a neat feature to have built into the integration.

Thank you :)

dingo35 commented 1 year ago

I agree, you can find a switch in a branch "add_switch"; to get it through the WAT (Wife Acceptance Test) I made it very simple: off = mode OFF, on = mode SMART. The idea is that if someone wants to put the charger ON by a simple switch, you want it to charge NOW. And with Solar you will never know....

The reason I didnt bring this switch into production: if you press it, it doesn't update the SELECTOR switch immediately (it lags between 0 and 60 seconds); I found this unacceptable, since it leads to confusion, and it shouldnt be necessary (because HA knows the switch has been thrown), I just didn't figure out the right code to update that status directly within HA.... but feel free to try it out or, even better, make a Pull Request!

Xnygra commented 1 year ago

Tried it now, and it works perfect for me, as the switch is only to be used by another integration. But I agree, the delay is not ideal. I'll make a Pull Request. FYI, I use this together with the great "EV Smart Charging" integration, i can highly recommend it.