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 fritzbox climate HVAC mode / temperature #25275

Merged
merged 4 commits into from Jul 19, 2019

Conversation

@cgtobi
Copy link
Collaborator

commented Jul 18, 2019

Description:

Set the target temperature according to the reported state.

Related issue (if applicable): fixes #25255

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

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. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
if self._target_temperature in (ON_API_TEMPERATURE,
OFF_API_TEMPERATURE):
return None
if self._target_temperature == ON_API_TEMPERATURE:

This comment has been minimized.

Copy link
@balloob

balloob Jul 18, 2019

Member

I don't know about this. It was already like this before: https://github.com/home-assistant/home-assistant/blob/0.95.0/homeassistant/components/fritzbox/climate.py#L91-L97

Also, this would mean target temp is hardcoded to 30 C?

This comment has been minimized.

Copy link
@pvizeli

pvizeli Jul 18, 2019

Member

Yes, I did not change that code

This comment has been minimized.

Copy link
@cgtobi

cgtobi Jul 18, 2019

Author Collaborator

The way I see it is that 127.0 and 126.5 are magic numbers where 'on' would equal 'boost' and 'off'... well ... 'off'. ;-)
So either it's one of the magic numbers, a temp equal either eco or comfort (which would translate to 'auto') or something else which is 'manual'.

This is from the upstream module:

            return {
                126.5: 'off',
                127.0: 'on',
                self.eco_temperature: 'eco',
                self.comfort_temperature: 'comfort'
            }[self.target_temperature]
        except KeyError:
            return 'manual'

https://github.com/hthiery/python-fritzhome/blob/b9d44918f015b491ed631cbf6e63884f6a25cea2/pyfritzhome/fritzhome.py#L492-L503

This comment has been minimized.

Copy link
@balloob

balloob Jul 18, 2019

Member

But we should not report the magic numbers in our frontend. They are internal and it's not actually the temperature that we want to reach. Imagine looking at your thermostat and it said 125 ;)

This comment has been minimized.

Copy link
@cgtobi

cgtobi Jul 18, 2019

Author Collaborator

It does not, it translates to 30.0/0.0.

This comment has been minimized.

Copy link
@balloob

balloob Jul 18, 2019

Member

But does that make sense ?

This comment has been minimized.

Copy link
@cgtobi

cgtobi Jul 18, 2019

Author Collaborator

Why not? 0.0/30.0 are the values that the upstream module defines as valid range for setting temperature. Those correspond to off/boost in preset terms. To me it makes perfect sense to use that in HA to show what the thermostat is set to and further translate that to the HVAC_MODE, being either off or heat.

See: https://github.com/hthiery/python-fritzhome/blob/b9d44918f015b491ed631cbf6e63884f6a25cea2/pyfritzhome/fritzhome.py#L202-L210

cgtobi added some commits Jul 18, 2019

@pvizeli pvizeli added this to the 0.96.2 milestone Jul 19, 2019

@cgtobi cgtobi closed this Jul 19, 2019

@pvizeli pvizeli removed this from the 0.96.2 milestone Jul 19, 2019

@cgtobi

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 19, 2019

New PR #25291

@cgtobi cgtobi reopened this Jul 19, 2019

@pvizeli pvizeli added this to the 0.96.2 milestone Jul 19, 2019

@pvizeli pvizeli changed the title Set the fritzhome target temperature Fix fritzbox climate HVAC mode / temperature Jul 19, 2019

@pvizeli pvizeli merged commit 1eb66f3 into home-assistant:dev Jul 19, 2019

9 checks passed

CI Build #20190719.14 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python35) Tests PyTest Python35 succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA

@cgtobi cgtobi deleted the cgtobi:climate_fritz_fix branch Jul 19, 2019

balloob added a commit that referenced this pull request Jul 19, 2019

