SmartThings Presence Detector with ZHA

I have a couple of these old sensors laying around and never really got them working with Home Assistant and ZHA. I did notice there are some old threads with some custom code (like THIS ONE), but they seem abandoned. I am leary of using code >6 months old at this point.

Not sure how long ago it was implemented, but I did notice that I now have zha.entity entity ids that list the mac address, lqi, and rssi. The state also shows online/offline. This is very useful in general.

It seems like this should be usable in making the presence detectors work by creating some template binary sensors based on online/offline status or even rssi. The problem is, the sensor never goes “offline”, even if I remove the battery for an extended period of time. Are there any other workarounds for this?

Honestly, I’m not sure. For the time being, I’ve reverted to using the presence sensors connected to smartthings, and then connecting via mqtt… not ideal, but best solution until zha is made to natively work with it.