i created an automation for covercontrol, based on temparature and time.
When the temperature of sensor X is 22.5 °C or above and it´s between 8:15 AM and 5:15 PM close cover X, Y, Z to 30%.
The automation works, if the temperature is under 22.5 and reaches it between 8:15 AM and 5:15 PM.
But now it´s very warm here and we have 23 °C before 8:15 AM, with my automation the cover don´t close after 8:15 AM, because the temperature was reached before the time.
Optional I want, if the covers already set to the exact position, that it don´t triggers / no notification is triggered.
Can you help me? This is my code:
alias: COVER CONTROL
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.ble_temperature_essbereich_thermometer
above: '22.5'
- platform: homeassistant
event: start
condition:
- condition: time
before: '17:15:00'
after: '08:15:00'
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
action:
- device_id: 7ecac06fb8a8ef4877ac59e1a73694c9
domain: cover
entity_id: cover.esszimmer_rollo_1
type: set_position
position: 30
- device_id: 4b7807dc4907e4db5e1f829dc1c66e66
domain: cover
entity_id: cover.esszimmer_rollo_2
type: set_position
position: 30
- device_id: 4185942f42ba490052474100c7bce295
domain: cover
entity_id: cover.esszimmer_rollo_3
type: set_position
position: 30
- device_id: 1309dcccdaaa21008bd6f49033ad747c
domain: cover
entity_id: cover.wohnzimmer_rollo_5
type: set_position
position: 30
- device_id: 6b5c90fa5806406ac15d616045a4eee2
domain: mobile_app
type: notify
message: >-
The shutters on the south side were lowered by 70% due to heat
shut down.
title: Shutters on the south side were lowered by 70%
mode: single
Also see my edited post above that suggests you need a second automation. You could do it in this one - but I believe there are no overheads having a second one to do the time trigger.
My wish is that it opens after 5:15 p.m. and the automation only checks the next day between 8:15 a.m. and 5:15 p.m. whether it is warm enough or whether it has already reached 22.5 degrees or not and triggers it accordingly.
In the same automation, add a trigger for when is 08:15 and a condition to not run unless the temperature is above 22,5°.
This will force it to check the conditions if is 08:15 but will on ly run if it is above your threshold.
automation:
- trigger:
- platform: time
# This trigger will fire at 5:15PM
at: "17:15:00"
action:
- device_id: 7ecac06fb8a8ef4877ac59e1a73694c9
domain: cover
entity_id: cover.esszimmer_rollo_1
type: set_position
position: 100
- device_id: 4b7807dc4907e4db5e1f829dc1c66e66
domain: cover
entity_id: cover.esszimmer_rollo_2
type: set_position
position: 100
- device_id: 4185942f42ba490052474100c7bce295
domain: cover
entity_id: cover.esszimmer_rollo_3
type: set_position
position: 100
- device_id: 1309dcccdaaa21008bd6f49033ad747c
domain: cover
entity_id: cover.wohnzimmer_rollo_5
type: set_position
position: 100
- device_id: 6b5c90fa5806406ac15d616045a4eee2
domain: mobile_app
type: notify
message: >-
The shutters on the south side were opened.
title: Shutters on the south side were opened
mode: single
You don’t need to check if they are already open, just open them at 17:15.
I have already built an automation for opening after 5:15 p.m.
Unfortunately, this is of no use, if it is already over 22.5 degrees before 8.15 a.m., then my automation will no longer trigger.
You don’t need another automation to open after 17:15. Just add that as another trigger on your automation and remove the “before: 17:15:00” from your time based condition.
Aha, you wanna open at 17:15. I understood from before yiu wanna close it… My mistake, sorry.
You can always name your triggers and use options to define what to do in each case, I would go for that onky if I have too many other automation and want to reduce the number on that list. It hat is not a problem for you having another automation is probably the best way as it would be easier to read (and probably easier to maintain).
By the way, you should later play with other triggers and conditions, so you kind of use sunrise/sunset instead to f fix times and some weather integration to keep the cover open if it isn’t sunny outside, etc.