AstraMeter
AstraMeter copied to clipboard
Min Charge Power / Min Discharge Power per battery for multiple batteries causes a loop
What's the issue?
When setting the min charge power and min discharge power causes astrameter to bounce between the batteries only to discover the demand is too low. See logs.
Of course the issue was that the demand was around my set min charge power
Version
2.5.0
Installation method
Home Assistant add-on
If "Other", which?
No response
Configuration
[GENERAL]
DEVICE_TYPE = ct003
SKIP_POWERMETER_TEST = false
THROTTLE_INTERVAL = 0
WAIT_FOR_NEXT_MESSAGE = false
DEADBAND = 0
SMOOTH_TARGET_ALPHA = 0
MAX_SMOOTH_STEP = 0
DASHBOARD_ALLOW_WRITE = True
[CT003]
ACTIVE_CONTROL = true
BALANCE_DEADBAND = 50
BALANCE_GAIN = 0.40
PACE_BASE_STEP = 0
PACE_MAX_STEP = 0
MAX_CORRECTION_PER_STEP = 300
FAIR_DISTRIBUTION = true
EFFICIENCY_ROTATION_INTERVAL = 28800
EFFICIENCY_FADE_ALPHA = 0.8
EFFICIENCY_SATURATION_THRESHOLD = 0.4
SATURATION_DETECTION = true
SATURATION_ALPHA = 0.5
MIN_TARGET_FOR_SATURATION = 25
CT_MAC = redacted
UDP_PORT = 12345
WIFI_RSSI = -38
DEDUPE_TIME_WINDOW = 0
CONSUMER_TTL = 120
SATURATION_GRACE_SECONDS = 90
SATURATION_STALL_TIMEOUT_SECONDS = 60
SATURATION_DECAY_FACTOR = 0.995
MIN_EFFICIENT_CHARGE_POWER = 800
MIN_EFFICIENT_DISCHARGE_POWER = 600
[HOMEWIZARD]
IP = redacted
TOKEN = redacted
SERIAL = 5c2faf10c316
POWER_OFFSET = 0, 0, 0
POWER_MULTIPLIER = 1, 1, 1
[MQTT_INSIGHTS]
BROKER = core-mosquitto
PORT = 1883
USERNAME = redacted
PASSWORD = redacted
TLS = false
BASE_TOPIC = astrameter
HA_DISCOVERY = true
HA_DISCOVERY_PREFIX = homeassistant
MARSTEK_MQTT_ENABLED = false
[MARSTEK]
ENABLE = true
MAILBOX = redacted
PASSWORD = redacted
Logs
2026-11-04 13:54:02 INFO:astrameter:Efficiency: probe succeeded for bc2a3314c6bc at -105W
2026-11-04 13:54:04 INFO:astrameter:bc2a3314c6bc idles: its share is below its minimum power
2026-11-04 13:54:07 INFO:astrameter:bc2a3314c6bc resumes above its minimum power
2026-11-04 13:55:14 INFO:astrameter:bc2a3314c6bc idles: its share is below its minimum power
2026-11-04 13:55:17 INFO:astrameter:bc2a3314c6bc resumes above its minimum power
2026-11-04 13:55:19 INFO:astrameter:Efficiency: bc2a3314c6bc cannot follow target (sat=0.43), rotating to 18cedff579dd
2026-11-04 13:55:19 INFO:astrameter:Efficiency: probing consumer 18cedff579dd with backups ['bc2a3314c6bc'] until 90.0s
2026-11-04 13:55:19 INFO:astrameter:Efficiency: deprioritizing consumer bc2a3314c6bc (demand 420W, 1 active)
2026-11-04 13:55:19 INFO:astrameter:Efficiency: activating consumer 18cedff579dd (demand 420W, 1 active)
2026-11-04 13:55:34 INFO:astrameter:Efficiency: probe succeeded for 18cedff579dd at 48W
2026-11-04 13:55:36 INFO:astrameter:18cedff579dd idles: its share is below its minimum power
2026-11-04 13:55:37 INFO:astrameter:18cedff579dd resumes above its minimum power
2026-11-04 13:55:42 INFO:astrameter:18cedff579dd idles: its share is below its minimum power
2026-11-04 13:55:43 INFO:astrameter:18cedff579dd resumes above its minimum power
2026-11-04 13:56:14 INFO:astrameter:18cedff579dd idles: its share is below its minimum power
2026-11-04 13:56:40 INFO:astrameter:18cedff579dd resumes above its minimum power
2026-11-04 13:56:41 INFO:astrameter:Efficiency: 18cedff579dd cannot follow target (sat=0.53), rotating to bc2a3314c6bc
2026-11-04 13:56:41 INFO:astrameter:Efficiency: probing consumer bc2a3314c6bc with backups ['18cedff579dd'] until 90.0s
2026-11-04 13:56:41 INFO:astrameter:Efficiency: deprioritizing consumer 18cedff579dd (demand 151W, 1 active)
2026-11-04 13:56:41 INFO:astrameter:Efficiency: activating consumer bc2a3314c6bc (demand 151W, 1 active)
2026-11-04 13:56:45 INFO:astrameter:Efficiency: probe succeeded for bc2a3314c6bc at -40W
2026-11-04 13:57:22 INFO:astrameter:Efficiency: 18cedff579dd takes the overflow of the batteries ahead
2026-11-04 13:57:25 INFO:astrameter:bc2a3314c6bc idles: its share is below its minimum power
2026-11-04 13:57:26 INFO:astrameter:bc2a3314c6bc resumes above its minimum power
2026-11-04 13:57:28 INFO:astrameter:bc2a3314c6bc idles: its share is below its minimum power
2026-11-04 13:58:25 INFO:astrameter:bc2a3314c6bc resumes above its minimum power
2026-11-04 13:58:26 INFO:astrameter:Efficiency: bc2a3314c6bc cannot follow target (sat=0.43), rotating to 18cedff579dd
2026-11-04 13:58:26 INFO:astrameter:Efficiency: probing consumer 18cedff579dd with backups ['bc2a3314c6bc'] until 90.0s
2026-11-04 13:58:26 INFO:astrameter:Efficiency: deprioritizing consumer bc2a3314c6bc (demand 250W, 1 active)
2026-11-04 13:58:26 INFO:astrameter:Efficiency: activating consumer 18cedff579dd (demand 250W, 1 active)
2026-11-04 13:58:31 INFO:astrameter:Efficiency: probe succeeded for 18cedff579dd at -55W
2026-11-04 13:58:34 INFO:astrameter:18cedff579dd idles: its share is below its minimum power
2026-11-04 13:58:38 INFO:astrameter:18cedff579dd resumes above its minimum power
2026-11-04 13:58:40 INFO:astrameter:Efficiency: 18cedff579dd cannot follow target (sat=0.43), rotating to bc2a3314c6bc
2026-11-04 13:58:40 INFO:astrameter:Efficiency: probing consumer bc2a3314c6bc with backups ['18cedff579dd'] until 90.0s
2026-11-04 13:58:40 INFO:astrameter:Efficiency: deprioritizing consumer 18cedff579dd (demand 281W, 1 active)
2026-11-04 13:58:40 INFO:astrameter:Efficiency: activating consumer bc2a3314c6bc (demand 281W, 1 active)
2026-11-04 13:58:48 INFO:astrameter:Efficiency: probe succeeded for bc2a3314c6bc at -58W
2026-11-04 13:58:50 INFO:astrameter:bc2a3314c6bc idles: its share is below its minimum power
2026-11-04 13:58:51 INFO:astrameter:bc2a3314c6bc resumes above its minimum power
2026-11-04 13:59:09 INFO:astrameter:bc2a3314c6bc idles: its share is below its minimum power
2026-11-04 13:59:29 INFO:astrameter:bc2a3314c6bc resumes above its minimum power
2026-11-04 13:59:29 INFO:astrameter:Efficiency: bc2a3314c6bc cannot follow target (sat=0.43), rotating to 18cedff579dd
2026-11-04 13:59:29 INFO:astrameter:Efficiency: probing consumer 18cedff579dd with backups ['bc2a3314c6bc'] until 90.0s
2026-11-04 13:59:29 INFO:astrameter:Efficiency: deprioritizing consumer bc2a3314c6bc (demand 222W, 1 active)
2026-11-04 13:59:29 INFO:astrameter:Efficiency: activating consumer 18cedff579dd (demand 222W, 1 active)
2026-11-04 13:59:35 INFO:astrameter:Efficiency: probe succeeded for 18cedff579dd at -47W
2026-11-04 13:59:36 INFO:astrameter:18cedff579dd idles: its share is below its minimum power
2026-11-04 13:59:41 INFO:astrameter:18cedff579dd resumes above its minimum power
2026-11-04 13:59:42 INFO:astrameter:Efficiency: 18cedff579dd cannot follow target (sat=0.43), rotating to bc2a3314c6bc
2026-11-04 13:59:42 INFO:astrameter:Efficiency: probing consumer bc2a3314c6bc with backups ['18cedff579dd'] until 90.0s
2026-11-04 13:59:42 INFO:astrameter:Efficiency: deprioritizing consumer 18cedff579dd (demand 230W, 1 active)
2026-11-04 13:59:42 INFO:astrameter:Efficiency: activating consumer bc2a3314c6bc (demand 230W, 1 active)
2026-11-04 13:59:51 INFO:astrameter:Efficiency: probe succeeded for bc2a3314c6bc at -43W
2026-11-04 13:59:53 INFO:astrameter:bc2a3314c6bc idles: its share is below its minimum power
2026-11-04 14:01:14 INFO:astrameter:bc2a3314c6bc resumes above its minimum power
2026-11-04 14:01:15 INFO:astrameter:Efficiency: bc2a3314c6bc cannot follow target (sat=0.43), rotating to 18cedff579dd
2026-11-04 14:01:15 INFO:astrameter:Efficiency: probing consumer 18cedff579dd with backups ['bc2a3314c6bc'] until 90.0s
2026-11-04 14:01:15 INFO:astrameter:Efficiency: deprioritizing consumer bc2a3314c6bc (demand 223W, 1 active)
2026-11-04 14:01:15 INFO:astrameter:Efficiency: activating consumer 18cedff579dd (demand 223W, 1 active)
2026-11-04 14:01:19 INFO:astrameter:Efficiency: probe succeeded for 18cedff579dd at -49W
2026-11-04 14:01:21 INFO:astrameter:18cedff579dd idles: its share is below its minimum power
2026-11-04 14:01:25 INFO:astrameter:18cedff579dd resumes above its minimum power
2026-11-04 14:01:26 INFO:astrameter:Efficiency: 18cedff579dd cannot follow target (sat=0.43), rotating to bc2a3314c6bc
2026-11-04 14:01:26 INFO:astrameter:Efficiency: probing consumer bc2a3314c6bc with backups ['18cedff579dd'] until 90.0s
2026-11-04 14:01:26 INFO:astrameter:Efficiency: deprioritizing consumer 18cedff579dd (demand 191W, 1 active)
2026-11-04 14:01:26 INFO:astrameter:Efficiency: activating consumer bc2a3314c6bc (demand 191W, 1 active)
2026-11-04 14:01:39 INFO:astrameter:Efficiency: probe succeeded for bc2a3314c6bc at -34W
2026-11-04 14:02:42 INFO:astrameter:bc2a3314c6bc idles: its share is below its minimum power
2026-11-04 14:02:43 INFO:astrameter:bc2a3314c6bc resumes above its minimum power
2026-11-04 14:02:45 INFO:astrameter:bc2a3314c6bc idles: its share is below its minimum power
2026-11-04 14:02:48 INFO:astrameter:bc2a3314c6bc resumes above its minimum power
2026-11-04 14:02:49 INFO:astrameter:Efficiency: bc2a3314c6bc cannot follow target (sat=0.43), rotating to 18cedff579dd
2026-11-04 14:02:49 INFO:astrameter:Efficiency: probing consumer 18cedff579dd with backups ['bc2a3314c6bc'] until 90.0s
2026-11-04 14:02:49 INFO:astrameter:Efficiency: deprioritizing consumer bc2a3314c6bc (demand 366W, 1 active)
2026-11-04 14:02:49 INFO:astrameter:Efficiency: activating consumer 18cedff579dd (demand 366W, 1 active)
2026-11-04 14:02:53 INFO:astrameter:Efficiency: probe succeeded for 18cedff579dd at -49W
2026-11-04 14:03:13 INFO:astrameter:18cedff579dd idles: its share is below its minimum power
2026-11-04 14:03:15 INFO:astrameter:18cedff579dd resumes above its minimum power
2026-11-04 14:03:19 INFO:astrameter:18cedff579dd idles: its share is below its minimum power
2026-11-04 14:03:21 INFO:astrameter:18cedff579dd resumes above its minimum power
2026-11-04 14:03:22 INFO:astrameter:Efficiency: 18cedff579dd cannot follow target (sat=0.43), rotating to bc2a3314c6bc
2026-11-04 14:03:22 INFO:astrameter:Efficiency: probing consumer bc2a3314c6bc with backups ['18cedff579dd'] until 90.0s
2026-11-04 14:03:22 INFO:astrameter:Efficiency: deprioritizing consumer 18cedff579dd (demand 359W, 1 active)
2026-11-04 14:03:22 INFO:astrameter:Efficiency: activating consumer bc2a3314c6bc (demand 359W, 1 active)
2026-11-04 14:03:26 INFO:astrameter:Efficiency: probe succeeded for bc2a3314c6bc at -29W
2026-11-04 14:03:29 INFO:astrameter:bc2a3314c6bc idles: its share is below its minimum power
2026-11-04 14:03:31 INFO:astrameter:bc2a3314c6bc resumes above its minimum power
2026-11-04 14:03:34 INFO:astrameter:Efficiency: bc2a3314c6bc cannot follow target (sat=0.43), rotating to 18cedff579dd
2026-11-04 14:03:34 INFO:astrameter:Efficiency: probing consumer 18cedff579dd with backups ['bc2a3314c6bc'] until 90.0s
2026-11-04 14:03:34 INFO:astrameter:Efficiency: deprioritizing consumer bc2a3314c6bc (demand 377W, 1 active)
2026-11-04 14:03:34 INFO:astrameter:Efficiency: activating consumer 18cedff579dd (demand 377W, 1 active)
2026-11-04 14:03:41 INFO:astrameter:Efficiency: probe succeeded for 18cedff579dd at -32W
2026-11-04 14:03:43 INFO:astrameter:18cedff579dd idles: its share is below its minimum power
Also... The general min charge power and min discharge power are useless. The per battery settings in dashboard are defaulted to 0
def _min_power(self, report: ConsumerReport, sign: int) -> float:
"""The least *report*'s battery may run at in direction *sign* (W).
Its own MIN_CHARGE_POWER / MIN_DISCHARGE_POWER override wins over the
global one; 0 means no minimum.
"""
if sign > 0:
own, default = report.min_discharge_power, self._cfg.min_discharge_power
elif sign < 0:
own, default = report.min_charge_power, self._cfg.min_charge_power
else:
return 0.0
return default if own is None else own
the value own is never None, when it is defaulted to 0, which takes precedence over the config values.