Fix fritzbox climate HVAC mode / temperature (#25275)
* Set the target temperature

* Update tests

* Update tests

* Fix linter complaints
@balloob balloob referenced this pull request Jul 19, 2019

KJonline added a commit to Rendili/home-assistant that referenced this pull request Jul 19, 2019

Merge branch 'dev' of https://github.com/home-assistant/home-assistant
…into hive-splitfiles-testing

* 'dev' of https://github.com/home-assistant/home-assistant: (109 commits)
  Multiroom support for snapcast (home-assistant#24061)
  Turn on device before setting mode (home-assistant#25314)
  Turn on device before setting mode (home-assistant#25314)
  Bumped version to 0.96.2
  Fix plant error when adding new value (home-assistant#25302)
  Fix HM with use wrong datapoint for off (home-assistant#25298)
  [climate] Correct honeywell supported_features (home-assistant#25292)
  Fixed python-wink method names (home-assistant#25285)
  Fix fritzbox climate HVAC mode / temperature (home-assistant#25275)
  Updated frontend to 20190719.0
  Updated frontend to 20190719.0
  Fix plant error when adding new value (home-assistant#25302)
  Fix HM with use wrong datapoint for off (home-assistant#25298)
  [climate] Correct honeywell supported_features (home-assistant#25292)
  Fix fritzbox climate HVAC mode / temperature (home-assistant#25275)
  Fixed python-wink method names (home-assistant#25285)
  Add services to set and remove Simplisafe PINs (home-assistant#25207)
  Add MQTT climate precision (home-assistant#25265)
  Add support for Rainforest Eagle-200 (home-assistant#24919)
  Update azure-pipelines-ci.yml for Azure Pipelines
  ...

# Conflicts:
#	homeassistant/components/hive/climate.py

KJonline added a commit to Rendili/home-assistant that referenced this pull request Jul 19, 2019

Merge branch 'dev' of https://github.com/home-assistant/home-assistant
…into dev

* 'dev' of https://github.com/home-assistant/home-assistant: (112 commits)
  Avoid creating temporary lists (home-assistant#25317)
  Multiroom support for snapcast (home-assistant#24061)
  Turn on device before setting mode (home-assistant#25314)
  Turn on device before setting mode (home-assistant#25314)
  Bumped version to 0.96.2
  Fix plant error when adding new value (home-assistant#25302)
  Fix HM with use wrong datapoint for off (home-assistant#25298)
  [climate] Correct honeywell supported_features (home-assistant#25292)
  Fixed python-wink method names (home-assistant#25285)
  Fix fritzbox climate HVAC mode / temperature (home-assistant#25275)
  Updated frontend to 20190719.0
  Updated frontend to 20190719.0
  Fix plant error when adding new value (home-assistant#25302)
  Fix HM with use wrong datapoint for off (home-assistant#25298)
  [climate] Correct honeywell supported_features (home-assistant#25292)
  Fix fritzbox climate HVAC mode / temperature (home-assistant#25275)
  Fixed python-wink method names (home-assistant#25285)
  Add services to set and remove Simplisafe PINs (home-assistant#25207)
  Add MQTT climate precision (home-assistant#25265)
  Add support for Rainforest Eagle-200 (home-assistant#24919)
  ...

KJonline added a commit to Rendili/home-assistant that referenced this pull request Jul 19, 2019

Merge branch 'master' of https://github.com/home-assistant/home-assis…
…tant

* 'master' of https://github.com/home-assistant/home-assistant: (888 commits)
  Turn on device before setting mode (home-assistant#25314)
  Bumped version to 0.96.2
  Fix plant error when adding new value (home-assistant#25302)
  Fix HM with use wrong datapoint for off (home-assistant#25298)
  [climate] Correct honeywell supported_features (home-assistant#25292)
  Fixed python-wink method names (home-assistant#25285)
  Fix fritzbox climate HVAC mode / temperature (home-assistant#25275)
  Updated frontend to 20190719.0
  Update azure-pipelines-ci.yml for Azure Pipelines
  Bumped version to 0.96.1
  Added states and modes for zwave climate (home-assistant#25274)
  Add hvac modes back to opentherm (home-assistant#25268)
  Restore SmartThings A/C on/off services (home-assistant#25259)
  Update CT80 Humidity call (home-assistant#25258)
  ecobee Preset Fix (home-assistant#25256)
  Fix the unit of measurement for ecobee climate (home-assistant#25246)
  Make presets prettier (home-assistant#25245)
  Fix eq3btsmart (home-assistant#25238)
  Show off value (home-assistant#25236)
  Updated frontend to 20190718.0
  ...

@lock lock bot locked and limited conversation to collaborators Jul 20, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.