homebridge-http-webhooks icon indicating copy to clipboard operation
homebridge-http-webhooks copied to clipboard

Occupancy Sensor abort autoRelease, if new occupancy is detected

Open Kellojo opened this issue 1 year ago • 2 comments

Hi,

I am using this plugin to turn on some lights behind my PC, if the pc is switched on. Currently, I am using the following configuration:

{
            "id": "PC_Status_Sensor",
            "name": "PC Status Sensor",
            "type": "occupancy",
            "autoRelease": true,
            "autoReleaseTime": 10000
}

Every 5 seconds I perform a GET request to turn on the sensor from my pc like so:

http://homebridge.local:51828/?accessoryId=PC_Status_Sensor&state=true

This works great! However, the autoReleaseTime is triggered after every request, causing the lights to turn off after 10 seconds, even if the sensor has received a second request that set's it's state to true. I would expect that the autoRelease timer is reset/restarted, when a new request comes in and the state is true.

To not break existing setups, we could introduce another configuration for the autoRelease, maybe 'resetAutoReleaseOnDetection' or similar.

What do you think?

Kellojo avatar Oct 02 '22 12:10 Kellojo

I think that is a very good idea, and should be implemented for every sensor that has an autoReleaseRegards JochenSent from my iPhoneOn 2 Oct 2022, at 14:26, Kellojo @.***> wrote: Hi, I am using this plugin to turn on some lights behind my PC, if the pc is switched on. Currently, I am using the following configuration: { "id": "PC_Status_Sensor", "name": "PC Status Sensor", "type": "occupancy", "autoRelease": true, "autoReleaseTime": 10000 } Every 5 seconds I perform a GET request to turn on the sensor from my pc like so: http://homebridge.local:51828/?accessoryId=PC_Status_Sensor&state=true This works great! However, the autoReleaseTime is triggered after every request, causing the lights to turn off after 10 seconds, even if the sensor has received a second request that set's it's state to true. I would expect that the autoRelease timer is reset/restarted, when a new request comes in and the state is true. To not break existing setups, we could introduce another configuration for the autoRelease, maybe 'resetAutoReleaseOnDetection' or similar. What do you think?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

jsiegenthaler avatar Oct 02 '22 13:10 jsiegenthaler

I created a pr that implements this behaviour - Happy to implement any changes, if required

Kellojo avatar Oct 02 '22 13:10 Kellojo