I have an automation to close roller blinds equiped with shelly.
The goal is to close based on the following conditions:
luminosity (from the sensor) bellow 400lm
no one at home
being after 4:30pm
I also wants to include a external temperature check and when it start decreasing
What i have already done is the code bellow, but only check the clock once (trigger), and never again returns to check the conditions.
Since at that time the sensor is above 400lm it dont start.
How can i get this automation on loop after the 4:30pm, and cheking the conditionuntil they are true?
How can i also check when the temperature start decreasing?
- id: 'xxxxxxxxxxx'
alias: PERSIANAS | Close (winter)
description: Close roller blind during winter when sun is going away and external temperature starts to decrease
trigger:
- platform: time_pattern
hours: '16'
minutes: '30'
seconds: '00'
condition:
- condition: state
entity_id: person.J1
state: not home
- condition: state
entity_id: person.S1
state: not home
- condition: numeric_state
entity_id: sensor.illumination_7811dcded1ae
below: '400'
action:
- service: cover.set_cover_position
target:
entity_id:
- cover.persiana_quarto1
- cover.persiana_quarto2
- cover.persiana_quarto3
- cover.persiana_quarto4
- cover.persiana_sala1
- cover.persiana_sala2
data:
position: 0
mode: single
As i can see the automation only trigger once, and if the conditions are not validated at the time it will not check again.
And what i need is if the trigger is activated, and the conditions are not validated at the time, it will call it again until it get validated.
Actually i found what is not working and is the verification is people are at home, the condition is always false.
I have used not_home and away and dont work.
How can this be verified using device tracker?