Vaillant: re-boost hot water every 15m (#20752)
This commit is contained in:
parent
9511d4e60c
commit
a33cf0ba35
1 changed files with 29 additions and 1 deletions
|
|
@ -93,18 +93,46 @@ func NewVaillantFromConfig(ctx context.Context, other map[string]interface{}) (a
|
|||
systemId := homes[0].SystemID
|
||||
heating := cc.HeatingSetpoint > 0
|
||||
|
||||
wwCancel := func() {}
|
||||
|
||||
set := func(mode int64) error {
|
||||
switch mode {
|
||||
case Normal:
|
||||
if heating {
|
||||
return conn.StopZoneQuickVeto(systemId, cc.HeatingZone)
|
||||
}
|
||||
|
||||
wwCancel()
|
||||
return conn.StopHotWaterBoost(systemId, sensonet.HOTWATERINDEX_DEFAULT)
|
||||
|
||||
case Boost:
|
||||
if heating {
|
||||
return conn.StartZoneQuickVeto(systemId, cc.HeatingZone, cc.HeatingSetpoint, 4) // hours
|
||||
}
|
||||
return conn.StartHotWaterBoost(systemId, sensonet.HOTWATERINDEX_DEFAULT) // zone 255
|
||||
|
||||
if err := conn.StartHotWaterBoost(systemId, sensonet.HOTWATERINDEX_DEFAULT); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var wwCtx context.Context
|
||||
wwCtx, wwCancel = context.WithCancel(ctx)
|
||||
|
||||
// re-boost every 15m
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-wwCtx.Done():
|
||||
return
|
||||
case <-time.After(15 * time.Minute):
|
||||
if err := conn.StartHotWaterBoost(systemId, sensonet.HOTWATERINDEX_DEFAULT); err != nil {
|
||||
log.ERROR.Println("hot water boost:", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
return nil
|
||||
|
||||
default:
|
||||
return api.ErrNotAvailable
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue