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

Hi,
Thanks for this very good blueprint.
I have a question about sun elevation. I set the automation to close my shutters at -6 degree, but the automation is not triggered at -6 (to_state) but approximately at -7. The from_state is -6.

Someone has an idea about it and could explain it to me ?


trigger:
  platform: template
  entity_id: sun.sun
  from_state:
    entity_id: sun.sun
    state: below_horizon
    attributes:
      next_dawn: '2024-07-30T03:23:15.048916+00:00'
      next_dusk: '2024-07-30T19:46:36.739657+00:00'
      next_midnight: '2024-07-29T23:35:28+00:00'
      next_noon: '2024-07-30T11:35:28+00:00'
      next_rising: '2024-07-30T04:01:22.475289+00:00'
      next_setting: '2024-07-30T19:08:41.843070+00:00'
      elevation: -6
      azimuth: 307.03
      rising: false
      friendly_name: Sun
    last_changed: '2024-07-29T19:14:05.620670+00:00'
    last_reported: '2024-07-29T19:48:11.529808+00:00'
    last_updated: '2024-07-29T19:48:11.529808+00:00'
    context:
      id: 01J400JFM9D1BBQDQXCZDCS3MC
      parent_id: null
      user_id: null
  to_state:
    entity_id: sun.sun
    state: below_horizon
    attributes:
      next_dawn: '2024-07-30T03:23:15.048916+00:00'
      next_dusk: '2024-07-30T19:46:36.739657+00:00'
      next_midnight: '2024-07-29T23:35:28+00:00'
      next_noon: '2024-07-30T11:35:28+00:00'
      next_rising: '2024-07-30T04:01:22.475289+00:00'
      next_setting: '2024-07-30T19:08:41.843070+00:00'
      elevation: -7.05
      azimuth: 308.62
      rising: false
      friendly_name: Sun
    last_changed: '2024-07-29T19:14:05.620670+00:00'
    last_reported: '2024-07-29T19:56:11.531017+00:00'
    last_updated: '2024-07-29T19:56:11.531017+00:00'
    context:
      id: 01J40114CB126SPCWT4G0CK240
      parent_id: null
      user_id: null
  id: t_close_5
  idx: '11'
  alias: null
  for:
    __type: <class 'datetime.timedelta'>
    total_seconds: 0
  description: sun.sun via template

I’m loving this blueprint, it made my life so much easier as I wanted to deal with 10 covers but was not sure how to make them all work properly…
I’ve been using this for some days but I’m not sure I understand the override manual feature.
I activate the override feature for open/close/shading (I don’t use ventilation) as I understood that this makes the next action skip if there was a manual movement. Correct?
This morning I manually moved the cover at 8:19 but then it automatically shaded at 8:30 (override manual reset should be after 60 minutes).
When I made a manual movement, the helper changed to:

{"open":{"a":true,"t":1722320349},"close":{"a":false,"t":1721744960},"ventilate":{"a":false,"t":0},"shading":{"a":false,"t":1722229904},"locked":{"a":false,"t":0},"manual":{"a":true,"t":1722320349},"p":100,"v":4,"t":1722320349}

Then changet to the below when the shading started, just 11 minutes later

 {"open":{"a":true,"t":1722321014},"close":{"a":false,"t":1721744960},"ventilate":{"a":false,"t":0},"shading":{"a":true,"t":1722321014},"locked":{"a":false,"t":0},"manual":{"a":false,"t":1722320349},"p":100,"v":4,"t":1722321014}

Am I missing something or am I supposed to leave the override options disabled?

You can find the trace here, if needed

ps. just found out that my shading position was lower than closed position. Don’t know if this is related…
pps. probably the same as this issue
thank you!

The trigger template for this is:

  value_template: '{{ state_attr(default_sun_sensor, ''elevation'') | float(default=sun_elevation_down) < sun_elevation_down }}'

so it’s < and not <=

Description is

description: The cover will be <ins>closed</ins> if the sun elevation is under this value

Automation is working as supposed to :slight_smile:

1 Like

did you create one helper by shutter ?

Yes I have 1 helper for each different cover. I can see that the helper changes when the cover moves to different positions and when there’s a manual intervention

1 Like

I need the trace for the trigger “t_shading_start_1”.

Please read this for further informations:

Could it be that your status helper is wrong?
Have you created a helper for each automation? And is it really 254 characters long? Then isn’t that the problem?

Oh, then I was probably right with my assumption. Only just read your other post. Yes, a separate helper for each CCA automation. Otherwise it won’t work.

1 Like

You have to use a cover status helper.

No, unfortunately it is not possible to read the values from other input entities.
It is also not possible to write the values externally within the automation.

There is already a ticket on GitHub in which a similar request was made.

I don’t understand the problem here.
That’s hardly relevant, is it? It would also be triggered at 6.01. And the values change every two minutes for me.

