Jump to content

How to take control of switchlink back from program.


wwat

Recommended Posts

Hi,

 

I have a motion sensor that controls a switchlink via a program (its very simple). I then need to be able to allow the switch to be controlled manually if a person hits the 'On' paddle while the MS program is running, the light should then stay on and not turn off when the motion sensor times out.

 

This must be a common real life scenario so there must be a programmatical solution for it but I'm all out of ideas for now.

help appreciaed, thanks.

 

 

Wayne.

Link to comment

Thanks Eric, after reading that very nice explanation by Darrell Peters I was able to come up with the following 4 programs but was wondering whether it could be made more efficient. There are no schedules for this program, its runs 24/7.

 

Thanks,

Wayne

 

 

 

- This program turns on the light if the MS detects motion.

 

[Mirror Light On]

If

Program 'Mirror Light Motion Disable' is False

And Status 'Ensuite MS - Sensor' is On

And Status 'Ensuite SL - Mirror Light' is Off

Then

Set 'Ensuite SL - Mirror Light' On

Else

- No Actions - (To add one, press 'Action')

 

 

- This program turns the light off when the MS turns off

 

[Mirror Light Off]

If

Program 'Mirror Light Motion Disable' is False

And Status 'Ensuite MS - Sensor' is Off

Then

Set 'Ensuite SL - Mirror Light' Off

Else

- No Actions - (To add one, press 'Action')

 

 

- The program below holds a value of either true or false depending on whether the switchlink has been operated manually.

 

[Mirror Light Motion Disable]

If

(

Control 'Ensuite SL - Mirror Light' is switched On

Or Control 'Ensuite SL - Mirror Light' is switched Fast On

Or Control 'Ensuite SL - Mirror Light' is switched Fast Off

Or Control 'Ensuite SL - Mirror Light' is switched Off

)

Then

- No Actions - (To add one, press 'Action')

Else

- No Actions - (To add one, press 'Action')

 

 

- Here we set the [Mirror Light Motion Disable] program back to false when the motion sensor turns off.

 

[Check Motion Status]

If

Control 'Ensuite MS - Sensor' is switched Off

Then

Run Program 'Mirror Light Motion Disable' (If)

Else

- No Actions - (To add one, press 'Action')

Link to comment

I am not 100% clear on what you are wanting to do when someone taps the switch.

 

Are you looking to turn the light on when someon taps the switch AND ignore the motion sensor completely...forever, until someone turns the light off manually and then go back to motion mode?

 

or

 

Are you looking to turn the light on OR off when someone taps the on/off paddle on the switch...but still allow the motion sensor to turn the light off when motion is no longer sensed?

 

Thanks.

Link to comment
I am not 100% clear on what you are wanting to do when someone taps the switch.

 

Are you looking to turn the light on when someon taps the switch AND ignore the motion sensor completely...forever, until someone turns the light off manually and then go back to motion mode?

 

Thanks.

 

This is what I'm doing with the above code and it works perfectly, but I'm wondering whether it could be written more efficiently

 

Wayne

Link to comment
I am not 100% clear on what you are wanting to do when someone taps the switch.

 

Are you looking to turn the light on when someon taps the switch AND ignore the motion sensor completely...forever, until someone turns the light off manually and then go back to motion mode?

 

Thanks.

 

This is what I'm doing with the above code and it works perfectly, but I'm wondering whether it could be written more efficiently

 

Wayne

 

Unless I am mistaken, it's not exactly what you are doing...it appears to me by the programs posted that once the Motion Sensor goes off, then it resets everything and turns out the light. What I was asking is if this is what you wanted, or did you want motion sensing completely disabled until the user pushes a button again.

 

Since you say it works perfectly how you want it, then I think it is fine. I prefer the methods that Darell posted in the link I posted, but that is just me. I am not sure efficiency has anything to do with it though...just that I think it gives more control from within ISY and is easier to manage.

Link to comment

Here is a description of what the program does, its slightly different to what Darell posted but it does work the way I want it to work. My question is, did I do it in the most programatically efficient/elegant way. I'm not at all use to this type of programming and was looking for better techniques.

 

Scenario:

 

Person walks into room and light automatically turns on by motion sensor.

Person also has ability to switch light off or on again via tapping paddle.

Person leaves room with light on or off.

Motion sensor times out and turns off the light.

 

**Added

 

The above scenario is not correct. Here is the revised scenario.

 

Person walks into room and light automatically turns on by motion sensor.

Person also has ability to switch light off or on again via tapping paddle.

Person leaves room with light on or off.

If person turned light off then Motion sensor times out and is re-enabled.

If person turned light on then motion sensor remains inactive until light is turned off.

 

Eric, you are correct, the code is not doing this so I'll try to correct it and post the update.

 

 

Thanks,

Wayne

Link to comment
[Mirror Light Off]

If

Program 'Mirror Light Motion Disable' is False

And Status 'Ensuite MS - Sensor' is Off

Then

Set 'Ensuite SL - Mirror Light' Off

Else

