No new Dallas entity after changing ESP device

I have an ESP 32 dev board which died so I’ve replaced it. I copied and pasted the original config to the new device and it installed just fine. I have a number of binary sensors and note that these all still exist but are unavailable (because the node that they were part of no longer exists). I also note that new entities have been created with the suffix “_2” added to the end of the name. These are all working fine so I’ll just delete the original entities and add the new ones to the front end and to any automations which used the old entities. That’s all fine and dandy.

BUT. I also have a Dallas temperature sensor and no new entity has been created for this. I only have the original entity which of course is showing as unavailable (because it is linked to the now defunct ESP module). I’ve tried changing the name of the Dallas sensor in ESP home and uploading that file to the module, but that entity name does not show up anywhere in Home Assistant - only the original (unavailable) entity name. I’ve tried a restart of home assistant but that didn’t help.

So it seems to me that the entity is somehow linked to the unique id of the Dallas sensor and this is turn is linked to the old, defunct ESP module even though I have deleted that device from ESP home. The question is, how can I make the Dallas device available for use with this replacement ESP32?

So the correct (and easy way) would have been to delete the esphome integration of the “dead” device before adding a new device with the same name. That way you wouldn’t need to bother with non existing entites and suffixes.

For the dallas thing it might help to just check the logs of your esphome node and maybe paste them here if you can’t help yourself.

Before adding the new device, I selected the old device, clicked on the 3 dots and selected “delete”. If that is the incorrect way of deleting a device, can you explain how it should be done?

Not sure how much of the log you want to see but here is what I guess is the relevant part.

