Script Gods

Good Evening All,

I am trying to setup a script that will do the following when triggered from a button in the lovelace dashboard in the following sequence

  1. When button is pressed it in LL dashboard it turns on output 1 for 0.5 seconds - ##Turns on device##
  2. Wait for 60 seconds - ##waits for device to power/warm up##
  3. Output 2 is then triggered for 0.5 seconds ##Select programmed drink##
    4)Wait 90 seconds ##Makes the Drink##
  4. Then trigger output 1 for 0.5 seconds ##Turns of Machine##

The reason for this is for my coffee machine, it wasn’t a ‘smart device’ but i have added a wifi relay board to the machine and connected the outputs to the coffee machine buttons. It needs time to power/warm up before before you can then select the drink you want.

Would someone be kind enough to help me with this script please?

Thank You

This is really easy to do, which part are you struggling with?

If I am honest writing the whole script…

I have tried doing it with the UI but cannot seem to build it up properly, so i have been reading the guide you attached and looking at examples of other peoples. Sorry if this is a basic question but its all a new learning curve to me, I have only really been doing it since the xmas break!

script:
  make_drink:
    sequence:
      # turn on machine 
      - service: switch.turn_on
        entity_id: switch.output_1
      - delay:
          milliseconds: 500
      - service: switch.turn_off
        entity_id: switch.output_1
      # warm up 
      - delay:
          seconds: 60
      # select drink
      - service: switch.turn_on
        entity_id: switch.output_2
      - delay:
          milliseconds: 500
      - service: switch.turn_off
        entity_id: switch.output_2
      # make drink
      - delay:
          seconds: 90
      # turn off machine 
      - service: switch.turn_on
        entity_id: switch.output_1
      - delay:
          milliseconds: 500
      - service: switch.turn_off
        entity_id: switch.output_1