Fix: use valve.open_valve/close_valve for valve entities#312
Open
jkolo wants to merge 1 commit into
Open
Conversation
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.
Owner
|
Using PWM is only for binary controllers. In order to use valves the PWM should be set to 0. |
Author
|
Thanks for the response! I'd like to point out that not all valve entities expose Of course a template switch could work around this, but it seems unnecessary when the valve entity is already a first-class HA type. |
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.
Summary
valve.*entity,_async_heater_turn_on()and_async_heater_turn_off()now callvalve.open_valve/valve.close_valveinstead ofhomeassistant.turn_on/homeassistant.turn_offhomeassistant.turn_on/offservices do not support valve entities, causinghomeassistant.turn_off does not support this entitywarnings and no actual valve controlhomeassistant.turn_on/offlogic unchangedProblem
When using valve entities as heaters (e.g. floor heating valves from ESPHome), SAT calls
homeassistant.turn_on/offwhich is not supported for thevalvedomain. This results in:The valve entity is defined with
VALVE_DOMAIN = "valve"and properopen_valve/close_valveservices exist, but only_async_set_valve_value()uses them — the PWM on/off methods did not.Test plan
does not support this entitywarnings