How can I create presence sensors in homekit?

It may be simple but I’m still new at this…
Since 0.66, we can filter what is added in homekit component.

I would like to have a presence sensor (or switch maybe) in my homekit accessories that basically is on when I’m home and off when I’m not.
Kind of like that with homebridge
https://www.npmjs.com/package/homebridge-people

In HA, device_tracker. works great but I don’t think I can add this directly in homekit, I think it needs to be a switch or sensor…

I would say I would need to create a template switch but I have no clue how…

Any help would be appreciated…

this: Homekit/iPhone Multi-user Presence Detection Using Homebridge might help you

but the point was to not use homebridge, I just don’t see the point now with 0.66

I created a template sensor and it’s working great but after I try to include it in homekit component, it doesn’t add itself in homekit…
How could I make this sensor to kit the supported homekit sensors (or switched)?
https://www.home-assistant.io/components/homekit/#supported-components

my template sensor:
image

According to this, HomeKit is supporting input_boolean , so you can use the method of my link.

Anyway, maybe you don’t want to relay on HomeKit for presence detection, but I guess you can use the same “philosophy” to create a input_boolean which changes based on automation triggered by a sensor.

ok I got it to work thanks…
But I didn’t think this through, by making a switch, the homekit user can manually turn it on and off which is not reliable at that point…
Any way to deny the manual switching or it has to be a sensor?
If not, I guess I’ll wait for HA to support this kind a sensor…

Homebridge presence detection does exactly that but the point was to only use HA…