Automation creation: (GUI Vs YAML)

Hi all,

Im have been creating automations on the new GUI of HASSIO however if I want to use time conditions or time triggers I caanot use weekdays as it doesnt get into the YAML file despite I write it and save it in the GUI.

I have tried now the old school style writing this specific automation code on the automations.yaml file, the file gets save but I cannot see the new automation neither on the entities or the automations gui. Im am giving alias and Id just in case but still doesnt work and I cant find the automation I wrote anywhere, hope you guys can help me.

Thanks in advance

If the new editor doesn’t yet support those features how would it display them?

that is true, dont get me wrong, the GUI is awesome for simple automations and newbies like me. The thing is that there is no sign the automation is working from the home assistant like recognizing it as an entity for example.

Reload automations at Configuration > Server Control > reload automations.

Thanks @Tediore the log was receiving the automations, however it was not accepting weekday as a trigger command on my code, so I had to add it via YAML editor as a condition within an automation that i created via de GUI, after edition I see within the GUI of the automation that there is a condition but doesnt show any data as it is a weekday data and not a before/after statement, will keep testing if the condition actually works on the automation

The automation UI doesn’t support everything yet. If it’s in the YAML and everything is formatted properly it’ll work regardless of what the automation UI shows for it.

Feel free to post the automation YAML if you want us to take a look at it.

Thanks @Tediore, I dont see errors in the logs about the lines I written and configurator corrector says everything is fine hence I trust, anyway the code of the automation in the YAML is the below, as I said before I created it via UI and added the condition part on the configurator manually, hope this mix of edition methodologies dont create any sort of corruption.

- id: '1573939995968'
  alias: simulate_sunrise2
  trigger:
  - at: '7:00'
    platform: time
  condition:
    - condition: 'time'
      weekday:
        - sat
        - sun
  action:
  - data:
      brightness: 20
      entity_id: light.la_luz_del_cuarto
    service: light.turn_on

YAML is YAML, doesn’t matter where it was created :wink:

Should be ok, but I’d suggest this:

  condition:
  - condition: time
    weekday:
    - sat
    - sun

just to be consistent with the indentation in the trigger and action. You also don’t need quotes in condition: time.

1 Like

No, I’d leave the condition with a dash as that way its consistent with adding conditions either later or to other automations using this as a template

2 Likes

Well, right. The hyphen was fine, it was more about being consistent with the indentation. Edited above, how’s that? :wink:

1 Like

Thanks for the tips @Mutt and @Tediore, already included your suggestions in my code

I generally use dashes under triggers, conditions and actions to make all my automations consistent and extendable (cos I’m both ocd about consistency and lazy (I’ll just grab the first appropriate automation I can find to use as a template)) :rofl:

Lol I started doing the same recently. A bunch of my old ones don’t have the hyphens but my automations are already about as inconsistent as they could possibly be in some regards… indentation is consistent, but I sometimes use quotes around states when they’re not needed, sometimes simple templates have ’ on the outside instead of " (but no " on the inside, don’t worry), etc. Oh well. It works :stuck_out_tongue:

I agree, and when I come across stuff I’ll correct it but what the eye doesn’t see … The heart doesn’t grieve over (and if it ain’t broke, don’t fix it) :rofl:

2 Likes

Yeah at this point I can’t be bothered to clean up the YAML lol.

Although maybe the Home Assistant backend secretly resents me for it…

1 Like