Skip to content

fix(climate): forward setpoint to configured thermostat and support climate entities in sensor reading - #191

Open
StefanoPierini wants to merge 1 commit into
Alexwijn:releases/thermo-novafrom
StefanoPierini:fix-push-setpoint-to-thermostat
Open

StefanoPierini wants to merge 1 commit into
Alexwijn:releases/thermo-novafrom
StefanoPierini:fix-push-setpoint-to-thermostat

Conversation

@StefanoPierini

Copy link
Copy Markdown

Summary of Changes

This PR addresses two related issues when using a secondary/physical thermostat entity (climate.*, e.g. ESPHome, Zigbee, or smart wall thermostats) with SAT:

  1. Forward target temperature to connected thermostat entity:
    When push_setpoint_to_thermostat is enabled, async_set_temperature previously only called self._coordinator.async_set_control_thermostat_setpoint(temperature). For coordinators without native bus thermostat control or when an external Home Assistant climate entity is configured (self._config.thermostat), the target temperature was never forwarded to that entity.

    • Fix: Call climate.set_temperature for self._config.thermostat if configured, ensuring external thermostats stay in sync when SAT changes its setpoint.
  2. Handle climate entities in _get_entity_state_float:
    When a user configures a climate entity as an indoor temperature sensor (e.g. using the thermostat's built-in room temperature sensor), _get_entity_state_float attempted to execute float(entity.state). In Home Assistant, a climate entity's state represents its HVAC mode (heat, off, idle, etc.), causing a ValueError: could not convert string to float and breaking temperature readings.

    • Fix: If the entity belongs to the climate domain or contains a current_temperature attribute, safely extract that numeric attribute first before falling back to entity.state.

Changes Made

  • custom_components/sat/climate.py:
    • In async_set_temperature(): invoke climate.set_temperature on self._config.thermostat when push_setpoint_to_thermostat is true.
    • In _get_entity_state_float(): inspect entity.domain == "climate" / current_temperature attribute and extract temperature safely.

Testing

  • Tested with an ESPHome-based room thermostat entity configured both as the connected thermostat and temperature sensor.
  • Verified that setpoint adjustments in SAT cascade properly to the physical thermostat display without crashing the float converter on HVAC state changes.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 1
  • master

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f63afce8-5650-455a-ab7e-b58aa18e802b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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