Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix climate temperature range checking does not support customization of ranges #126924

Closed
wants to merge 7 commits into from

Conversation

PeteRager
Copy link
Contributor

Proposed change

PR #118649 introduced validation of climate temperature ranges in the climate platform. Prior to this change, the limits were enforced in the UI and optionally in the integration. The climate min and max temperature ranges may be overridden using customize - this change updates the validation code to take this into account.

Here is a simple example using the generic thermostat. The min limit that should be checked should be 40.

input_boolean:
 study_heater:
    name: study_heater

input_number:
  study_temperature:
    min: 0
    max: 80
    step: 1
    unit_of_measurement: "°F"
    mode: box


climate:
  - platform: generic_thermostat
    name: study
    heater: input_boolean.study_heater
    target_sensor: input_number.study_temperature
    min_temp: 60
    max_temp: 80
    ac_mode: false
    target_temp: 17
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 5
    keep_alive:
      minutes: 3
    initial_hvac_mode: "off"
    away_temp: 16

homeassistant:
  customize:
    climate.study:
      min_temp: 40    

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (climate) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of climate can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign climate Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@PeteRager PeteRager marked this pull request as draft September 27, 2024 13:49
@balloob
Copy link
Member

balloob commented Sep 27, 2024

Customize is not meant to override any behavior. All features that customize was meant to cover have been migrated to the frontend. We cannot accept this PR.

@balloob balloob closed this Sep 27, 2024
@PeteRager
Copy link
Contributor Author

Alot of people seem to be broken by this change. As far as I can tell there is no way to customize min or max temp from the front end. Open to other suggestions on how to fix. I believe it should be validating against the attributes in the state machine not the attributes reported by the integration.

@frenck
Copy link
Member

frenck commented Sep 27, 2024

As far as I can tell there is no way to customize min or max temp from the front end.

That is correct.

Open to other suggestions on how to fix.

There is nothing to fix, as this is not a feature at this point. If you want to suggest a feature, you should try our Community Forum: Feature Requests.

If you have additional questions, feel free to join our Discord chat server.

Thanks! 👍

../Frenck

@PeteRager
Copy link
Contributor Author

sounds good, was trying to help out as #123612 has been open for a month with no progress. The example using generic_thermostat may not have been optimal. lots of people customize the range of thermostats (zwave, etc.) by using these parameters as not all integrations properly report the min / max range and hence default to the defaults. Before the breaking change in #118649 - all these use cases worked - and now they are broken.

@frenck
Copy link
Member

frenck commented Sep 27, 2024

all these use cases worked

Just because a workaround worked, doesn't make the workaround a valid solution or feature.

../Frenck

@lotan80
Copy link

lotan80 commented Sep 27, 2024

As @PeteRager mentions, customizing max min temp has been a working solution for those thermostats not integrating properly. I've had my Honeywell T6 Zwave thermostat for 5 years w/ customized max min and have been unable to upgrade from 7.4 due to the breaking change mentioned. There are no end-user options available to fix this integration problem that affects numerous thermostats.

@frenck
Copy link
Member

frenck commented Sep 27, 2024

@lotan80 I've understood that part, nevertheless thanks for clarifying. However, that doesn't change the already mentioned above.

../Frenck

@PeteRager
Copy link
Contributor Author

I think I finally understand. Took me a while :-).

If the integration is reporting incorrect min and max limits for the climate entity, the fix is to update the integration to report the correct limits.

So in context of @lotan80 issue with the T6 (i have 4 of these), the correct solution is to update the zwavejs integration to report the correct limits.

@lotan80 - please open an issue for the zwave integration, link it here and i'll start working on it.

@PeteRager
Copy link
Contributor Author

Actually, for the T6 the thermostat does not report it's limits in a standard way, so there is no way for the integration to report them correctly and hence it returns the defaults.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 28, 2024
@PeteRager PeteRager deleted the fix-temperature-range branch November 17, 2024 12:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants