Hello,
Manually configured MQTT sensor(s) found under platform key ‘sensor’, please move to the mqtt integration key, see MQTT Sensor - Home Assistant
As the configuration of MQTT Sensors will change I was wondering how I should split my configuration.
Until now all MQTT Sensor YAML Files and Template YAML Files were in the sensor Folder (see below at: My current configuration structure).
My Question is:
- Do I need to split the MQTT Sensor File and the Template File in two different Folders?
- Is there a way to have the two Files in Folder mqtt/sensor?
- What do I need to change in File 2 to archive this?
New configuration structure:
configuration.yaml
mqtt:
sensor: !include_dir_merge_list mqtt/sensor/
sensor: !include_dir_merge_list sensor/
File 1 in Folder mqtt/sensor/
- name: outdoor_node_1_status
state_topic: "home/outdoor_node_1/status"
value_template: '{{ value_json.node_status }}'
File 2 in Folder sensor/
- platform: template
sensors:
template_outdoor_node_1_status:
##friendly_name: "XXX"
value_template: "{{ states.sensor.outdoor_node_1_status.state }}"
icon_template: >-
{% if is_state('sensor.outdoor_node_1_status', 'online') %}
mdi:wifi
{% else %}
mdi:wifi-off
{% endif %}
My current working configuration structure:
configuration.yaml
sensor: !include_dir_merge_list sensor/
File 1 in Follder sensor/
- platform: mqtt
name: outdoor_node_1_status
state_topic: "home/outdoor_node_1/status"
value_template: '{{ value_json.node_status }}'
File 2 in Follder sensor/
- platform: template
sensors:
template_outdoor_node_1_status:
value_template: "{{ states.sensor.outdoor_node_1_status.state }}"
icon_template: >-
{% if is_state('sensor.outdoor_node_1_status', 'online') %}
mdi:wifi
{% else %}
mdi:wifi-off
{% endif %}