Invalid config for [automation]: Integration 'mqtt' does not provide trigger support Error in 2022.3.1+

Hello, this is my first time posting in the forums and I hope I got the correct place for this issue. I wanted to update to 2022.3 but when I run the configuration checker add-on I receive the following error 6 times:

ERROR:homeassistant.config:Invalid config for [automation]: Integration ‘mqtt’ does not provide trigger support. Got OrderedDict([(‘default_config’, {}), (‘discovery’, {}), (‘frontend’, OrderedDict([(‘themes’, OrderedDict([(‘amoled’, OrderedDict([(‘accent-color’, ‘#E45E65’), (‘card-background-color’, ‘var(–paper-card-background-color)’), (‘dark-primary-color’, ‘var(–accent-color)’), (‘disabled-text-color’, ‘#7F848E’), (‘divider-color’, ‘rgba(0, 0, 0, .12)’), (‘google-green-500’, ‘#39E949’), (‘google-red-500’, ‘#E45E65’), (‘ha-card-background’, ‘#000000’), (‘label-badge-background-color’, ‘#2E333A’), ('lab… (See /tmp/config/configuration.yaml, line 121).

Line 122 in my configuration.yaml points to my automation.yaml, but I’m not sure why it would be throwing any errors. I do have a number of automations that are using zigbee buttons as triggers but I’m not sure what the issue could be with them as they were fine up until this check. I looked at the breaking changes for 2022.3 and nothing stood out as causing an issue to me. In fact, if I change the config checker from stable to 2022.3.0, I do not receive these errors; they only come from 2022.3.1 and later.

Here is an example of one of my automations using mqtt triggers if it helps:

- id: '1632521127207'
  alias: Apartment Bedroom Light 1 Toggle with Remote 1
  description: ''
  trigger:
  - platform: device
    domain: mqtt
    device_id: 0982657dd507f5ab4765055fadd246d6
    type: action
    subtype: 'on'
    discovery_id: 0x597e81fffe21e4f3 action_on
  - platform: device
    domain: mqtt
    device_id: 0982657dd507f5ab4765055fadd246d6
    type: action
    subtype: 'off'
    discovery_id: 0x597e81fffe21e4f3 action_off
  condition: []
  action:
  - type: toggle
    device_id: 811e145b2575bd487d9e53f46d205b5f
    entity_id: light.apartment_bedroom_bulb_1
    domain: light
  mode: single

Any insight into this issue would be greatly appreciated as it’s making me nervous to update to the latest version.

So after fighting with this error for the past 10 days or so, it has mysteriously resolved itself (maybe?). I decided to focus on the latter part of the error and not the mqtt trigger part and I thought that it was strange that it was referencing theme settings. I was running a custom theme, Google Dark theme, via HACS; I changed to the default dark theme and re-ran the config checker. This time it was checking against 2022.3.4 and the result came back clean. Curious if the .4 release fixed the issue or if my theme change did, I reran the config checker with 2022.3.3 which had previously produced the error multiple times. Another clean check. So it must have been my theme change, right? Doing my due diligence I switched back to the custom theme and reran stable (2022.3.4) and 2022.3.3 checks and sure enough they were … clean. What?

I have since updated to 2022.3.4 without incident running the default dark theme and everything seems to be operating properly. As for the errors that prompted this post… :man_shrugging:

I have the same problem in 2022.8.4: Invalid config for [automation]: Integration ‘mqtt’ does not provide trigger support. First occurred: 11:46:36 AM (13 occurrences). In automation.yaml I have (13 times):

- action:
    data:
      value: RFI Monde
    service: shell_command.radio_info
  alias: key 1 - RFI Monde
  trigger:
    payload: key 1
    platform: mqtt
    topic: keyboard

This code appears to follow the example in Automation Trigger - Home Assistant

@gumdomike Do you not have any idea what you did to get the problem to go away? Do you have any stack traces when you start homeassistant? I see:

Aug 13 09:47:22 entrance sh[16034]: 2022-08-13 09:47:22.453 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry configuration.yaml for mqtt
Aug 13 09:47:22 entrance sh[16034]: Traceback (most recent call last):
Aug 13 09:47:22 entrance sh[16034]:   File "/tmp/ve/lib/python3.10/site-packages/homeassistant/config_entries.py", line 357, in async_setup
Aug 13 09:47:22 entrance sh[16034]:     result = await component.async_setup_entry(hass, self)
Aug 13 09:47:22 entrance sh[16034]:   File "/tmp/ve/lib/python3.10/site-packages/homeassistant/components/mqtt/__init__.py", line 463, in async_setup_entry
Aug 13 09:47:22 entrance sh[16034]:     await async_forward_entry_setup_and_setup_discovery(entry)
Aug 13 09:47:22 entrance sh[16034]:   File "/tmp/ve/lib/python3.10/site-packages/homeassistant/components/mqtt/__init__.py", line 456, in async_forward_entry_setup_and_setup_discovery
Aug 13 09:47:22 entrance sh[16034]:     await _async_setup_discovery(hass, conf, entry)
Aug 13 09:47:22 entrance sh[16034]:   File "/tmp/ve/lib/python3.10/site-packages/homeassistant/components/mqtt/__init__.py", line 162, in _async_setup_discovery
Aug 13 09:47:22 entrance sh[16034]:     await discovery.async_start(hass, conf[CONF_DISCOVERY_PREFIX], config_entry)
Aug 13 09:47:22 entrance sh[16034]:   File "/tmp/ve/lib/python3.10/site-packages/homeassistant/components/mqtt/discovery.py", line 246, in async_start
Aug 13 09:47:22 entrance sh[16034]:     hass.data[DISCOVERY_UNSUBSCRIBE] = await asyncio.gather(
Aug 13 09:47:22 entrance sh[16034]:   File "/tmp/ve/lib/python3.10/site-packages/homeassistant/components/mqtt/discovery.py", line 248, in <genexpr>
Aug 13 09:47:22 entrance sh[16034]:     mqtt.async_subscribe(hass, topic, async_discovery_message_received, 0)
Aug 13 09:47:22 entrance sh[16034]: AttributeError: module 'homeassistant.components.mqtt' has no attribute 'async_subscribe'

See https://github.com/home-assistant/core/issues/76619 for other people with similar problems.