I want to automate shutters based on the expected sunrise time. I am still fairly new to home assistant. I think this should be easily possible but I am somewhat stuck with how to define the condition.
I would like to close shutters at 3:00 am if the sunrise will be before 6:30 am.
So I think the trigger would be “3:00 am” and for the condition I can maybe use the ‘next-rising’ attribute, but I don’t know how. Any support would be highly appreciated.
alias: close shutters
description: ''
mode: single
trigger:
- platform: time
at: '03:00:00'
condition:
- condition: state
entity_id: sun.sun
attribute: next_rising
action:
- device_id: xyz
domain: cover
entity_id: zyx
type: set_position
position: 0
I suggest to use elevation and no offset. Because the “real darkness” level is more or less aligned with the elevation degree, whereas the darkness level is different with only using the offset, because the sun is rising and setting “faster” (curves) or “slower” depending on the seasons.
Sorry I’m a little closer confused here. What I wrote is what the visual editor gave me. If this is incorrect, would the following be the correct syntax?