feat(smartir): power consumption feedback and retries#1540
Open
jmcaracoche wants to merge 1 commit intosmartHomeHub:masterfrom
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
What this adds
Docs
Benefit