hardbyte / ha-evnex

A cloud-polling Home Assistant component to integrate with an Evnex Charger
MIT License
8 stars 1 forks source link

Connector availability issue #11

Open hardbyte opened 1 year ago

hardbyte commented 1 year ago

@drc38 do you see this same behavior where the connector availability toggle is off even if the connector is available and not disabled?

E.g. here I'm charging but the new availability switch says disabled:

image

Any idea what data we should be using for that switches value? It looks to me that in v3 details we could use ocppStatus=UNAVAILABLE, or in api v2 we can see status="DISABLED"

drc38 commented 1 year ago

The way its been coded is such that if you are charging the connector is 'unavailable' (as someone is charging) and the switch is in the Off position. If you toggle the switch (to make the connector available) while charging it will stop the charge and the connector then becomes available when the cable is unplugged. If on the other hand the connector status is Available (switch is On) and you toggle the switch it will become Unavailable and prevent charging. On the Evnex portal they term it disable/renable and ignore the current status which is another way to do it (ie remove the is_on property and swap the on/off logic).

drc38 commented 1 year ago

If you toggle the switch (to make the connector available) while charging it will stop the charge and the connector then becomes available when the cable is unplugged. On second thoughts it may not behave in this way and may just keep charging... not sure

hardbyte commented 1 year ago

I had a chat with someone on the team at EVNEX and they told me that feature was designed for disabling chargers when they shouldn't be used for an extended time - for example at a bach.

I suggest we copy that behaviour with this available button, and think about having a "cancel"/"stop current charge" button?

drc38 commented 1 year ago

I'd still keep it as a switch rather than use a button so you can disable and re-enable the charger with the 1 entity. But drop the availability name and call it 'disable connector' reversing the current on/off logic.

drc38 commented 1 year ago

The stop charge can be a button, as on the Evnex you can't start a charge remotely without unplugging the cable so not much point implementing it in HA.