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

Climate 1.0 #23899

Merged
merged 92 commits into from Jul 8, 2019

Conversation

@pvizeli
Copy link
Member

commented May 16, 2019

Breaking Change:

  • All operation are now defined by the core
  • Abstract operation mode and current action for devices they support this (only for viewing on UI)
  • Hold modes called now presets
  • Away mode move into hold modes because it is what it is and manufactory use it like that
  • Remove on/off in flavor of hvac state

Platforms:

Most platform will support now a lot more features. But Somethings was also cleaned out:

  • OEM - Remove fake away
  • Hive - Hot water is not a climate device @KJonline @Rendili (use the new component for hot water) / boost use now preset instead hack into auxiliary
  • Radiotherm - remove fake away
  • Nuheat - service renamed from climate.nuheat_resume_program to nuheat.resume_program
  • generic-thermostat - rename initial_operation_mode to initial_hvac_mode

Description:

Looks like a small change but they are massive. I look over all climate API and also external Interfaces like Voice Assistant, and that is the result they should be able to cover our cases.

Most of the problem was that a lot of stuff was mixed because of history for that component. Like Away mode, they were initially added and later as the hold modes come too, they were never strict merged back. Some integration was added hacks to offload it from hold mode.

That is the result of hours and hours research of what we have and what exists and how the device manufacture implement things.

I don't think our old climate was bad because no platform supports so many different devices and I learned a lot from that code. The problem was only, that no one had the overview to make a clean setup.

Implement the subset of over 100 comments from home-assistant/architecture#22

This pull request includes an updated UI to work with the new schema.

AWAY

Some HA hardware interfaces (components) use a fake away. That is something that is not part of an interface schema. Logic abstraction or components level 2 allowed to fake logic but not on level 1 (hardware interfaces).

Upgrade guide

The main thing that is new is presets Things like eco mode, away mode, hold mode, manual mode, etc are now all presets and set via set_preset_mode function.

  • New set_preset_mode/async_set_preset_mode replaces the following (including their async variants):
    • turn_away_mode_on
    • turn_away_mode_off
    • set_hold_mode
    • turn_on
    • turn_off
  • supported_features:
    • SUPPORT_TARGET_TEMPERATURE_LOW + SUPPORT_TARGET_TEMPERATURE_HIGH -> SUPPORT_TARGET_TEMPERATURE_RANGE
    • Removed SUPPORT_TARGET_HUMIDITY_HIGH, SUPPORT_TARGET_HUMIDITY_LOW
    • Removed SUPPORT_OPERATION_MODE
    • Removed SUPPORT_HOLD_MODE
    • Removed SUPPORT_SWING_MODE
    • Removed SUPPORT_AWAY_MODE
    • Removed SUPPORT_ON_OFF (implement HVAC_MODE_HEAT + HVAC_MODE_OFF instead)
  • is_on removed (implement HVAC_MODE_HEAT + HVAC_MODE_OFF instead)
  • STATE_IDLE -> HVAC_STATE_OFF
  • State machine attribute ATTR_OPERATION_MODE is now the state of the entity
  • Properties that are the same:
    • name
    • precision_unit
    • temperature_unit
    • current_humidity
    • target_humidity
    • current_temperature
    • target_temperature
    • target_temperature_step
    • target_temperature_high
    • target_temperature_low
    • min_temp
    • max_temp
    • min_humidity
    • max_humidity
  • current_operation -> hvac_mode(limited to one of HVAC_MODES const)
  • operation_list -> hvac_modes (subset of HVAC_MODES const)
  • hvac_action new. The current action of the device (heating, etc. See CURRENT_HVAC_* consts)
  • preset_mode new The current preset mode (home, away, temp) (one of preset_modes)
  • preset_modes new The available preset modes (prefer one of PRESET_* const, custom values allowed)
  • is_aux_heat_on -> is_aux_heat
  • current_fan_mode -> fan_mode (one of fan_modes)
  • fan_list -> fan_modes (prefer using FAN_* constants from climate/const.py, custom values allowed)
  • current_swing_mode -> swing_mode (one of swing_modes)
  • swing_list -> swing_modes (prefer SWING_ constants, custom values allowed)
  • set_operation_mode -> set_hvac_mode

