☀️ Cover Control Automation (CCA) - a comprehensive and highly configurable roller blind blueprint

Hello everyone, I would like to introduce you to my roller shutter blueprint:

Cover Control Automation (CCA)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

My GitHub Project

Minimum required version of Home Assistant: 2024.6.0

If you would like to support me or say thank you, please click here: :pray: Click Here :pray:

This is a comprehensive and highly configurable blueprint that can be used for the following basic purposes:

  • Opening and closing the roller shutters (depending on brightness, sun-elevation and within time windows)

  • Ventilation feature (Currently for two-way sensors)

  • Resident feature: keep the cover closed if resident is asleep

  • Complete flexibility in almost all parameters:

    • Fixed drive delay and random drive delay
    • Waiting time duration for triggers
    • Position tolerance
  • Each feature can be activated or deactivated as required. Not only through a switch in the blueprint, but also through dynamic conditions outside the automation. Condition examples:

    • If, for example, your blinds on the upper floor only close automatically and are not opened via the automation, you can also enable the blinds to be opened during this time by activating a vacation mode boolean.
    • If you have visitors or a party, you may not want the blinds to close. This can be easily configured using a party mode boolean.
    • If, for any reason, you want to pause the activation of shading or the ending of shading, this can be controlled via a shading boolean.
    • If you want to suspend the entire roller blind control for a short time, perhaps because maintenance work or window cleaning is being carried out, this is possible with just one Boolean.
    • Are the roller blinds on side doors normally only opened by the automation system and never closed because you don’t want to lock yourself out? But on vacation, the blinds should still be closed. This is how the conditions work.
  • Extensive automatic sun shading with many different setting options:

    • Sun azimuth
    • Sun elevation
    • Solar irradiation/Light intensity/Illuminance
    • Weather Conditions
    • Two different temperature sensors (compare thresholds for indoor and/or outdoor sensors)
    • Not only the current temperature, but also the temperature forecast can also be taken into account.
  • Added the option to save the current status in a helper. This has the advantage that the roller blind can also be in other positions and the automation can still be executed. And manual interventions are not constantly overridden with every trigger.

General information
  • If multiple criteria (e.g. temperature sensors and/or azimuth and/or elevation) are defined, shading will not occur until all criteria are met.
  • It is not possible to execute this automation manually!
  • In order to have extensive flexibility here, different sensors are used. But there is also the possibility to define a resident of the room,
    so that e.g. the cover does not go up in the morning, although the resident is still sleeping.
  • If you want to use sun elevation and/or azimuth it’s strongly advised to use sun.sun. And please make sure your sun.sun entity is enabled!
Important configuration notes
  • time_up_early should be earlier than time_up_late
  • time_up_early_non_workday should be earlier than time_up_late
  • time_down_early should be earlier than time_down_late
  • shading_azimuth_start should be lower than shading_azimuth_end
  • shading_elevation_min should be lower than shading_elevation_max
  • shading_sun_brightness_start should be higher than shading_sun_brightness_end
  • open_position should be higher than closed_position
  • open_position should be higher than ventilate_position
  • closed_position should be lower than ventilate_position
  • shading_cover_position should be higher than closed_position
  • shading_cover_position should be lower than open_position
  • resident is only allowed to be on/off/true/false
  • cover must have a current_position attribute

I hope you have lots of fun with this version.

49 Likes

Debugging:

At this point, I would like to mention that it is possible to increase the number of traces. The following lines must be added to the respective automation in the YAML code.

trace:
  stored_traces: 20

See also: Troubleshooting automations - Home Assistant

In case of errors, I need at least the blueprint configuration in YAML format (no screenshot). And if necessary, please also upload a trace here. Thank you very much.


Changelog

(Full Changelog on Github)

2024.01.29-01:

  • Updated hints
  • Fixed one resident condition (thx to Eimeel)
  • Added version number to json (thx to Eimeel)

2024.01.29-02:

  • Added: Implemented configuration check to perform some basic checks (idea and code by Eimeel)
  • Added: Cover Drive Time
  • A few logic changes

