Dim DMX quickly up while press switch

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Madii
New user
Posts: 2
Joined: 12 Mar 2021, 19:55

Dim DMX quickly up while press switch

#1 Post by Madii » 12 Mar 2021, 20:10

Hi All,
I am quite new with ESP Easy but I think that is my Programm witch can help me with my smart home projects.
Actually I am working on a project with DMX. The plan is in easy I have 4 Button‘s and if I press a button one of 4 LED Dim slowly (in 1Sec) up to a maximum. So far so good. Actually it is working with 1 Led but it doesn’t dim up very smooth. Probably somebody can give me an Idea how to do it better. (I am using DMX because the next project is a light under my stair every step and with DMX I have enough outputs and I can integrate it in my fuse box).
Thanks for your help and I hope that there not hundreds of the same questions in the forum. I didn’t found further information.

Mathias

Code: Select all

 On Switch1#State Do
 If [Switch1#State]=1
    TimerSet_ms,1,1
    Let,1,0
    TaskValueSet,6,1,[VAR#1]
  Else
    TimerSet_ms,1,0
    Let,1,0
    TaskValueSet,6,1,[VAR#1]
    DMX,1,0
  EndIf
 EndOn
On Rules#Timer=1 Do
 If [VAR#1]<255
   Let,1,[VAR#1]+10
   TaskValueSet,6,1,[VAR#1]
   TimerSet_ms,1,1
   DMX,1,[VAR#1]
 Else
   TaskValueSet,6,1,[VAR#1]
   TimerSet_ms,1,1
   DMX,1,[VAR#1]
EndOn

TD-er
Core team member
Posts: 8642
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Dim DMX quickly up while press switch

#2 Post by TD-er » 12 Mar 2021, 20:27

You're setting the timer with an interval of 1 msec.
That's way too low to handle for the rules engine.
At max you can only handle 10 - 20 events a second, but that's limited by a lot of factors.
For larger rules and depending on the actions taken when handling an event it may be significantly less.

I don't know how long it takes to send a DMX command.

Let's assume fading in 5 steps per second can be considered smooth, so then the timerset_ms should be set to an interval of 200 msec.

Madii
New user
Posts: 2
Joined: 12 Mar 2021, 19:55

Re: Dim DMX quickly up while press switch

#3 Post by Madii » 12 Mar 2021, 20:56

Hi TDer
Thanks for you good understandable answers. Good news: changing to 200msec doesn’t make the smooth much worse but also not really better. But it could be right that the problem is that it takes some time until the DMX command is send. Probably I should try to dim it up on the hardware side.
If somebody else has an idea I am open for it but otherwise I‘ll try it on the hardware side.

TD-er
Core team member
Posts: 8642
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Dim DMX quickly up while press switch

#4 Post by TD-er » 12 Mar 2021, 22:24

I just noticed you may get a value over over 255.
So maybe that may cause strange issues?

Code: Select all

On Rules#Timer=1 Do
 If [VAR#1]<255
   Let,1,[VAR#1]+10      // <=== This may yield something > 255
   TaskValueSet,6,1,[VAR#1]
   TimerSet_ms,1,1
   DMX,1,[VAR#1]
 Else
   TaskValueSet,6,1,[VAR#1]
   TimerSet_ms,1,1
   DMX,1,[VAR#1]
EndOn
I also don't know what the "else" part should do here as it does keep setting the timer, not increasing the variable value and keep sending the DMX command.

Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests