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
@@ -148,6 +148,11 @@ by Home Assistant integrations, such as:
These values are typically consumed by EOS **device simulations** during optimisation.
The configuration key is the `/`-separated path of the setting. Devices are addressed by their
`device_id`, e.g. `devices/batteries/battery1/capacity_wh`. Only existing settings are updated: a
path that names no setting, e.g. a device that is not configured, is reported as an error in the
EOS log. An entity that is unavailable or unknown leaves the configured value unchanged.
### 3.2 Device measurement entity IDs
EOS retrieves **measurement values** that describe the *current state* of devices, such as:
@@ -179,7 +184,7 @@ EOS value:
* **Boolean `True`**: `["y", "yes", "on", "true", "home", "open"]`
* **Boolean `False`**: `["n", "no", "off", "false", "closed"]`
* **`None`**: `["unavailable", "none"]`
* **`None`**: `["unavailable", "unknown", "none"]`
* **`float`**: if the value can be converted to a floating-point number
* **`str`**: if none of the above apply