I’m using a curtain motor. It will disappear from the entity list once in a while but it will come back after I reboot Pi. I notice there is a message about it in the log:
You are using a custom component for cover.hassmart which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
It could be the problem of the motor itself. The only way I can think of is to config an automation and reboot automatically. Since the entity has disappeared, I don’t know how to trigger an automation from it, but I try the following template in the developer tools section and is appears as “True”:
You can ignore this message in the log. It appears on every restart for every custom component, it’s just a warning that this custom component might cause problems. You could disable it if you want to.
Instead of making a workaround, I would rather try to find out why your Pi disappears from the entity list, but to each his own.
Thanks very much for you prompt reply, Tinkerer. I’ve tried you way. But it couldn’t trigger either. I think it is because the entity “cover.hassmart_192_168_2_76” had disappeared from the entity list and therefore, its state didn’t exist, so it won’t trigger the automation. That’s why I try the template trigger. Even though the entity “cover.hassmart_192_168_2_76” had disappeared, but when I tried to get the state of it by using template, it returned “True”. I just couldn’t figure out why the automation couldn’t be triggered when the condition was satisfied.
My bad for the formatting. I’m not quite familiar with this editor. Below is the automation I tried to make it work:
Thanks for your reply, Burningstone. I noticed the message in the log long before the problem happened. Since the program is provided by the motor vendor, and I’m not familiar with python, there is nothing I can do about it. So I just ignore it.
The only way I can think of now is to reboot manually when the curtain motor disappears from the entity list. This is tiresome. That’s why I try to make it automatically.
After reboot, It appears back in the entities list and works well.
At this time, when I put
{{ states(‘cover.hassmart_192_168_2_76’) == ‘unknown’ }}
in the template editor, it shows “False”.
Many thanks for your help, Nickrout. I’m now using the example code as you suggested. Since it’s from the official document, I think it will work. I’ll update if it didn’t. Thanks again!