Core: 0.88 complains about climate.mqtt "retain" option

Created on 25 Feb 2019  ·  12Comments  ·  Source: home-assistant/core

Home Assistant release with the issue: 0.88

Last working Home Assistant release (if known): N/A

Operating environment (Hass.io/Docker/Windows/etc.): Debian Stretch, virtualenv

Component/platform: https://www.home-assistant.io/components/climate.mqtt/

Description of problem:

With the new HA 88.0 I’m getting this warning for each configured climate device:
Please remove [retain]. (See /home/homeassistant/.homeassistant/packages/fhem_mqtt.yaml, line 5).

Seems to be a bug as “retain” is an essential part of MQTT.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

climate:
  - platform: mqtt
    name: 'Arbeitszimmer Ventil'
    qos: 2
    retain: true
    current_temperature_topic: 'az_t/temperature'
    mode_command_topic: 'az_t/temperature/set'
    mode_state_topic: 'az_t/state'
    temperature_command_topic: 'az_t/temperature/set'
    temperature_state_topic: 'az_t/state'

Traceback (if applicable):


Additional information:

Most helpful comment

That is a more appropriate fix indeed. Thanks!

All 12 comments

It is not about default_config. It is good example we should tie up platform config schema earlier.

The _MQTT HVAC_ component also complains about the initial key which is an optional configuration variable.

I want to add additional info as I also am getting this warning.
Hass version: 0.88.1
Env: hassOS on virtualbox x86_64

Error message in ha logs:

2019-02-26 12:49:57 WARNING (MainThread) [homeassistant.helpers.config_validation] Your configuration contains extra keys that the platform does not support.
Please remove [retain].  (See /config/configuration.yaml, line 231). 

Offending line and context:

[ln 231] climate:
  - platform: mqtt
    name: "Mom Downstairs Thermostat"
    qos: 1
    retain: true
    availability_topic: mom_downstairs_thermostat/status
    current_temperature_topic: mom_downstairs_thermostat/sensor/mom_downstairs_thermostat_temperature/state
    modes:
      - cool
      - heat
    mode_state_template: >
      {% if value == "ON" %}
        heat
      {% else %}
        cool
      {% endif %}
    mode_command_topic: mom_downstairs_thermostat/sensor/mom_downstairs_thermostat_mode/command
    mode_state_topic: mom_downstairs_thermostat/sensor/mom_downstairs_thermostat_mode/state
    temperature_command_topic: mom_downstairs_thermostat/sensor/mom_downstairs_thermostat_setpoint/command
    temperature_state_topic: mom_downstairs_thermostat/sensor/mom_downstairs_thermostat_setpoint/state
    initial: 68
    min_temp: 50
    max_temp: 90
    temp_step: 1

Having the retained flag set to true does work and sends retained messages. Removing it does use the default of sending unretained messages (and the validation warning stops). Please remove the warning about an unsupported key, it is in fact supported in MQTT HVAC (climate.mqtt).
Documentation: https://www.home-assistant.io/components/climate.mqtt/

If someone wants to point me in the right direction of the new configuration validator stuff I'd be happy to make a PR to fix.

+1

I've received the same warning concerning the use of retain with the MQTT HVAC (climate) component (0.88.1). In fact, the option was retain: false (which also happens to be the implicit, default state). Nevertheless, a warning was issued regarding this legal option.

I also have this issue.

@emontnemery It also shows a warning for "command_topic" for switches, obviously this is needed!

I see this was closed at solved in 0.89, but on 0.89.1 I still have the same

Your configuration contains extra keys that the platform does not support (but were silently accepted before 0.88). Please find and remove the following.This will become a breaking change.
[command_topic], [payload_on], [payload_off], [retain]

I still see these too.

It looks like only the climate schema was updated, when in fact most of them need updating to prevent these errors...?

@boojew, @Swiftnesses can you please post configuration.yaml for the devices causing your issue?
Note I changed title of this issue since OP had problems with mqtt climate.

I am running 0.89.2 and I am getting this error. Should I make a separate issue for this?

Log Details (WARNING)
Sat Mar 16 2019 13:00:41 GMT+0100 (Central European Standard Time)
Your configuration contains extra keys that the platform does not support.
Please remove [intial].  (See /config/includes/climate.yaml, line 28). 
- platform: mqtt
  name: Woonkamer
  current_temperature_topic: "home/ems-esp/thermostat_data"
  current_temperature_template: "{{ value_json.thermostat_currtemp }}"
  temperature_command_topic: "woonkamer/woonkamer/thermostaat/temperature/set"
  temperature_state_topic: "woonkamer/woonkamer/thermostaat/tempsetpoint2"
  mode_state_topic: "woonkamer/woonkamer/thermostaat/boilerstatus"
  modes:
    - "No"
    - "HW"
    - "CH"
  min_temp: 10
  max_temp: 25
  intial: 15
  retain: True

Or you can spell initial correct :)

That is a more appropriate fix indeed. Thanks!

Was this page helpful?
0 / 5 - 0 ratings