Is it possible to make this switch with an enable auto off option. I really need a momentary switch that will work with this child device. I was told the device that is labeled button trigger will work but it does not.
This seems like a Konnected question for @nate, they could potentially make a new driver for the siren that allows an auto off function
In the meantime though, you could create a Rule Machine rule that would trigger on the siren turning on and then after a 5 second delay (or whatever auto off delay you want) turns off the siren again. You can probably use Basic Rules or Simple Automation Rules or even the Visual Rules Builder for this if you are more familiar with those, but Iโve only ever used Rule Machine so I canโt say for sure that you could do the same in the other apps
Hubitat does publish the code for a Generic Component Switch in their code examples on Github.
I took that driver and added an auto off preference. You are welcome to try this
@user2574 It works. Thank you so much. I do not know anything about writing code. Would you mind putting 750 ms in there. Konnected support has been no help. I have a pro board on the legacy drivers that has worked great and was testing a older wifi board before flashing my pro board. I use the momentary for a keyswitch.
Sure. I see there is a runInMillis() method, so I changed it to msecs and added 750msecs as an option.
Code is updated at the same link.
@user2574 Thanks, a lot, really appreciate you doing that. It works perfect from what I see so far. If I were to add some other times would I just add them in between what is highlighted?
Yes, it is pretty easy. Just add a new bracket section and a comma to separate it from the next one. You might want to remove times you do not need as well. Whatever you change will just appear in the driver preferences after you save the driver code.
The two things in brackets are the actual number to use, and what to display in the menu, so you can change how you want it displayed as well.
Thanks again for your help.