I have several mqtt topics that need to be shown separately in HA.
First sensor is a temperature sensor, this one is defined directly in configuration.yaml:
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
mqtt:
sensor:
- name: "Zolder Temperature"
state_topic: "home/thermostat/current_temperature"
unit_of_measurement: "°C"
device_class: temperature
unique_id: "zolder_temp"
The second set of sensors that feed mqtt is from my weather station. All these sensors are grouped together in a separate yaml file that resides in a directory called mqtt and listens to the name weather_sensors.yaml. Contents (part of) are like this:
- name: "Weerstation temperatuur"
unique_id: "weather_temp"
force_update: true
state_topic: "rtl_433/Vevor-7in1/11564"
value_template: "{{ value_json.temperature_C }}"
unit_of_measurement: "°C"
- name: "Weerstation Relatieve luchtvochtigheid"
unique_id: "weather_hum"
force_update: true
state_topic: "rtl_433/Vevor-7in1/11564"
value_template: "{{ value_json.humidity }}"
unit_of_measurement: "%"
- name: "Weerstation UV"
unique_id: "weather_uv"
force_update: true
....
It should be possible to include this file in configuration.yaml using:
!include mqtt/weather_sensors.yaml
but I can’t seem to find the right syntax for this.
So, I guess what I’m trying to do is to mix direct mqtt configuration with a file full of mqtt settings,
Is this even possible ?
Or do I need a different approach, e.g. put all sensor related configs into (in this case) two files, and include them both (maybe using !include_dir_list) ?
Thanks