Cannot get automation for switch to work

Hi, guys!
I’ve been struggling with this automation for days now, and cannot figure out what’s causing it not to work as intended.

rocket_espresso.yaml

- alias: Espresso machine on at 05:00  
  trigger:
    - platform: time
      at: '05:00:00'
  action:
    service: switch.turn_on
    entity_id: switch.espressomaskin

I am using
automation: !include_dir_merge_named automation/
in the configuration.yaml

the rocket_espresso.yaml is placed in the folder config/automation

Calling the service in Services works like a charm
SERVICE: switch.turn_on
ENTITY: switch.espressomaskin
{
“entity_id”: “switch.espressomaskin”
}

What am I missing here?

Is your system time correct?

maybe not… Timezone in hassio is correct: Europe/Oslo —> UTC -1
the time stamps in home-assistant.log is correct
… so yes?

And you’re expecting this to trigger at 5am only correct?

Yes.
Actually I would like the espresso machine to be on between 05:00 and 21:00 every day.
Later I will be adding at feature to turn it off when there are no adults at home, trigged by device_tracker on our iPhones.

Go to Home Assistant’s States page, find the automation in the list, and confirm its state is on.

Its there.
I can work the switch manually, and it turns on / off manually.

You have gone into configuration, checked the config and reloaded automations right?

OK, the switch is there, and works, but is the automation set to on?

You’re looking for something like:

automation.espresso_machine_on_at_05:00 

or

automation.rocket_espresso

I’m not sure of its name because I don’t normally create each automation in a separate YAML file.

Anway, the automation’s state should be on.

Yes. Reloaded, rebooted hassio…
Set a new trigger time eg. one minute ahead of current time, saved the .yaml file, reloaded Automations…

The automation is not even in the states list… :blush:
Could the issue be related to my splitting of the automation files?

I am using
automation: !include_dir_merge_named automation/
in the configuration.yaml

the rocket_espresso.yaml is placed in the folder config/automation

Ah, that could be the problem.

Mine is as so:

automation: !include_dir_merge_list automations/

Putting the scrip into the automations.yaml file in /config and changing the
automation: !include_dir_merge_named automation/
to
automation: !include automations.yaml/
did the work.

The automation now show up in the States entity list as State :on
… and was trigged at the time set in the script

There is a slight difference from @Philip_Embleton:
automation: !include_dir_merge_named automation/
automation: !include_dir_merge_list automation/

The last line is correct when putting several automation .yaml files in one directory.

Thank you for helping me out here guys!

Glad you got it working.

I have an Automations directory with a load of .yaml files. Most of the files have more than one automation inside. I generally split the automations into separate .yaml files per function (e.g. living room switch automations in one file, automations related to motion sensors in another and ones for automated window shutters in another etc).

You have a tip for how to shut the espresso machine off at e.g. 21:00 at the latest too?

When everything in the automation appears to be valid, yet it fails to work, then it suggests the automation is not on or, in even worse, not even recognized by Home Assistant (as was your case). I’ve seen this recently where someone entered two instances of automation: in configuration.yaml (the second instance was indented by one space to pass Config Check). Needless to say, the second automation failed to run.