Renaming sensors in configuration.yaml doesn't work

I had given some of my sensors (rfxtrx, mqtt, template) in configuration.yaml unlogical names, so I decided to rename some of them. But the old ones still remain in home assistant (for example Lovelace and Developer Tools states) and the new ones don’t show up. I tried retarting HASS from the File Editor menu and rebooting from the Supervisor menu, but this had no effect. I even deleted the home-assistant_v2.db to let it start from scratch, but even then the old names were kept.

Where does it store the names and how can I enforce the changes I made in the yaml files.

Seems weird. Can you paste the code that creates the entities from your configuration.yml? Are you renaming the entity or friendly name from the entity?

Are those directly sensors etc or configs for components?

Check the integration menu under settings.

I’ll show one example:

Old code:

 - platform: mqtt
   name: "mqtt_power1"
   icon: mdi:lightbulb-on
   state_topic: "stat/emon/power"
   unit_of_measurement: 'W'
   value_template: "{{ value_json.power1 }}"
...
 - platform: template
   sensors:
     mqtt_power1_t:
       friendly_name: "Totaal"
       icon_template: mdi:lightbulb-on
       unit_of_measurement: 'W'
       value_template: >-
          {% if is_state('sensor.mqtt_power1', 'unknown') %}
            unknown
          {% else %}
            {{ states('sensor.mqtt_power1')|float }}
          {% endif %}

New code:

- platform: mqtt
  name: "mqtt_power1_org"
  icon: mdi:lightbulb-on
  state_topic: "stat/emon/power"
  unit_of_measurement: 'W'
  value_template: "{{ value_json.power1 }}"
...
- platform: template
  sensors:
    mqtt_power1:
      friendly_name: "Totaal"
      icon_template: mdi:lightbulb-on
      unit_of_measurement: 'W'
      value_template: >-
         {% if is_state('sensor.mqtt_power1_org', 'unknown') %}
           unknown
         {% else %}
           {{ states('sensor.mqtt_power1_org')|float }}
         {% endif %}

Now mqtt_power1 and mqtt_power1_t are still available, but mqtt_power1_org is not.

BTW, I also moved the sensors to a seperate sensor.yaml file. Before everything was in configuration.yaml. Now there are no sensors anymore in the latter file.

I guess the HA “remembers” the old entities then. Can you rename these from the front end? Open the entity card and top right the settings.

I guess my system was fubar because of too many crashes and (partial and full) restores.
I have already started again from scratch.

Renaming via frontend - That worked. :+1:
Thanks