The new version of Home Assistant needs an update to MQTT, and its kind of nice that it gives a warning:
Now, I found this thread which gives the solution:
Unfortunately, this solution does not work in my case.
Why not?
I have a lot of MQTT Devices. So I do things in my configuration.yaml like:
##########
# SENSOR #
##########
sensor: !include sensor.yaml
#mqtt:
# broker: core-mosquitto
# broker: a0d7b954-mqtt
# port: 1883
# username: mqtt_user
# password: !secret mqtt_password
# client_id: home-assistant
mqtt: !include mqtt.yaml
# binary_sensor:
# name: "Laserjet_4000 Print Queue"
# payload_on: "ON"
# state_topic: "hass/printers/Laserjet_4000"
Notice how I have an include for my sensor.yaml - and I also created a net-new mqtt.yaml to follow the new format requirements for mqtt. Finally, I commented out my mqtt devices, and moved every single mqtt device I have into mqtt.yaml, which contains lines like:
#############
# MQTT YAML #
#############
switch:
name: "Bedroom Fan"
command_topic: "cmnd/bedroomfan/power" # Need to change "sonoff" later as I add more of these.
state_topic: "stat/bedroomfan/POWER"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: false
But this does not work.
It passes the YAML check and should nest as:
mqtt:
switch:
name: "Bedroom Fan"
...
Which I believe should be valid, and should work according to the new format. Unfortunately, doing this clears the warnings completely - and completely breaks every MQTT device I have so that they never load.
I have been googling, and going through the docs, and I am a bit at a loss for how to migrate my MQTT devices to the new stuff - and maintain includes to keep my code organized. I don’t really want to have one giant configuration.yaml file.
I am obviously missing something, but I cant figure out what it is.