Click to set dim level


#1

In need of assistance!

I have recently entered the CoRe world to fix my issues with my home lighting.

At home I have all lights wired from my fusebox to the light outlet - meaning all dimming aculators are placed in the DIN rail in the fuse box. To control the dimmers I have nodon wall switch’s located in relevant spots around the house.

My issue: I want to have each dimmer to be able to dim from off -> low -> med -> high with the swith’s button no 1 and dim from high -> med -> low -> off with the swith’s button no 3, i.e. if dimmer is “off” then I can click the switch’s button no 1 one time and the dimmer goes to level “low”, if on “low” I click the switch’s button no 1 one time and the dimmer goes to level “med”, etc.

Someone that have a solution on this??? Thanks in advance!


#2

Try a switch case.

On events from switch button 1
Switch (light level)
case - between 0-24%
with light
Set level to 25%
case - between 25-49%
with light
Set level to 50%
case - between 50-74%
with light
Set level to 75%
case - between 75-99%
with light
Set level to 100%

On events from switch button 3
Switch (light level)
case - between 1-24%
with light
Set level to 0%
case - between 26-50%
with light
Set level to 25%
case - between 51-75%
with light
Set level to 50%
case - between 76-100%
with light
Set level to 75%


#3

Thanks for the info!

Attached is the code the preliminar code for the functionality.

I also added the functionality for “dubble click” for lights “on” and “off”.


#4

You haven’t followed my example, your method will work but it requires a lot more execution time and may be slow to respond for some of the else statements further down the chain.

There’s not much point using ‘switch’ cases when you only have a single case.


#5

Hi again and thanks for you answer.

I tried to follow your example once again and as you see in the attached pic I am not able to set the event “Keypad 1” button no “1” in the “On event” statement. The only statement I am able to set this is in “If Block” statements…

Am I correct thinking that the first statement is the example you sugested?


#6

Hey Flamingo, did you get this working?


#7

Got it working somehow but was never satisfied with it. I think this was due to the aculators not wanting to set the actual dimming level, i.e. set to 50% - aculator sets itself to 30%…

Solved it by directly associating switches and aculators using a Homey.