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
Merged

Climate 1.0 #23899

merged 92 commits into from
Jul 8, 2019

Conversation

pvizeli
Copy link
Member

@pvizeli pvizeli 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

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 has been minimized.

@MartinHjelmare

This comment has been minimized.

@presslab-us

This comment has been minimized.

@pvizeli

This comment has been minimized.

@elupus

This comment has been minimized.

@zxdavb

This comment has been minimized.

@Jc2k
Copy link
Member

Jc2k commented Jul 7, 2019

@zxdavb cheers!

Have submitted #25009 to fix that.

@pvizeli pvizeli merged commit 84cf76b into dev Jul 8, 2019
@delete-merged-branch delete-merged-branch bot deleted the climate-1.0 branch July 8, 2019 12:00
@balloob
Copy link
Member

balloob 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
Copy link
Contributor

Rendili 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
Copy link
Contributor

elupus commented Jul 8, 2019

@balloob
Copy link
Member

balloob 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
Copy link
Member

balloob commented Jul 8, 2019

@elupus #25019

KJonline pushed a commit to Rendili/home-assistant that referenced this pull request Jul 8, 2019
… 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
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.