@@ -1291,6 +1291,9 @@ def automatic_config(self):
12911291 discharge_enable_entities = []
12921292 export_limit_entities = []
12931293 inverter_limit_entities = []
1294+ battery_scaling_entities = []
1295+ battery_rate_max_entities = []
1296+ inverter_time_entities = []
12941297
12951298 for inv in inverters :
12961299 suffix = inv .serial [- 6 :].lower ()
@@ -1323,6 +1326,10 @@ def automatic_config(self):
13231326 self .log (f"Warn: GatewayMQTT: inverter { inv .serial } has no battery capacity, setting to None for automatic discovery" )
13241327
13251328 inverter_limit_entities .append (f"sensor.{ base } _inverter_rate_max" )
1329+ battery_scaling_entities .append (f"sensor.{ base } _battery_dod" )
1330+ battery_rate_max_entities .append (f"sensor.{ base } _battery_rate_max" )
1331+ # Clock drift detection — uses GatewayStatus.timestamp
1332+ inverter_time_entities .append (f"sensor.{ base } _inverter_time" )
13261333
13271334 # Map entity lists to PredBat args
13281335 self .set_arg ("soc_percent" , soc_entities )
@@ -1355,13 +1362,11 @@ def automatic_config(self):
13551362
13561363 # Battery health (first inverter)
13571364 self .set_arg ("battery_temperature_history" , f"sensor.{ base0 } _battery_temperature" )
1358- self .set_arg ("battery_scaling" , [f"sensor.{ base0 } _battery_dod" ])
13591365
1360- # Battery rate max
1361- self .set_arg ("battery_rate_max" , [f"sensor.{ base0 } _battery_rate_max" ])
1362-
1363- # Inverter time (clock drift detection — uses GatewayStatus.timestamp)
1364- self .set_arg ("inverter_time" , [f"sensor.{ base0 } _inverter_time" ])
1366+ # Per-inverter: inverter.py reads these at index=self.id, so each needs one entry per inverter
1367+ self .set_arg ("battery_scaling" , battery_scaling_entities )
1368+ self .set_arg ("battery_rate_max" , battery_rate_max_entities )
1369+ self .set_arg ("inverter_time" , inverter_time_entities )
13651370
13661371 # EMS aggregate entities (GivEnergy EMS only)
13671372 inv0 = inverters [0 ]
0 commit comments