Migration

  • homematic
  • demo
  • xs1
  • hive
  • mill
  • lcn
  • oem
  • toon
  • deconz
  • tesla
  • vera
  • zwave
  • velbus
  • wink
  • dyson
  • tefiac
  • tado
  • mqtt
  • venstar
  • zhong_hong
  • tuya
  • spider
  • radiotherm
  • sensibo
  • smartthings
  • melissa
  • fibaro
  • mysensors
  • nest
  • ecobee
  • elkm1
  • flexit
  • coolmaster
  • daikin
  • honeywell #24257
  • proliphix
  • ephember
  • incomfort
  • homekit
  • homekit_controller
  • geniushub #24191
  • touchline
  • stiebel_eltron
  • opentherm_gw
  • nuheat
  • netatmo
  • modbus
  • maxcube
  • knx
  • homematicip_cloud
  • heatmiser
  • generic_thermostat
  • fritzbox
  • evohome #24491
  • esphome
  • eq3btsmart
  • ambiclimate #24911

Integration

  • Alexa
  • Google Assistant
homeassistant/components/climate/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/climate/const.py Outdated Show resolved Hide resolved
homeassistant/components/climate/const.py Outdated Show resolved Hide resolved
@pvizeli

This comment was marked as outdated.

Copy link
Member Author

commented May 16, 2019

I'm currently not happy about the hold stuff. Will overthink that part again

EDIT: hmm, it's not to bad / maybe it need a rename to presets or profile

@MartinHjelmare

This comment was marked as outdated.

Copy link
Member

commented May 16, 2019

I like preset.

@SukramJ SukramJ referenced this pull request May 20, 2019
9 of 9 tasks complete
@presslab-us

This comment was marked as outdated.

Copy link
Contributor

commented May 21, 2019

Zigbee thermostats support a true "hold" mode which means that it does not execute the internal schedule, it just holds the current setpoints. It also optionally allows this hold mode to self disable after some configurable time.

I think it would be nice to at least support this hold mode somehow. Could the "preset" accommodate this?

@pvizeli

This comment was marked as outdated.

Copy link
Member Author

commented May 22, 2019

@presslab-us the old climate try to integrate every climate native. Now we have our own schema and interfaces can wrap that to the device. I think in future presets should support a time range because some devices can use that.

@elupus

This comment was marked as outdated.

Copy link
Contributor

commented May 22, 2019

I just want to suggest again that hvac_state is renamed to hvac_mode. You have hvac_mode(s) plurar for the list, so the current aught to be the singular.

I'd suggest the same for presets and preset. Or preset_mode and preset_modes for list. That way it's clear they belong together.

@balloob balloob added this to In progress in Home Assistant 1.0 May 24, 2019

@zxdavb

This comment was marked as outdated.

Copy link
Contributor

commented May 25, 2019

I am trying to migrate evohome to the new climate platform, PR #23969

I have a difficulty with

supported_features = SUPPORT_TARGET_TEMPERATURE | SUPPORT_CURRENT_HVAC | SUPPORT_PRESET_MODE

In the Web UI (/states), I only get: Fan mode , and Swing mode . Understandably, both drop-down lists are empty.

I do get the Target Temperature in the UI.

If I have supported_features = 2**16-1, then I get the full gamut in the UI, but the Operation list is empty.

[edit] More info:

2019-05-25 19:22:08 WARNING (MainThread) [homeassistant.components.evohome] supported_features(929524) = 577
2019-05-25 19:22:08 WARNING (MainThread) [homeassistant.components.evohome] state_attributes(929524) = {'hvac_modes': ['auto', 'heat', 'off'], 'current_temperature': 17.0, 'min_temp': 5.0, 'max_temp': 23.0, 'temperature': 15.5, 'current_hvac': 'auto', 'preset_mode': None, 'preset_list': ['auto', 'heat', 'off']}

