Skip to content

Fix: use valve.open_valve/close_valve for valve entities#312

Open
jkolo wants to merge 1 commit into
ScratMan:masterfrom
jkolo:fix/valve-entity-turn-on-off
Open

Fix: use valve.open_valve/close_valve for valve entities#312
jkolo wants to merge 1 commit into
ScratMan:masterfrom
jkolo:fix/valve-entity-turn-on-off

Conversation

@jkolo

@jkolo jkolo commented Feb 23, 2026

Copy link
Copy Markdown

Summary

  • When a heater/cooler entity is a valve.* entity, _async_heater_turn_on() and _async_heater_turn_off() now call valve.open_valve / valve.close_valve instead of homeassistant.turn_on / homeassistant.turn_off
  • The homeassistant.turn_on/off services do not support valve entities, causing homeassistant.turn_off does not support this entity warnings and no actual valve control
  • Non-valve entities (switches, lights, etc.) continue to use the existing homeassistant.turn_on/off logic unchanged

Problem

When using valve entities as heaters (e.g. floor heating valves from ESPHome), SAT calls homeassistant.turn_on/off which is not supported for the valve domain. This results in:

homeassistant.turn_off does not support this entity valve.heating_controller_bedroom_valve_bedroom

The valve entity is defined with VALVE_DOMAIN = "valve" and proper open_valve/close_valve services exist, but only _async_set_valve_value() uses them — the PWM on/off methods did not.

Test plan

  • Verify valve entities open/close correctly when thermostat activates heating
  • Verify non-valve heater entities (switches) still work unchanged
  • Verify polarity invert still works for non-valve entities
  • Check HA logs for absence of does not support this entity warnings

The _async_heater_turn_on() and _async_heater_turn_off() methods use
homeassistant.turn_on/turn_off services which don't support valve
entities. This causes valve-based heating systems to never be
controlled, with continuous warnings in the HA log:

  "The service homeassistant.turn_off does not support entities
   valve.heatingcontroller_*"

The component already correctly handles valve entities in
_async_set_valve_value() (used in non-PWM mode), but the PWM mode
code path was missing valve support.

This adds valve entity detection (matching the existing pattern in
_async_set_valve_value) to use valve.open_valve/close_valve instead
of homeassistant.turn_on/turn_off for valve.* entities.
@ScratMan

Copy link
Copy Markdown
Owner

Using PWM is only for binary controllers. In order to use valves the PWM should be set to 0.

@jkolo

jkolo commented Feb 25, 2026

Copy link
Copy Markdown
Author

Thanks for the response! I'd like to point out that not all valve entities expose SET_POSITION — according to the HA developer docs, position control is an optional feature (ValveEntityFeature.SET_POSITION). Valves without it are purely binary and only support open_valve / close_valve, making PWM the right approach for controlling heat output.

Of course a template switch could work around this, but it seems unnecessary when the valve entity is already a first-class HA type.

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.

2 participants