MQTT (tasmota - Sonoff) and WOL Rules

Hi! This is the rule I want to make :

  1. Turn on Sonoff switch for TV
    then
  2. Turn on Sonoff Switch for Receiver
    then
  3. delay 10 seconds
    then
  4. Turn on WOL

Thanks!

Hi there, we are going to need a few more details, please…

from top of my head…
syntax is probably wrong here and there, but for general idea:

rule "weird switches"
when
    Item Sonoff_TV_Switch changed from OFF to ON
then
    Sonoff_receiver.sendcommand(ON)

    var now = Time.now
    var timer = createTimer(now.plusSeconds(10))
    createTimer(now.plusSeconds(10))
    if(now > timer){
        Whatever_is_WOL.sendcommand(ON)
    }
end

Yes almost
The timer syntax is very different though.

rule "weird switches"
when
    Item Sonoff_TV_Switch changed from OFF to ON
then
    Sonoff_receiver.sendcommand(ON)

    createTimer(now.plusSeconds(10), [ |
        Whatever_is_WOL.sendCommand(ON)
    ])
end

:wink:

    createTimer(now.plusSeconds(10), [ |
        Whatever_is_WOL.sendCommand(ON)
    ])

The | and [ where swapped and missing the “C” in sendCommand.

If I had a dime for every time I’ve done this I’d be a millionaire.

Thanks, I was rushing out.
Corrected above