fix(homeassistant): apply 0 and off from config entities, never add settings

The configuration sync of the Home Assistant adapter skipped every value that is false in
Python, so an entity state of 0 or off never reached the configuration. It also set any
path it was given: the documented example devices/batteries/0/capacity_wh named a device
"0" that does not exist, so EOS silently added a new battery with a random device id.

Apply every value except an unavailable or unknown entity, and only update settings that
exist; report other paths as an error. The example now addresses the battery by its
device_id.

Signed-off-by: SchaafAlexander <86607129+SchaafAlexander@users.noreply.github.com>

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SchaafAlexander
2026-11-11 09:38:45 +01:00
committed by Bobby Noelte
co-authored by Claude Opus 5.5
parent 1fda5f9201
commit 62cbf4cf2a
5 changed files with 126 additions and 12 deletions
+4 -4
View File
@@ -11398,10 +11398,10 @@
}
],
"title": "Config Entity Ids",
"description": "Mapping of EOS config keys to Home Assistant entity IDs.\nThe config key has to be given by a \u2018/\u2019-separated path\ne.g. devices/batteries/0/capacity_wh",
"description": "Mapping of EOS config keys to Home Assistant entity IDs.\nThe config key has to be given by a \u2018/\u2019-separated path\ne.g. devices/batteries/battery1/capacity_wh\nDevices are addressed by their device_id. The setting must exist.",
"examples": [
{
"devices/batteries/0/capacity_wh": "sensor.battery1_capacity"
"devices/batteries/battery1/capacity_wh": "sensor.battery1_capacity"
}
]
},
@@ -11574,10 +11574,10 @@
}
],
"title": "Config Entity Ids",
"description": "Mapping of EOS config keys to Home Assistant entity IDs.\nThe config key has to be given by a \u2018/\u2019-separated path\ne.g. devices/batteries/0/capacity_wh",
"description": "Mapping of EOS config keys to Home Assistant entity IDs.\nThe config key has to be given by a \u2018/\u2019-separated path\ne.g. devices/batteries/battery1/capacity_wh\nDevices are addressed by their device_id. The setting must exist.",
"examples": [
{
"devices/batteries/0/capacity_wh": "sensor.battery1_capacity"
"devices/batteries/battery1/capacity_wh": "sensor.battery1_capacity"
}
]
},