MQTT After upgrading to Home Assistant version 2023.4.3 mosquito broker stopped working

After upgrading to Home Assistant version 2023.4.3 mosquito broker stopped working.
Gives me following error:

Logger: homeassistant.components.homeassistant
Source: components/homeassistant/init.py:310
Integration: Home Assistant Core Integration (documentation, issues)
First occurred: 09:52:30 (1 occurrences)
Last logged: 09:52:30

The system cannot reload because the configuration is not valid: Invalid config for [mqtt]: The ‘broker’ option near /config/configuration.yaml:1 has been removed, please remove it from your configuration for dictionary value @ data[‘mqtt’]. Got {‘broker’: ‘192.168.1.65’, ‘port’: 8123, ‘username’: ‘mqtt’, ‘password’: 123, ‘switch’: [{‘name’: ‘output-1’, ‘unique_id’: ‘output-1’, ‘state_topic’: ‘relay32/21fb4be04f9c2a465817b17b/state’, ‘command_topic’: ‘relay32/21fb4be04f9c2a465817b17b/set’, ‘payload_on’: ‘{“relay1”:{“on”:1}}’, ‘payload_off’: ‘{“relay1”:{“on”:0}}’, ‘value_template’: ‘{{ value_json.relay1.on }}’, ‘state_on’: 1, ‘state_off’: 0}, {‘name’: ‘output-2’, ‘unique_id’: ‘output-2’, ‘state_topic’: 'relay32/21fb4be04f9c2a465817b17… (See /config/configuration.yaml, line 1).

Configuring MQTT in configuration.yaml is not valid anymore.

I’m not very practical, how can I solve this problem?

You have to remove the following options under mqtt: in the configuration.yaml, if you have them.
Those are now configured via the GUI.

  discovery
  discovery_prefix
  broker
  port
  username
  password
  certificate
  client_cert
  client_key

My file is this:
____________-

mqtt:
broker: 192.168.1.65
port: 8123
username: mqtt
password: 123

switch:

  • name: ‘output-1’
    unique_id: output-1
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay1”:{“on”:1}}’
    payload_off: ‘{“relay1”:{“on”:0}}’
    value_template: ‘{{ value_json.relay1.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-2’
    unique_id: output-2
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay2”:{“on”:1}}’
    payload_off: ‘{“relay2”:{“on”:0}}’
    value_template: ‘{{ value_json.relay2.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-3’
    unique_id: output-3
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay3”:{“on”:1}}’
    payload_off: ‘{“relay3”:{“on”:0}}’
    value_template: ‘{{ value_json.relay3.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-4’
    unique_id: output-4
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay4”:{“on”:1}}’
    payload_off: ‘{“relay4”:{“on”:0}}’
    value_template: ‘{{ value_json.relay4.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-5’
    unique_id: output-5
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay5”:{“on”:1}}’
    payload_off: ‘{“relay5”:{“on”:0}}’
    value_template: ‘{{ value_json.relay5.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-6’
    unique_id: output-6
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay6”:{“on”:1}}’
    payload_off: ‘{“relay6”:{“on”:0}}’
    value_template: ‘{{ value_json.relay6.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-7’
    unique_id: output-7
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay7”:{“on”:1}}’
    payload_off: ‘{“relay7”:{“on”:0}}’
    value_template: ‘{{ value_json.relay7.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-8’
    unique_id: output-8
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay8”:{“on”:1}}’
    payload_off: ‘{“relay8”:{“on”:0}}’
    value_template: ‘{{ value_json.relay8.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-9’
    unique_id: output-9
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay9”:{“on”:1}}’
    payload_off: ‘{“relay9”:{“on”:0}}’
    value_template: ‘{{ value_json.relay9.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-10’
    unique_id: output-10
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay10”:{“on”:1}}’
    payload_off: ‘{“relay10”:{“on”:0}}’
    value_template: ‘{{ value_json.relay10.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-11’
    unique_id: output-11
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay11”:{“on”:1}}’
    payload_off: ‘{“relay11”:{“on”:0}}’
    value_template: ‘{{ value_json.relay11.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-12’
    unique_id: output-12
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay12”:{“on”:1}}’
    payload_off: ‘{“relay12”:{“on”:0}}’
    value_template: ‘{{ value_json.relay12.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-13’
    unique_id: output-13
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay13”:{“on”:1}}’
    payload_off: ‘{“relay13”:{“on”:0}}’
    value_template: ‘{{ value_json.relay13.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-14’
    unique_id: output-14
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay14”:{“on”:1}}’
    payload_off: ‘{“relay14”:{“on”:0}}’
    value_template: ‘{{ value_json.relay14.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-15’
    unique_id: output-15
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay15”:{“on”:1}}’
    payload_off: ‘{“relay15”:{“on”:0}}’
    value_template: ‘{{ value_json.relay15.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-16’
    unique_id: output-16
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay16”:{“on”:1}}’
    payload_off: ‘{“relay16”:{“on”:0}}’
    value_template: ‘{{ value_json.relay16.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-17’
    unique_id: output-17
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay17”:{“on”:1}}’
    payload_off: ‘{“relay17”:{“on”:0}}’
    value_template: ‘{{ value_json.relay17.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-18’
    unique_id: output-18
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay18”:{“on”:1}}’
    payload_off: ‘{“relay18”:{“on”:0}}’
    value_template: ‘{{ value_json.relay18.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-19’
    unique_id: output-19
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay19”:{“on”:1}}’
    payload_off: ‘{“relay19”:{“on”:0}}’
    value_template: ‘{{ value_json.relay19.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-20’
    unique_id: output-20
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay20”:{“on”:1}}’
    payload_off: ‘{“relay20”:{“on”:0}}’
    value_template: ‘{{ value_json.relay20.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-21’
    unique_id: output-21
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay21”:{“on”:1}}’
    payload_off: ‘{“relay21”:{“on”:0}}’
    value_template: ‘{{ value_json.relay21.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-22’
    unique_id: output-22
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay22”:{“on”:1}}’
    payload_off: ‘{“relay22”:{“on”:0}}’
    value_template: ‘{{ value_json.relay22.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-23’
    unique_id: output-23
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay23”:{“on”:1}}’
    payload_off: ‘{“relay23”:{“on”:0}}’
    value_template: ‘{{ value_json.relay23.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-24’
    unique_id: output-24
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay24”:{“on”:1}}’
    payload_off: ‘{“relay24”:{“on”:0}}’
    value_template: ‘{{ value_json.relay24.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-25’
    unique_id: output-25
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay25”:{“on”:1}}’
    payload_off: ‘{“relay25”:{“on”:0}}’
    value_template: ‘{{ value_json.relay25.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-26’
    unique_id: output-26
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay26”:{“on”:1}}’
    payload_off: ‘{“relay26”:{“on”:0}}’
    value_template: ‘{{ value_json.relay26.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-27’
    unique_id: output-27
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay27”:{“on”:1}}’
    payload_off: ‘{“relay27”:{“on”:0}}’
    value_template: ‘{{ value_json.relay27.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-28’
    unique_id: output-28
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay28”:{“on”:1}}’
    payload_off: ‘{“relay28”:{“on”:0}}’
    value_template: ‘{{ value_json.relay28.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-29’
    unique_id: output-29
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay29”:{“on”:1}}’
    payload_off: ‘{“relay29”:{“on”:0}}’
    value_template: ‘{{ value_json.relay29.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-30’
    unique_id: output-30
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay30”:{“on”:1}}’
    payload_off: ‘{“relay30”:{“on”:0}}’
    value_template: ‘{{ value_json.relay30.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-31’
    unique_id: output-31
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay31”:{“on”:1}}’
    payload_off: ‘{“relay31”:{“on”:0}}’
    value_template: ‘{{ value_json.relay31.on }}’
    state_on: 1
    state_off: 0

  • name: ‘output-32’
    unique_id: output-32
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    command_topic: ‘relay32/21fb4be04f9c2a465817b17b/set’
    payload_on: ‘{“relay32”:{“on”:1}}’
    payload_off: ‘{“relay32”:{“on”:0}}’
    value_template: ‘{{ value_json.relay32.on }}’
    state_on: 1
    state_off: 0

binary_sensor:

  • name: ‘input-1’
    unique_id: input-1
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    value_template: ‘{{ value_json.input1.on }}’
    payload_on: 1
    payload_off: 0

  • name: ‘input-2’
    unique_id: input-2
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    value_template: ‘{{ value_json.input2.on }}’
    payload_on: 1
    payload_off: 0

  • name: ‘input-3’
    unique_id: input-3
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    value_template: ‘{{ value_json.input3.on }}’
    payload_on: 1
    payload_off: 0

  • name: ‘input-4’
    unique_id: input-4
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    value_template: ‘{{ value_json.input4.on }}’
    payload_on: 1
    payload_off: 0

  • name: ‘input-5’
    unique_id: input-5
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    value_template: ‘{{ value_json.input5.on }}’
    payload_on: 1
    payload_off: 0

  • name: ‘input-6’
    unique_id: input-6
    state_topic: ‘relay32/21fb4be04f9c2a465817b17b/state’
    value_template: ‘{{ value_json.input6.on }}’
    payload_on: 1
    payload_off: 0

You have to remove the following options under mqtt: in the configuration.yaml
Those are now configured via the GUI.

  broker
  port
  username
  password

thanks, the problem is solved;)

Hi guys,
When you say that these parameters are configured via GUI now- where does one do that exactly…?

I assume it was meant you can add the integration MQTT and there you can configure…
in the configuration.yaml, I only left the line “mqtt:”
Why yaml (as much easier) is now not anymore possible really also annoyed me!
Just an update should not crash whole system, especially if MQTT is running 90% of sensors :wink:

I have read all the comments and I have the same problem. In my case I don’t have anything in the configuration.yaml, only the “mqtt: !include mqtt.yaml”.
When I include this line I get the error, what can I do?

Maybe check the included mqtt.yaml? :slight_smile:

I just updated HA, and the amount of breaking changes is mind boggling. OK will will jump through all the hoops again.

1 Like

I added MQTT using UI but the UI dialog gives me this when I hit next (it shows only a port)

User input malformed: expected str for dictionary value @ data[‘broker’]

Any ideas???

Never mind, it turned out that the UI doesn’t render correctly on Edge.

Hello koying, thanks for clarifying on the question about mqtt setup.

After some years, I finally upgraded to the most recent version of home assistant, running in docker.
I am wondering, that configuration by GUI should be the only option left in a world that found a wording for ‘Infrastructure as Code’.
Do you know whether there is any option left to not rely on clicky colorfully gui setup for people who like to maintain there configuration in a git repository?

Thanks in advance and best regards
Tom

I’m upgrading from homeassistant/home-assistant:2021.11.5 to homeassistant/home-assistant:2024.5, the fact that the configuration of the MQTT broker has been removed from the configuration file seems quite pointless to me.
Are they trying to make home assistant become an amateur software where all configuration has to be done manually each time via GUI?

this is my exact experience too. I stopped upgrading HA in 21 because every upgrade broke something THAT WORKED before but was changed with poor documentation.This week I upgraded from Z-Wave JS UI (1.11.2) to Z-Wave JS UI (3.9.2) and have spent 4 days reading every single homeassisant article on how to get HA to remove" MQTT zwave device unavailable" error in my HA setup. MQTT auto discover refuses to work and the websockets auto discover documentation is atrocious.

HA for years now seems to attract failed MS software programmers that break what works for no reason than that they get more work.