Skip to content

Commit

Permalink
EEbus: only disable recommendations if available (#15829)
Browse files Browse the repository at this point in the history
Some EEBUS wallboxes like the PCMP do report the OSCEV usecase to be available, but it doesn’t provide the necessary recommendation limit data.

This change adds checks for this case.
  • Loading branch information
DerAndereAndi authored Sep 1, 2024
1 parent 6a3aeb2 commit 095fa42
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions charger/eebus.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,13 @@ func (c *EEBus) writeCurrentLimitData(evEntity spineapi.EntityRemoteInterface, c
}

// make sure the recommendations are inactive, otherwise the EV won't go to sleep
if err := c.disableLimits(evEntity, c.uc.OscEV); err != nil {
return err
// but only if it supports OSCEV and has required data!
if c.uc.OscEV.IsScenarioAvailableAtEntity(evEntity, 1) {
if _, err := c.uc.OscEV.LoadControlLimits(evEntity); err == nil {
if err := c.disableLimits(evEntity, c.uc.OscEV); err != nil {
return err
}
}
}

// set overload protection limits
Expand Down Expand Up @@ -419,6 +424,11 @@ func (c *EEBus) writeLoadControlLimitsVASVW(evEntity spineapi.EntityRemoteInterf
return false
}

// OSCEV requires recommendation limits to be available
if _, err := c.uc.OscEV.LoadControlLimits(evEntity); err != nil {
return false
}

// on OSCEV all limits have to be active except they are set to the default value
minLimits, _, _, err := c.uc.OscEV.CurrentLimits(evEntity)
if err != nil {
Expand Down

0 comments on commit 095fa42

Please sign in to comment.