Skip to content

feat(smartir): power consumption feedback and retries#1540

Open
jmcaracoche wants to merge 1 commit intosmartHomeHub:masterfrom
jmcaracoche:feature/power-consumption-feedback-retries-and-optimistic-climate-state
Open

feat(smartir): power consumption feedback and retries#1540
jmcaracoche wants to merge 1 commit intosmartHomeHub:masterfrom
jmcaracoche:feature/power-consumption-feedback-retries-and-optimistic-climate-state

Conversation

@jmcaracoche
Copy link
Copy Markdown

Problem

  • Binary power_sensor only works when the monitor exposes strict on/off. Many setups use a watt sensor on a plug or Zigbee energy reporting.
  • IR can be missed; a single send may not match physical load until retried.

What this adds

  • Optional power_consumption_sensor (+ threshold + W/kW handling) on climate, fan, light, and media_player when power_sensor is not set (binary wins if both).
  • Shared custom_components/smartir/power_feedback.py for watt parsing, threshold mapping, and exponential-backoff retry after sends when feedback mismatches desired on/off (configurable retry count and delays).
  • Climate: optimistic UI (write HA state before awaiting IR/retry) and defer consumption-driven _apply_effective_power while send+retries run so the card does not flip off while power is still ramping or IR is retried.
  • manifest.json updater files includes power_feedback.py for HACS-style updates.

Docs

  • Configuration tables aligned with CLIMATE style; consumption + retry examples for all platforms.

Benefit

  • Keeps entity state aligned with real device load using common energy sensors.
  • Reduces stuck UI vs reality after missed IR via bounded retries.

Problem
- Binary power_sensor only works when the monitor exposes strict on/off.
  Many setups use a watt sensor on a plug or Zigbee energy reporting.
- IR can be missed; a single send may not match physical load until retried.

What this adds
- Optional power_consumption_sensor (+ threshold + W/kW handling) on climate,
  fan, light, and media_player when power_sensor is not set (binary wins if both).
- Shared custom_components/smartir/power_feedback.py for watt parsing, threshold
  mapping, and exponential-backoff retry after sends when feedback mismatches
  desired on/off (configurable retry count and delays).
- Climate: optimistic UI (write HA state before awaiting IR/retry) and defer
  consumption-driven _apply_effective_power while send+retries run so the card
  does not flip off while power is still ramping or IR is retried.
- manifest.json updater files includes power_feedback.py for HACS-style
  updates.

Docs
- Configuration tables aligned with CLIMATE style; consumption + retry examples
  for all platforms.

Benefit
- Keeps entity state aligned with real device load using common energy sensors.
- Reduces stuck UI vs reality after missed IR via bounded retries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant