benzman81 / homebridge-http-webhooks

A http plugin with support of webhooks for Homebridge: https://github.com/nfarina/homebridge
GNU General Public License v3.0
178 stars 57 forks source link

Occupancy Sensor abort autoRelease, if new occupancy is detected #168

Open Kellojo opened 2 years ago

Kellojo commented 2 years ago

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?

jsiegenthaler commented 2 years ago

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: @.***>

Kellojo commented 2 years ago

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