Mapping Switch to Push Button OFF after 60sec

Hi everybody,

in my setup i use the DMX Binding to control four Roomlights.

Switch Alles_Aus		"Alles Aus" 	(Lighting, Global, gDashboard)

Switch Saallicht_Aus	"Saallicht Aus" (Lighting, Global, gDashboard)

Switch Kneipe		"Kneipe"			(Lighting, Global, gDashboard)

Switch Alles_An		"Alles 100%"		(Lighting, Global, gDashboard)



/* Lighting */


Switch Fade_In_Fast "Fade In <<<"		(Lighting, Global, gDashboard)	{dmx="CHANNEL[1/4], ON[FADE|5000:  85, 0, 0, 0 :0|5000:   170,  85, 0, 0 :0|5000:   255,   170,  85, 0 :0|5000:   255,   255,   170,  85 :0|5000:   255,   255,   255,   170 :0|5000: 255, 255, 255, 255 :0|]"}

Switch Fade_In_Slow "Fade In <"			(Lighting, Global, gDashboard)	{dmx="CHANNEL[1/4], ON[FADE|10000:  85, 0, 0, 0 :0|10000:   170,  85, 0, 0 :0|10000:   255,   170,  85, 0 :0|10000:   255,   255,   170,  85 :0|10000:   255,   255,   255,   170 :0|10000: 255, 255, 255, 255 :0|]"}

Switch Fade_Out_Slow "Fade Out >"		(Lighting, Global, gDashboard)	{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|]"}

Switch Fade_Out_Fast "Fade Out >>>"		(Lighting, Global, gDashboard)	{dmx="CHANNEL[1/4], ON[FADE|5000: 170, 255, 255, 255 :0|5000:  85, 170, 255, 255 :0|5000:   0,  85, 170, 255 :0|5000:   0,   0,  85, 170 :0|5000:   0,   0,   0,  85 :0|5000:   0,   0,   0,   0 :0|]"}


/* DMX Adresse 1-6 auf Dimmer*/



Dimmer Saallicht1	"Spotreihe 1" (Saallicht, Lighting, gDashboard)		{dmx="CHANNEL[1:1000]"}

Dimmer Saallicht2	"Spotreihe 2" (Saallicht, Lighting, gDashboard)		{dmx="CHANNEL[2:1000]"}

Dimmer Saallicht3	"Spotreihe 3" (Saallicht, Lighting, gDashboard)		{dmx="CHANNEL[3:1000]"}

Dimmer Saallicht4	"Spotreihe 4" (Saallicht, Lighting, gDashboard)		{dmx="CHANNEL[4:1000]"} 

So now i want to push one button which set all other buttons to off.

I.e. Switch “All OFF” ON --> Set DMX to 0 and all Buttons to OFF

My rule look like this:

rule "Alles Aus"

when 
		Item Alles_Aus changed from OFF to ON
then
		postUpdate(Kneipe, OFF)

		postUpdate(Alles_An, OFF)

		postUpdate(Saallicht_Aus, OFF)
		
		sendCommand(Saallicht1, 0)

		sendCommand(Saallicht2, 0)

		sendCommand(Saallicht3, 0)

		sendCommand(Saallicht4, 0)

end	

That works fine for me, but now i have fadetimes with 30sec and 60sec.

So i need a rule

Fade Out Slow (over 60secs) --> Switch DMX Item Fade 60secs to ON and All other to OFF / AFTER 60 secs set “Fade Out Slow” to OFF an “All off” to ON

Any idea?

Thanks

Not sure this is of any help, but you can pause your rules for X seconds:

rule "Turn off door relay"
when
	Item Div_DoorOpener changed from OFF to ON
then
if (DisableStartupNotifications.state = OFF)
{	DoorTimer = createTimer(now.plusSeconds(6))[|
	sendCommand(Div_DoorOpener, OFF)
]}
end

If I got it right, you have 4 dmx dimmers at Channel 1 to 4. You also have configured Buttons in openHAB to trigger dmx to fade those dimmers automatically up or down. Then if you want a fadeout, all you have to do is an Fade_Out_Slow.sendCommand(ON) followed by postUpdates for the other Buttons. If this Button should also reset to off at the end of dimming, you could make a rule which triggers if the dimmer has reached 0. This rule would then set the button to off.

Another way to do it would be to set autoupdate=false to the buttons, so the buttons would never be active at all.