I have several Sonoff Basic switches which are all called switchXX
where XX
are two digits. I used to have them flashed with ESPurna (and communicate with HA though MQTT) but I decided to move them to ESPHome.
To do this, I used the same steps for ~20 switches:
- reflash the switch
- remove it from HA (via the web interface)
- add it to HA though the ESPHome component.
The reason for this approach is to make sure I have clean switch.switchXX
entries, and not something like switch.switchXX_2
because of an existing switchXX
entry. As you can imagine, this is a learned experience
So now all my switches are moved and they have the right names. Except one, namely switch02
(there is nothing special with this switch).
When starting HA, I see in the logs:
2020-08-19 16:05:40 ERROR (MainThread) [homeassistant.components.sensor] Platform esphome does not generate unique IDs. ID 68c63aa3ad46-wifisignal already exists - ignoring sensor.switch02
2020-08-19 16:05:40 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform esphome does not generate unique IDs. ID switch02binary_sensorswitch02 already exists - ignoring binary_sensor.switch02
2020-08-19 16:05:40 ERROR (MainThread) [homeassistant.components.switch] Platform esphome does not generate unique IDs. ID switch02switchswitch02 already exists - ignoring switch.switch02
Apparently, there are some artefacts left from the “old” switch02
(why, I do not know). Despite the log messages switch02
works perfectly and is seen correctly by HA: (the ESPHome integration also sees one switch02
, 2nd screenshot below)
When searching for switch02
in the entities (though the web interface) I see only what is above. There are no traces of the other entries form the log.
While this is mostly an aesthetical/cleanup point (because switch02
works as expected) I would like to understand how to get rid of these entries.
I imagine I could fiddle with the contents of .storage
because I do see them there, but I would prefer a softer approach first (domain redacted):
/etc/docker/data/hass/.storage(master*) # grep switch02 * root@srv
core.config_entries: "host": "switch02.my.domain",
core.config_entries: "title": "switch02",
core.config_entries: "host": "switch02.my.domain",
core.config_entries: "title": "switch02",
core.device_registry: "name": "switch02",
core.entity_registry: "entity_id": "binary_sensor.switch02",
core.entity_registry: "original_name": "switch02",
core.entity_registry: "unique_id": "switch02binary_sensorswitch02",
core.entity_registry: "entity_id": "switch.switch02",
core.entity_registry: "original_name": "switch02",
core.entity_registry: "unique_id": "switch02switchswitch02",
core.entity_registry: "entity_id": "sensor.switch02",
core.entity_registry: "original_name": "switch02",
core.entity_registry: "entity_id": "device_tracker.switch02",
core.entity_registry: "original_name": "switch02",
core.restore_state: "friendly_name": "switch02",
core.restore_state: "entity_id": "switch.switch02_2",
esphome.0841eee4ac7f43c683fbe804bdf2352e: "name": "switch02",
esphome.0841eee4ac7f43c683fbe804bdf2352e: "object_id": "switch02",
esphome.0841eee4ac7f43c683fbe804bdf2352e: "unique_id": "switch02binary_sensorswitch02"
esphome.0841eee4ac7f43c683fbe804bdf2352e: "name": "switch02",
esphome.0841eee4ac7f43c683fbe804bdf2352e: "name": "switch02",
esphome.0841eee4ac7f43c683fbe804bdf2352e: "object_id": "switch02",
esphome.0841eee4ac7f43c683fbe804bdf2352e: "name": "switch02",
esphome.0841eee4ac7f43c683fbe804bdf2352e: "object_id": "switch02",
esphome.0841eee4ac7f43c683fbe804bdf2352e: "unique_id": "switch02switchswitch02"
esphome.6f498b337d14425f8f2516a8687e62a3: "name": "switch02",
esphome.6f498b337d14425f8f2516a8687e62a3: "object_id": "switch02",
esphome.6f498b337d14425f8f2516a8687e62a3: "unique_id": "switch02binary_sensorswitch02"
esphome.6f498b337d14425f8f2516a8687e62a3: "name": "switch02",
esphome.6f498b337d14425f8f2516a8687e62a3: "name": "switch02",
esphome.6f498b337d14425f8f2516a8687e62a3: "object_id": "switch02",
esphome.6f498b337d14425f8f2516a8687e62a3: "name": "switch02",
esphome.6f498b337d14425f8f2516a8687e62a3: "object_id": "switch02",
esphome.6f498b337d14425f8f2516a8687e62a3: "unique_id": "switch02switchswitch02"
esphome.fb94b3930d0c4d409982cecf05ad100e: "name": "switch02",
esphome.fb94b3930d0c4d409982cecf05ad100e: "object_id": "switch02",
esphome.fb94b3930d0c4d409982cecf05ad100e: "unique_id": "switch02binary_sensorswitch02"
esphome.fb94b3930d0c4d409982cecf05ad100e: "name": "switch02",
esphome.fb94b3930d0c4d409982cecf05ad100e: "name": "switch02",
esphome.fb94b3930d0c4d409982cecf05ad100e: "object_id": "switch02",
esphome.fb94b3930d0c4d409982cecf05ad100e: "name": "switch02",
esphome.fb94b3930d0c4d409982cecf05ad100e: "object_id": "switch02",
esphome.fb94b3930d0c4d409982cecf05ad100e: "unique_id": "switch02switchswitch02"