2024.01.29-03:

  • Added config check for sun attributes
  • Fixed: Wrong trigger condition while closing

2024.01.29-04/2024.01.29-05:

  • Updated descriptions

2024.01.30-01/2024.01.30-02:

  • Fixed and extended config check
  • Fixed closing condition. Wrong fix yesterday. Back to the origin. Will check this later.

2024.02.01-01:

  • Minor Layout changes
  • Removed commented out code
  • Fixed closing-condition
  • Fixed cover status helper initialisation and still make the first cover drive possible

2024.02.02-01:

  • BREAKING CHANGE: Please reconfigure/rename the variables close_position and shading_position in your blueprint config.
    Old: closed_position - New: close_position
    Old: shading_cover_position - New: shading_position
  • Added tilt positions for open, close and ventilation

2024.02.03-01:

  • Strict separation of the two brightness sensors. The previous problem was that the shading sensor used the same values to open or close the blinds as the normal sensor. Depending on the sensor (different edge, slope, median, filter, etc.), incorrect triggers occur.
    Important: If required, please register both brightness sensors.

2024.02.03-02:

  • Opening the blinds only until time_down_early. Otherwise, overlaps may occur if the brightness values are not set correctly. Avoid bouncing the blinds.

2024.02.06-01:

  • Added: Helper length validation
  • Comprehensive JSON changes / Now multidimensional JSON
  • Roller blind movements can now only be executed once a day when the helpers are used.

2024.02.07-01:

  • Fixed weather.get_forecasts: The response from the service is a dict with the target entities as keys

2024.02.09-01:

  • Streamline the code
  • Added option to enable time control via external schedule helper
  • Added more options for manual time control (drive up - late on non-workdays / drive down early and late on non-workdays)
  • Possible breaking change: You should reconfigure the times in your CCA automations!

2024.02.12-01:

  • Allow input_boolean as contact sensors.
  • The state of the contact sensor can be true/on or false/off
  • Fixed time control bug

2024.02.13-01:

  • Fixed potential bug when opening via time control

2024.02.15-01:

  • Fixed timestamp comparison bug
  • Faster checking for manual position changes

2024.02.18-01:

  • Fixed: Schedule open/close-bug
  • Fixed: Next try - faster checking for manual position changes
  • Separate ventilation from lockout protection
  • Added own lockout protection feature
  • Removed door/window chooser (contact_cover_place)

2024.02.18-02:

  • Fixed: Problems with helper json

2024.02.19-01:

  • Added: External trigger to force opening or closing. Useful for Antifreeze, RainProtection or WindProtection.
  • Fixed: Still timing problems occur when recognising manual drives
  • Added: Additional actions for open, close, ventilation, shading start and shading end

2024.02.28-01:

  • Fixed a nasty bug in the helper detection.
  • Fixed the warning: AttributeError: ‘list’ object has no attribute ‘lower’

2024.02.28-02:

  • Fixed: Float values were incorrectly compared as integers. This fixed problems with sun-elevation and brightness.

2024.03.01-01:

  • Roller blinds may only be closed once after Time_Down_Late. Previously, the entire day was checked.

2024.03.11-01:

  • Added various options for fine adjustment
  • Possibility to ignore actions after manual position changes
  • Only compare such positions if the mode has been activated accordingly
  • Avoid status change from ‘unavailable’
  • Allow delay in ventilation mode
  • Fixed: Shading should not be activated when ventilation mode is active
  • Fixed: Closing the door contact should always lower the roller
  • Instead of cover helper and position detection working against each other, the two can now complement each other.
  • Manual detection adjusted. Positions 0% and 100% always result in close/open regardless of the configuration.
  • Forcing a status is now also automatically used as a negative condition in other queries.

2024.03.11-02:

  • Completely new structure of the various choose-branches
  • Relocation of some conditions to the sequence section
  • Redesign of the ventilation mode
  • Added: Additional Condition For Ventilation #33
  • Added: Force Ventilation #28

