(deprecated) Extensive roller shutter control including shading (brightness, sun position, temperature, forecast)

Sounds like a good idea. Currently I have no better approach. So let’s try.

i don´t know where the failure is. The modified automation will not load with the following sequence at line 879:

        sequence:
          - if:
            - condition: template
              value_template: '{{expand(blind)|map(attribute=''entity_id'')|list|count > 1 }}'
            then:
              - repeat:
                for_each: '{{ expand(blind)|map(attribute=''entity_id'')|list }}'
                sequence:
                  - delay: 00:00:{{ (range(1, 3)|random|int) }}
                  - service: cover.open_cover
                    data: {}
                    target:
                      entity_id: "{{ repeat.item }}"
            else:
              - delay: 00:00:{{ (range(1, 3)|random|int) }}
              - service: cover.open_cover
                data: {}
                target:
                  entity_id: blind
          - stop: Stop the automation

Can you try

 value_template: "{{expand(blind)|map(attribute='entity_id')|list|count > 1 }}"

and

                for_each: "{{ expand(blind)|map(attribute='entity_id')|list }}"

the result is:

Message malformed: expected a dictionary for dictionary value @ data['action'][1]['choose'][0]['sequence'][0]['choose'][1]['sequence'][0]['then'][0]['repeat']

@Gifford47: I uploaded a new version. Can you please test this one?
Cover groups are handled for opening, closing, shading and also ventilate. But I’m not sure if ventilation makes sense if we have a group cause every blind of the group is driving to ventilate_position as we don’t know which blind (window) is connected to the window sensor. Any ideas for this?

Maybe my changes are useful for some else.
Because of I have a lot of externel blinds the new open and close position feature brought my blinds in a wrong position. They were not fully opened (because of the position is calculatet based on the driving time) and goining to the close position of 0% leaves the slats of my blinds opened.
Going to the shading position means the same. The slats are still in the wrong position and the sun came in.
Thats why I replaced the open an close position (set_cover_position) with the cover_open an cover_close service.
I also added an input for a “shading tilt position”.

Thanks a lot for this geat Blueprint. It saves me a lot of time.

  input:
    # inputs we need for everything
    blind:
      name: "Blind"
      description: "Which roller shutter should be automated?"
      selector:
        entity:
          filter:
          - domain: 
            - cover
    # inputs only for shading
    auto_shading:
      name: "🕶️ Auto Shading"
      description: "Enable the auto shading function?\n\n`Shading`"
      default: true
      selector:
        boolean: {}
    shading_blinds_position: 
      name: "🕶️ Shading position"
      description: "To which position should the shutter be moved for shading?\n\n`Shading`"
      default: 25
      selector:
        number:
          min: 0.0
          max: 100.0
          unit_of_measurement: "%"
    shading_tilt_position: 
      name: Shading tilt position
      description: "To which tilt position should the cover be moved for shading?\n\n`Shading`"
      default: 50
      selector:
        number:
          min: 0
          max: 100
          unit_of_measurement: "%"

[…]

mode: restart
max_exceeded: silent

variables:
  blind: !input blind
  brightness_sensor: !input brightness_sensor
  shading_sun_sensor: !input shading_sun_sensor
  shading_outdoor_temperatur_sensor: !input shading_outdoor_temperatur_sensor
  shading_outdoor_temperatur_sensor2: !input shading_outdoor_temperatur_sensor2
  shading_azimuth_in: !input shading_azimuth_in
  shading_azimuth_out: !input shading_azimuth_out
  shading_elevation_min: !input shading_elevation_min
  shading_elevation_max: !input shading_elevation_max
  shading_min_temperatur: !input shading_min_temperatur
  shading_min_temperatur2: !input shading_min_temperatur2
  shading_blinds_position: !input shading_blinds_position
  shading_tilt_position: !input shading_tilt_position                                                   
  shading_sun_brightness_in: !input shading_sun_brightness_in
  shading_sun_brightness_out: !input shading_sun_brightness_out
  shading_waitingtime: !input shading_waitingtime
  shading_waitingtime_out: !input shading_waitingtime_out
  auto_shading: !input auto_shading
  forecast_sensor: !input forecast_sensor
  forecast_temp: !input forecast_temp
  weather_conditions: !input weather_conditions
  temporary_disable_shading: !input temporary_disable_shading

