Setting a few scenes in Sitting Room Lights


#1

1) Give a description of the problem
Trying to setup 4 lights in Sitting room to cover a few scenarios.

2) What is the expected behavior?
a Few things.
1 - As these are on a manual switch that I cant remove due to risk of divorce. That if the switch is turned on and the room lux sensor is above 35 lux that the lights turn off again.
2 - If there is motion and the lux is above 35 the lights turn off
3 - If there is motion and the lux is between 17 and 35 the lights turn on to 50%
4 - If there is motion and the lux is between 0 and 17 the lights turn on to 100%
5 - If there is no motion for 60 minutes the lights turn off.
6 - And there is an over ride that if lights are set outside webcore (alexa or app) that the settings dont change but the timer works.

3) What is happening/not happening?
Lights turn on and stay on when the switch is turned on.
Motion turns on the lights to 100% and I tried but couldnt get the different lux settings to work . Lights were going up and down in brightness for no reason.

NOTE - I had to remove the test lines as my better half wasnt happy to have the lights changing.

**4) How do I upload an image ?


#2

From your dashboard, create an anonymized copy of your piston, then copy it to the clipboard. Then paste it into your post.


#3


#4
  1. Your second if has no command to perform.
  2. What is happening is;
    If you move around motion triggers and sets light to 50 %. Then second if lux block changes it to 100%. Then when motion stops and goes inactive( you may still be in room) it turns off lights. You move again it sets lights to 50% then lux block change to 100%. And repeat

I would change

  1. the first if block to changes to active.
  2. Set a variable to occupied as true
  3. Set a restriction at the beginning to check if variable occupied is true
  4. Set a command for the first lux if block
  5. After you have the lights turn off set variable to false (maybe another if block if motion stays inactive for more than 5 minutes then turn off lights and set variable to false.) make it a top level check, by doing it this way you could remove the else block.