2024.03.14-01:

  • Fixed: Ventilation mode could always be started by mistake.
  • Fixing helper length check. Thx to crandler.

2024.03.21-01:

  • Breaking change in the schedule helper usage! You can find the details in the section “Selection of time control options”.
  • New: Reduction of triggers and thus avoidance of overlaps due to running delays (fixes #40)
  • New: Added possibility to disable the use of ‘set_cover_position’ and ‘set_cover_tilt_position’ and only use the additional actions
  • Fixed: Shading Forecast Weather Conditions
  • Fixed: Ventilation mode should not only be ended in the evening, but whenever it is not yet daytime.
  • Fixed: Added the ventilation mode activation on closing down again
  • Try to avoid overlaps in the execution of the automation if several triggers are triggered shortly after each other.
  • Fixed: Optional weather conditions for “shading in” #41

2024.04.05-01:

  • Update: Forecast Temperature below 0 possible
  • Delay lines minimally changed
  • Added: Allow shading to activate multiple times a day #44
  • Fixed: Ventilation is usually activated too often.

2024.04.08-01:

  • Fixed: Make the shading work even without a helper

2024.05.01-01:

  • Updated: Trigger shading at time_up_early and schedule helper state change, too
  • Fixed: Possibility to ignore actions after manual position changes
  • Added Feature: Force activation of sun shading #49
  • Fixed: Manual shutter movements after a core restart were not always recognised.

2024.05.03-01:

  • Minor editorial changes

2024.05.15-01:

  • Fixed: Do not recognise manual movement if status is unknown
  • Updated: Change the step size for the brightness values to 1
  • Fixed: Made the force function easier with fewer conditions
  • Added: Make it possible to open and close the roller blinds multiple times
  • Added: The forecast sensor can now trigger the sun shading #48
  • Added: Delay between set_cover_position and set_cover_tilt_position.
  • Added: Lockout protection implemented at the start and end of shading. #43/#55 (Attention: Cover may close in the evening after contact is closed again!)
  • Fixed: Retriggering of the shading is possible again. Open/close branches are only started if automation is not already running.

2024.05.15-02:

  • Quick workaround, as opening and closing does not currently work.
  • Minor changes

2024.05.22-01:

  • Added: Separation of the contact sensors for ventilation and lockout protection
    BREAKING CHANGE: Reconfiguration of lockout protection necessary!
  • Updated: Combining the shading triggers. No more problems with waiting times and retriggers.
  • Fixed: Do not close after closing the contact if ‘Automatic Closing’ is disabled
  • Fixed: Missing shading force trigger
  • Fixed: Prevent trigger with invalid status

2024.05.28-01:

  • Complete restructuring and logic change for shading, lockout protection and ventilation:

    • When the cover is opened, the system checks whether a sun shading is already in place. If this is the case, the cover is not opened but moved directly into the shading position.
    • If the cover is to be closed and the contact is open, either lockout protection or ventilation mode is activated.
    • If the cover is closed and the corresponding contact is opened, the ventilation position is activated.
    • When the sun shading is activated, the lockout protection is taken into account if the contact is open. If the contact is closed, the cover moves back to the shading position.
    • When the sun shading is stopped, the lockout protection is checked. It is also possible to move to the ventilation position when the contact is open. If the contact is closed here, the cover is opened.

    Summary: CCA saves the temporary status (ventilation, lockout protection and shading) and the actual target status in the Cover Status Helper.

    • This means that the cover is simply opened or closed as before.
    • And it does not always return to the previous state (which may have changed in the meantime).
    • Instead, it switches to the state that should actually be current.
  • Fixed: Incorrect position detection during manual drives if shading_position is smaller than close_position

  • Added: Shading activation before opening. The cover can now move into the shading during the opening process. #4

  • Added: Prevent automatic closing due to the resident sensor #63

  • Added: Option to deactivate time control. This means that the system can now also be controlled exclusively via the brightness and the height of the sun. I

  • BREAKING CHANGES:

    • Cover Status Helper is now mandatory for ventilation, lockout protection and shading!
    • Invert the status of some options #61 (“Prevent the cover from being … several times a day” instead of “Allow the cover to be … several times a day”)

2024.06.04-01:

  • Major GUI Update: Using blueprint sections now (Min-Core-Version: 2024.6.0)

2024.06.05-01:

  • Added: Optional checking workday tomorrow sensor when closing the cover #71
  • Updated: GUI section icons to MDI icons

2024.06.24:

  • Breaking change: ‘prevent_higher_position_shading_end’ changed to new parameter ‘prevent_lowering_when_closing_if_shaded’
  • Added: Limited templates for enabling automation triggers
  • Added: Shading sensor 2 is also checked again during shading
  • Fixed: Occasionally sun shading was performed without checking the weather conditions
  • Fixed: The ventilation position was not set correctly when closing the roller blind
  • Fixed: At the end of sun shading, the system no longer moves to the ventilation position
  • Fixed: Sun shading is now also calculated outside the configured times and can be taken into account when opening.
  • Fixed: Option “Prevent the cover from closing immediately after deactivating the lockout protection”
  • Many thanks to Eimeel and Bostil

2024.06.26:

  • Breaking change: The option “Prevent the use of the ‘get_forecasts’ service (prevent_forecast_service)” has been removed and replaced by the configuration option under “Sun Shading Forecast Type”
  • Fixed: If tomorrow is not a working day, the right time is taken now - #80
  • Fixed: If the blind is moved manually below the shading and ventilation position, this is no longer recognised as closed.
  • Added: Additional Actions After Manual Change - #87
  • Added: You can now decide whether you want to use the hourly or daily weather forecast.
  • Added: It is now possible to reset the manual detection of roller blind movements at 00:01 - #86

2024.06.29:

  • Breaking change: The checkbox introduced in the last update “reset_manual_detection” has been moved to a separate selection. Please reconfigure.
  • Added: Time and timeout in minutes to reset the manual override #95
  • Added: Additional Actions After Override Reset #94
  • Fixed: The cover may also be closed after ventilation if the down mode is not activated
  • Many thanks to crandler for the ideas

2024.06.30:

  • Fixed: Preventing errors and warning on manual execution
  • Fixed: Incorrect time adopted if tomorrow is a working day and today is a weekend

2024.07.06:

  • Fixed: Return to shading after ventilation #43
  • Fixed: When closing the ventilation contact, do not move the roller blind if it is already in the correct position #102
  • Updated: Trigger name renamed to make debugging easier for beginners
  • Added: Additional information on when a Cover Status Helper is required
  • Added: License notification and notice about the new Take Control-feature

2024.07.31:

  • Fixed: Override conditions were incorrect #109
  • Fixed: Faulty timing triggers although they have been deactivated #104
  • Fixed: Removed duplicate line of code without effect #105
  • Fixed: Reset shading status at midnight that is no longer required - but still saved #106
  • Fixed: Empty weather conditions are now taken into account when shading is ended #110
  • Fixed: When the shading is ended, the resident sensor is now also checked so that nobody is woken up #116
  • Updated: All force situations are now fully cross-checked in all choose-branches
  • Added: Save the length of the helper for better debugging #107
  • Added: The ventilation position can now be moved to after the sun shading has ended (if the contact is open)

2024.08.03:

  • Fixed: Helper length analysis template variable warning #120
  • Fixed: New trigger “t_shading_reset” causes errors #119
  • Fixed: “Manual Override” don’t work #122 (Thanks to Eimeel)
  • Fixed: Commenting out the check of the position information in the config check #121
  • Fixed: Blinds not opening with resident mode when auto close disabled #115
2 Likes

nice, thank you!

Happy Release Day :slight_smile:
Thanks again for all the work you put in.As a shift worker, I am very happy about the resident mode. But what I’m missing is an additional block that doesn’t open the blinds, for example during school holidays or weekends.

Hi Loi, you can control all of this via the conditions.

But you should be able to achive this by using the resident mode, shouldn’t you?
As it’s an input_boolean is just for this, you can create an automation and define however you want.
Or am I missing your point?

You’re right about resident mode. But I only have one presence detector in the bedroom and if it doesn’t recognize me or my wife, the shutters open. It is easier not to open the shutters on certain days. @Herr.Vorragend gave me the tip about the Additional Conditions For Opening The Cover and I’m going to test that now :slight_smile:

I see. But still I would prefer to use this with resident mode. Create a new input_boolean and set to true on all days you don’t want the shutters to open.
Guess it’s easier than dealing with additional conditions.

1 Like

Oh dear… you’re so right. I didn’t even think about this possibility. Thank you.

1 Like

I just started to use this blueprint but luck is not yet on my side.
in my application i want to use the blueprint just for shading in combination with screens i have installed in my home.

Regardless of what i try i cannot make this blueprint control my screens for shading alone.

I made sure to:

  • Configure a cover to control
  • selected the shading option (6) as only enabled option)
  • under the shading option i’ve set the:
  • start and end azimuth (65/220)
  • the start and end elevation (6/90)
  • i’ve set 0% as the setting to close the screen for shading (this is when my screens are fully closed)
  • i’m using the default weather forecast conditions and made sure the forecast entity exists

