Create MQTT sensor for presence detection of BLE devices

AFAIK there has been an unanticipated certificate change on the GitHub side, as described in the 1.8.0 release notes

I only ever use the PlatformIO OTA installs anyway, as I’m using custom environments, so for any only awkwardly reachable gateway this might be the best option.

With the newly changed certificate this should not be an issue again in the future.

So this means… I have to locally web flash them once again to switch/upgrade from some-kind-of-1.7.0 to latest 1.8.0?

Edit: Upgrade finally done. Back to 1.8.0 stable.

But, INTERESTINGLY @DigiH my Mi Scale became unavailable in HA (MQTT integration) once I upgraded all my OMGs. I had to restart my TheengsGateway (HA addon which may have been stuck), seems like the Scale is only read by the TG but not the OMGs (one is right next to the Mi Scale…) anymore (even I can see the scale in both OMG’s BTtoMQTT topics)…

That is very weird, as the Xiaomi scales’ decoders haven’t been touched in two years.

What do you mean exactly by unavailable?
Did you possibly delete its discovery entries somehow, so it had to be rediscovered, by Theengs Gateway this time?
How does the state_topic look like further above from your last screenshot?
Can you see the Xiaomi Scale messages coming in on your OMGs when doing a weighing, and up to 20 minutes later?

I cannot find any issues, admittedly with my XMTZC05HM, here at all.

What do you mean exactly by unavailable?

Well, all entities were unavailable in HA.

Did you possibly delete its discovery entries somehow, so it had to be rediscovered, by Theengs Gateway this time?

Nope, did not delete anything.

How does the state_topic look like further above from your last screenshot?

It looks good, checked it twice.

Can you see the Xiaomi Scale messages coming in on your OMGs when doing a weighing, and up to 20 minutes later?

Yes, takes a while.

So everything seems to work, it’s just that "via_device": "TheengsGateway" and the fact the entities were unavailable in HA until I restarted the TG which confuses me a bit. Maybe I would have had to wait longer - after upgrading both OMGs I waited ~ 10 minutes (even performed a weighting).

The discovery entries definitely must have been deleted, as this is what usually happens when previously discovered devices have had their discovery entries deleted. And you didn’t have discovery on (plus a restart) on your newly updated OMGs, so that they would not discover the scale again. Only when you restarted TG, with discovery on, did you get new discovery entries for the scale.

You might as well want to turn discovery off in TG now, just to not discover any additional devices passing by your house.

:stuck_out_tongue_winking_eye: I actually meant if you could paste it, but if you say it looks fine, I believe you, as long as it starts with two wild cards +/+/ it will correctly also pick up all the scale MQTT messages for all your OMGs. The actual discovery device

“via_device”: “TheengsGateway”

is purely informational and doesn’t make any difference.

1 Like

Ah right, I forgot about the “Auto discovery” switch.

Interestingly I was wondering why the firmware for the device in MQTT integration (HA) did not upgrade, even after reloading MQTT integration:

Now once I enabled this for 3 seconds…
grafik

…also the firmware version immediately got updated (finally, though a HA restart would be needed):

So it seems like this autodiscovery switch does quite some “magic” next to what it sounds like it does :wink:

I’m good for now I think, don’t want to waste your time any longer. Thanks!

1 Like