Looking for a way to operate automation of blinds via photocell triggered, but pervent sun to retriggered blinds automation.
A choose statement is perfect for this.
Script Syntax - Home Assistant.
Draw a flowchart to start…
when I see this above that, preform action1
then
If I see that above this, preform action 2
then as default
I don’t know what happened, do the other thing as a failsafe.
Take the notes and start building the automation in the UI. Test as you go.
During building I always add a temporary trigger on my magic cube so I can force a trigger that is a real trigger to test, then throw that away later.
alias: €€ Porch blinds / sunSet / -8min / photocell
description: “”
trigger:
- platform: sun
event: sunset
offset: “-00:08:00” - platform: device
type: turned_on
device_id: 2de153b9e49df07e676b678c4c90378e
entity_id: 15382026433a5bbaa4ed6aaaad76bd34
domain: switch
condition:
action: - device_id: 1e445a4daba4dab032975719bf6ae688
domain: cover
entity_id: 9f62bac1a27c0af946acc505cb903483
type: set_position
position: 56 - delay:
hours: 0
minutes: 0
seconds: 6
milliseconds: 0 - device_id: 64e3b8e9e7ba19b7b8146be04de985bd
domain: cover
entity_id: bf97bb01e62cdd573e0b2ae6b77ea3f3
type: close - delay:
hours: 0
minutes: 0
seconds: 12
milliseconds: 0 - device_id: 1e445a4daba4dab032975719bf6ae688
domain: cover
entity_id: 9f62bac1a27c0af946acc505cb903483
type: set_position
position: 12
mode: single
Hope that posted ok but sorry confused
in short of an elicit step to fix this issue, I added a timer at the end of this automation. So two automation can’t be used too close. Thinking 4hrs would work, but I can change if needed.
What you posted suggests you put everything under trigger. If so that is not correct. Very hard to understand. Perhaps reformatting would help.
You don’t need to use a timer to delay an Automation restart, just use delay: 04:00:00
after your last action.
Well you’re correct if I put a delay step on the automated it wouldn’t work since I would have to wait for the delay.
So I put it on the end and it stops the error so if the photocell sets off (storm) then the sunset step can’t work since it’s has a delay.
Work around but it works. Simple enough