Automation Gods - Timers on multiple switches

Good Evening All,

I hope someone could help!

Sorry if this is a silly/stupid question HA is new to me as is .yaml!!!

I have just retro-fitted a eWeLink 4 relay wifi output board to my coffee machine to make it smart (smarter than me)

Output 1 - Power/Warm up
Output 2 - Flat Coffee
Output 3 - Latte

I have added the eWeLink integration to my HA and can control the outputs via that. However i would like to setup a couple of automations based on the 3 outputs above.

I would like to carry out the following:

Automation 1:

If O/P 1 is triggered from HA it only keeps it toggles it for say 00:05:00 minutes then turns it back off again.

Automation 2:

If i select the Flat Coffe (output 2) it latches output 1 on for 00:01:45 minutes and after minute 1 it latches output 2 for 45 seconds (enough time for it to make the coffee) and then turns off both outputs.

Automation 3:

Same as Automation 2 but with the Latte output 3. I can adjust the timers to suit this after.

I hope this makes sense :upside_down_face:


This is just like a standard light timed switch off problem

I’m writing this on a tablet so you’ll need to push this through a config check and or rewrite it through the gui.
Rinse and repeat for the other two

  - alias: coffee1
    mode: single
    max_exceeded: silent
        - platform: state
          entity_id: switch.coffee1
          from: 'off' 
          to: 'on'
          for: '00:05:00'
        - service: switch.turn_off
          entity_id: switch.coffee1