trigger:

  # triggers for shading in
  - platform: numeric_state
    entity_id: !input shading_outdoor_temperatur_sensor
    above: !input shading_min_temperatur
    id: "t_si_1"
  - platform: numeric_state
    entity_id: !input shading_outdoor_temperatur_sensor2
    above: !input shading_min_temperatur2
    id: "t_si_2"
  - platform: numeric_state
    entity_id: !input brightness_sensor
    above: !input shading_sun_brightness_in
    id: "t_si_3"
  - platform: numeric_state
    entity_id: !input shading_sun_sensor
    attribute: elevation
    above: !input shading_elevation_min
    id: "t_si_4"
  - platform: numeric_state
    entity_id: !input shading_sun_sensor
    attribute: azimuth
    above: !input shading_azimuth_in
    below: !input shading_azimuth_out
    id: "t_si_5"
  - platform: numeric_state
    entity_id: !input shading_outdoor_temperatur_sensor
    above: !input forecast_temp
    id: "t_si_6"
  - platform: state
    entity_id: !input temporary_disable_shading
    from: "on"
    to: "off"
    for: '00:00:05' # we need a small delay cause temporary_disable_shading also triggers shading out
    id: "t_si_7"

  # triggers for shading out
  - platform: numeric_state
    entity_id: !input shading_outdoor_temperatur_sensor
    below: !input shading_min_temperatur
    id: "t_so_1"
  - platform: numeric_state
    entity_id: !input shading_outdoor_temperatur_sensor2
    below: !input shading_min_temperatur2
    id: "t_so_2"
  - platform: numeric_state
    entity_id: !input brightness_sensor
    below: !input shading_sun_brightness_out
    id: "t_so_3"
  - platform: numeric_state
    entity_id: !input shading_sun_sensor
    attribute: elevation
    above: !input shading_elevation_max
    id: "t_so_4"
  - platform: numeric_state
    entity_id: !input shading_sun_sensor
    attribute: azimuth
    above: !input shading_azimuth_out
    id: "t_so_5"
  - platform: numeric_state
    entity_id: !input shading_sun_sensor
    attribute: elevation
    below: !input shading_elevation_min
    id: "t_so_6"
  - platform: state
    entity_id: !input temporary_disable_shading
    from: "on"
    to: "off"
    for: '00:00:02' # we need a small delay cause temporary_disable_shading also triggers shading in
    id: "t_so_7"


  # trigger for opening blind
  - platform: numeric_state
    entity_id: !input brightness_sensor2
    above: !input brightness_up
    for: '00:00:03'
    id: "t_bo_1"
  - platform: time
    at: !input time_up_late
    id: "t_bo_2"  
  - platform: time
    at: !input time_up_early
    id: "t_bo_3"
  - platform: time
    at: !input time_up_early_non_workday
    id: "t_bo_4"
  - platform: state
    entity_id: !input resident
    from: "on"
    to: "off"
    id: "t_bo_5"
  - platform: numeric_state
    entity_id: !input brightness_sensor
    above: !input brightness_up
    for: '00:00:05'
    id: "t_bo_6"

  # trigger for closing blind
  - platform: numeric_state
    entity_id: !input brightness_sensor2
    below: !input brightness_down
    id: "t_bc_1"
  - platform: time
    at: !input time_down_early
    id: "t_bc_2"
  - platform: time
    at: !input time_down_late
    id: "t_bc_3"
  - platform: state
    entity_id: !input window_sensor
    from: "on"
    to: "off"
    id: "t_bc_4"
  - platform: state
    entity_id: !input resident
    from: "off"
    to: "on"
    id: "t_bc_5"
  - platform: numeric_state
    entity_id: !input brightness_sensor
    below: !input brightness_down
    id: "t_bc_6"

  # trigger for ventilate
  - platform: state
    entity_id: !input window_sensor
    from: "off"
    to: "on"
    id: "t_bv_1"

