Motion Based Light EXCEPT when Manually turned On

manual
except
off
light
motion

#203

WOW! That app has a LOT of features! I agree that it would probably do what I’m looking for. Unfortunately, when I create a room, set the name, then hit SAVE, it gives me an error, and doesn’t save the room :frowning:


#204

The ST log definitely shows the “turn on” event coming from the Google Home, so it should be possible to distiguish.

If you don’t mind building me the logic framework, I will put in my devices, and see if we can get it to work!


#205

whats the error shown in the IDE log?

did you publish both the rooms manager and rooms child smartapp and the rooms occupancy device from the IDE?


#206

DUH… no. I hadn’t installed the device. I got it all working, but it doesn’t do what I want in terms of changing the light based on the lux sensor, so it’s back to the pistons :slight_smile:


#207

sure it does. just create 2 rules for those lux values. :slight_smile:

or use AL settings to automatically change the level / color temperature with time of day.


#208

The trick I use for this portion of your dilemma is using a Simulated Switch.
(make sure you choose a unique name)

Piston 1:
If SimSwitch turns on
Then turn on favorite lights
End IF

If SimSwitch turns off
then turn off favorite lights
End IF


Piston 2: (the one you are working on)
If Motion changes to active
then turn on favorite lights
End IF

If Motion remains inactive for 10 minutes
and
SimSwitch is OFF
then turn off favorite lights
End IF


The hardest part may be training your household to use the new SimSwitch for Google instead of asking it to turn on the specific lights like they are used to doing…


#210

nah not really that hard. Just name your simulated switch to the name of your lights the way your used to, and rename the original lights to something else


#211

That would work very well…

And if it is a group of lights that Google Home toggles, then you can delete that group, and name the Simulated Switch the same name


#212

did the posts from @WCmore and @Gopack2 solve what you were looking for?

if not please dont hesitate to ask any of us here.


#213

Those are good ideas. I’ve asked for some help with the logic from some friends, but they haven’t had a chance to help out yet.

I’ll post what we come up with, if it does the trick.


#214

try this. i slightly modified the first piston in this thread for what you mentioned in your post. i have set the level to 35% when lux is above 800 otherwise to 70%. if you want to set the level to something else when the lux is below 400 thats an easy change to the set level statement.


#215

Hello everyone,
I’m new to smart things and completely new to WEBcore (and of course I still haven’t figured out how to start…)
I’m sorry because my issue it’s probably something very easy, but I have to admit…I’m lost!
What I want is to have a simple motion sensor activated light controlled by movement, but I also want to capability to disable motion sensor pressing a Flic button I have in my bedroom.
Can somebody point me to the right direction? I don’t know ho w to program, perhaps a piston already made would save me a lot of troubles…
Many thanks


#216

try this:


#217

I like this @bangali, is that an exclamation point on line 47?
I have never seen this before…
Does that toggle the boolean variable each time it is pressed?


#218

thanks, it is.
just cooked it up for OP.
right.


#219

You are DA MAN! I have two more questions:

  1. I assume it only works with booleans, correct?
  2. Does it also work on globals?

#220

works on any data type … always returns a boolean
yes


#221

Thanks to all the posters above; I’ve taken the examples for inspiration and adjusted for my use case:

I wanted the physical switch to pretty much continue to operate as a ‘dumb’ switch; but also add some motion controlled smarts for general use. I’m using the Aeotec Nano Dimmer (as I’m in the UK and the switches don’t work with my wiring).

The physical switch operates as an override to the motion detection, so if you switch it off, motion detection is ignored for the next hour. Operating the physical switch while it is in override mode just drops it back to motion detection controlled. This way if ‘someone’ forgets to turn the light off in override mode it will still eventually turn itself off…

I had a hard time understanding the logic in the first example post, as I didn’t realise that the ‘programmatic’ variable was actually a workaround to the piston not being able to differentiate ‘physical’ and ‘programmatic’. All in all good practice and a learning experience. Very open to any suggestions on how to optimise my code :slight_smile:


#222

I love this idea but would like some help with my situation. What I would like is for my motion to turn on my bulbs for 5 minutes and then turn off if no activity. If the light is manually (ST) turned on, then remain on until manually turned off. I have a “Sleep Switch” that I use that basically disables the motion during sleeping time (so the light doesn’t come on when we go to the bathroom and wake the other person up). In a strange way (timer set for 8 hours) I have the sleep switch turn off - thus the motion is reactivated. I also have a different piston that is supposed to turn on these same lights when my alarm goes off.
How can I incorporate all that into 1 (or 2) pistons? I can’t get my mind to think in combining so I have a ton of pistons running and I think they are getting as confused as I am.


#223

may be try rooms manager? :slight_smile: