ricott / homey-no.easee

Easee app for Homey
GNU General Public License v3.0
5 stars 5 forks source link

Charger status #31

Closed aoeriksen closed 1 year ago

aoeriksen commented 2 years ago

Hi!

I have a flow in Homey which is based upon charger status. Until a couple of days ago when no car was connected and the charger doing nothing the charger status was "Standy" in the Homey app, now it is reporting as "Paused" in the same state. The easee.cloud webpage reports the charger status as "Standby".

ricott commented 2 years ago

Hi!

This is the mapping I use for the charger status, https://github.com/ricott/homey-no.easee/blob/216c1499332a21bb4f98b5da4c8991c26e5045e1/lib/enums.js#L13 I can't tell why that status would be different. Some statuses differ between the Homey app and the Easee cloud webapp. The numerical value returned from the Easee API is converted with the logic on the link above.

DavidDjerf commented 2 years ago

I have similar issues. When I change the state from disabled to enable, the charger starts but the status in the app remain disabled causing issues later on with my flows.

ricott commented 1 year ago

The communication between the charger and Homey is asynchronous with the Easee cloud in between. When you invoke the action enable charger, the Homey app calls the Easee cloud API that responds back stating command accepted. In the Homey app the flow is now done, action invoked successfully.

Easee cloud will then send the command to the charger, which hopefully is online and awake, and it will try to execute the command. The charger will then sync its properties with the Easee cloud, I assume the chargers push changes to the Easee cloud but I'm not sure.

Then the Homey app refreshes the properties values from the Easee cloud on a schedule. Currently each 30 seconds.

With knowledge of the above I hope it is clear that (at least currently) it is not possible to invoke action "Enable charger", and then as an example, immediately a few milliseconds later check if charger is enabled using a condition.

ricott commented 1 year ago

The current version of the app waits and checks if the command sent to the charger was accepted or not, that should solve this problem.