I want to switch ON kitchen light if there is a motion detect and illuminance is less 20lux (this part is ok), but I want to turn off if there are no motion since 3 minutes.
I use IF/Then but my light turn OFF after 3 minutes with or whithout motion detection
But Core is just amazing, I discover today ST and itâs so friendly use (before Iâm on Vera)
This will do it for you.
Note the cancel on piston state change
This means that whilst there is motion the light will not turn off.
In your piston when you go to the action for wait and turm off, scroll down and enable cancel on piston state change.
There are several ways to skin a cat. Here is another way you can accomplish your end result. This is a latching piston. Instead of setting a timer initially to turn the light off and relying on the cancel to stop it I am monitoring the motion for staying inactive for my desired time.
I do not have any lux sensors. I uploaded my example to show how a latching piston could be used instead of adding all those restrictions. They already figured out how to get the light to do what they wanted but could not get it to turn off properly. So this would probably be the easiest to edit their current piston.
Perfect I try the 2 solution.
C1arkbar I try your solution now it s work but I wait to test more.
I have a fibaro sensor
I am happy to see its working nice.
I like this kind of solution.
@anon36505037 Thank for your explanation I search because iâm in Normal mode more easy with this explanation
@bobbles I try your solution but I have a problem if my sensor is inactive 3min after my light switch off but Iâm now again in the kitchen and my light turn on again.
I want my light turn off stay inactive 3min only but I keep your process to use in a other room, Iâm not a expert but my wife knows what she wants (not a misogynist message because is Kitchen, Itâs just a coincidence)
I have done something similar but using both CoRE and the smart lighting smart app. I set smart lighting to turn on my daughterâs bathroom light when thereâs motion and to turn it off 2 minutes after motion stops. The problem I was having was if the light was turned on manually and no one walked into the bathroom, then smart light would not turn the light off as smart light turns does its thing after motion stops but it doesnât register doing that unless motion started in the first place.
I set up CoRE to turn the light off after a period of time if the motion sensor shows as inactive which allows the automation to run wether motion had started or not. I also noticed that using the toilet when people arenât very active, the lights would go off without warning. To fix this I set CoRE to dim the lights to 2% for 10 seconds before turning the lights off, letting you know if you donât move soon the lights will go out. Any movement after that restores the light to its previous level.
The Piston looks so complicated but itâs really simple and it works rock solid 100% of the time and evolved over time and trial and error.
Also, the reason I use smart lighting to turn on the lights is that my motion sensor and light are both run locally along with smart lighting, so that basic automation will run even if I donât have an Internet connection. CoRE is there to do the heavy lifting when there is Internet but itâs good having a backup automation.
Core will turn off the lights at 115 seconds and if it does Smart lights wonât run, but without core running smart lights turns it off at 2 minutes (120 seconds) so they donât conflict.
Here is how I typically set up my motion controls. It uses a second âORâ condition to guarantee a state change, which prevents the light from turning off if someone is moving around.
It also allows the lights to come on at a specific color temperature and brightness depending on time of day or mode, checks for lux, and is only active if the lights werenât turned on by a switch or some other method (the âturnedOnByMeâ variable). It also checks the status of a simulated âMotionEnabledâ switch, which automatically gets turned off when nobody is home to shut down all the motion sensors. (I donât want the silly cat tripping lights on and off all day )
Iâm still experimenting between using the âWaitâ task, and âStays inactive forâŠâ to determine which I like better. Iâm leaning towards the Stays function for simplicity, but the Wait works fine.
You could put in another group in the IF statement.
So you have:-
IF First group.
Kitchen Motion is active
And
smartweather etc. etc.
OR Second Group
Kitchen Light changes to on
THEN
Using Kitchen Light
Turn On.
ELSE
As you have already specified.
I would also on the first page of the piston, scroll down to advanced options.
Click on the + symbol
Where it says âDisable command optimisationâ put the slider to the right so that it is active.
This way the piston will ignore whatever state the device is in and run.
Iâm not sure if you need expert mode enabled for this or not. I always have this active anyway.
This can be done in the settings for CoRE.
You will have an issue though if it is not between sunset and sunrise and the light gets turned on. It will not turn off. You might want to get rid of that restriction.
@bobbles thanks for the help. I will try this. I donât want the light to automatically turn off between sunset and sunrise. I want to handle this manually.
@bobbles, I have now changed the piston based on your inputs. I have changed CoRE to expert mode, but couldnât find anything under Advance options to âDisable command optimisationâ. Can you please help me where this exactly will be? I looked under each condition screen and the screen which shows all the groups. Below is how the piston looks now.
When you go into
Automation -> SmartApps
you will see the CoRE app.
Click on it and open your piston,
Scroll down and you will find Advanced Options.
Click on it and you will see Disable command optimisations.
If it doesnât appear you may need expert mode enabled.
To do this->
Automation -> SmartApps
you will see the CoRE app.
Click on it and scroll down and open settings.
You enable expert mode there.
Donât know why. It should work.
Take out the change only in the else.
This wonât make a difference but isnât needed.
Go into the dashboard and watch the piston.
Does it ever go blue (true) when you either have motion (change the lux to greater than for testing if it is above the value set) or turn the light on.
EDIT: Check to make sure mode is home.