Hi,
I’m trying to automate my sunblinds. I have a bh1750 light sensor working via MySensors, which works fine. Also I use the darksky component to determine the cloud coverage. But now I’m stuck with the blind-up automation. I want the blinds go up when the light level is below a specific value for a particular time, which depends on the cloud coverage. So I tried the following:
- id: covers_up_center_right
alias: Zonneschermen midden en rechts omhoog
trigger:
- platform: sun
event: sunset
- platform: numeric_state
entity_id: sensor.relay_temp_light_55_3
below: 1500
for: '{{ (30 - states.sensor.dark_sky_cloud_coverage*0.3) | int}'
condition:
condition: and
conditions:
- condition: template
value_template: '{{ (states.sun.sun.attributes.azimuth > 163) and (states.sun.sun.attributes.azimuth < 343) }}'
- condition: template
value_template: '{{ ((as_timestamp(now()) - as_timestamp(states.automation.zonneschermen_midden_en_rechts_omhoog.attributes.last_triggered)) / 60) | int > 20 }}'
action:
- service: cover.close_cover
data:
entity_id: cover.zonnescherm_midden
- service: cover.close_cover
data:
entity_id: cover.zonnescherm_rechts
This doesn’t work, because the for-condition in the trigger doesn’t support templates as far as I know. But is there a possibility to make this work? Or an alternative for the for-condition which supports templates?
Thanks in advance.