- No Actions - (To add one, press 'Action')

 

Shouldn't this program also check to see if the light is "NOT OFF" already in its conditions?

Link to comment

Hi Eric, you are correct, the code is not doing what I wanted. I'll try to correct it and post the update.

 

The above scenario is not correct. Here is the revised scenario.

 

Person walks into room and light automatically turns on by motion sensor.

Person also has ability to switch light off or on again via tapping paddle.

Person leaves room with light on or off.

If person turned light off then Motion sensor times out and is re-enabled.

If person turned light on then motion sensor remains inactive until light is turned off.

 

 

 

Thanks,

Wayne

Link to comment
Hi Eric, you are correct, the code is not doing what I wanted. I'll try to correct it and post the update.

 

The above scenario is not correct. Here is the revised scenario.

 

Person walks into room and light automatically turns on by motion sensor.

Person also has ability to switch light off or on again via tapping paddle.

Person leaves room with light on or off.

If person turned light off then Motion sensor times out and is re-enabled.

If person turned light on then motion sensor remains inactive until light is turned off.

 

 

 

Thanks,

Wayne

 

That is what I thought you might want...and is a bit more complicated. To much "Christmas Cheer" for me to post anything that might be closely related to coherent programming tonight.... :?

 

Merry Christmas...and post what you have corrected when you get it!

Link to comment
That is what I thought you might want...and is a bit more complicated. To much "Christmas Cheer" for me to post anything that might be closely related to coherent programming tonight.... :?

 

Merry Christmas...and post what you have corrected when you get it!

 

Merry Christmas... Christmas cheer is always good :)

 

After too much thinking I think it might be close if not there, although to my eyes the code looks ugly with too many programs. At this stage I'm leaving out the Fast On's/Off's.

 

 

[Motion Turn On]

 

If

(

Control 'Ensuite MS - Sensor' is switched On

And Status 'Ensuite SL - Mirror Light' is Off

)

And (

Program 'Motion Disable (On)' is False

And Program 'Motion Disable (Off)' is False

)

 

Then

Set 'Ensuite SL - Mirror Light' On

 

Else

- No Actions - (To add one, press 'Action')

 

 

[Motion Turn Off]

 

If

(

Control 'Ensuite MS - Sensor' is switched Off

And Status 'Ensuite SL - Mirror Light' is On

)

And (

Program 'Motion Disable (On)' is False

And Program 'Motion Disable (Off)' is False

)

 

Then

Set 'Ensuite SL - Mirror Light' Off

 

Else

- No Actions - (To add one, press 'Action')

 

 

[Motion Disable (On)]

 

If

(

Control 'Ensuite SL - Mirror Light' is switched On

)

 

Then

- No Actions - (To add one, press 'Action')

 

Else

- No Actions - (To add one, press 'Action')

 

 

[Motion Disable (Off)]

 

If

(

Control 'Ensuite SL - Mirror Light' is switched Off

)

 

Then

Run Program 'Motion Disable (On)' (If)

 

Else

- No Actions - (To add one, press 'Action')

 

 

[Reset Motion Disable]

 

If

Control 'Ensuite MS - Sensor' is switched Off

 

Then

Run Program 'Motion Disable (Off)' (If)

 

Else

- No Actions - (To add one, press 'Action')

Link to comment

Assuming that you want to use the off time setup in the motion sensor (which is how you have your programs setup) then I would do it this way:

 

In my example, the light is called "Test Light" and the motion sensor is called "Test Motion Sensor".

 

Setup a Folder for it (I called it Test Motion) with the following conditions:

 

Folder Conditions for 'Test Motion Folder'

If
       Control 'Test Light' is not switched On
   And Control 'Test Light' is switched Off

Then
  Allow the programs in this folder to run.

Whenever someone turns on the light, it will disable the program(s) in the folder.

 

Inside this folder is the following program:

 

Program Name: Test Motion Control

If
       Control 'Test Motion Sensor' is switched On
   And Control 'Test Motion Sensor' is not switched Off

Then
       Set 'Test Light' On

Else
       Set 'Test Light' Off

This should work as you want: When someone enters the room, the light will turn on when the motion sensor sends the on command and will turn off when the motion sensor sends the off command.

 

If the person taps the ON button on the light control, it will disable the folder conditions and consequently disable the motion program from working. It will stay disabled until someone turns the light out by tapping the OFF button. You could add the Fast On and Fast Off buttons accordingly if you want.

 

You could have another program that waits a LONG time, then turns the light out (just in case someone forgets) like this:

 

Program Name: Test Light On To Long

If
       Control 'Test Light' is switched On
   And Control 'Test Light' is not switched Off

Then
       Wait  1 hour 
       Set 'Test Light' Off

Else
  - No Actions - (To add one, press 'Action')

 

The only issue with this last one is that it will keep your Motion sensing disabled...the light will turn out, but the folder conditions will not be reset and therefore the light will have to be turned off or on manually again to get the motion sensing enabled. Maybe OK, since this would be an indication that someone left the light on too long or something. Just an idea...

 

