I have been doing this in my house based on sun elevation not time and I think it works well the key is to have it trigger when the sun is still above the horizon. I have found 10 degrees above the horizon works well for me. Here is the code, this will trigger then the sun elevation falls below 10deg above the horizon, kinds confusing.
alias: Lights on at sunset
description: ''
trigger:
- platform: numeric_state
entity_id: sun.sun
attribute: elevation
below: '10'
condition: []
I cannot believe that I did not know that you can use the attributes of the sun.sun entity id. I literally thought that all you could do is use if for above and below the horizon. I thought the attributes were just for information, rather than being usable by the system.
This adds a whole new dimension to HA, now.
I am going to try both methods as I am finding that the best way of learning HA.
Raelx - can I just ask something about your method, please?
Which of the Node-Red nodes are you using to enter the above information?
Ahh i should have mentation Iām not using NodeRed, i was never able to figure it out. So this is just an Automation in HA (Configuration > Automations)