Help with checking if Xiaomi component started or not on boot

Hello everyone!

I was wondering if there is a reliable way to check if the Xiaomi component started successfully on Hassio boot/start up?

Sometimes, specially on a power outage, Hassio comes back earlier than the Xiaomi gateway connects to Wifi and opens its ports to make itself available for the component to connect to it and set things up on boot.

If there is a way to check if all sensors are configured and available on the front end, I could set the startup automation to reboot again if it does not happens.

Another very useful case is to not start HomeKit until everything is fine, causing the Home App on iOS to remove all undetected devices from the settings, so I will have to reboot Hassio and then reconfigure all sensors on the app, setting their room, type, names and so on. Since I have 95 accessories, this causes a lot of problems for me.

That would be the same as documented on the component with Z-Wave, but with Xiaomi’s. I believe it does not leave any events, just logs. Not sure the best way to do this? Maybe checking the hub’s light availability? Sensors?

Thanks a lot!

I have this problem a lot and would also love to monitor it’s status. I plan on moving to an open source zigbee gateway but I’m undecided on what to go for as I also have LOTS of Xiaomi sensors and worried about the limitations of moving to another GW.

The logs normally show the Xiaomi component has failed. There must be a way to parse the log in an automation? Never actually tried this before or even thought of it until I saw your post.

1 Like

Hello!

I am also planning on that too, just bought all equipment needed to use zigbee2mqtt project.

The main reason now is to migrate from the addon homebridge to native homekit component.

I hope someone could help us out here!

Thanks!

Maybe @Danielhiversen? Not sure, he is very busy man :slight_smile:

Hi there.

You do get a permanent notification in Home Assistant when that happens, right? If that’s the case, I might have an idea for you…

Hello!

I don’t think so. The component will load normally, with or without the gateway discovered/connected.

There is no persistent notification on the HA dashboard.

Did you ever find a solution to this?
I would like to implement this check for my vera, hue and Xiaomi hubs.

Hello.

I’ve been using this code on my Home Assistant start up automation:

    - service_template: >
        {% if (is_state('light.gateway_light_34ce0090940e', 'on' ) or is_state('light.gateway_light_34ce0090940e', 'off' )) %}
          homekit.start
        {% else %}
          script.homekit_no_start
        {% endif %}

If device is not on or off (unavailable) I’ve created a script to not start the component and warn me.