I have 2 files in the restful dir and want to include them with !include_dir_merge_list, but it’s not wokring. Only file2.yaml works and even some of the sensors from that file are broken (they report 0 when they definitely shouldn’t). The configured sensor from the other module reports entity unreachable.
Both of the files work without issues separately.
If I combine them manually into a single file there is no issue either. (Edit: I added some other sensors to file2.yaml and as it turns out combining them manually also breaks it, I just couldn’t notice before because of the string based sensor)
Tried all of the !include_dir_* methods but none of them are working.
I’m running HA in a docker container:
~/homeassistant $ ls -l restful/
total 12
-rw-r--r-- 1 root root 408 Apr 9 18:51 file1.yaml
-rw-r--r-- 1 root root 6329 Apr 9 19:28 file2.yaml
config.yaml:
rest: !include_dir_merge_list restful
file1.yaml:
- scan_interval: 60
resource: https://REDACTED
sensor:
- name: "Status"
value_template: "{{ value_json.status }}"
file2.yaml:
- scan_interval: 60
resource: http://REDACTED
sensor:
- name: "CPU Temperature (average)"
value_template: "{% for elem in value_json if elem.SensorName == 'CPU Die (average)' %}{{ '%0.2f' | format (elem.SensorValue | regex_replace(',', '.') | float)}}{% endfor %}"
device_class: temperature
unit_of_measurement: "°C"
- name: "CPU Core 0 Clock"
value_template: "{% for elem in value_json if elem.SensorName == 'Core 0 Clock' %}{{ '%0.2f' | format (elem.SensorValue | regex_replace(',', '.') | float)}}{% endfor %}"
unit_of_measurement: "MHz"
- name: "CPU PPT"
value_template: "{% for elem in value_json if elem.SensorName == 'CPU PPT' %}{{ '%0.3f' | format (elem.SensorValue | regex_replace(',', '.') | float)}}{% endfor %}"
device_class: power
unit_of_measurement: "W"
- name: "CPU Load"
value_template: "{% for elem in value_json if elem.SensorName == 'CPU Total' %}{{ '%0.2f' | format (elem.SensorValue | regex_replace(',', '.') | float)}}{% endfor %}"
unit_of_measurement: "%"
- name: "Memory Load"
value_template: "{% for elem in value_json if elem.SensorName == 'Generic Memory: Memory' %}{{ '%0.2f' | format (elem.SensorValue | regex_replace(',', '.') | float)}}{% endfor %}"
unit_of_measurement: "%"
- name: "GPU Temperature"
value_template: "{% for elem in value_json if elem.SensorName == 'GPU Temperature' %}{{ '%0.2f' | format (elem.SensorValue | regex_replace(',', '.') | float)}}{% endfor %}"
device_class: temperature
unit_of_measurement: "°C"
- name: "GPU Core Voltage"
value_template: "{% for elem in value_json if elem.SensorName == 'GPU Core Voltage' %}{{ '%0.3f' | format (elem.SensorValue | regex_replace(',', '.') | float)}}{% endfor %}"
device_class: voltage
unit_of_measurement: "V"
- name: "GPU Power"
value_template: "{% for elem in value_json if elem.SensorName == 'GPU Power' %}{{ '%0.3f' | format (elem.SensorValue | regex_replace(',', '.') | float)}}{% endfor %}"
device_class: power
unit_of_measurement: "W"
- name: "GPU Core Clock"
value_template: "{% for elem in value_json if elem.SensorName == 'GPU Clock' %}{{ '%0.2f'| format (elem.SensorValue | regex_replace(',', '.') | float)}}{% endfor %}"
unit_of_measurement: "MHz"
- name: "GPU Memory Clock"
value_template: "{% for elem in value_json if elem.SensorName == 'GPU Memory Clock' %}{{ '%0.2f' | format ((elem.SensorValue | regex_replace(',', '.') | float) * 4)}}{% endfor %}"
unit_of_measurement: "MHz"
- name: "GPU Core Load"
value_template: "{% for elem in value_json if elem.SensorName == 'GPU Core Load' %}{{ elem.SensorValue | regex_replace(',', '.') | int}}{% endfor %}"
unit_of_measurement: "%"
- name: "GPU Memory Usage"
value_template: "{% for elem in value_json if elem.SensorName == 'GPU Memory Usage' %}{{ elem.SensorValue | regex_replace(',', '.') | int}}{% endfor %}"
unit_of_measurement: "%"
- name: "GPU Memory Controller Load"
value_template: "{% for elem in value_json if elem.SensorName == 'GPU Memory Controller Load' %}{{ elem.SensorValue | regex_replace(',', '.') | int}}{% endfor %}"
unit_of_measurement: "%"
- name: "GPU Fan"
value_template: "{% for elem in value_json if ((elem.SensorName == 'GPU Fan1') and (elem.SensorUnit == '%')) %}{{ elem.SensorValue | regex_replace(',', '.') | int}}{% endfor %}"
unit_of_measurement: "%"
- name: "GPU Fan (rpm)"
value_template: "{% for elem in value_json if ((elem.SensorName == 'GPU Fan1') and (elem.SensorUnit == 'RPM')) %}{{ elem.SensorValue | regex_replace(',', '.') | int}}{% endfor %}"
unit_of_measurement: "rpm"