Climate e HA 0.96

after upgrading to version 0.96, the climate section has changed.
could someone convert these automations according to the new syntax in Home Assistant?

  action:
  - service: climate.set_away_mode
    data:
      entity_id: climate.netatmo_cucina
      away_mode: 'on'
  action:
  - service: climate.set_away_mode
    data:
      entity_id: climate.netatmo_cucina_2
      away_mode: 'off'
  action:
  - data:
      away_mode: 'off'
      entity_id: climate.netatmo_cucina_2
    service: climate.set_away_mode
  - data:
      entity_id: climate.netatmo_salone_2
      temperature: 20
    service: climate.set_temperature

they tell you right in the breaking changes section of the release notes:

the service is now: climate.set_preset_mode
and the data would be:

entity_id: climate.your_climate_device
preset_mode: "away"

and for the other automation?

It’s all in the documentation, which was also updated.

You posted the same question again in another thread … and received the same answer (use the new set_preset_mode service). It’s all explained in the documentation.

ok for the away mode but to remove this mode and set a temperature setting for the thermostat? could you have an example?
or can I continue the old syntax?

I thought of changing so:

action:
 - service: climate.turn_on
   entity_id: climate.netatmo_cucina_2 
- data: 
  entity_id: climate.netatmo_salone_2  
  temperature: 20 
  service: climate.set_temperature

and for the other

  action:
  - service: climate.turn_off
    data:
      entity_id: climate.netatmo_cucina
  1. should become
  action:
  - service: climate.set_preset_mode
    data:
      entity_id: climate.netatmo_cucina
      preset_mode: 'away'
  1. should become
  action:
  - service: climate.set_hvac_mode
    data:
      entity_id: climate.netatmo_cucina
      hvac_mode: 'auto'
  1. should become
  action:
  - service: climate.set_temperature
    data:
      entity_id: climate.netatmo_cucina
      temperature: 20

No.

The documentation contains examples of how to use each one of the climate component’s services. All of your questions are answered by the documentation.

yeah, I gave up

Thank you. Grazie

following on can anyone help me, ?
think i understand the changes to climate that are effecting my setup atleast apart from one. before update the heating would always be on but wouldn’t be calling for heat unless “actual temp” was below "set temp " then the little flame icon would change to orange and you knew that thermostat was calling for heat. (and which on was calling for heat)
now it seems you have to have thermostat on or “heat” all the time, the flame icon stays orange regardless of whether the thermostat is calling for heat, (so there is no indication of which thermostat is calling for heat) , thanks :slight_smile:

Is there any documentation anywhere for what set of strings are a valid preset_mode?

Failing that documentation it is very simple to turn on “away” mode by calling the service climate.set_preset_mode and passing it preset_mode: "away" but taking the thermostat back out of “away” mode (e.g. putting it back on its regular scheduled functioning) is opaque.

1 Like

I’ve been told that any string can be used as a preset_node. However, that’s in theory, meaning you have a custom climate component where you have the ability to handle any preset_mode you wish.

In practice, there’s a set of defined preset_modes. Here’s the relevant portion from the climate’s const.py file:

# No preset is active
PRESET_NONE = 'none'

# Device is running an energy-saving mode
PRESET_ECO = 'eco'

# Device is in away mode
PRESET_AWAY = 'away'

# Device turn all valve full up
PRESET_BOOST = 'boost'

# Device is in comfort mode
PRESET_COMFORT = 'comfort'

# Device is in home mode
PRESET_HOME = 'home'

# Device is prepared for sleep
PRESET_SLEEP = 'sleep'

# Device is reacting to activity (e.g. movement sensors)
PRESET_ACTIVITY = 'activity'

A given climate platform (Ecobee, Nest, Honeywell, Radiotherm, etc) may be able to handle some or all of the defined preset_modes.

Full Disclosure: It’s ‘early days’ for Climate 1.0 and, based on some of the posts I’ve read, the conversion of all platforms to the new climate component design has left some room for improvement.

My only experience with it so far has been with MQTT HVAC (that’s the platform I use with my thermostat). I’ve had little luck with its preset_modes and will probably log it as an Issue in Github. Plus the ability to distinguish between the HVAC system’s operation mode and its current operating state, a hallmark feature of Climate 1.0, won’t be implemented in MQTT HVAC until 0.97. All this to say, I can’t experiment with Climate 1.0’s new functionality because MQTT HVAC doesn’t reveal enough of its features.

1 Like

I’m trying to convert to the ‘new’ Nest/Climate commands, I currently have:

    action:
    - service: climate.set_hvac_mode
      data:
        entity_id: climate.upstairs
        hvac_mode: 'auto'

which results in:

TLDR HVAC cannot cool

Error while executing automation automation.nest_auto_away_mode_off. Unknown error for call_service at pos 1: 
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 449, in action
    await script_obj.async_run(variables, context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 189, in async_run
    await self._handle_action(action, variables, context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 272, in _handle_action
    await self._actions[_determine_action(action)](action, variables, context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_call_service
    context=context,
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 96, in async_call_from_config
    domain, service_name, service_data, blocking=blocking, context=context
  File "/usr/src/homeassistant/homeassistant/core.py", line 1226, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1251, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 201, in handle_service
    self._platforms.values(), func, call, service_name, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 335, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 357, in _handle_service_platform_call
    await getattr(entity, func)(**data)
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 422, in async_set_hvac_mode
    await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/nest/climate.py", line 257, in set_hvac_mode
    self.device.mode = MODE_HASS_TO_NEST[hvac_mode]
  File "/usr/local/lib/python3.7/site-packages/nest/nest.py", line 407, in mode
    self._set('devices/thermostats', {'hvac_mode': value.lower()})
  File "/usr/local/lib/python3.7/site-packages/nest/nest.py", line 206, in _set
    response = self._nest_api._put(path=path, data=data)
  File "/usr/local/lib/python3.7/site-packages/nest/nest.py", line 1874, in _put
    return self._request('PUT', path, data=data)
  File "/usr/local/lib/python3.7/site-packages/nest/nest.py", line 1866, in _request
    raise APIError(response)
nest.nest.APIError: Cannot change HVAC mode to heat-cool: HVAC cannot cool

which is true…my NEST controls only heating not cooling. But all I’m wanting to do is what I used to do with:

    action:
      - service: climate.set_away_mode
        data:
          entity_id: climate.upstairs
          away_mode: true

Have you read the thread? Set preset_mode to away

Sorry, my post was contradictory. I want to convert this

      - service: climate.set_away_mode
        data:
          entity_id: climate.upstairs
          away_mode: false

There is no longer an away_mode. The opions for preset are

# No preset is active
PRESET_NONE = "none"

# Device is running an energy-saving mode
PRESET_ECO = "eco"

# Device is in away mode
PRESET_AWAY = "away"

# Device turn all valve full up
PRESET_BOOST = "boost"

# Device is in comfort mode
PRESET_COMFORT = "comfort"

# Device is in home mode
PRESET_HOME = "home"

# Device is prepared for sleep
PRESET_SLEEP = "sleep"

# Device is reacting to activity (e.g. movement sensors)
PRESET_ACTIVITY = "activity"