condition:
  - or:
      - condition: template
        value_template: "{{ auto_shading }}"
      - condition: template
        value_template: "{{ auto_up }}"
      - condition: template
        value_template: "{{ auto_down }}"

action:
## we have to call a service for forecast due to HA changes
- if:
  - condition: template
    value_template: "{{ (forecast_sensor != [] )  }}"
  then:
  - service: weather.get_forecasts
    target:
      entity_id: !input forecast_sensor
    data:
      type: daily
    response_variable: forecast

- choose:

    - alias: "Check and perform shading in or blinds up"
      conditions: 
        - or:
          - condition: template
            value_template: "{{ auto_shading }}"
          - condition: template
            value_template: "{{ auto_up }}"
        - or: 
          # Check if we have a trigger for shading in
          - condition: trigger
            id: "t_si_1"
          - condition: trigger
            id: "t_si_2"
          - condition: trigger
            id: "t_si_3"
          - condition: trigger
            id: "t_si_4"
          - condition: trigger
            id: "t_si_5"
          - condition: trigger
            id: "t_si_6"
          - condition: trigger
            id: "t_si_7"
          # Check if we have a trigger for blinds up
          - condition: trigger
            id: "t_bo_1"
          - condition: trigger
            id: "t_bo_2"
          - condition: trigger
            id: "t_bo_3"
          - condition: trigger
            id: "t_bo_4"
          - condition: trigger
            id: "t_bo_5"
          - condition: trigger
            id: "t_bo_6"
      sequence:
        - choose:
            - alias: "Checking for shading in"
              conditions: 
              - and: # Check if we want to perform shading in
                - condition: template
                  value_template: "{{ auto_shading }}"
                - condition: template
                  value_template: "{{ ( (temporary_disable_shading == [] ) or (is_state(temporary_disable_shading, 'off')) ) }}"
                - condition: template
                  value_template: "{{ now() >= today_at(time_up_early) }}"
                - condition: template
                  value_template: "{{ now() <= today_at(time_down_late) + timedelta(seconds = 5) }}"
                - condition: template
                  value_template: "{{ ( (shading_outdoor_temperatur_sensor == [] ) or (states(shading_outdoor_temperatur_sensor) | int(default=shading_min_temperatur) >= shading_min_temperatur) ) }}"
                - condition: template
                  value_template: "{{ ( (shading_outdoor_temperatur_sensor2 == [] ) or (states(shading_outdoor_temperatur_sensor2) | int(default=shading_min_temperatur2) >= shading_min_temperatur2) ) }}"
                - condition: template
                  value_template: "{{ ( (brightness_sensor == [] ) or (states(brightness_sensor) | int(default=shading_sun_brightness_in) >= shading_sun_brightness_in) ) }}"
                - condition: template
                  value_template: "{{ state_attr(shading_sun_sensor, 'azimuth') >= shading_azimuth_in and state_attr(shading_sun_sensor, 'azimuth') <= shading_azimuth_out }}"
                - condition: template
                  value_template: "{{ state_attr(shading_sun_sensor, 'elevation') >= shading_elevation_min and state_attr(shading_sun_sensor, 'elevation') <= shading_elevation_max }}"
                - condition: template
                  value_template: "{{ state_attr(blind, 'current_position') | int(default=101) > shading_blinds_position }}"
                - condition: template
                  value_template: "{{ ( (resident == [] ) or (is_state(resident, 'off')) ) }}"
                - or:
                  - condition: template
                    value_template: "{{ ( forecast_sensor == [] ) and (shading_outdoor_temperatur_sensor == [] ) }}"
                  - condition: template
                    value_template: "{{ ( forecast_sensor != [] ) and ( forecast.forecast[0].temperature | int(default=forecast_temp) >= forecast_temp ) }}"
                  - condition: template
                    value_template: "{{ (shading_outdoor_temperatur_sensor != [] ) and (states(shading_outdoor_temperatur_sensor) | int(default=forecast_temp) >= forecast_temp) }}"
                - condition: template
                  value_template: "{{ ( forecast_sensor == [] ) or (states(forecast_sensor) in weather_conditions) }}"
              sequence:
                # we are ready for shading in
                - if: # check if blind is higher than ventilate position. In this case we consider blind position like open and therefor we want to use the delay timer
                  - condition: template
                    value_template: "{{ state_attr(blind, 'current_position') | int(default=101) > ventilate_position }}"
                  - not:
                    - condition: trigger
                      id: "t_si_7"
                  then:
                    - alias: "Wait the number of seconds set in shading_waitingtime"
                      delay:
                        seconds: !input shading_waitingtime
                  else:
                    # seems that blinds are lower or at ventilate position. So we consider blinds as closed and directly drive to shading position
                - alias: "Wait 1-5 random seconds to prevent sending to many commands to blinds at same time"
                  delay: '00:00:{{ (range(1, 3)|random|int) }}'
                - alias: "Moving the blind to cover position"
                  service: cover.set_cover_position
                  data:
                    position: !input shading_blinds_position
                  target:
                    entity_id: !input blind
                - alias: "Set cover tilt position for shading"
                  service: cover.set_cover_tilt_position
                  data:
                    position: !input shading_tilt_position
                  target:
                   entity_id: !input blind
                - stop: "Stop the automation"

            - alias: "Check for opening"
              conditions: 
              - condition: template
                value_template: "{{ auto_up }}"
              - or: # Check if the trigger is for normal blind opening
                - condition: trigger
                  id: "t_bo_1"
                - condition: trigger
                  id: "t_bo_2"
                - condition: trigger
                  id: "t_bo_3"
                - condition: trigger
                  id: "t_bo_4"
                - condition: trigger
                  id: "t_bo_5"
                - condition: trigger
                  id: "t_bo_6"
              - or:
                - condition: template
                  value_template: "{{ state_attr(blind, 'current_position') | int(default=101) == ventilate_position }}"
                - condition: template
                  value_template: "{{ (state_attr(blind, 'current_position') | int(default=110) <= closed_position + position_tolerance) and (state_attr(blind, 'current_position') | int(default=110) >= closed_position - position_tolerance)}}"
              - condition: template
                value_template: "{{ ( (resident == [] ) or (is_state(resident, 'off')) ) }}"
              # Now we have to check different opening scenarios
              - condition: or
                conditions:
                  - alias: "Blinds - opening - up late reached "
                    and:
                      - condition: template
                        value_template: "{{ now() >= today_at(time_up_late) }}"
                      - or:
                        - condition: template
                          value_template: "{{ now() <= today_at(time_down_early) + timedelta(seconds = 5) }}"
                        - condition: template
                          value_template: "{{ now() <= today_at(time_down_late) + timedelta(seconds = 5) }}"
                  - alias: "Blinds - opening - up early reached and brightness above minimum"
                    and:
                      - or:
                        - and:
                          - condition: template
                            value_template: "{{ (workday_sensor == [] or (is_state(workday_sensor, 'on')) )  }}"
                          - condition: template
                            value_template: "{{ now() >= today_at(time_up_early) }}"
                        - and:
                          - condition: template
                            value_template: "{{ (workday_sensor == [] ) or (is_state(workday_sensor, 'off')) }}"
                          - condition: template
                            value_template: "{{ now() >= today_at(time_up_early_non_workday) }}"
                      - condition: template
                        value_template: "{{ now() <= today_at(time_up_late) + timedelta(seconds = 5) }}"
                      - or:
                        - condition: template
                          value_template: "{{ ( (brightness_sensor2 == []) and  (brightness_sensor == []) ) }}"
                        - condition: template
                          value_template: "{{ ( (brightness_sensor2 != []) and (states(brightness_sensor2) | int(default=brightness_up) >= brightness_up) ) }}"
                        - condition: template
                          value_template: "{{ ( (brightness_sensor2 == [] and brightness_sensor != []) and (states(brightness_sensor) | int(default=brightness_up) >= brightness_up) ) }}"
              sequence:
                # ok, we can open the blind 
                - delay: '00:00:{{ (range(1, 3)|random|int) }}'
                - service: cover.open_cover
               # - service: cover.set_cover_position
               #   data:
               #     position: !input open_position
                  target:
                    entity_id: !input blind
                - stop: "Stop the automation" 
          default:
            - stop: "Stop the automation"          

    - alias: "Check and perform shading out"
      conditions: 
        # - condition: trigger
        #   id: "t_o_2"
        - condition: template
          value_template: "{{ auto_shading }}"
        - condition: template
          value_template: "{{ ( (temporary_disable_shading == [] ) or (is_state(temporary_disable_shading, 'off')) ) }}"
        - condition: template
          value_template: "{{ now() >= today_at(time_up_early) }}"
        - condition: template
          value_template: "{{ now() <= today_at(time_down_late) + timedelta(seconds = 5) }}"
        - or:
          - condition: trigger
            id: "t_so_1"
          - condition: trigger
            id: "t_so_2"
          - condition: trigger
            id: "t_so_3"
          - condition: trigger
            id: "t_so_4"
          - condition: trigger
            id: "t_so_5"
          - condition: trigger
            id: "t_so_6"
          - condition: trigger
            id: "t_so_7"
        - condition: template
          value_template: "{{ state_attr(blind, 'current_position') | int(default=101) == shading_blinds_position }}"
      sequence:
        - if:
            # if sun is outside of shading window (azimuth or elevation) we immedately stop shading
            - and:
              - condition: template
                value_template: "{{ state_attr(shading_sun_sensor, 'azimuth') >= shading_azimuth_in and state_attr(shading_sun_sensor, 'azimuth') <= shading_azimuth_out }}"
              - condition: template
                value_template: "{{ state_attr(shading_sun_sensor, 'elevation') >= shading_elevation_min and state_attr(shading_sun_sensor, 'elevation') <= shading_elevation_max }}"
            - not:
              - condition: trigger
                id: "t_so_7"
          then:
            - alias: "Wait the number of seconds set in shading_waitingtime_out"
              delay:
                seconds: !input shading_waitingtime_out
        - if:
            - condition: template
              value_template: "{{ ( (window_sensor != []) and (is_state(window_sensor, 'on') ) ) }}"          
            - condition: template
              value_template: "{{ auto_ventilate }}"
          then:
            - alias: "Moving the blind to ventilate position"
              service: cover.set_cover_position
              data:
                position: !input ventilate_position
              target:
                entity_id: !input blind 
          else:
            - alias: "Wait 1-5 random seconds to prevent sending to many commands to blinds at same time"
              delay: '00:00:{{ (range(1, 3)|random|int) }}'
            - alias: Moving the blind to open position
              #service: cover.set_cover_position
                            #data:
                #position: !input open_position
              service: cover.open_cover
              target:
                entity_id: !input blind
        - stop: "Stop the automation"

    - alias: "Check for closing blind"
      conditions: 
        - or:
          - condition: template
            value_template: "{{ auto_down }}"
          - condition: template
            value_template: "{{ auto_ventilate }}"
        - or:
          - condition: template
            value_template: "{{ ( (adv_blind == []) or (is_state(adv_blind, 'off')) ) }}"
          - condition: trigger
            id: "t_bc_5"
        - or: 
          # Check if we have a trigger for blind down
          - condition: trigger
            id: "t_bc_1"
          - condition: trigger
            id: "t_bc_2"
          - condition: trigger
            id: "t_bc_3"
          - condition: trigger
            id: "t_bc_4"
          - condition: trigger
            id: "t_bc_5"
          - condition: trigger
            id: "t_bc_6"
        - condition: template
        #   ## check to allow a window but a door only if window_sensor not open - we want protection
          value_template: "{{ ( ( door == 'false' ) or ( (door == 'true') and (window_sensor == []) ) or ( (door == 'true') and (window_sensor != []) and (is_state(window_sensor, 'off') ) ) ) }}"
        - or:
          - condition: template
            value_template: "{{ (state_attr(blind, 'current_position') | int(default=110) <= open_position + position_tolerance) and (state_attr(blind, 'current_position') | int(default=110) >= open_position - position_tolerance)}}"
          - condition: template
            value_template: "{{ state_attr(blind, 'current_position') | int(default=101) == ventilate_position }}"
        - or:
          - alias: Blinds - closing - down late reached
            and:
              - condition: template
                value_template: "{{ now() >= today_at(time_down_late) }}"
              - condition: template
                value_template: "{{ auto_down }}"
          - alias: Blinds - closing - down early reached and brightness below minimum
            and:
              - condition: template
                value_template: "{{ auto_down }}"
              - condition: template
                value_template: "{{ now() >= today_at(time_down_early) }}"
              - condition: template
                value_template: "{{ now() <= today_at(time_down_late) + timedelta(seconds = 5) }}"
              - or:
                - condition: template
                  value_template: "{{ ( (brightness_sensor == [] ) and (brightness_sensor2 == [] ) ) }}"
                - condition: template
                  value_template: "{{ ( (brightness_sensor != [] ) and (states(brightness_sensor) | int(default=brightness_down) <= brightness_down) ) }}"
                - condition: template
                  value_template: "{{ ( (brightness_sensor2 != [] ) and (states(brightness_sensor2) | int(default=brightness_down) <= brightness_down) ) }}"
          - alias: Blinds - closing - due to resident goes sleeping
            and:
              - condition: template
                value_template: "{{ auto_down }}"
              - condition: template
                value_template: "{{ ( (resident != [] ) and (is_state(resident, 'on')) ) }}"
              - condition: trigger
                id: t_bc_5
          - alias: Blinds - closing after ventilate
            and:
              - condition: trigger
                id: "t_bc_4"
              - condition: template
                value_template: "{{ auto_ventilate }}"
              - condition: template
                value_template: "{{ state_attr(blind, 'current_position') | int(default=101) == ventilate_position }}"
              - condition: template
                value_template: '{{ (window_sensor != [] ) and (states(window_sensor) == ''off'') }}'
      sequence:
        - if:
            - not:
              - condition: trigger
                id: "t_bc_4"
          then:
            - delay: '00:00:{{ (range(1, 3)|random|int) }}'
        - if:
            - condition: template
              value_template: "{{ ( (window_sensor != []) and (is_state(window_sensor, 'on') ) ) }}"
            - condition: template
              value_template: "{{ auto_ventilate }}"
          then:
            - service: cover.set_cover_position
              data:
                position: !input ventilate_position
              target:
                entity_id: !input blind 
          else:
            #- service: cover.set_cover_position
              #data:
                #position: !input closed_position
            - service: cover.close_cover
              target:
                entity_id: !input blind
        - stop: "Stop the automation"

    - alias: Window sensor - opened
      conditions:
          - condition: trigger
            id: "t_bv_1"
          - condition: template
            value_template: "{{ auto_ventilate }}"
          - condition: template
            value_template: "{{ (state_attr(blind, 'current_position') | int(default=110) <= closed_position + position_tolerance) and (state_attr(blind, 'current_position') | int(default=110) >= closed_position - position_tolerance)}}"
          - condition: template
            value_template: "{{ ( (window_sensor != []) and (is_state(window_sensor, 'on')) ) }}"
      sequence:
        - service: cover.set_cover_position
          data:
            position: !input ventilate_position
          target:
            entity_id: !input blind
        - stop: "Stop the automation"

  default:
    - stop: "Stopping the automation - reset"