It’s also described in the documentation, isn’t it?

Just change your value to 5.99 if that’s important to you.

And it is even very important that it is “lesser than” (lt) and not “lesser than or equal” (lte). Because if the variable is not set, the default value would take effect and the condition would always be true. It is also important that we work with floats here and not with integers. Otherwise, 7 is identical to 7.01 and also to 7.5.

:smiley:

1 Like

Well prepared. Good information. Thanks for the trace.

They will probably also be affected by the bug. I really have to fix it.

my work is customer service for industrial machinery so I know that precise and good information is the most useful part… I try my best to always be good at that :joy:

Thanks again for your work, I will send you a small gift as your work is really helping me out

ps. again: with the help of chatGPT I made a “translator” for the input_text entities that the automation creates… it makes is easier for me to keep track of what is going on, maybe it helps others too:

{%- set data = states('input_text.example') | from_json %}
{%- set true_icon = "✅" %}
{%- set false_icon = "❌" %}
open: {{ true_icon if data.open.a else false_icon }} ({{ data.open.t | timestamp_custom('%Y-%m-%d %H:%M:%S') }}), 
close: {{ true_icon if data.close.a else false_icon }}  ({{ data.close.t | timestamp_custom('%Y-%m-%d %H:%M:%S') }}), 
ventilate: {{ true_icon if data.ventilate.a else false_icon }}  ({{ data.ventilate.t | timestamp_custom('%Y-%m-%d %H:%M:%S') }}), 
shading: {{ true_icon if data.shading.a else false_icon }}  ({{ data.shading.t | timestamp_custom('%Y-%m-%d %H:%M:%S') }}), 
locked: {{ true_icon if data.locked.a else false_icon }}  ({{ data.locked.t | timestamp_custom('%Y-%m-%d %H:%M:%S') }}), 
manual: {{ true_icon if data.manual.a else false_icon }}  ({{ data.manual.t | timestamp_custom('%Y-%m-%d %H:%M:%S') }})

of course replace input_text.example with your entity.
The result is something like below

GMM 012

:smiley:

4 Likes

Hey, I was already thinking about making something like this today. Under FHEM there were samples of so-called readingsGroups back then.
But thank you very much for your feedback. You were quicker. :smile:

Post-holiday update :smile:

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)
6 Likes

Hi!

I’m afraid the override is still not working properly. I made a manual movement as a test this morning at 06:33 and the helper changed to:

{"open":{"a":true,"t":1722486783},"close":{"a":false,"t":1722419051},"ventilate":{"a":false,"t":0},"shading":{"a":false,"t":1722321014},"locked":{"a":false,"t":0},"manual":{"a":true,"t":1722486783},"p":100,"v":4,"t":1722486783}

at 07:01 the brightness value was high enough so shading started anyway (manual reset still set to 60min), the helper changed to:

{"open":{"a":true,"t":1722488495},"close":{"a":false,"t":1722419051},"ventilate":{"a":false,"t":0},"shading":{"a":true,"t":1722488495},"locked":{"a":false,"t":0},"manual":{"a":false,"t":1722486783},"p":100,"v":4,"t":1722488495}

Here the trace too, if needed.

shouldn’t the condition

  - or:
      - '{{ not is_cover_helper_manual }}'
      - '{{ not override_shading_after_manual }}'
      - '{{ is_cover_helper_manual and override_shading_after_manual }}'

be

  - or:
      - '{{ not is_cover_helper_manual }}'
      - '{{ not override_shading_after_manual }}'
      - '{{ is_cover_helper_manual and not override_shading_after_manual }}'

?

One more question, sorry for bothering! :smiley:
The resident sensor state prevents the shading IN/OUT if true, correct? That actually worked this morning but then nothing happened when the sensor turned to false as my wife woke up. I thought that would have started shading but I think this is not a trigger in the blueprint. The only trigger related to the state of the resident sensor is t_open_6 or t_close_6 so I guess those open/close the covers only. Is there a workaround to make also the shading start when the sensor changes and the conditions are true for shading?

Thanks again!

Thanks for the response. I’ve tested several conditions, but shading is never started, the whole day. Only when resident is present or absence, the cover were closed.
The cover is a group of covers and every automation uses it’s own helper (254 chars). The shading trigger is executed but in the following choice block, the automation exits to default choice.

I only want shading by temperature sensor and azimuth and elevation. What I am doing wrong?
I might have the same problem as @matteorossininchi

according trace

image

Thanks, but it`s not the issue. I followed every trace and it´s quite obvious that shading isn’t starting because of the resident sensor. If the resident sensor is off after azimuth or elevation trigger passed, there’s no additional trigger that starts shading anymore. That’s my current behaviour.

It’s works now ! thank you !

If I want to be able to use the weather conditions for triggering: for example, if it’s cloudy, don’t activate the automation. i’ve just to choose “cloudy” in “sun shading wheaters condition”?