Welcome.
Firstly, format your code correctly. Do this:
```
CODE HERE
```
Then it’ll look like this:
CODE HERE
with correct indentation and no silly formatting. See here:
To get an automation to run once per day only, add a template condition with a value template of:
{{ this.attributes.last_triggered.date() != now().date() }}
so if you’re editing that code rather than doing it via the UI, add this before or after your sun condition:
- condition: template
value_template: "{{ this.attributes.last_triggered.date() != now().date() }}"
Also, don’t conceal device or entity IDs. There’s no privacy risk but you might be hiding other issues.