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.
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
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).
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.