Jump to content
C4 Forums | Control4

Simple, but complex LED programming

Recommended Posts

Hopefully I can explain the situation, so I can get some advice on ways to achieve the desired result.

I have a hallway with a study nook - two light circuits.
At one end I have a dimmer for the study and a 6 button keypad dimmer for the hallway
At the other end of the hall, I have a 6 button keypad.

I am trying to get the LED colours programmed on the 6 button keypad.

The top button is linked via connections to a toggle scene called 'Hallway + Study Off'
The scene has colour = black for toggle active and colour = blue for toggle inactive.

This works perfect.
If either or both of the hallway and study lights are on, the keypad is lit blue, if they are both off, the keypad is black.
The button turns the lights off when one or both are on, and both on if both are off.

Now I want to have the led red if the lights are on due to the motion sensor triggering a lighting scene.
I think my only option is to use the 'Set LED Current' property

When lighting scene Motion_Study is Invoked
   Set Hallway LED on the Study->Hallway Keypad to Red

This works, but I don't think there is a way to then set it back to using the toggle options for the linked scene?
Can I set it back to allow led colours to come from the toggle scene or do I need to program colours based on all the combinations?



Link to comment
Share on other sites

  • 2 weeks later...

Apologies! I answered this in my head a week ago but see I never posted!

The way I do this is:

1. make the LED programmable (I.e. don’t have it follow a light connection).

2. create a macro which sets the LED to the colour you want. In your particular case, this is slightly complex (see below for one way to get the macro to work).

3. Call the macro on every possible event that could create a colour change (e.g. when a lighting scene is activated, motion is detected a timer expires or whatever).

In your use case, I would create a variable LightsOnDueToMotion. I would set this to false whenever the lighting scene is deactivated. I would set this to true immediately before activating the lighting scene when motion is detected.

The macro would then check if LightsOnDueToMotion is true.  If it is it would set the LED to red. If not, it would check if the scene is active and set the LED to blue and if not, it would set the LED to black.

In this case,  the macro only needs to be called when the lighting scene is activated or when it is deactivated (after the variable is set to false).

Because your use case is fairly simple (macro only needs to be called from 2 places), you could also do it by splitting the macro code in to 2 parts and putting these in the on activate and on deactive events for the lighting scene, but that is less flexible for future additions / changes.

Link to comment
Share on other sites


I was assuming this would be the way to go.
But I was hoping there would be some magic way to say follow my programming for this state, but revert to following connection for that state.

I like the simplicity of having the LED follow the light connection/scene toggle colour.
But given this colour is changed via programming, I'll just have to have the whole process follow programming.

Cheers for the response.


Link to comment
Share on other sites

  • 3 months later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...