sprut666666 / com.sprut.homekit

Homekit app for Homey
77 stars 13 forks source link

Added occupancy sensor support based on Homey presence state. #3

Closed robertklep closed 6 years ago

robertklep commented 6 years ago

I thought it would be nice to map presence state, as maintained by Homey, to a HomeKit OccupancySensor (strictly speaking, these are meant for devices that track room occupancy, whereas Homey tracks what amounts to home occupancy).

I use nl.terryhendrix.smartpresence in a flow that sets presence state, and any changes will be reflected in the state of the sensor.

Tracking a user's presence is entirely optional, which means that for each registered Homey user you can set their "tracked" state in the Settings. When a user is being tracked, an OccupancySensor is added to the HAS, and when the user is untracked, that sensor is removed.