Hi guys, I’m trying to get an automation to run, but atm I can’t figure out, why it’s not working …
My christmas tree light should turn on at 07:30 in the morning and turn off at 23:30 in the evening. But only if me or my girlfriend (or both) is at home. When nobodys home, the light should turn off. I want to use the automation editor, but I was not able to define a range of time in the trigger section and I was not able to create an “or” condition… Here’s my code, I’m kinda new to the automation stuff and tried to create the code out of the wiki, examples, automations.yaml created by the editor and other sources …
maybe someone can give me a hint why my automation could not be set up and is not showed in the editor …
- id: Xmas an
alias: Weihnachtsbeleuchtung an
trigger:
- platform: time
after: '06:30:00'
before: '23:30:00'
condition:
condition: or
conditions:
- condition: state
entitiy_id: device_tracker.1
state: 'home'
- condition: state
entitiy_id: device_tracker.2
state: 'home'
action:
- service: switch.turn_on
entity_id: group.weihnachtsbeleuchtung
- id: Xmas aus
alias: Weihnachtsbeleuchtung aus
trigger:
- platform: time
after: '06:30:00'
before: '23:30:00'
condition:
- condition: state
entitiy_id: group.all_devices
state: 'not_home'
action:
- service: switch.turn_off
entity_id: group.weihnachtsbeleuchtung
You don’t see them in the editor because the id: field should be numbers when using the editor
id: '1506535718756'
I believe it’s randomly generated but putting any 13 digit number in that field for your existing automations should make them show up after reloading automations… also it will change the order of trigger conditions etc… but they still work just a little harder to troubleshoot…
Also for mine… Id is indented under action and action has the - Hyphen. I don’t know how much it matters but most of my automations I create first in the editor for the basics and do the more detailed stuff in automations.yaml because some things you cannot do in the editor
I think there dont have to be numbers … as it says here: “For each automation that you copy over you’ll have to add an id. This can be any string as long as it’s unique.”
I tried using numbers, and the automation didn’t appeared …