I have created multiple sensors in the template section, and after multiple edits of the templates file i have started experiencing the ghost sensors.
I guess either i am doing something wrong or missing something completely - and need your advice
the situation
in /config/configuration.yaml file:
template: !include templates.yaml
in the “/config/templates.yaml” file (current state, system has been rebooted afterwards)
#- sensor:
# - name: "Kitchen Thermostat - Target Temperature - BB"
# unit_of_measurement: "°C"
# state: "{{ state_attr('climate.kitchen_thermostat_aqara', 'temperature' )}}"
# icon: mdi:thermometer
# unique_id: kitchen_thermostat_target_temperature_bb
#- sensor:
# - name: "Kitchen Thermostat - Target Temperature - BB"
# unit_of_measurement: "°C"
# state: "{{ state_attr('climate.kitchen_thermostat_aqara', 'temperature' )}}"
# icon: mdi:thermometer
# unique_id: kitchen_thermostat_target_temperature_5
- sensor:
- name: "Kitchen Thermostat - Target Temperature"
unit_of_measurement: "°C"
state: "{{ state_attr('climate.kitchen_thermostat_aqara', 'temperature' )}}"
icon: mdi:thermometer
unique_id: kitchen_thermostat_target_temperature
- sensor:
- name: "Kitchen XXX Thermostat - Target Temperature"
unit_of_measurement: "°C"
state: "{{ state_attr('climate.kitchen_thermostat_aqara', 'temperature' )}}"
icon: mdi:thermometer
unique_id: kitchen_xxx_thermostat_target_temperature
even after a complete reboot the “old” configuration, sensor from the template remains in the system.
it stays with the status “unavailable”, but it is there.
see the screenshot:
and newly “redefined” / “edited” value is missing.
what is also a bot astonishing - the “unique_id” field seems to have no impact on defined sensor name, but the field name does have an impact.
Note: System is based on ORDOID-N2, 64 GB eMMC, started from the dedicated to this platform image
Question
Hot to “reset” the system that “old” sensors are purged from it and new ones are active and visible?