I really like Home Assistant, but I’m completely frustrated with the syntax of the configuration. I can’t seem to find any good formula or logic for why certain items are indented, or itemized. For example, this works formatted the way it is:
garage_lights_timer_off:
alias: "Turn off Garage lights after 10 minutes"
sequence:
- delay:
minutes: 10
- condition: state
entity_id: garage_lights_manual_mode
state: 'off'
- service: switch.turn_off
data:
entity_id: switch.garage_lights
But, this doesn’t:
garage_lights_timer_off:
alias: "Turn off Garage lights after 10 minutes"
sequence:
- delay:
minutes: 10
- condition: state
entity_id: garage_lights_manual_mode
state: 'off'
- service: switch.turn_off
data:
entity_id: switch.garage_lights
And the only difference is the indentation of “entity_id” and “state”. Which seems appropriate.
And this works:
office_lights_timer_reset:
alias: "Reset Office Lights Timer"
sequence:
- service: switch.turn_on
data:
entity_id: switch.office_fan_light
- service: switch.turn_on
data:
entity_id: switch.office_desk_lights
But, this doesn’t:
office_lights_timer_reset:
alias: "Reset Office Lights Timer"
sequence:
- service: switch.turn_on
data:
- entity_id: switch.office_fan_light
- entity_id: switch.office_desk_lights
It seems like “entity_id” would be an itemized component of “data”, so that the block of code above doesn’t need to be repeated.
And, then there’s this whole “condition: condition:” thing:
trigger:
platform: time
after: '08:00:00'
condition:
condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
Is there any resource that could teach me how, and why I should indent something, when I should use multiple condition tags, or just pretty much anything that will teach me to create rules logically in my head? The syntax is really holding me back from doing some incredible stuff that I know is possible. I know how to script in many different languages, if that matters any.
Edit: Do you folks not feel the same way? Is writing the automation just blatantly obvious to you and there’s just something I’m missing?