triggering the automation manually or wait for sun elevation and azimuth to become true, no dice.

Must be something obvious i am doing wrong but i cannot seem to find out what.

HELP! :slight_smile:

You need to post your configuration.
And - as stated in the documentation - it’s NOT possible to manually trigger this blueprint.

1 Like

i’ve testet the blueprint with the following config:

it went down at 17:00 pm although i set sun_elevation_down: -10.2 wich should have been after 5pm!?

anything i’m doing wrong or a bug?

alias: "Rolladen: Isabella Tür"
description: >-
  fährt nach Sonnenauf- /untergangszeiten, aber nur innerhalb des Fensters (7-9
  Uhr)

  Beschattung ab 18 Grad
use_blueprint:
  path: hvorragend/cover_control_automation.yaml
  input:
    shading_forecast_sensor: weather.openweathermap
    blind: cover.rolladen_bella_tur
    time_up_early: "07:00:00"
    time_up_early_non_workday: "08:00:00"
    time_up_late: "09:00:00"
    auto_brightness_options: auto_brightness_disabled
    sun_elevation_up: 0
    time_down_early: "17:00:00"
    sun_elevation_down: -10.2
    drive_delay_fix: 5
    drive_delay_random: 0
    position_tolerance: 5
    shading_azimuth_start: 158
    shading_azimuth_end: 258
    shading_forecast_temp: 18
    workday_sensor: binary_sensor.workday_sensor

