Jump to content
C4 Forums | Control4

Is there a variable to store current settings?


ekohn00

Recommended Posts

Hi all, 

 

Got a questions, and assume this should be easy:

 

When opening the front door, I want to save the porch lights setting, then set the porch lights to on/100%.  When I close the door, I want to put the lights back to the original setting.

 

I assume theres a way to save and restore config/settings to a variable?

 

thanks.

Link to comment
Share on other sites


Hi all, 

 

Got a questions, and assume this should be easy:

 

When opening the front door, I want to save the porch lights setting, then set the porch lights to on/100%.  When I close the door, I want to put the lights back to the original setting.

 

I assume theres a way to save and restore config/settings to a variable?

 

thanks.

A similar need that I have is this - 

I have a schedule that happens all day long - blinds open, waterfall starts, temperature settings etc.

 

When I turn on the alarm - I shut the blinds, turn off the waterfall, etc.

I have a rather complicated way of turning these all back on correctly when I turn off the alarm - but I would like it to go to the temperature it should be for the time of day I return, and if it is appropriate I would like the blinds to open etc.  

 

It would be really cool to have "settings" that the system knows that you can simply say - return to these settings and have those settings updated during the day as necessary. I have mimicked this with variables - but something actually supported by C4 would be nice.

 

Bill

Link to comment
Share on other sites

you could use media scenes.  I think that would do what you are after - @TexasBill

 

@ekohn00 - before you make any changes just create a variable and store the current value in it.

 

On Door Open

   PorchHoldLightLevel = Params{deviceid,value}

   PorchLightOn 100

 

On Door Close

   PorchLightLevel = PorchHoldLightLevel

Link to comment
Share on other sites

@Texasbill

 

another way would be to but a if statement on each of the scheduled events if alarm is not armed then do the action

 

Then you can trigger each event to start on the disarm of the alarm.

 

idk if this is how you have your variables set up but this would be the way.

Link to comment
Share on other sites

The easiest thing was to create a variable and set it equal to the light's setting.  Quite easy once I realized it could be done and how.

 

Quite honestly, I am not sure how a media scene would work in this scenario.  

Link to comment
Share on other sites

The easiest thing was to create a variable and set it equal to the light's setting.  Quite easy once I realized it could be done and how.

 

Quite honestly, I am not sure how a media scene would work in this scenario.  

 

Wasn't recommending Media scene for you.  I was recommending that for TexasBill

Link to comment
Share on other sites

@Texasbill

 

another way would be to but a if statement on each of the scheduled events if alarm is not armed then do the action

 

Then you can trigger each event to start on the disarm of the alarm.

 

idk if this is how you have your variables set up but this would be the way.

I have that - depending on the alarm state I do the action - that works well - the problem comes when I come home and the alarm is on and I change the alarm state - I would LIKE the system to go back to the following:

 

1. turn on the waterfall

2. open or close the blinds as appropriate (what WOULD have happend had the alarm not been off

3. the lighting state that WOULD have happend had i been there.

4. the air conditioning state that WOULD have happened had I not turned on the alarm.

 

etc.  The problem is that if I return after ten pm then the lights should not necessarily come on - the blinds should NOT open the waterfall should NOT come on etc.

 

My issue is not what happens then the alarm is not set or when it is set - but what should things do when I turn OFF the alarm. I would like everything to be happening in the back ground and be able to say go to what should be happening - 

 

Here is what I have come to at the moment - 

 

1. Waterfall state on - True or false

2. outside lights on - true or false

3. blinds state open - true or false

 

Now - what I do is state - 

in scheduler - for the blinds open I set it (the variable = TRUE)

 

I state that when the variable changes and the alarm is off I open the blinds.

Now - when I turn off the alarm - I just check for the variable state and if it is TRUE then I open the blinds.

 

This means a lot of re-programming - but at the moment it is worth it as I now have a "house state" for almost everything. I now can say the outside porch lights are supposed to be at 50 percent - but when someone comes to the front door I raise that to 100 percent and after 5 minutes of no motion I reset it back to the 50 percent state.

 

I was hoping for something "easier".

 

Bill

Link to comment
Share on other sites

you might look into using macros. you can use a macro to check several things and then just activate the macro on what ever triggers you need alarm state,

time, or whatever

OK - Macros - can you point me to anything that shows what Macros do and how to use them? Or just give me an example?

Bill

Link to comment
Share on other sites

Or in short Macro's don't DO anything - they provide a single point to add complex programming to, making it easy to find, change, adapt and remove.

 

It likely won't make your work any less, but it's easier to maintain and review than having bits and pieces everywhere, and no duplicate programming that you have to remember to change in every location (you just trigger the Macro instead everywhere, any changes are thus automatically transferred everywhere).

Link to comment
Share on other sites

Macros are a "housekeeping" repository.  I use one and only one here.  Otherwise, I do just what you are doing- a load of code. If what you have works, don't try to change it.  The controller doesn't care and as long as you either have a good memory or keep notes, changes should come easy.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.