[22:37:12][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Heating Valve'
[22:37:12][C][gpio.binary_sensor:015]:   Device Class: 'opening'
[22:37:12][C][gpio.binary_sensor:016]:   Pin: GPIO25 (Mode: INPUT_PULLUP, INVERTED)
[22:37:12][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Water Valve'
[22:37:12][C][gpio.binary_sensor:015]:   Device Class: 'opening'
[22:37:12][C][gpio.binary_sensor:016]:   Pin: GPIO26 (Mode: INPUT_PULLUP, INVERTED)
[22:37:12][C][logger:189]: Logger:
[22:37:12][C][logger:190]:   Level: DEBUG
[22:37:12][C][logger:191]:   Log Baud Rate: 115200
[22:37:12][C][logger:192]:   Hardware UART: UART0
[22:37:12][C][esp32_touch:029]: Config for ESP32 Touch Hub:
[22:37:12][C][esp32_touch:030]:   Meas cycle: 8.19ms
[22:37:12][C][esp32_touch:031]:   Sleep cycle: 27.31ms
[22:37:12][C][esp32_touch:051]:   Low Voltage Reference: 0.5V
[22:37:12][C][esp32_touch:071]:   High Voltage Reference: 2.7V
[22:37:12][C][esp32_touch:091]:   Voltage Attenuation: 0V
[22:37:12][C][esp32_touch:097]:   IIR Filter DISABLED
[22:37:12][C][esp32_touch:104]:   Touch Pad 'Airing Cupboard Water Leak2'
[22:37:12][C][esp32_touch:105]:     Pad: T7
[22:37:12][C][esp32_touch:106]:     Threshold: 30
[22:37:12][C][status:034]: Status Binary Sensor 'Airing Cupboard Status'
[22:37:12][C][status:034]:   Device Class: 'connectivity'
[22:37:12][C][dallas.sensor:072]: DallasComponent:
[22:37:12][C][dallas.sensor:073]:   Pin: GPIO23 (Mode: OUTPUT)
[22:37:12][C][dallas.sensor:074]:   Update Interval: 60.0s
[22:37:12][D][dallas.sensor:079]:   Found sensors:
[22:37:12][D][dallas.sensor:082]:     0x773C01D07560B928
[22:37:12][C][dallas.sensor:087]:   Device 'Hot Water Temp'
[22:37:12][C][dallas.sensor:087]:     Device Class: 'temperature'
[22:37:12][C][dallas.sensor:087]:     State Class: 'measurement'
[22:37:12][C][dallas.sensor:087]:     Unit of Measurement: '°C'
[22:37:12][C][dallas.sensor:087]:     Accuracy Decimals: 1
[22:37:12][C][dallas.sensor:095]:     Address: 0x773C01D07560B928
[22:37:12][C][dallas.sensor:096]:     Resolution: 12
[22:37:12][C][captive_portal:148]: Captive Portal:
[22:37:12][C][ota:029]: Over-The-Air Updates:
[22:37:12][C][ota:030]:   Address: heating_valves.local:3232
[22:37:12][C][api:095]: API Server:
[22:37:12][C][api:096]:   Address: heating_valves.local:6053
[22:37:20][D][dallas.sensor:153]: 'Hot Water Temp': Got Temperature=25.1°C
[22:37:20][D][sensor:117]: 'Hot Water Temp': Sending state 25.06250 °C with 1 decimals of accuracy
[22:38:20][D][dallas.sensor:153]: 'Hot Water Temp': Got Temperature=25.1°C
[22:38:20][D][sensor:117]: 'Hot Water Temp': Sending state 25.06250 °C with 1 decimals of accuracy

Note that the entity has the name “Hot Water Temp” but no such entity is available in Home Assistant. Only the defunct entity for that sensor which was “Hot Water Temperature”.

Have you re added the sketch in integrations? If so when you click on the node and the page that comes up with all the attached entities, you can’t see it there?

The doubled entities, look in .storage for esphome files. There will be a copy of the old configuration. It will not have the same name, you will need to open the files to find it. If you sort by date it should have the oldest modified date.

Yes I’ve added the new node to integrations. What I get is this

If I click on any entity, other than "Hot Water Temperature, the IDs all have the _2 suffix. But “Hot Water Temperature” does not have any such suffix. I’ve also tried renaming that sensor in ESPHOME to be “Hot Water Temp” and re-upoading that to the device. But the only entity I see is still that old one which of course is unavailable.

Maybe you have set ‘internal: true’ on your Dallas temp sensor so it does not get exposed to ha?

Update. I looked in .storage for esphome files and managed to find the file for the old node and the file for the new one. Comparing the two, the “unique_id” for all other sensors is different. BUT, the unique_id for the Dallas sensor is the same in both cases. The key is different and the name is different but the unique_id for both is “unique_id”: “dallas-773C01D07560B928”,. That part of that id after “dallas-” matches the address of the sensor which is 0x773C01D07560B928

So I guess that’s the cause of the problem. The question is, what to do about it? I guess I could go out and buy another Dallas sensor which would force a new unique id but that seems a little excessive.

Remove the old node in the ESPhome panel and remove it in the HA integration.
Restart HA

Normally it’s enough to delete the old integration (which will automatically delete the the corresponding device which normally has the same name as the integration).

Best is always to do this before adding a new integration with the same name (esphome node name) - if you do it after you might need to delete the new esphome node (integration) too, check that all corresponding devices are gone and than add the new esphome node (integration) again. You should have a fresh start than and everything working.

For me this looks like a inconsistency for the esphome Dallas component actually - all other entities always inherit from the esphome node itself (and it’s unique I’d).

Many people don’t really understand the concept of esphome.

It doesn’t matter to ha at all what yaml’s/devices you have in you esphome dashboard (panel) - it’s in no way connected to ha integrations or devices.

Restarting is typically also not needed when working with integrations and devices (but actually can somewhat help with cached things)…

Ahh, we are getting closer. I removed the old device from esphome and naively thought that would remove it from HA completely. But looking at configuration - devices, I see the old device is still there. How do I delete it from HA? I can see a toggle button which will dassable it but nothing obvious about how to delete the device.

I solved the same problem a few days ago and it helped.

Click on the old node in the integration panel and use the three dots to select delete.

Yes I’ve done that. The node doesn’t show up in the esphome integration panel, but its still showing up as a device in HA (configuration - devices).

I don’t mean the ESPhome panel, but where you have all the integrations

Did you use the “new” esp already with another esphome sketch in the past?

It can be it’s actually already registered… Things get than get a bit messy and one esphome integration which under normal circumstances reflects exactly one (esphome) device can than have more than one device.

Please check who is the “parent” integration of your (esphome) device you want to see gone and delete this corresponding esphome integration

AFAIK, this is a brand new, unused ESP32

Delete hereesp

Yes , I’ve said multiple times that I’ve done that.

Did you restart HA?