Hi, I configured the themes on my home assistant and thought of an automation to change the frontend theme depending on day and night (using the sun sensor and “sunrise” and “sunset” events).
Now I have two themes, default one and a “dark” one.
I also wrote an automation (that actually doesn’t work), this one:
- alias: "Default Theme after Sunrise"
trigger:
platform: sun
event: sunrise
offset: "+00:00:00"
action:
- service: frontend.set_theme
data:
name: default
- alias: "dark Theme after Sunset"
trigger:
platform: sun
event: sunset
offset: "+00:00:00"
action:
- service: frontend.set_theme
data:
name: dark
What could be the problem? Look forward to your answers
I don’t think that that is the normal behavior… the trigger should fire only on HA start. Can you please post part of the log where you see the script is beeping triggered?
I don’t think you have an option to hide the icon. What you can do is a trick like changing the color of the icon to the same color as the background or give the icon a name that doesn’t exist (like icon: mdi:noiconhere). Never used that but i believe it works.
log is empty its just like it is above. the script triggers every minute to see if the sun is still up/down. I think that’s just tweaking the triggers.
The automation is firing every minute because of this trigger:
- platform: state
entity_id: sun.sun
Because you do not specify what attribute or state to trigger on, the automation will trigger when any attribute of the sun component changes, which is every minute. Try this instead for the sun triggers
- platform: sun
event: sunset
- platform: sun
event: sunrise
Now the automation will only fire when HA starts, the sun sets, or the sun rises. the rest of the automation action will work accordingly.