In the configuration YAML files, there should be possible to add custom entries which, apart from beng valid YAML, should be ignored by HA.
One common nice standard syntax for it is having such entry names prefixed with “x-”. For example, “x-my-custom-config-entry” or whichever “x-” name I want.
Why supporting this?
Apart from being able to have meta data stored in the configuration files, the most important use case for this is YAML anchors. Let me showcase this with and example:
x-thermostat-common: &thermostat-common
min_temp: 19
max_temp: 24
target_temp: 23
away_temp: 19
comfort_temp: 23
home_temp: 21
sleep_temp: 20
hot_tolerance: 0
cold_tolerance: 0.5
target_temp_step: 0.5
min_cycle_duration:
minutes: 5
climate:
- platform: generic_thermostat
unique_id: climate.master_bedroom_heating
name: Master Bedroom Heating
heater: switch.master_bedroom_heating
target_sensor: sensor.master_bedroom_temperature
<<: *thermostat-common
target_temp: 21
- platform: generic_thermostat
unique_id: climate.closet_heating
name: Closet Heating
heater: switch.closet_heating
target_sensor: sensor.closet_temperature
<<: *thermostat-common
Here I’m creating 2 thermostats, both sharing common configuration options. And one could have dozens of them (as I have).
Without such feature, the configuration files get pointlessly long and it makes it difficult to make common changes that should he inherited by all.