Could be a bug. Stay tuned.
@Herr.Vorragend see PN

Btw: “fährt nach Sonnenauf- /untergangszeiten, aber nur innerhalb des Fensters (7-9 Uhr)” ist not completely right. It’s opening between 7-9 but closing 17-22.

yeah i know, my description is not yet final, as the blueprint ist still under evaluation :wink:

Could you please check whether “sun.sun” and the elevation attribute even exist? If not, a default value is assumed which makes the condition apply.

I hadn’t even thought of such an application. But from the code it should even be possible.
So I need your config to get an impression.

In the worst case, we need a screenshot of the trace.

alias: SCREENS - Woonkamer groot
description: ""
use_blueprint:
  path: hvorragend/cover_control_automation.yaml
  input:
    blind: cover.woonkamer_groot
    auto_options:
      - auto_shading_enabled
    auto_global_condition:
      - condition: state
        entity_id: input_boolean.screen_automation_bypass_woonkamer_groot
        state: "on"
    shading_cover_position: 0
    shading_azimuth_start: 65
    shading_azimuth_end: 220
    shading_elevation_min: 6

This is my current configuration. Thanks in advance for wanting to look at this :slight_smile:

yes, it exists:

One short question:
Could you please show me the state of: input_boolean.screen_automation_bypass_woonkamer_groot?

If automation should work, the conditions must be true or empty. These are conditions and not blockers.