DMX Binding Fade Times

Hi everybody,

i try to create buttons with fade times for the DMX binding.
My first idea was to create rules for the buttons.

rule "Fade In Fast"

when Item Fade_In_Fast changed from OFF to ON

then 
	var Number dimmerintensity_in_fast=20

while (dimmerintensity_in_fast<60) {
	
	if (dimmerintensity_in_fast != 59)  {
		
	dimmerintensity_in_fast=dimmerintensity_in_fast+1
	sendCommand (Saallicht1, dimmerintensity_in_fast)
	sendCommand (Saallicht2, dimmerintensity_in_fast)
	sendCommand (Saallicht3, dimmerintensity_in_fast)
	sendCommand (Saallicht4, dimmerintensity_in_fast)
	Thread::sleep(500)
	}
	else {
	
	postUpdate(Fade_In_Fast, OFF)
	}
}

I need this 4 times.

Fade Out Fast, Fade Out Slow, Fade In Fast, Fade In Slow

So i created four of this rules. But after i started every rule they didn’t break and the dimmerintensity began to jump.

In the end i want a fade out over 60 seconds (slow). But the lights should dimm one after another.

So every light has 30 seconds from 60 to 0 %.
The first row starts at 0 sec.
The secons on 10 sec.
The third on 20 sec.
And the last on 30 sec.

0 seconds(Saallicht1) - - - 10(Saallicht2) ---- 20(Saallicht3) ---- 30(Saalicht1 ends; Saalicht4 starts) ---- 40(Saallicht 2 ends) — 50(Saalicht 3 ends) ----- 60 seconds (Saallicht 4 ends)

So how can i do this with the DMX Binding Fade? And how get i the best performance?

I would be grateful for every good idea.

That’s an interesting setup. I really would like to see a video of this once you get it working :wink:

Implementing the fade in a rule is not a good idea. Have a look at the [documentation] (https://github.com/openhab/openhab/wiki/DMX-Binding), you can just use the built in fade commands.

Assuming that you know the starting state of your lights, you could just create a fade command that contains 10 seconds blocks.
For example, assuming that your four lights are on dmx channel 1 to 4 and that they are all at 100% (which is 255 in DMX terms) when you start the command, you could do something like this to have this cascading fade effect:

{dmx="CHANNEL[1/4], ON[FADE|
10000: 170, 255, 255, 255 :0|
10000:  85, 170, 255, 255 :0|
10000:   0,  85, 170, 255 :0|
10000:   0,   0,  85, 170 :0|
10000:   0,   0,   0,  85 :0|
10000:   0,   0,   0,   0 :0|
]"}

Of course, this should be on one line, but I’ve indented it a little to show how the cascade effects work. Each line represents a fade action of 10000 milliseconds. This duration 10000ms is defined in the first column.
Then you have a column per channel. The second column shows you that the first fade action will dim the light of channel 1 in 10000 ms from 255 (current state) to 170 (target state). All other lights (columns 3,4,5) stay at full intensity.
The second fade then triggers the fade of channel one from 170 to 85 with a duration of 10 seconds. It also starts the first 255 -> 170 fade for channel 2. And so on.
The 0 at the end of the line indicates how long the target values should be kept. In this case it is 0, as you want to move to the next fade immediately.

The dmx fade format is rather compact and can be daunting at first, but you can do very complicated things with it once you know how it works…

1 Like

@davy Thank you very much.

This works for me. After i programmed all buttons on the dashboard, i’ll show you a short video :wink: .

Thank you

This works for me

Great!

a short video

Looking forward to it …

Hi All,

Is it possible to fade to a dynamic HSB value?
I want to fade the group “colorpicker” to a specific value. My 4 Hue bulbs are fading in smooth.
But via DMX it is not fading in smooth. (by the way, the color of the Hue bulbs is really ugly, compared to my RGB dimmer, but maybe i will implement a color correction)

My items:

//Hue
Color		Hue_Color_4 	"Desk"   	<light_rgb_64>	(colorpicker)	{hue="4"}
//DMX Lights
Color		rgb_living	"RGB Ledstrip" 	<light_rgb_64>	(colorpicker)	{dmx="CHANNEL[1,2,3:1000]"}

My Items for the kodi binding are using fixed values, but thats ok. (When movie is playing, dim the lights)
I need 2 switches for having 4 states.

Switch 	Sideboard_1	"Front"		{dmx="CHANNEL[1/3] ON[FADE|1000:0,0,255:-1] OFF[FADE|1000:0,0,0:-1]"}
Switch 	Sideboard_2	"Front"		{dmx="CHANNEL[1/3] ON[FADE|1000:0,0,30:-1] OFF[FADE|1000:0,0,150:-1]"}