@kreuzundkwer: Maybe it’s an idea to check if open_position is 100 and in this case calls cover.open_cover instead of cover.set_cover_position (same for closed_position = 0 and cover.close_cover)?

If so, adding shading_tilt_position would be no additional effort (as I could copy your code) :wink:

Yes, thats seems to be a comfortable way to implement this option.

Do your blind, which are able to tilt, have an attribute current_tilt_position? Cause I need to implement a check if a blind is able to perform cover.set_cover_tilt_position. Just calling the service will always create an error.

Yes, they do. There is a special communication object wich gives back the current position.

Hi,
I am relatively new to HA and last week I imported the blueprint and created automations.
Unfortunately, they don’t work for me.
Either I’m misunderstanding something in the config or the log or I’m running into a bug.
I’m not even shadowing yet, it’s winter here :wink:
Unfortunately, closing in the evening and opening in the morning doesn’t work for me.
I see that the automation is executed but then runs directly to a stop.

I use the Christmas mode to close the blinds automatically only when nobody is at home.

I need your config to get an idea what could go wrong.
And, if possible, a screenshot of a trace would be nice. I explained it a little bit here Extensive roller shutter control including shading (brightness, sun position, temperature, forecast) - #40 by Eimeel

Ok, has been implemented. But as my blinds are not able to tilt, I can’t check it.

