Jump to content
C4 Forums | Control4

Dimmer program


bog

Recommended Posts

I'd like to program the dimmer (gallery dimmer) by the main exit of my home so that the bottom LED is red if any other lights are on. If the gallery dimmer is off and I press the bottom button I'd like to execute the "All Off" lighting scene (this way I do not have to turn off all the lights if I know someone is home). Setting the LED to red is a reminder to turn off lights.

Attached is a screenshot of what I've done so far.

Is there a more efficient way to do this? I can't seem to figure out boolean statements like:

IF a OR b OR c OR d THEN x

What if I wanted to do a logical AND operation?

Also, if the gallery dimmer remains off the bottom LED never changes to red. What's the best way to set the LED to red if the gallery dimmer never changes state? Create a variable "IsSomethingOn" and incriment/decriment whenever devices go on/off?

Link to comment
Share on other sites


IF/THENs are accomplished by cascading IF statements and instructing the LED one way under the outcome of the IFs or the other way if none if the IFs pass the test. Same for AND operand- just cascade two or more IFs. Don't forget STOP commands (that will get you out having to use the VAR IsSomethingOn).

Since C4 is not a "real time" operating system as such, you will need to invoke an action to get a reaction. Unfortunately, you will need to go back to each "field" device and program some instructions to change the color of the LED on the gallery device. Simply changing the state of a VAR does no good if you don't call on the VAR at your gallery device.

Personally, I think that's much effort for little gain. Why not just double-duty your bottom button on the gallery dimmer. Two taps for ALL OFF like you have it and one tap for just the gallery light. Wait for the pros to chime in, I'm just a new user...

PS: your ALL OFF might not work if you use a long dim-down-to-off time constant.

Link to comment
Share on other sites

I agree with Controlfouruserguy that this is a lot of work for little gain, but I have tons of stuff like that in my house (more work than it is worth) just because I like it, so I understand.

Let me think about the most efficient way to do this for a minute while I am in this yawner of a meeting.

I'll post back later on today.

Link to comment
Share on other sites

I've done the double-click off and just experimenting with different behaviours. What I'm primarily trying to accomplish now is a visual notification by the exit to remind me or others "hey, there's a light on somewhere in the house".

So, for each light I'll have to program some logic for the visual notification (i.e. set the bottom LED to red on the gallery dimmer). I am thinking about using a "IsSomethingOn" variable.

For each light I'd program something like the following when it is turned on:

IsSomethingOn=IsSomethingOn + 1
IF IsSomethingOn > 0
THEN set the bottom LED to red on the gallery dimmer

For each light I'd also have to program something like the following when it is turned off:

IsSomethingOn = IsSomethingOn - 1
IF IsSomethingOn = 0
THEN set the bottom LED to navy on the gallery dimmer

Can you show me how you nestle statements to accomplish AND and OR operations (like for the example in my original post)?

Link to comment
Share on other sites

^I'm talking about his satellite devices that will feed back to the main dimmer. He's trying to keep track of a numeric variable that is incremented/decremented by hitting a button. How does that work? I sometimes tap a down button three or four times to get the right level.

Link to comment
Share on other sites

^I'm talking about his satellite devices that will feed back to the main dimmer. He's trying to keep track of a numeric variable that is incremented/decremented by hitting a button. How does that work? I sometimes tap a down button three or four times to get the right level.

The numeric variable obviously wouldn't work in this situation. I need to think about the best way to do this for a minute.

Link to comment
Share on other sites

I am on 1.7.2.160.

I think I can still use the variable and address it on button presses by also using a condition on wether the device is on or off.

All devices are dimmers.

Link to comment
Share on other sites

Attached is the script I eventually created for a visual notification on the gallery dimmer (the dimmer by the exit of my home).

I copy and paste this script to each dimmer for the event "level changes". Seems to be working great.

No variables necessary.

Link to comment
Share on other sites

Thanks ILoveC4. Is there any better way to construct Boolean AND operations?

I've since updated the script to also provide a visual notification on the master bedroom dimmer.

I really like how it works.

Now I'm deciding on how I want to trigger the all off. Double-tap or single tap (if the light is already off).

Eventually I'll program my blinds into the same button so I can raise/lower them as I enter/exit my home.

B

Link to comment
Share on other sites

I don't intend on changing it, just interested to know how I'm supposed to do AND and OR operations.

While siting in my bathtub this morning I had another thought...

Is it possible to use the dimmer in my bathroom to control media playback and volume of the speakers in the bathroom?

For example, do some kind of combination of presses (and state conditions) on the dimmer and it is now in "media mode". When in "media mode":

-LEDs change colour

-Top button controls volume up

-Bottom button controls volume down

-Double tap skips track (or something similar to how the button on the iPhone earbuds work)

Will top and bottom buttons of the dimmer always operate the lights?

Thoughts?

Link to comment
Share on other sites

Yeah, I don't think there is any way to override a dimmer working as a dimmer. You could set it up to Control your volume as well I guess, but your light would be constantly changing.

Just put in a 6 or 10 button keypad.

Link to comment
Share on other sites

The above srcipt may work but there still exists a fundamental problem for those with long dim-down times. You do something to a dimmer like push a button and then check for an OFF state on some other dimmer. What if that some other dimmer was commanded off in 15 sec.? You would never be checking the condition at the right time (when the dimmer is truly off). I use delay and a conditional <5% duty to trigger an OFF LED status. Is there some C4 property I'm missing here?

Link to comment
Share on other sites

iTouch + C4 app = yay

except for the cost, of course.

I think we need some sort of dog collar keypad. That way if youre on the Shi%%er and you dont have a keypad handy you just yell for the dog and there it is. :)

Link to comment
Share on other sites

this works for me... i set a variable to +1 when each light turns on/off then:

big difference here is it only works if the variable changes... this way the script isnt eatin up yer cpu all the time. also, set the variable in the light state not on the button press/release. this eleiminates the dimmer issue mentioned eailer too. if you need more screen shots let me know.

dzg4am

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.