I did not run this through any paces, but it should work. Let me know what you think.

Link to comment

Eric,

 

The ability for control to revert back to the sensor (after it times out) if the 'Off' paddle is tapped is a must so I dont think that will work.

 

It seems to work as intended at the moment, if you or anyone can point out any flaws or can reduce the number of programs (currently 5) without compromising on functionality that would be great.

 

 

Wayne

Link to comment
Eric,

 

The ability for control to revert back to the sensor (after it times out) if the 'Off' paddle is tapped is a must so I dont think that will work.

 

It seems to work as intended at the moment, if you or anyone can point out any flaws or can reduce the number of programs (currently 5) without compromising on functionality that would be great.

 

 

Wayne

 

What I wrote gives you that ability. In fact, it works just like your 5 programs do, only with 1 program and folder conditions. If you tap the OFF button, it will shut off the light and re-enable the motion sensor.

 

The only thing that wouldn't is the very last (optional) program that I posted just in case you wanted to turn the light out after a long period of time if someone forgets. This is optional and not needed to work like you stated in your updated requirements. If someone turns on the light manually, it will stay on forever (and the motion sensing will stay disabled) until they tap the off button....which is the same way it works in your program.

Link to comment

 

What I wrote gives you that ability. In fact, it works just like your 5 programs do, only with 1 program and folder conditions. If you tap the OFF button, it will shut off the light and re-enable the motion sensor.

 

The only thing that wouldn't is the very last (optional) program that I posted just in case you wanted to turn the light out after a long period of time if someone forgets. This is optional and not needed to work like you stated in your updated requirements. If someone turns on the light manually, it will stay on forever (and the motion sensing will stay disabled) until they tap the off button....which is the same way it works in your program.

 

Hi Eric,

 

I just tried it and it doesn't seem to function, for some reason the light doesn't initially turn on via the sensor. I'm not sure why but probably only requires a small change.

 

Would be good if we can get it to work because its much smaller and would be more efficient.

 

Wayne

 

Program Name: Test Motion Control 

If 
       Control 'Test Motion Sensor' is switched On 
   And Control 'Test Motion Sensor' is not switched Off 

Then 
       Set 'Test Light' On 

Else 
       Set 'Test Light' Off

Link to comment

Eric,

 

I just tested the sensor again and this code is definately not turning on the light. I then changed the code to my code and it started working, so the sensor and light are working.

 

Here is a 'copy to clipboard' of the folder code followed by the program code within the folder.

 

[Folder Test Code]

 

If
       Control 'Mud Room SL - Light' is not switched On
   And Control 'Mud Room SL - Light' is switched Off

Then
  Allow the programs in this folder to run.


 

 

[Test Motion Control]

 

If
       Control 'Mud Room - Sensor' is switched On
   And Control 'Mud Room - Sensor' is not switched Off

Then
       Set 'Mud Room SL - Light' On

Else
       Set 'Mud Room SL - Light' Off


Link to comment

I think I see the problem...it is in the folder conditions. The switch must be toggled off once to get the thing jump started. I did not have this problem, because I tested the folder conditions right away when I put it in.

 

I will take a look (and please, someone jump in if you have a fix) but in the mean time, try putting it back it in and then check the Folder on the program summary tab...I am betting it will be FALSE. Tap the light on then tap it off and it will go TRUE then it will start working correctly.

 

Let me know what you find.

 

Thanks.

 

Eric,

 

I just tested the sensor again and this code is definately not turning on the light. I then changed the code to my code and it started working, so the sensor and light are working.

 

Here is a 'copy to clipboard' of the folder code followed by the program code within the folder.

 

[Folder Test Code]

 

If
       Control 'Mud Room SL - Light' is not switched On
   And Control 'Mud Room SL - Light' is switched Off

Then
  Allow the programs in this folder to run.


 

 

[Test Motion Control]

 

If
       Control 'Mud Room - Sensor' is switched On
   And Control 'Mud Room - Sensor' is not switched Off

Then
       Set 'Mud Room SL - Light' On

Else
       Set 'Mud Room SL - Light' Off


Link to comment
Yes the folder value is 'FALSE' on startup and tapping the paddle changes it to true.

 

Wayne

 

So I assume it worked correctly after that?

 

Off to the Aquarium today with the family... No automation playtime for me today according to the wife! :cry:

Link to comment

So I assume it worked correctly after that?

 

Yes it worked correctly once the paddle was tapped, but I'd still have to add in dimming and fast on/off and it appears that the programs I'm using currently handle both of those.

 

We would pretty much need to solve that requirement to have to tap the paddle in order to kick off the process. I can imagine it could become an issue if for any reason ISY lost power or when it requires rebooting etc, then we would have to walk around and tap all the paddles. Its not a clean approach but once that issue is solve we are off and running.

 

Off to the Aquarium today with the family... No automation playtime for me today according to the wife! :cry:

 

Sounds like a very nice day out, you'll probably come back with the solution, ready to go :)

 

Thanks for your help,

Wayne

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...