Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Kellojo opened this issue Oct 2, 2022 · 2 comments
Open

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

Kellojo opened this issue Oct 2, 2022 · 2 comments

Comments

@Kellojo
Copy link

Kellojo commented Oct 2, 2022

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
Copy link
Contributor

jsiegenthaler commented Oct 2, 2022 via email

@Kellojo
Copy link
Author

Kellojo commented Oct 2, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants