Simple sequence of commands when pushing a button

hi guys,

hope you can help me with this. Despite I love computer programming, I don’t get use to this YML programming.

All I want is watering my garden manually, I meant, when I push a button on my dashboard.
My reles are connected to the valvules that open the water flow.They are 3 and are connected with ESP8266 and MQTT to HomeAssistant.

The program in a nutshell should be like this:

  1. switch.garden_rain_master on
  2. switch.garden_rain_zone_1 on
  3. wait for 5 minutes
  4. switch.garden_rain_zone_1 off
  5. switch.garden_rain_zone_2 on
  6. wait for 5 minutes
  7. switch.garden_rain_zone_2 off
  8. switch.garden_rain_zone_3 on
  9. wait for 5 minutes
  10. switch.garden_rain_zone_3 off
  11. switch.garden_rain_master off

This is a first objective. I would like to decide when watering when I’m at home.
Can you help me to convert this commands to YML?

Would be great also if you could help me to configure this watering program to be launched automatically every day at a specific time…just in case this covid19 let me go on holidays some day.

Thanks for reading, hope you can help me

Use NodeRed. It’s super easy and intuitive.

trigger:
  platform: time 
  at: '13:30:00'
action:
  - service: switch.turn_on
    entity_id:
      - switch.garden_rain_master
      - switch.garden_rain_zone_1
  - delay:
      minutes: 5
  - service: switch.toggle
    entity_id:
      - switch.garden_rain_zone_1
      - switch.garden_rain_zone_2
  - delay:
      minutes: 5 
  - service: switch.toggle
    entity_id:
      - switch.garden_rain_zone_2
      - switch.garden_rain_zone_3
  - delay:
      minutes: 5
  - service: switch.turn_off
    entity_id:
      - switch.garden_rain_zone_3
      - switch.garden_rain_master
2 Likes

Wow! Thanks for such a quick and great reply!

Is there any way to trigger this manually when I push a button in the dashboard?

Hope you and your family are safe from this coronavirus

1 Like

Put the automation on your dashboard and click on it and then click trigger in the pop up.

Or, maybe neater, put a button on your dashboard somewhere with the tap_action with service automation.trigger and the entity of the automation.

Hi Marc,
thanks for yourmessage.

I think I did something wront in automations.yml and now my home assistant web application doesn’t start.
I can access to Home Assistant Command Line pluging a keyboard.
Isthereany way in there to edit automations.yml to revert the configuration and have HA backagain?

Thanks in advanced

Depends on how you’re set up, but it’s just a text file so usually just open it in the editor of your choice and make the changes and then restart homeassistant.

I got it with Vim editor over the HomeAssistant command line

1 Like