Jump to content

Return to previous state


kurelgyer

Recommended Posts

Posted

Something I thought about and wished I could do with Hal2000 for years. It may not be easily possible.

 

I would like the ability to return a device to its previous state. For example:

 

-With a RemoteLinc, I set the Living Room Lamps to 45%.

-A motion sensor at the front door detects motion and flashes the Living Room Lamps on and off a couple times

-Now I would like the Living Room Lamps to return to their previous state, 45%.

 

Is this currently possible? Could it ever be (easily) possible?

 

I'm thinking of a program somehow taking a snapshot of current state of a device before making a change, so that it could end by reverting that device to its previous state.

Posted

I think this is possible by having a bunch of program to Remember the State of the previous Dim Intensity..

 

 

 

example:

 

 

 

Program State00-10

Program State10-20

Program State20-30

[etc]

Program State90-100

 

these program are empty, they just remember the True/False value to keep in memory the last value.. they keep TRUE when they are called directly to the 'then' and they keep FALSE when they are called directly to the 'else'..

 

 

you have a bunch of program that set the state when the value changes:

 

Program SetState10-20

if device dimlevel > 10 and <20> 20 and < 30
then
 //Set all the State to False
 run State00-10 (else)
 run State10-20 (else)
 [etc]
 //call the good one to true
 run State20-30 (then)

 

 

 

and then when you turn the device back on:

 

Program OnState10-20

if device=turn on and State10-20=true
then
 device.dimlevel = 15%

 

Program OnState20-30

if device=turn on and State 20-30=true
then
 device.dimleve = 25%

 

 

it's a BUNCH of program but yes it should be possible.. :)

 

 

Note that this is Pseudo Code to reflect the General Idea.. it`s not working code..

Posted

That's pretty much the way I was thinking it to be possible. But, as you said, that would be a LOT of programming! Hence my "(easily)" note :)

 

I think for this concept to be feasible, it would have to be written into the ISY program where a snapshot of exact device status would be recorded for, say, the last "x" number of states. An action option would allow returning to "x" states ago.

 

I'm by no means a programmer, so maybe this is a pipe dream. I'd love to see it though! I think this would add some very interesting programming options.

 

Any chance?

Posted

That's pretty much the way I was thinking it to be possible. But, as you said, that would be a LOT of programming! Hence my "(easily)" note :)

 

I think for this concept to be feasible, it would have to be written into the ISY program where a snapshot of exact device status would be recorded for, say, the last "x" number of states. An action option would allow returning to "x" states ago.

 

I'm by no means a programmer, so maybe this is a pipe dream. I'd love to see it though! I think this would add some very interesting programming options.

 

Any chance?

Posted

Current State

It may be easier if you could set all your levels through programs. For example, instead of being able to set the dim level of your light from the remote control, you could have 4 specific scenes: Off, 45%, 80%, 100%, for example. Each of these scenes could be linked to a KPL button or RL button. In addition, you could have 4 programs 'StatusScene1', 'StatusScene2', 'StatusScene3', and 'StatusScene4' that keep state for the scences. For example:

 

StatusScene1:

If

Control 'KPL A' is switched On

Then

Set Scene 'Scene1' to On (if not directly linked to the button)

Run Program 'StatusScene2' (Else Branch)

Run Program 'StatusScene3' (Else Branch)

Run Program 'StatusScene4' (Else Branch)

Else

-- No Statements --

 

and so on. So of the four programs: 'StatusScene1', 'StatusScene2', 'StatusScene3', and 'StatusScene4', only one would be true at any particular time reflecting the currently set scene. So to accomplish what you want, you need four more programs: 'RestoreScene1', 'RestoreScene2', 'RestoreScene3', and 'RestoreScene4'. For example:

 

RestoreScene1:

If

Control 'Motion Sensor' is switched Off (your trigger event)

And Program 'StatusScene1' is True

Then

Set Scene 'Scene1' to On

Else

-- No Statements --

 

and so On. So, you have eight programs to support 4 scenes, but its less than what you were looking at.

 

Future State

What you need here is variables. And I am not talking about the variables coming in 3.1, but variables into which you can read real-world values, such as the current illumination level of your device, and then use that level variable to restore the light when the motion state is over. It looks like there will be several evolutionary steps in the ISY programming model before we get to that level of variable support (it requires not only variables, but data types and an object model from which to read the real world values), but hopefully we will get there soon.

Guest
This topic is now closed to further replies.

×
×
  • Create New...