1 Like

This is the configuration of one of my roller blinds.
While we are at home, the blinds should not be raised in the morning or lowered in the evening. But we were still at home over New Year’s Eve and unfortunately nothing moved.
Unfortunately, I can no longer access the schedule for 31.12/01.01 via the ui.

Ok, seems to be ok (so far).

But I’m a little bit confused.
You don’t want the blind to move if you are home. Ok. And the automation didn’t moved while you have been at home over New Year’s Eve? Or is there a “not” missing?

Nevertheless let’s clarify a little bit:
As I wrote in the documentation for adv_blind:

If this Sensor (input_boolean or binary_sensor) is set to TRUE, the shutter will not close automatically

The check is:

              - "{{ ( (adv_blind == []) or (is_state(adv_blind, 'off')) ) }}"

So if you define adv_blind, the automation will only close the blind if adv_blind is off (false).
And I guess group.anwesenheit_family will be home or not_home. So this check can never be passed.

I first thought I could easilier expand the check. Following your case I just need to check as well for “home”. But the next one will need to check for “not_home” or something different. So I leave it as it is, sorry. Meaning you need an additional sensor for your usecase.

But I don’t understand why the blind is not mowing in the morning. Cause you didn’t define resident - which most likely would have explained it.
Can you have a look at the automation traces what happend today at 05:45?

