OK, another one with problems converting to the new syntax.
My manual config is split across a number of āthemeā-based yaml files in packages
Two of them have mqtt configured sensors. I am seeing the same problem in both. One will serve as an example.
I get no errors when I run ha core check, but when HA restarts I see errors of the form:
The version platform for the sensor integration does not support platform setup. Please remove it from your config.
17:05:59 ā (ERROR) Sensor - message first occurred at 17:05:59 and shows up 2 times
Unable to prepare setup for platform mqtt.switch: Unable to set up component.
17:05:57 ā (ERROR) setup.py
Setup failed for mqtt: Invalid config.
17:05:57 ā (ERROR) setup.py
Invalid config for [mqtt]: [sensor] is an invalid option for [mqtt]. Check: mqtt->mqtt->sensor. (See ?, line ?). Please check the docs at https://www.home-assistant.io/integrations/mqtt
17:05:57 ā (ERROR) config.py
and
2022-06-02 17:05:57 ERROR (MainThread) [homeassistant.config] Invalid config for [mqtt]: [sensor] is an invalid option for [mqtt]. Check: mqtt->mqtt->sensor. (See ?, line ?). Please check the docs at https://www.home-assistant.io/integrations/mqtt
2022-06-02 17:05:57 ERROR (MainThread) [homeassistant.setup] Setup failed for mqtt: Invalid config.
Thanks. I saw that, but I canāt see where that first mqtt: is.
The Mosquitto integration is configured through the GUI - thereās no reference to it in configuration.yaml. All the real config takes in places in packages. The relevant one starts:
# Batteries.yaml
# Stuff to report battery state and raise an elert of a battery state gets low.
#
# Customisations to facilitate selecting the filtered battery levels
homeassistant:
customize:
sensor.filtered_shed_battery:
type: "filtered"
sensor.filtered_bedroom1_battery:
type: "filtered"
sensor.filtered_bedroom2_battery:
type: "filtered"
sensor.filtered_livingroom_battery:
type: "filtered"
sensor.filtered_shack_battery:
type: "filtered"
# emonCMS battery sensors
mqtt:
sensor:
- name: "Shed Battery"
state_topic: "emon/emonth4/battery"
unit_of_measurement: "V"
device_class: battery
value_template: "{{ value | float | round(1) }}"
expire_after: 300
I see no place where an extra level got added in. However, I do see that VSC (Iām using the VSC editor addon) does put a blue hash highlight on that whole section.
Not sure about the terminology, but it looks like itās not possible to have multiple instances of the mqtt: configuration key, each with a unique secondary identifier, the way you can with platform keys like binary_sensor, sensor, etc. This would be helpful (to me at least) to keep the YAML more manageable.
For exampleā¦
# this validates but has been deprecated
binary_sensor basement:
- platform: mqtt
name: Basement Motion 1
- platform: mqtt
name: Basement Motion 2
binary_sensor bedrooms:
- platform: mqtt
name: Hall Motion
# but this doesn't validate
mqtt basement:
binary_sensor:
- name: Basement Motion 1
- name: Basement Motion 2
mqtt bedrooms:
binary_sensor:
- name: Hall Motion
# and neither does this
mqtt:
binary_sensor basement:
- name: Basement Motion 1
- name: Basement Motion 2
binary_sensor bedrooms:
- name: Hall Motion
I have rewritten syntax in accordance to recent changes, but now when I check config before rebooting HA I get:
Invalid config for [mqtt]: [entity_id] is an invalid option for [mqtt]. Check: mqtt->mqtt->sensor->44->entity_id. (See /config/configuration.yaml, line 81).
Hereās the look of My config.yaml, line 81 corresponds to MQTT: