diff --git a/charger/eebus.go b/charger/eebus.go index d570d827f..dda77c191 100644 --- a/charger/eebus.go +++ b/charger/eebus.go @@ -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 @@ -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 {