Help with simple automation

Hi

Trying my hand at the automation part of HASS. Running into problems with what should be a simple set of yaml code…
Ive got a smart plug, which I want to turn on at a set time

Note: configuration.yaml points to a file via “!include [file]”
I want the switch.irrigation to turn on daily at the specified time

HA v0.49

So far, I have this

- alias: "Water Plants"
  hide_entity: true
  initial_state: off
  trigger:
    platform: time
    at: "22:00:00"
  action:
    service: switch.turn_on
    entity_id: switch.irrigation

The log file has no errors, but the automation doesnt fire when I try it. Ive searched peoples configs and syntax and read no end of forum threads and cookbooks…just cant get it to work for some reason!

Can anyone help please??

The automation won’t fire if the inital_state is off as it means the automation is off, either set initial_state: on or click the automation switch in the frontend that corresponds to this automation (Water Plants) to turn the automation on, but if you want it to automatically work set the initial_state to on.

1 Like

Awesome, thank you, will try that
I guess i misinterpreted this in the docs!

To set an automation to be disabled when Home Assistant starts set initial_state: to False.

Yep that’s true but you then either have to have another automation to turn it on at some point or turn it on manually :slight_smile:

got ya. now I see the functionality of that initial_state

thank you

PS, the automation is working now, I also added another one to turn it off a minute later - progression, woo hoo!

2 Likes