ebaauw / homebridge-rpi

Homebridge plugin for Raspberry Pi.
Apache License 2.0
305 stars 18 forks source link

one minute pulse duration #170

Closed Olivierbkk closed 4 months ago

Olivierbkk commented 6 months ago

Hi, would it be possible to extend the limit of pulse to 60 seconds? I tried to change the value to 60000 in the config file but it caps at 5 seconds anyway

ebaauw commented 6 months ago

See https://github.com/ebaauw/homebridge-rpi/wiki/switch-device

Olivierbkk commented 6 months ago

Hello and thanks for the reply, my connected device for this case is a siren. I could use a valve but I try to keep the home app clean with actual devices correct (a valve for a valve, a switch for anything that is not explicitly implemented in HomeKit). Extending the switch max pulse time to one minute would simplify automations in HomeKit. I do not know if there is a limitation in HomeKit but I know that for example the Dummy Switch plugin allows for that...

ebaauw commented 6 months ago

Unfortunately, there's no proper HomeKit support for sirens. I use a Switch as well (for Zigbee sirens in Homebridge deCONZ), with Default Duration to set the time for sounding the siren, but these sirens turn off automatically after the specified duration.

Unfortunately, Valve is the only service in HomeKit with an auto-off feature. I appreciate that it doesn't make sense semantically to expose a siren as valve, but neither does exposing it as a stateless pulse switch. What you need is a stateful (rocker-like) switch, with auto-off after a settable duration. I won't support abusing pulse for that. I could (optionally) add Default Duration to the switch device, with the added benefit that you can set the duration from HomeKit rather than in config.json.

Olivierbkk commented 6 months ago

I can see how a default duration on a switch makes more sense indeed. Would you be willing to implement it?

ebaauw commented 4 months ago

v1.8.13 adds a duration setting to the switch device. When set, Homebridge RPi will expose Default Duration on the Switch service, to turn off the switch automatically.

Olivierbkk commented 4 months ago

Thanks! it's perfect!