Hi all, I need some generic help on what’s the best way to handle devices that are not always available.
For example I have a Xiao Mi Smart Fan that I used only during summer time.
It’s correctly configured in HA, but when I turn it off in autumn, my logs starts filling in with such errors:
2021-10-06 18:35:37 ERROR (MainThread) [custom_components.xiaomi_miio_fan.fan] XiaomiFanMiot Got exception while fetching the state: Unable to discover the device 192.168.5.109 , _retry=92
what’s the strategy for situations similar to this? Do I have a way to disable the device from within the UI? Or with an automation?
The entity doesn’t have a unique_id, so it can’t be disabled. You’d need to ask the developer of the custom component that he adds unique_id to the entities, otherwise you’re out of luck.
Leave it on, but ensure whatever automation turns it on and off only does so when you want it to be active, possibly using the season sensor Season - Home Assistant
I thought I would use this existing (older) thread rather than starting a new one that is almost identical. If I should have started a new thread - I’d appreciate a moderator letting me know and I’ll move it and do better next time.
I have the same issue, but unfortunately the suggested solution has its own list of implications in my use case.
I’ll use an example of a zigbee soil-moisture monitor. This device pretends (but that’s another story!) to send you soil moisture levels and soil temperatures. In the winter when temperatures drop here to -20C and below, I remove the device and bring it inside. I also remove the batteries so they don’t leak while in storage.
a) With the batteries out, the HA log gets significant errors (90% of my log entries appear to be related to this) - about 2-5 entries per second, each entry 5 lines long).
b) With the device “disabled”, all of my dashboards that display information from this device show errors (battery level, moisture level, temp, etc) - not a clean look.
c) I could create a user setable helper toggle called “Soil Monitor Removed for Winter” (for example), and use this as a condition in some of my dashboards - but not all (I cannot conditionally display items in some cards) .
d) right now, the only thing I can think of is to leave the batteries in - and in dashboards where I can put a condition, test that if the soil moisture level = 0%, assume the device is disabled and display a message as such. This isn’t ideal either as in the summer - if my soil actually was super-dry - I wouldn’t get alerted.
I might have to use a combination of C&D above - but before I do, I’m very curious as to what other users have done to handle seasonal devices.