You’re right, of course, there’s a “not” missing. We weren’t at home over New Year’s Eve.
But as you wrote, it can’t work if the only condition is “true”. I’ll have to see how I can create a sensor that is set to “true” or “false” when the status of group.anwesenheit_family changes.
Unfortunately I don’t have any traces from this morning, probably because I restarted HA at noon today.
Do I understand correctly that the christmas mode only applies to closing and that I also have to define the new dummy sensor to be created as a resident if I only want automation in the event of absence?

Yes, you are correct. This is more or less due to the fact that my purpose for the blueprint is not a “only run when no one is home”-automation :slight_smile:

The sensor is quite easy. You can use something like:

trigger:
  platform: state
  entity_id: group.anwesenheit_family
action:
  service_template: >
    {% if is_state('group.anwesenheit_family', 'not_home') %}
		input_boolean.turn_off
	{% else %}
		input_boolean.turn_on
	{% endif %}
  data:
    entity_id: input_boolean.my_boolean
1 Like

I don’t get it…
My code is

#Anwesenheit
- trigger:
  platform: state
  entity_id: group.anwesenheit_family
  action:
    service_template: >
      {% if is_state('group.anwesenheit_family','not_home') %} input_boolean.turn_off {% else %} input_boolean.turn_on {% endif %}
    data:
      entity_id: input_boolean.anwesenheit

Studio Code server shows no error but yaml check says:
image

It’s just a stub :slight_smile: You need to create a real automation.

1 Like

oh me idiot, I wanted to enter the whole thing in sensor.yaml.

1 Like