Hi all, I’m totally new on HA and I am trying to create an automation for the lights of my backyard.
The first question is if I must paste the code in automations.yaml or configuration.yaml
This is the code that I have copied from other post:
[
alias: Lights on with the Sunset
trigger:
platform: sun
event: sunset
offset: ‘+00:15:00’
action:
Your formatting is wrong. You can place it in automations.yaml only if you have a line in your configuration.yaml like automation: !include automations.yaml. In either case, your rules should look like this:
- alias: Lights on with the Sunset
trigger:
platform: sun
event: sunset
offset: '+00:15:00'
action:
service: switch.turn_on
entity_id: switch.luces_patio
- alias: Lights off with the sunrise
trigger:
platform: sun
event: sunrise
offset: '+00:15:00'
action:
service: switch.turn_off
entity_id: switch.luces_patio
If you are adding these to configuration.yaml, you’ll want to add automation: as the first line.
I have pasted you code but the system is giving me an error that says:
missed comma between flow collection entries at line 3, column 5:
- alias: ‘Lights Sunset Sunrise’
^
New Home Assistant user in the house. I want to thank all of you for that great work. As I am planning to migrate from ST to HA how can I use this automation to turn ON/OFF not one light but all my outdoor lights (6 in total)?
I appreciate your quick reply, I will try it later and will keep you posted. Having a second HA server for testing purposes or just relying on the backups which one is better? Also, can you suggest to me some good tiny PCs for HA? Thanks.
Those questions are off topic for this thread and already covered in many other threads. Please use the search function or start new topics instead of asking them here.