HarmonyHub: Trigger Command after x seconds

Hello,
I do have a elite screens spectrum projector that is currently configured with HarmonyHub that has 3 commands: Up, Down and Stop.
By default , Elite screens projector does not has a limit to stop the screen at a specific length (ex: 85%)

I was thinking that: If i trigger the Down button, stop Button has to be automatically triggered after 5 seconds
So far, i tried searching on the forum for a similar rule.

My question is, can I create a rule where i can achieve that “limit” feature via button delay or something similar? please let me know.

I am using OH 2.5 on Ubuntu 20.4
Thing: Elite Screens Home Appliance, Channel; send button press harmonyhub:device:2342232:buttonPress type: string

Thank you very much

Try something like

rule "Send stop command"
when 
    Channel harmonyhub:device:2342232:buttonPress triggered
then
    Thread::sleep(5000)
    //Send stop command
end

Only do that if you want to run the risk of running out of threads and delaying or stopping all of your rules! A timer is the right tool here.

Is this really an issue? I use `Thread::sleep most of the time and did not have any issues with it. I only use timers for longer time periods

Yes… the old rule engine has a limited number of threads in the pool, and the pool defaults to 5 threads. For example, if the harmonyhub:device:2342232:buttonPress Channel were triggered 5 times, it would use up all of the threads and prevent all rules from running for 5s. If triggered 6 times, rules would stop for 10s. If triggered 100 times…

1 Like

@Felix_Schneider and @5iver thanks a lot for your help .

1 Like