Update your manually configured MQTT entities

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

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.

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:

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"
A portrait photo oif Liam Alexander Colman, the author, creator, and owner of Home Assistant Guide wearing a suit.

About Liam Alexander Colman

is an experienced Home Assistant user who has been utilizing the platform for a variety of projects over an extended period. His journey began with a Raspberry Pi, which quickly grew to three Raspberry Pis and eventually a full-fledged server. Liam's current operating system of choice is Unraid, with Home Assistant comfortably running in a Docker container.
With a deep understanding of the intricacies of Home Assistant, Liam has an impressive setup, consisting of various Zigbee devices, and seamless integrations with existing products such as his Android TV box. For those interested in learning more about Liam's experience with Home Assistant, he shares his insights on how he first started using the platform and his subsequent journey.

Leave a comment

Share to...