lincomatic / open_evse

Firmware for Open EVSE
GNU General Public License v3.0
116 stars 166 forks source link

`$SH` and sleep timer #149

Closed chaseadam closed 2 years ago

chaseadam commented 2 years ago

https://github.com/lincomatic/open_evse/blob/51f71ed7ac5e2b339ca54c1a18caaf7930916a02/firmware/open_evse/rapi_proc.h#L190

I was hoping I could use $SH X to override an active delay timer (openevse sleeping), but it returns $NK^21 even though the state is in "B" (connected) {"cmd":"$G0","ret":"$OK 1^31"}%. Seems the reference to the delay timer is only for preventing delay timer from causing the evse to enter sleep mode, not to override a sleeping EVSE.

It also appears that $SH will not work in "sleeping" mode, nor will it pull the evse out of sleep, so conditions for use appear to be:

I assume this applies to $S3 as well (but I have not confirmed.

With the current state of things, the only way I found to "activate" the charger with a kWh limit when a sleep timer is active is:

Attempting to set the timer while actively charging and a kWh limit value set will sleep the EVSE. Getting that timing right makes me nervous.

Seems there has to be a better way to override the timer, but $FE does not override it (goes immediately back to sleep). I can use $F1 to override the sleep timer (for the current session?), but for some reason I am uncomfortable with the non-explicit command of "simulate a button".

There is also no way to clear a kWh limit value when not in a good "state" (to prepare for when state is "good" to start session).

Proposals:

Aside: I assume this setting will use "cumulative" value now (comments use the term "total"), despite references to "additional" in https://github.com/lincomatic/open_evse/issues/96

chaseadam commented 2 years ago

After upgrading to 4.x wifi, I realized this is the "old" way and the Wifi offers many better features which meet the use cases I am attempting.

https://openevse.stoplight.io/docs/openevse-wifi-v4/ZG9jOjQyMjE5ODI-open-evse-wi-fi-esp-32-gateway-v4