Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions custom_components/sat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,11 @@ async def async_set_target_temperature(self, temperature: float, cascade: bool =
data = {ATTR_ENTITY_ID: entity_id, ATTR_TEMPERATURE: temperature}
await self.hass.services.async_call(CLIMATE_DOMAIN, SERVICE_SET_TEMPERATURE, data, blocking=True)

# Set the target temperature for the connected boiler
# Set the target temperature for the connected boiler / thermostat
if self._config.push_setpoint_to_thermostat:
if self._config.thermostat is not None:
data = {ATTR_ENTITY_ID: self._config.thermostat, ATTR_TEMPERATURE: temperature}
await self.hass.services.async_call(CLIMATE_DOMAIN, SERVICE_SET_TEMPERATURE, data)
await self._coordinator.async_set_control_thermostat_setpoint(temperature)

# Reset the climate
Expand Down Expand Up @@ -683,7 +686,17 @@ def _get_entity_state_float(self, entity_id: str) -> Optional[float]:
if entity.state in [STATE_UNKNOWN, STATE_UNAVAILABLE]:
return None

return float(entity.state)
if entity.domain == "climate" or "current_temperature" in entity.attributes:
if (curr_temp := entity.attributes.get("current_temperature")) is not None:
try:
return float(curr_temp)
except (ValueError, TypeError):
pass

try:
return float(entity.state)
except (ValueError, TypeError):
return None

def _update_heating_curves(self) -> None:
"""Update the heating curves based on the current outside temperature."""
Expand Down