Config: remove more ui-enabled settings (#10982)

This commit is contained in:
andig 2023-12-10 17:24:30 +01:00 • committed by GitHub
parent 1a28912579
commit 3e1dcd3402
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 30 deletions

View file

@ -66,8 +66,6 @@ type Site struct {
ResidualPower float64 `mapstructure:"residualPower"` // PV meter only: household usage. Grid meter: household safety margin
Meters MetersConfig // Meter references
MaxGridSupplyWhileBatteryCharging float64 `mapstructure:"maxGridSupplyWhileBatteryCharging"` // ignore battery charging if AC consumption is above this value
SmartCostLimit float64 `mapstructure:"smartCostLimit"` // always charge if cost is below this value
BatteryDischargeControl bool `mapstructure:"batteryDischargeControl"` // prevent battery discharge for fast and planned charging
// meters
gridMeter api.Meter // Grid usage meter
@ -75,10 +73,14 @@ type Site struct {
batteryMeters []api.Meter // Battery charging meters
auxMeters []api.Meter // Auxiliary meters
// cost settings
smartCostLimit float64 // always charge if cost is below this value
// battery settings
prioritySoc float64 // prefer battery up to this Soc
bufferSoc float64 // continue charging on battery above this Soc
bufferStartSoc float64 // start charging on battery above this Soc
prioritySoc float64 // prefer battery up to this Soc
bufferSoc float64 // continue charging on battery above this Soc
bufferStartSoc float64 // start charging on battery above this Soc
batteryDischargeControl bool // prevent battery discharge for fast and planned charging
tariffs tariff.Tariffs // Tariff
loadpoints []*Loadpoint // Loadpoints
@ -247,7 +249,7 @@ func (site *Site) restoreSettings() error {
}
}
if v, err := settings.Bool(keys.BatteryDischargeControl); err == nil {
site.BatteryDischargeControl = v
site.batteryDischargeControl = v
}
return nil
}
@ -796,7 +798,7 @@ func (site *Site) update(lp Updater) {
site.log.ERROR.Println(err)
}
if batMode := site.GetBatteryMode(); site.BatteryDischargeControl {
if batMode := site.GetBatteryMode(); site.batteryDischargeControl {
if mode := site.determineBatteryMode(site.Loadpoints()); mode != batMode {
if err := site.updateBatteryMode(mode); err != nil {
site.log.ERROR.Println("battery mode:", err)
@ -818,7 +820,7 @@ func (site *Site) prepare() {
site.publish(keys.BufferStartSoc, site.bufferStartSoc)
site.publish(keys.PrioritySoc, site.prioritySoc)
site.publish(keys.ResidualPower, site.ResidualPower)
site.publish(keys.SmartCostLimit, site.SmartCostLimit)
site.publish(keys.SmartCostLimit, site.smartCostLimit)
site.publish(keys.SmartCostType, nil)
site.publish(keys.SmartCostActive, false)
if tariff := site.GetTariff(PlannerTariff); tariff != nil {
@ -826,7 +828,7 @@ func (site *Site) prepare() {
}
site.publish(keys.Currency, site.tariffs.Currency.String())
site.publish(keys.BatteryDischargeControl, site.BatteryDischargeControl)
site.publish(keys.BatteryDischargeControl, site.batteryDischargeControl)
site.publish(keys.BatteryMode, site.batteryMode.String())
if err := site.restoreSettings(); err != nil {

View file

@ -153,24 +153,24 @@ func (site *Site) SetResidualPower(power float64) error {
return nil
}
// GetSmartCostLimit returns the SmartCostLimit
// GetSmartCostLimit returns the smartCostLimit
func (site *Site) GetSmartCostLimit() float64 {
site.RLock()
defer site.RUnlock()
return site.SmartCostLimit
return site.smartCostLimit
}
// SetSmartCostLimit sets the SmartCostLimit
// SetSmartCostLimit sets the smartCostLimit
func (site *Site) SetSmartCostLimit(val float64) error {
site.Lock()
defer site.Unlock()
site.log.DEBUG.Println("set smart cost limit:", val)
if site.SmartCostLimit != val {
site.SmartCostLimit = val
settings.SetFloat(keys.SmartCostLimit, site.SmartCostLimit)
site.publish(keys.SmartCostLimit, site.SmartCostLimit)
if site.smartCostLimit != val {
site.smartCostLimit = val
settings.SetFloat(keys.SmartCostLimit, site.smartCostLimit)
site.publish(keys.SmartCostLimit, site.smartCostLimit)
}
return nil
@ -216,7 +216,7 @@ func (site *Site) GetTariff(tariff string) api.Tariff {
func (site *Site) GetBatteryDischargeControl() bool {
site.Lock()
defer site.Unlock()
return site.BatteryDischargeControl
return site.batteryDischargeControl
}
// SetBatteryControl sets the battery control mode
@ -234,7 +234,7 @@ func (site *Site) SetBatteryDischargeControl(val bool) error {
site.Lock()
defer site.Unlock()
site.BatteryDischargeControl = val
site.batteryDischargeControl = val
settings.SetBool(keys.BatteryDischargeControl, val)
site.publish(keys.BatteryDischargeControl, val)
}

View file

@ -110,20 +110,14 @@ site:
aux:
- aux # list of auxiliary meters for adjusting grid operating point
residualPower: 0 # additional household usage margin
prioritySoc: 0 # give home battery priority up to this soc (empty to disable)
bufferSoc: 0 # continue charging on battery above soc (0 to disable)
bufferStartSoc: 0 # start charging on battery above soc (0 to disable)
maxGridSupplyWhileBatteryCharging: 0 # ignore battery charging if AC consumption is above this value
smartCostLimit: 0 # set cost limit for automatic charging in PV mode
# loadpoint describes the charger, charge meter and connected vehicle
loadpoints:
- title: Garage # display name for UI
charger: wallbe # charger
meter: charge # charge meter
mode: "off" # set default charge mode, use "off" to disable by default if charger is publicly available
# vehicle: car1 # set default vehicle (disables vehicle detection)
resetOnDisconnect: true # set defaults when vehicle disconnects
mode: "off" # default charge mode to apply when vehicle is disconnected; use "off" to disable by default if charger is publicly available
phases: 3 # electrical connection (normal charger: default 3 for 3 phase, 1p3p charger: 0 for "auto" or 1/3 for fixed phases)
minCurrent: 6 # minimum charge current (default 6A)
maxCurrent: 16 # maximum charge current (default 16A)

View file

@ -180,8 +180,16 @@
"minItems": 1,
"uniqueItems": true
},
"smart": {
"type": "string"
"aux": {
"description": "Auxiliary meters (0 or more)",
"type": [
"string",
"array"
],
"items": {
"type": "string"
},
"uniqueItems": true
}
}
},
@ -208,9 +216,6 @@
"mode": {
"$ref": "#/definitions/mode"
},
"resetOnDisconnect": {
"type": "boolean"
},
"charger": {
"type": "string"
},