How to get button double tap and hold to work and override motion for set time?

hello

Have been buying motion sensors and more lights lately. motion to reduce the "on time" and more lights to shut them off.

I have an issue that keeps bothering my wife lol

I have the kitchen main lights set to come on only with a press of the switch, and trying ot add the button right now. (i'm not even sure this is setup right but i got it working lol)
it comes on fine but double press is NOT shutting it off? how do i do this?

Finally the light are set to turn off with motion but when the wife is cooking is "like a stone" and the 3 motion sensors in the kitchen do not pick up small movements. (like when cutting back is to the motions sesnors)

what i want is for when she presses this button once it make like a "cooking override" so it will turn on the main lights to 100% and disable or set the motion to like 30 minutes.

I would also like to do this on the undercab lights, set to 100% set to "daylight"

however the catch is I want this to self heal and go back motion only after timer above expires (no motion 30 minutes) OR after the button is pressed 2x

There are multiple ways to do this. One that comes to mind is:

Trigger:
Button Press

Action:
Turn on virtual switch
wait 30 minutes
Turn off virtual switch

With a β€œwait” command, pressing the paddle again will cancel the first wait, and hence start over.

In your rule that turns off with motion, set it to be cancelled/inactive when the virtual switch is on.

An alternative to this (which is what I do) is to set a notification 30 seconds before the light will turn off. Then my wife (or kids or me) know to move a bit to re-activate it.

As for double-press of the button - when you double-press it, does it somehow indicate that it has been double-pressed in its device screen?

If it does, then this same command could be used as the trigger for your rule.

2 Likes

I like @Sebastien 's approach, particularly the first one utilising a virtual switch. This provides a lot of flexibility, at least in terms of a broad approach that can be used in a number of locations and situations.

I have similar requirements for wanting to disable motion lighting. I have Hue Dimmers in most of my rooms and whenever I turn the lights on using these, the motion lighting is disabled, then when I turn them off, the motion lighting rules resume, much like your use of the single and double-tap. I use something similar with a Samsung button on my Study desk, which disables the motion lighting and turns on my TV (monitor), but have not got around to automating the transition out of the mode after I finish work.

To add to my comment around the flexibility of the virtual switch... Many of the rules apps have the ability to override features using them, so it naturally fits within the way Hubitat have developed their apps. It also opens up possibilities to trigger the disabling of motion lighting for other reasons, without the motion rules needing to change, such as keeping the lights on while watching TV.

2 Likes

okay so right now i have (after i crash my habitat 2 times lol i had rule loop lol)

Please don't laugh if this is bad but like i said i got it working)
KITCHTEN AUTO LIGHT (main big lights)
I not have it on with switch or button press, off with switch or button press

so press new button they turn on, press again for off.

now I tried the "don't turn off if button" I found the button app and was able to make the button (Third Reality smart button) hit button "2" on double tap

this is working but now the lights are stuck on. how do i end this ? or do i have to pull this rule into rule machine now?

As for double-press of the button - when you double-press it, does it somehow indicate that it has been double-pressed in its device screen?

the logs report and double tap but they all report as button "1"...... ugh the "motion lights" app will not all my to use the reported "double tap" only button #

Trigger:
Button Press

Action:
Turn on virtual switch
wait 30 minutes
Turn off virtual switch

so will this 30 minute timer reset on further motion?

i think i will try and set this up.

but first how do i fix it? how to i tell it to stop the override and use motion again ?

thank you both so much you are always super helpful :slight_smile:
image

It might take me at least a few minutes to digest, but a general suggestion would be to start with something small, e.g. motion activation (which you don't appear to have in the screenshot you posted, then add the various extras you are after. Apologies if you have done this, just a bit to take in, that's all.

There are probably a couple of things that may need to change, but I think the disabling of OFF with the Kitchen button 2 would be causing you problems, if want that to be one of the ways you actually turn the lights off.

I don't have the big kitch lights turn on with motion, I have another rule for the under cab lights that does, I removed motion from these light on purpose (really bright not needed most of the time with undercab lights

so I got the button set so that 1 press turns on (if off) and one press turns off (if on)
this is the "toggle lights on/off" above

but the Button 2 has now* disabled the motion off and I cannot figure out how to enable it lol

I think what you are saying above is to make another rule or sence/virtual button that button 2 would activate and override while active correct?

im trying to look in the "new "room lighting" but i havn't even been able to get simple stuff to work in there

other rule

Ok, let's focus on the earlier motion lighting rule then, i.e. the Kitchen Auto Lights.

Try taking the Kitchen Light Dimmer out of the Options for On (bottom left panel). I expect the inclusion of the dimmer in the Light to Turn On section will be enough. Also remove the dimmer from the Off options, bottom right panel. Remove the Button 2 from this section as well, where is is used to disable turning off.

There'll be one or two more options to add, I just need to check the options available.

okay i can do that

(question - is my understanding and experance if the dimmer is not in the "on and off" options the rule breaks and if a switch is manually turned on or off the automation ruls doesn't "fire" and that means the light will just stay on or not come on the next time someone walks in

Also I put "enable on button push" into the rule log show it enable but lights are turning off

I will make the correction above

Try using the Buttons to Turn lights on, rather than the toggle option you have used for button 1

Then try adding button 2 into the buttons to turn lights off:

I'll just add, we'll most likely want to swap out the buttons from the motion lighting rule eventually, replacing them with virtual switches like Sebastian and I were talking about, but let's get this working first...

current on off with button is working fine on the toggle it jsut not turn off with motion...........

let me flip it around

completed
NOTE: dog active the motion and the lights turnd off after that - i think i have to rule setup wrong - while i fine rule machine harder to get working it seems more reliable after....

edit: tested button works fine
image

1 Like

so now that the above is working what are next steps ?

Unfortunately for me it is to get ready for work :slightly_smiling_face:

But to try and get you started... Would I be right in thinking when the lights are turned on using the button, you want the 30 min pause in motion lighting? If so you want to

  • Create a new virtual switch
  • Setup an RM rule like @Sebastien described to manage a virtual switch
  • Have that virtual switch disabling both on and off in the ML rule we have been looking at

There may be one or two more changes, but I think that will get you started.

1 Like

lol i'm just getting off work :stuck_out_tongue: I will read back and see what i can do. (ill try not to crash my HUB this time)

1 Like

You may want to think about how you want this 30 min timeout to work with the double-tap.... But start small and then we can get to that part. Good luck.

in a perfect world double taping would "replace" the current 2 minute time out with 10-20-30 minutes.
once that say 30 minutes i completed it would go back to the normal 2 minutes.

so: use 2 minute timer unless button is press use 30 minutes, after 30 minutes if no motion go back to 2 minutes

still working this but i noticed something - should it work like this ?

If i turn the lights on the button, the motion rules never kicks in, i never noticed this before with the switch since the switch has motion sensor it nearly impossible to turn on the switch with out tripping motion

image

okay it worked like 90% ( i reduce the time to 5 minute for testing)

the kitch AUTO worked and turn off after time and then 2 minutes later (no motion)

the kitchen under cab are currently stuck on............. posiibly no motion event in after the timer?

how do you work around that?