pvizeli added some commits Jul 7, 2019

@Jc2k

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2019

@zxdavb cheers!

Have submitted #25009 to fix that.

Jc2k and others added some commits Jul 7, 2019

@pvizeli pvizeli merged commit 84cf76b into dev Jul 8, 2019

2 of 7 checks passed

build Workflow: build
Details
ci/circleci: pre-install-all-requirements Your tests are queued behind your running builds
Details
ci/circleci: pre-test 3.5.5 Your tests are queued behind your running builds
Details
ci/circleci: pre-test 3.6 Your tests are queued behind your running builds
Details
ci/circleci: pre-test 3.7 Your tests are queued behind your running builds
Details
ci/circleci: static-check Your tests passed on CircleCI!
Details
cla-bot Everyone involved has signed the CLA

@delete-merged-branch delete-merged-branch bot deleted the climate-1.0 branch Jul 8, 2019

@balloob

This comment has been minimized.

Copy link
Member

commented Jul 8, 2019

🎉 🎉 🎉 🎉 🎉

We did it! We made a lots of changes and things might have been broken. If you find a bug in one of the integrations or have a PR with improvements, please tag PRs with [climate] so it is easy to spot for us. Feel free to tag me and I prioritize reviewing.

@Rendili

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2019

Hi @balloob,

Khole and I are working on fixes to the Hive climate code, which we think we have completed now and re-adding Hive hotwater support as water_heater after it was removed from climate.

We are still ironing out some bugs in the water_heater, but if not complete before Climate 1.0 goes live we will lose hotwater / water_heater support for Hive (assuming no one else is working on this)

How do you recommend we proceed? We were aiming for one PR with the new file for water_heater and the fixed file for climate.
and do we now make the PR for DEV rather than Climate branch?

@elupus

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2019

The ecobee failure is due to dict in 3.5 not preserving order on keys.

@balloob

This comment has been minimized.

Copy link
Member

commented Jul 8, 2019

@Rendili PRs against dev branch. We are cutting the 96 beta this Wednesday but will include a water heater PR in 96 if it comes in during the beta period.

@elupus good catch, I'll open a PR with a fix.

@balloob

This comment has been minimized.

Copy link
Member

commented Jul 8, 2019

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

Merge branch 'hive_water_heater' of github.com:Rendili/home-assistant…
… into hive_water_heater

* 'hive_water_heater' of github.com:Rendili/home-assistant: (21 commits)
  Sensibo, add HVAC_MODE_OFF (home-assistant#25016)
  Add support for arcam fmj receivers (home-assistant#24621)
  Enphase envoy individual inverter production (home-assistant#24445)
  Implement Twilio SMS notify MediaUrl support (home-assistant#24971)
  Climate 1.0 (home-assistant#23899)
  Correct socket use in cert_expiry platform (home-assistant#25011)
  Added missing yeelight models mapping (home-assistant#24963)
  Install requirements for integrations in packages before importing them. (home-assistant#25005)
  Upgrade insteonplm to 0.16.0 and add INSTEON scene triggering (home-assistant#24765)
  Upgrade hdate==0.8.8 (home-assistant#25008)
  upgrade switchmate to latest lib (home-assistant#25006)
  Test dependency updates (home-assistant#25004)
  Add support for aurora ABB Powerone solar photovoltaic inverter (home-assistant#24809)
  Sleepiq single sleeper crash (home-assistant#24941)
  Changes as per code review of home-assistant#24646 (home-assistant#24917)
  Upgrade mypy to 0.711, drop no longer needed workarounds (home-assistant#24998)
  Adds Stale Probot for issues (home-assistant#24985)
  Adds Lock Threads Probot (home-assistant#24984)
  Switched from tuyapy to tuyaha as 1st one is not maintained (home-assistant#24821)
  Fix errors if rest source becomes unavailable (home-assistant#24986)
  ...

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

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Jul 9, 2019

@balloob balloob moved this from In progress to Done in Home Assistant 1.0 Jul 11, 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.