core: 1-wire device on RPi cannot be removed
The problem
After physically removing/disconnecting 1-wire temperature sensor (DS18B20) from RPi4 the device is still in the Integration page. I do not use configuration.yaml for 1-wire integration. After removing the sensor I have several time restarted and rebooted my instance and this did not help. Still when I go to Configuration/Integrations I see 4 devices and 3 entities. When I click on “4 devices” I get the list and the one which is removed can only be disabled. I am not able to remove/delete it. It should be possible to delete this device.
What is version of Home Assistant Core has the issue?
core-2021.3.0 - but also previous ones have it
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
1-Wire
Link to integration documentation on our website
https://www.home-assistant.io/integrations/onewire/
Example YAML snippet
There is no entry in configuration.yaml for this integration
Anything in the logs that might be useful for us?
# Put your logs below this line
Logger: homeassistant.components.onewire.sensor Source: components/onewire/sensor.py:430 Integration: 1-Wire (documentation, issues) First occurred: 4 March 2021, 15:54:45 (18 occurrences) Last logged: 09:49:16
Cannot read from sensor /sys/bus/w1/devices/28-3c01a8168f7a/w1_slave: Unsupport response [] Cannot read from sensor /sys/bus/w1/devices/28-0000049212b9/w1_slave: Unsupport response [] Cannot read from sensor /sys/bus/w1/devices/28-00000492032b/w1_slave: Unsupport response []
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 23 (14 by maintainers)
Commits related to this issue
- Cleanup orphan devices (https://github.com/home-assistant/core/issues/47438) — committed to epenet/home-assistant-core by epenet 3 years ago
- Cleanup orphan devices in onewire integration (#48581) * Cleanup orphan devices (https://github.com/home-assistant/core/issues/47438) * Refactor unit testing * Filter device entries for this co... — committed to home-assistant/core by epenet 3 years ago
- Cleanup orphan devices in onewire integration (#48581) * Cleanup orphan devices (https://github.com/home-assistant/core/issues/47438) * Refactor unit testing * Filter device entries for this co... — committed to home-assistant/core by epenet 3 years ago
- Update fork (#4) * Bump HAP-python to 3.4.1 for homekit (#48444) * Bump aiodiscover to 1.1.2 for dhcp (#48445) * Remove myself as codeowner of HomematicIP Cloud (#48437) * [ci skip] Translat... — committed to RenierM26/core by RenierM26 3 years ago
But for 1-wire we have no way to know if the device is missing purposefully (removed) or temporarily/accidently (device failure or wiring issue) so I don’t want to implement automatic cleanup of entities. In my opinion it is better to have them unavailable (to be deleted manually) than disappearing unexpectedly.
For devices, there is definitely a case for automatic cleanup if there are no attached entities. Possibly with a code similar to this one (extracted from deconz):
Then the last question becomes: where is it best to place this code?
It seems
zwave_jsintegration has it implemented on restart - but it’s also a complicated place as need to ensure the platforms have been fully initialised and also that server isn’t attempting to stop…@epenet - I very much appreciate and fully support your approach !
Exactly, it may happen that wire to your sensor gets disconnected (or cut) in which case you do not want the device and entity to be removed. I would expect some sort of notification which in a way today exist in the form of WARNING in the log (maybe from user prospective it would be “nicer” to have more specific indication ? (There might be several warnings which not always gets proper attention) to give to user.
So, I would also support @Misiu to open possibility to delete device but not remove it “automatically”.
@frenck
I am afraid I do not have enough knowledge to “contribute” so at this point of time I would leave it as bug report… Thanks.