New mqtt configuration not working

Hi all,
I just updated home-assistant and tried to fix the new mqtt sensors with the following yaml:

mqtt:
  broker: 192.168.1.65
  port: 1883
  username: user
  password: password

  sensor:
    - name: Balcony irrigation consumption
      state_topic: "shellies/shelly1pm-98CDAC2E84F0/relay/0/power"
      unit_of_measurement: "W"
    - name: GC01SRVR CPU
      state_topic: "GC01SRVR/cpu_usage"
      unit_of_measurement: "%"
  binary_sensor:
    - name: "Stereo playing"
      state_topic: "/home-assistant/stereosalottoplaying"
      payload_on: "1"
      payload_off: "0"

    - platform: ping
      host: 10.10.10.165
      name: "Ponte di Legno Server"
      count: 10
      scan_interval: 60

However I still get a wrong configuration. What am I doing wrong?

Invalid config for [mqtt]: [platform] is an invalid option for [mqtt]. Check: mqtt->mqtt->binary_sensor->1->platform. (See /home/homeassistant/.homeassistant/configuration.yaml, line 84). 

Thanks!

This isn’t an mqtt binary sensor so it doesn’t below under mqtt. You need to move that out of the mqtt block and just put it under binary_sensor at the top level, next to mqtt.

EDIT: Also this doesn’t belong in YAML anymore:

It gets entered in the UI now. You should have a repair telling you those fields have been deprecated, have been migrated to the UI and should be removed from your YAML. Assuming you see that repair, you need to do that as I believe in the latest release that’s no longer a depreation and has now become a breaking change.

1 Like