Update your manually configured MQTT entities

Disclosure: This post contains affiliate links. If you click through and make a purchase, I’ll earn a commission, at no additional cost to you. Read my full disclosure here.
Advertisement

An incoming change to defining manually configured MQTT entities might require you to change some lines of YAML in your configuration. MQTT entities will no longer be configured directly under the respective platform keys (e.g., fan, light, switch, etc) and will instead require the MQTT platform key.

Advertisement

If the last two sentences are leaving you confused, the following two code snippets should help you understand what needs to be done as of Home Assistant Core 2022.6. Currently, a manually configured MQTT entity might look like this:

switch:
  - platform: mqtt
    name: "Zigbee2MQTT - Main join"
    state_topic: "zigbee2mqtt/bridge/info"
    value_template: '{{ value_json.permit_join | lower }}'
    command_topic: "zigbee2mqtt/bridge/request/permit_join"
    payload_on: "true"
    payload_off: "false"

In the above example, I am using the switch platform key. As of Home Assistant 2022.6, this configuration is deprecated and will be removed in Home Assistant 2022.9. From now on, I will have to use the MQTT configuration key instead, and the example above will have to be switched to the following:

Advertisement
mqtt:
  switch:
    - name: "Zigbee2MQTT - Main join"
      state_topic: "zigbee2mqtt/bridge/info"
      value_template: '{{ value_json.permit_join | lower }}'
      command_topic: "zigbee2mqtt/bridge/request/permit_join"
      payload_on: "true"
      payload_off: "false"
Advertisement
Liam Alexander Colman, the author and maintainer of Home Assistant Guides.

About Liam Alexander Colman

Liam Alexander Colman has been using Home Assistant for various projects for quite some time. What started off with a Raspberry Pi quickly became three Raspberry Pis and eventually a full-blown server. I now use Unraid as my operating system, and Home Assistant happily runs in a Docker container. My personal setup includes many Zigbee devices as well as integrations with existing products such as my Android TV box. Read on to find out more on how I got started with Home Assistant.

Leave a comment

Advertisement
Share to...