dingo35 / ha-SmartEVSEv3

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

Fix displaying override current. #12

Closed stevoh6 closed 1 year ago

stevoh6 commented 1 year ago

Adding missing /10

image

stevoh6 commented 1 year ago

@dingo35 thx for this awesome project, is there any other help needed? :-)

dingo35 commented 1 year ago

Well I have been struggling with the update of related entities.

E.g. when you change the mode selector from SMART to OFF in HA, it will take the power switch (which basically does the same) a full update cycle, ca 1 minute, to update.

There must be a smarter way to do this around the coordinator entity, so it can updatr instantaneously, but I have not found it yet....

stevoh6 commented 1 year ago

You mean, update status in HA? Or switch charging off? It is doing that on all modes too?

Maybe, I think, it is because charger waiting 6s to gracefully stop charging by the vehicle (https://github.com/serkri/SmartEVSE-3/blob/master/SmartEVSE-3/src/evse.cpp#L2020)

dingo35 commented 1 year ago

You mean, update status in HA? Or switch charging off? It is doing that on all modes too?

Maybe, I think, it is because charger waiting 6s to gracefully stop charging by the vehicle (https://github.com/serkri/SmartEVSE-3/blob/master/SmartEVSE-3/src/evse.cpp#L2020)

Yes I mean to update the status in HA.

stevoh6 commented 1 year ago

I found this topic: https://community.home-assistant.io/t/manually-refresh-rest-sensor/353208 I can try implement it, but it will take time, since I never code integration into HA.

dingo35 commented 1 year ago

No it should not be necessary to trigger the REST API, because the new value is already present in HA.

stevoh6 commented 1 year ago

I that case, ti should be this param: https://github.com/dingo35/ha-SmartEVSEv3/blob/main/custom_components/smartevse/switch.py#L56

Or if we are talking about SELECT (which probably dont have optimistic parameter, you should change value directly in that write function, which you already doing, right? https://github.com/dingo35/ha-SmartEVSEv3/blob/main/custom_components/smartevse/select.py#L72)

dingo35 commented 1 year ago

Why dont you try it out and, if it works, make a Pull Request out of it?

stevoh6 commented 1 year ago

I will np, just im new in this project and ha integrations, so im asking first, gathering info :)