TheWabit Posted April 21, 2020 Posted April 21, 2020 (edited) I cant figure this one out. Can someone please tell me why this doesnt work? if ( from 1 hour before sunset to 1 hour after sunrise next day ) and Control 'office motion detector - sensor' is switched on Then in scene 'Matts Office Light' Set 'office lamp' 100% wait 10 minutes In scene 'Matts Office Light' Set 'office lamp' 0% It keeps turning on OUTSIDE of those times when motion is detected and "then" doesnt trigger. Thanks for the help Edited April 21, 2020 by TheWabit
lilyoyo1 Posted April 21, 2020 Posted April 21, 2020 You have 1 hr before sunset to 1 hr After sunset the NEXT day. It'll trigger all day
TheWabit Posted April 21, 2020 Author Posted April 21, 2020 (edited) It is in the program correctly. Sorry - I mis-typed. It should have said 1hr after SUNRISE next day Edited April 21, 2020 by TheWabit
lilyoyo1 Posted April 21, 2020 Posted April 21, 2020 You're calling for it to set the device level. Is this device part of a scene or by itself? If it is part of a scene, simply say Then: turn scene on Or else: turn scene off
dbwarner5 Posted April 21, 2020 Posted April 21, 2020 18 minutes ago, lilyoyo1 said: You're calling for it to set the device level. Is this device part of a scene or by itself? If it is part of a scene, simply say Then: turn scene on Or else: turn scene off to add to lilyoyo1, your program is "adjusting" the scene. You still need to turn it on or off. In your case, there is no need to adjust the scene, just turn it on or turn it off. Adjusting the scene will affect the properties of that light for the NEXT time you turn it on, and in of itself, does NOT turn the light on. 1
garybixler Posted April 21, 2020 Posted April 21, 2020 Try adding this to the if conditions. "and Control 'office motion detector - sensor' is not switched off"
lilyoyo1 Posted April 21, 2020 Posted April 21, 2020 (edited) 17 minutes ago, garybixler said: Try adding this to the if conditions. "and Control 'office motion detector - sensor' is not switched off" He doesn't want the "not switched off" since he's using the then statement to turn off the light. However since he only wants it on during those hrs the or else would turn off the light at sunrise Edited April 21, 2020 by lilyoyo1
garybixler Posted April 21, 2020 Posted April 21, 2020 (edited) The only thing is that the 'then statement' will never complete if the sensor turns off before the timer expires. Edited April 21, 2020 by garybixler
lilyoyo1 Posted April 21, 2020 Posted April 21, 2020 (edited) 20 minutes ago, garybixler said: The only thing is that the 'then statement' will never complete if the sensor turns off before the timer expires. It should since he's using control. That's the condition that will start the then portion. There's nothing in it to cause it to reevaluate and stop except the time which will run the or else Edited April 21, 2020 by lilyoyo1
TheWabit Posted April 22, 2020 Author Posted April 22, 2020 Thank you all very much! Changing it from "adjust Scene" to "Device" and selecting scene, I was able to get it to work correctly. I hope this helps someone else.
TheWabit Posted April 22, 2020 Author Posted April 22, 2020 So I gues I lied - I can down this morning, and it is well after 1 hour after sunrise. And the lamp came on. Why is the program not honoring the time limitations?
dbwarner5 Posted April 22, 2020 Posted April 22, 2020 19 minutes ago, TheWabit said: So I gues I lied - I can down this morning, and it is well after 1 hour after sunrise. And the lamp came on. Why is the program not honoring the time limitations? @TheWabit can you post the actual program? In the Admin console, right click on the program and at the bottom choose, Copy to clipboard. then paste it in this forum? Also try to explain in 1-2 sentences EXACTLY what you are trying to achieve. This is not a complex problem, but can sometimes be confusing for those trying to help w./o these two things, which then leads to even more confusion for you!! thanks
dbwarner5 Posted April 22, 2020 Posted April 22, 2020 (edited) @TheWabit One more question for clarification. Do you have the Motion Sensor as a controller of the scene? If you do, that is why your light is coming on. You have now have two triggers for the scene, the MS and the program. And that is why your program is not running the then, as it IS false based on the time, but the MS as controller of the scene is turning it on 24hours a day. If not, then as my earlier post, please copy to clipboard and paste the actual program for review. thanks. Edited April 22, 2020 by dbwarner5 1
lilyoyo1 Posted April 22, 2020 Posted April 22, 2020 I would agree with dbwarner5. You don't want the sensor directly linked to the light.
TheWabit Posted April 23, 2020 Author Posted April 23, 2020 Matts Office Lamp - [ID 0005][Parent 0001] If ( From Sunset - 1 hour To Sunrise + 1 hour (next day) ) And Control 'Office Motion Detector-Sensor' is switched On Then Set Scene 'Matts Office Light' On Wait 10 minutes Set Scene 'Matts Office Light' Off Else - No Actions - (To add one, press 'Action') I dont believe the lamp module is directly linked to the motion Sensor
TheWabit Posted April 23, 2020 Author Posted April 23, 2020 I see what you are saying. ,,I had the MS as a controller in the scene. I removed it and it seems to work fine. For some reason, I was thinking they both had to be in the scene. Thanks for the help. 1
dbwarner5 Posted April 23, 2020 Posted April 23, 2020 3 hours ago, TheWabit said: I see what you are saying. ,,I had the MS as a controller in the scene. I removed it and it seems to work fine. For some reason, I was thinking they both had to be in the scene. Thanks for the help. @TheWabit Think of it this way..,. the MS can be in the scene but doesn't have to be. For any scene, you can have multiple ways to "trigger" them. In a scene, any of the devices (depends on kind), can either be a responder or a controller., If its a controller, then its a "trigger" for that scene. For example, if. you have three switches that control three different lights in a room and you want to have a "mood" setting, you could set up a scene to do so, with each light set at the level you want. Now how do you "trigger" that scene? Some possibilities could be: -a Program that calls it on or off, dependant on its IF statement -a controller in the scene itself.. ie, it could be whenever you turn one of the three switches on or off, all three go to the scene setting - could be two of the three switches, it could be all three of the switches etc -Alexa. -keypad button in the scene or keypad that calls a program that turns it on -etc. Glad you got it working the way you want it to! Also remember, that with Waits and Repeats, the IF statement gets re-evaluated, so in your program, the MS turns on, and if its in the time period, the program turns true and turns on the scene and starts the WAIT. At that point it re-evaluates the IF. In your case the MS will still be on as it probably has a 30 or 60 second delay. So the program is still true and continues to the end of the Wait clause. However for example, if you had a second Wait after the first 10 minutes, followed by action xyzzy, the program would never get to xyzzy because the MS would be off, and the program would turn false and stop running. Here is the description from the wiki attached below on this. Its easy to get tripped up by this as your programs grow in complexity. A series of statements within a Then clause (or within an Else clause), up to the next Wait or Repeat statement, are atomic. In other words, all such statements are executed before the conditions of the program are retested. The program's conditions are reevaluated each time a Wait or Repeat statement is encountered, and at the end of each iteration of a Repeat loop. https://wiki.universal-devices.com/index.php?title=ISY-99i/ISY-26_INSTEON:Scope,_Precedence_and_Execution_Order Cheers.
TheWabit Posted April 23, 2020 Author Posted April 23, 2020 DB - Great explanation! it makes sense. Thanks for taking the time.
dbwarner5 Posted April 23, 2020 Posted April 23, 2020 22 minutes ago, TheWabit said: DB - Great explanation! it makes sense. Thanks for taking the time. @TheWabit no problem.. good luck. The ISY is an extremely powerful device and only limited by your imagination and determination to figure it out the nuances of "state" based programming. Even after ~20 years of doing this beginning with X10 telephone responders at a second home, I still learn something or a new trick all the time from folks here. Cheers.
Recommended Posts