Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easee: validate charger phases #13238

Merged
merged 3 commits into from
Apr 6, 2024
Merged

Easee: validate charger phases #13238

merged 3 commits into from
Apr 6, 2024

Conversation

andig
Copy link
Member

@andig andig commented Mar 31, 2024

Fix #13236

@GrimmiMeloni das Diff sieht nur deshalb so groß aus weil ich die Phasenumschaltung wie bei den anderen Chargern nach unten geschoben habe. Dazu ein paar RW Mutex Zugriffe.

@andig andig added enhancement New feature or request devices Specific device support labels Mar 31, 2024
@andig andig requested a review from GrimmiMeloni March 31, 2024 19:00
Copy link
Collaborator

@GrimmiMeloni GrimmiMeloni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to confirm the correct observationID is read in getPhases(), as we otherwise might break things.

charger/easee.go Outdated
func (c *Easee) GetPhases() (int, error) {
c.mux.RLock()
defer c.mux.RUnlock()
return c.phaseMode, nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich kann es gerade nicht prüfen (frühestens Mittwoch) - aber ich glaube dieser Wert ist statisch und entspricht dem physikalischen Anschluß der Wallbox. Um den "aktuellen" Wert zu erhalten, müßten wir nach meinem Verständnis ObservationID 110 OUTPUT_PHASES lesen.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GrimmiMeloni I think if we change this we should also refactor the Easee a bit. Currently, there are lots of local variables plus obsTime. Imho we should add an obs sync.Map or mutex-guarded map that holds Observations plus a getObs(val any) error method for accessing it. Wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I double checked some recent logs of mine. They confirmed my hunch.
PHASE_MODE stays static (at 2 in my case), whereas OUTPUT_PHASE follows the active phases as controlled by evcc. Noteworthy implementation detail - OUTPUT PHASE values are not 0,1,3 but 0,10,30, so we need to map (or simply div by 10).

I also like the suggested refactoring, but I would rather put this in a separate PR. It will touch a lot of code and would not want to mix this with this feature.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok- then lets add another var here and the reduce all of them separately.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to take this over and do the rest (e.g. local testing, etc.)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible that would be great 👍🏻

@andig andig marked this pull request as draft April 1, 2024 12:37
@andig andig marked this pull request as ready for review April 6, 2024 14:08
charger/easee.go Outdated Show resolved Hide resolved
@andig andig merged commit bb4148b into master Apr 6, 2024
6 checks passed
@andig andig deleted the feat/easee-validate branch April 6, 2024 14:08
@TheFreaker86
Copy link

I can confirm that Easee works now again like intended! thankk you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devices Specific device support enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Easee: validate charger phases
3 participants