Skip to content

feat(engine,power_meter): regulator opening sensor + always-poll refactor - #162

Closed
XavierBerger wants to merge 3 commits into
mainfrom
feat/regulator_opening_refactor
Closed

feat(engine,power_meter): regulator opening sensor + always-poll refactor#162
XavierBerger wants to merge 3 commits into
mainfrom
feat/regulator_opening_refactor

Conversation

@XavierBerger

@XavierBerger XavierBerger commented Aug 13, 2026

Copy link
Copy Markdown
Member

No description provided.

Xavier Berger and others added 3 commits August 13, 2026 21:01
Adds a shared "Regulator Opening Sensor" template sensor to
`engine_common.yaml` so every engine variant surfaces the current
regulator opening (%) in Home Assistant graphs. The sensor mirrors
`id(regulator_opening)` on a 5 s update cadence.

To make the sensor actually update on the 1-switch variant, this
commit also declares the `regulator_opening` template number in
`engine_1switch.yaml` and drives it from the `router_level` on_value
handler — same pattern engine_1dimmer.yaml already uses at :48-50. On
this variant the router is either fully open (100 %) or fully closed
(0 %), so the number uses `mode: box` with `step: 100`; a slider would
only be reachable at its endpoints.

Without this wiring the sensor would read 0 forever on the 1-switch
variant, which was the case in the original feature commit.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Converts every power_meter_*.yaml from the YAML-merge include syntax
(`<<: !include`) to the modern `packages:` include, and removes the
`if id(power_meter_activated) != 0` guard around each meter's
`power_meter_source` script so the meter reports live data to Home
Assistant even while the Solar Router's `activate` switch is off. The
engine still only acts on real_power when `activate` is on.

The uniform refactor covers all six meter variants — fronius,
shelly_em, shelly_em3, proxy_client, jsy-mk-194t, home_assistant.

Meter-specific notes:

- power_meter_home_assistant.yaml: because both this file and
  power_meter_common.yaml would now define `real_power`/`consumption`
  under `packages:`, the HA-imported sensors are renamed to
  `real_power_reader` / `consumption_reader` (marked `internal: True`
  to hide the duplicates from HA) and forward their values into the
  common template sensors via an `on_value` lambda. A `min_version:
  2025.5.0` is pinned since the new include syntax requires it.

- power_meter_shelly_em3.yaml: drops the previously required re-
  declarations of `real_power` / `consumption` (the `<<:` merge only
  kept the first `sensor:` key so the common template sensors were
  never instantiated). The obsolete comment about that limitation is
  removed. Substitutions are trimmed to the shelly-specific overrides,
  since `packages:` correctly propagates the defaults from common.

- power_meter_proxy_client.yaml: `min_version` bumped from 2024.11.1
  to 2025.5.0 to match the include syntax requirement.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Aligns temperature_limiter_DS18B20.yaml and
temperature_limiter_home_assistant.yaml with the same include-syntax
change already applied to every power_meter_*.yaml: replaces
`<<: !include temperature_limiter_common.yaml` with a `packages:`
block, and pins `esphome.min_version: 2025.5.0` since the merge-map
form of `!include` was retired in newer ESPHome releases.

Also fixes a typo in the header comment
(temperaturewer → temperature).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hacf-fr hacf-fr locked and limited conversation to collaborators Aug 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant