WTH why change MQTT config so drastically?

The recent changes to MQTT setup in configuration.yaml (moving from sensors: to the new mqtt:) really confused me. My system went from working fine to throwing a warning that I need to change my setup to the new style before the next release (or something like that). So I went through config edits, and thought I had it all working. No dice. I didn’t make a backup, of course. Eventually I rolled back to a disk image I made from a few days earlier.

Anyway, WTH? Why change something if it isn’t broken? Why can’t the two config methods live in harmony? I probably have some weird non-standard coding that doesn’t jibe with the new stuff. I’m wondering if anyone else has faced this issue.

The change to the new format was implemented in 2022.6.0 and indicated the old format would cease to function in 2022.9.0.

The explanation is found in the Pull Request that implemented it.

2 Likes

I thought I had converted them all, and still got a warning. Eventually found out is were sensors declared in a package.

I REALLY don’t get why people are making this so hard.

it’s literally going from this:

sensor:
  - platform: mqtt
    name: etc

binary_sensor:
  - platform: mqtt
    name: etc_2    

to this:

mqtt:
  sensor:
    - name: etc
  binary_sensor:
    - name: etc_2
1 Like

I think OP may be just asking “why”
Personally I found migration not any complicated but would like to know the reasons behind the change.

It was never mapped, it’s deserialized in order received. That didn’t change, so there’s nothing to fear.

all of this has been accessible since the decision was made, in april 2020.

1 Like

Yes in the second part of the post the question was “why?”.

But I would guess that was only prompted by all of the struggles explained in the longer first paragraph.

thanks for the link. The rationale presented in the article explains the change pretty well.

it seems it was waiting for new changes in order to start refactoring (I think there were changes in mqtt light at the same time)

That repo has all the guidelines that HA has set about development of HA.

Well, that’s not so friendly, @finity! The fact that I had to come to the WTH posts after searching means it’s not such common knowledge at all! That was one point. I don’t go to the source code for documentation.

Closing because the reasoning is listed above :+1: