Guest User

Untitled

a guest
Jul 1st, 2025
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 154.23 KB | None | 0 0
  1. {
  2.   "trace": {
  3.     "last_step": "condition/1/conditions/1",
  4.     "run_id": "77679821b45244e81b4a7e947e765277",
  5.     "state": "stopped",
  6.     "script_execution": "failed_single",
  7.     "timestamp": {
  8.       "start": "2025-07-01T14:48:45.387253+00:00",
  9.       "finish": "2025-07-01T14:48:45.422450+00:00"
  10.     },
  11.     "domain": "automation",
  12.     "item_id": "1750688188481",
  13.     "trigger": "sensor.helligkeit_aussen via template",
  14.     "trace": {
  15.       "trigger/20": [
  16.         {
  17.           "path": "trigger/20",
  18.           "timestamp": "2025-07-01T14:48:45.415561+00:00",
  19.           "changed_variables": {
  20.             "this": {
  21.               "entity_id": "automation.rollladen_ankleide",
  22.               "state": "on",
  23.               "attributes": {
  24.                 "id": "1750688188481",
  25.                 "last_triggered": "2025-07-01T14:48:01.092375+00:00",
  26.                 "mode": "single",
  27.                 "current": 1,
  28.                 "friendly_name": "Rollladen Ankleide"
  29.               },
  30.               "last_changed": "2025-06-30T21:24:14.841965+00:00",
  31.               "last_reported": "2025-07-01T14:48:01.277303+00:00",
  32.               "last_updated": "2025-07-01T14:48:01.092450+00:00",
  33.               "context": {
  34.                 "id": "01JZ37B299V5PEH334H8XCTMEF",
  35.                 "parent_id": null,
  36.                 "user_id": null
  37.               }
  38.             },
  39.             "trigger": {
  40.               "platform": "template",
  41.               "entity_id": "sensor.helligkeit_aussen",
  42.               "from_state": {
  43.                 "entity_id": "sensor.helligkeit_aussen",
  44.                 "state": "34873.1",
  45.                 "attributes": {
  46.                   "state_class": "measurement",
  47.                   "unit_of_measurement": "lx",
  48.                   "device_class": "illuminance",
  49.                   "friendly_name": "Helligkeit Aussen"
  50.                 },
  51.                 "last_changed": "2025-07-01T14:47:14.395050+00:00",
  52.                 "last_reported": "2025-07-01T14:47:14.395050+00:00",
  53.                 "last_updated": "2025-07-01T14:47:14.395050+00:00",
  54.                 "context": {
  55.                   "id": "01JZ379MP9EFTKG64J2AMD7CEX",
  56.                   "parent_id": null,
  57.                   "user_id": null
  58.                 }
  59.               },
  60.               "to_state": {
  61.                 "entity_id": "sensor.helligkeit_aussen",
  62.                 "state": "35845.3",
  63.                 "attributes": {
  64.                   "state_class": "measurement",
  65.                   "unit_of_measurement": "lx",
  66.                   "device_class": "illuminance",
  67.                   "friendly_name": "Helligkeit Aussen"
  68.                 },
  69.                 "last_changed": "2025-07-01T14:48:44.866962+00:00",
  70.                 "last_reported": "2025-07-01T14:48:44.866962+00:00",
  71.                 "last_updated": "2025-07-01T14:48:44.866962+00:00",
  72.                 "context": {
  73.                   "id": "01JZ37CD1AJEMXCAC95FBFFP9Q",
  74.                   "parent_id": null,
  75.                   "user_id": null
  76.                 }
  77.               },
  78.               "id": "t_shading_start_pending_2",
  79.               "idx": "20",
  80.               "alias": null,
  81.               "for": null,
  82.               "description": "sensor.helligkeit_aussen via template"
  83.             },
  84.             "blind": "cover.dg_rl_ank",
  85.             "open_position": 100,
  86.             "close_position": 0,
  87.             "ventilate_position": 99,
  88.             "shading_position": 1,
  89.             "position_tolerance": 0,
  90.             "open_tilt_position": 50,
  91.             "close_tilt_position": 50,
  92.             "ventilate_tilt_position": 50,
  93.             "shading_tilt_elevation_1": 20,
  94.             "shading_tilt_elevation_2": 30,
  95.             "shading_tilt_elevation_3": 48,
  96.             "shading_tilt_position_0": 0,
  97.             "shading_tilt_position_1": 20,
  98.             "shading_tilt_position_2": 37,
  99.             "shading_tilt_position_3": 50,
  100.             "auto_options": [
  101.               "auto_up_enabled",
  102.               "auto_down_enabled",
  103.               "auto_sun_enabled",
  104.               "auto_shading_enabled",
  105.               "auto_ventilate_enabled"
  106.             ],
  107.             "time_up_early": "07:00:00",
  108.             "time_up_early_non_workday": "08:00:00",
  109.             "time_up_late": "08:00:00",
  110.             "time_up_late_non_workday": "09:00:00",
  111.             "time_down_early": "20:00:00",
  112.             "time_down_early_non_workday": "20:00:00",
  113.             "time_down_late": "22:00:00",
  114.             "time_down_late_non_workday": "22:00:00",
  115.             "workday_sensor_today": "binary_sensor.workday_sensor",
  116.             "workday_sensor_tomorrow": "binary_sensor.workday_sensor_tomorrow",
  117.             "default_brightness_sensor": [],
  118.             "brightness_up": 0,
  119.             "brightness_down": 0,
  120.             "default_sun_sensor": "sun.sun",
  121.             "sun_elevation_up": 5,
  122.             "sun_elevation_down": -6,
  123.             "resident_sensor": [],
  124.             "contact_window_tilted": [],
  125.             "contact_window_opened": "binary_sensor.tfk_ank",
  126.             "lockout_tilted_options": [
  127.               "lockout_tilted_closing",
  128.               "lockout_tilted_shading_start"
  129.             ],
  130.             "lockout_tilted_when_closing": true,
  131.             "lockout_tilted_when_shading_starts": true,
  132.             "lockout_tilted_when_shading_ends": false,
  133.             "time_control": "time_control_input",
  134.             "time_schedule_helper": [],
  135.             "shading_brightness_sensor": "sensor.helligkeit_aussen",
  136.             "shading_temperatur_sensor1": "sensor.dg_wt_sz_temperatur",
  137.             "shading_temperatur_sensor2": "sensor.raspberrymatic_sv_wm_temperatur",
  138.             "shading_min_temperatur1": 20,
  139.             "shading_min_temperatur2": 22,
  140.             "shading_temperature_hysteresis1": 0.2,
  141.             "shading_temperature_hysteresis2": 0.2,
  142.             "shading_azimuth_start": 150,
  143.             "shading_azimuth_end": 330,
  144.             "shading_elevation_min": 25,
  145.             "shading_elevation_max": 90,
  146.             "shading_sun_brightness_start": 35000,
  147.             "shading_sun_brightness_end": 10000,
  148.             "shading_forecast_sensor": [],
  149.             "shading_forecast_type": "weather_attributes",
  150.             "shading_forecast_temp": [],
  151.             "shading_weather_conditions": [
  152.               "sunny",
  153.               "partlycloudy",
  154.               "cloudy",
  155.               "clear"
  156.             ],
  157.             "is_shading_enabled": true,
  158.             "cover_tilt_config": "cover_tilt_disabled",
  159.             "is_cover_tilt_enabled": false,
  160.             "is_up_enabled": true,
  161.             "is_down_enabled": true,
  162.             "is_brightness_enabled": false,
  163.             "is_sun_elevation_enabled": true,
  164.             "is_ventilation_enabled": true,
  165.             "is_time_field_enabled": true,
  166.             "is_schedule_helper_enabled": false,
  167.             "is_time_control_disabled": false,
  168.             "reset_override_config": "reset_disabled",
  169.             "reset_override_time": "00:01:00",
  170.             "reset_override_timeout": 5,
  171.             "is_reset_disabled": true,
  172.             "is_reset_fixed_time": false,
  173.             "is_reset_timeout": false,
  174.             "cover_status_options": "cover_helper_enabled",
  175.             "cover_status_helper": "input_text.cover_status_helper_ankleide",
  176.             "version": "2025.06.19",
  177.             "blind_entities": [
  178.               "cover.dg_rl_ank"
  179.             ],
  180.             "current_position": 1,
  181.             "current_tilt_position": 101,
  182.             "current_sun_azimuth": 250.82,
  183.             "current_sun_elevation": 43.66,
  184.             "is_today_off": false,
  185.             "is_tomorrow_off": false,
  186.             "is_tomorrow_on": true,
  187.             "drive_delay_fix": 90,
  188.             "drive_delay_random": 0,
  189.             "drive_time": 90,
  190.             "time_up_early_today": "07:00:00",
  191.             "time_up_late_today": "08:00:00",
  192.             "time_down_early_today": "20:00:00",
  193.             "time_down_late_today": "22:00:00",
  194.             "auto_up_force": [],
  195.             "auto_down_force": [],
  196.             "auto_ventilate_force": [],
  197.             "auto_shading_start_force": [],
  198.             "auto_up_force_disabled": true,
  199.             "auto_down_force_disabled": true,
  200.             "auto_ventilate_force_disabled": true,
  201.             "auto_shading_start_force_disabled": true,
  202.             "is_cover_tilt_enabled_and_possible": false,
  203.             "cover_tilt_reposition_config": "cover_tilt_reposition_disabled",
  204.             "is_cover_tilt_reposition_enabled": false,
  205.             "shading_tilt_position": 37,
  206.             "shading_waitingtime_start": 300,
  207.             "shading_waitingtime_end": 600,
  208.             "is_shading_end_immediate_by_sun_position": false,
  209.             "shading_start_behavior": "trigger_periodic",
  210.             "shading_end_behavior": "open_position",
  211.             "start_shading_trigger_reset": false,
  212.             "start_shading_trigger_periodic": true,
  213.             "is_status_helper_enabled": true,
  214.             "helper_state_json": {
  215.               "open": {
  216.                 "a": 1,
  217.                 "t": 1751366731
  218.               },
  219.               "close": {
  220.                 "a": 0,
  221.                 "t": 1751313693
  222.               },
  223.               "shading": {
  224.                 "a": 1,
  225.                 "t": 1751380669,
  226.                 "p": 0,
  227.                 "q": 1751381269
  228.               },
  229.               "vpart": {
  230.                 "a": 0,
  231.                 "t": 0
  232.               },
  233.               "vfull": {
  234.                 "a": 0,
  235.                 "t": 0
  236.               },
  237.               "manual": {
  238.                 "a": 0,
  239.                 "t": 1751192507
  240.               },
  241.               "v": 5,
  242.               "t": 1751380669
  243.             },
  244.             "is_helper_open": true,
  245.             "is_helper_closed": false,
  246.             "is_helper_shaded": true,
  247.             "is_helper_shading_start": false,
  248.             "is_helper_shading_end": true,
  249.             "is_helper_vent_partial": false,
  250.             "is_helper_vent_full": false,
  251.             "is_helper_manual": false,
  252.             "ts_helper_open": 1751366731,
  253.             "ts_helper_closed": 1751313693,
  254.             "ts_helper_shaded": 1751380669,
  255.             "ts_helper_vent_partial": 0,
  256.             "ts_helper_vent_full": 0,
  257.             "ts_helper_manual": 1751192507,
  258.             "in_open_position": false,
  259.             "in_close_position": false,
  260.             "in_shading_position": true,
  261.             "in_ventilate_position": false,
  262.             "individual_config": [],
  263.             "prevent_higher_position_closing": false,
  264.             "prevent_lowering_when_closing_if_shaded": false,
  265.             "prevent_forecast_service": true,
  266.             "prevent_shading_end_if_closed": false,
  267.             "prevent_opening_after_shading_end": false,
  268.             "prevent_opening_after_ventilation_end": false,
  269.             "prevent_default_cover_actions": false,
  270.             "prevent_shading_multiple_times": false,
  271.             "prevent_opening_multiple_times": false,
  272.             "prevent_closing_multiple_times": false,
  273.             "resident_config": [],
  274.             "resident_opening_enabled": false,
  275.             "resident_closing_enabled": false,
  276.             "resident_allow_shading": false,
  277.             "resident_allow_opening": false,
  278.             "resident_allow_ventilation": false,
  279.             "ignore_after_manual_config": [],
  280.             "override_opening_after_manual": false,
  281.             "override_closing_after_manual": false,
  282.             "override_ventilation_after_manual": false,
  283.             "override_shading_after_manual": false,
  284.             "auto_ventilate_options": [],
  285.             "ventilation_delay_enabled": false,
  286.             "ventilation_if_lower_enabled": false,
  287.             "ventilation_after_shading_end": false,
  288.             "check_config": false,
  289.             "check_config_debuglevel": "info",
  290.             "check_status_helper_length": 254
  291.           }
  292.         }
  293.       ],
  294.       "condition/0": [
  295.         {
  296.           "path": "condition/0",
  297.           "timestamp": "2025-07-01T14:48:45.415858+00:00",
  298.           "result": {
  299.             "result": true
  300.           }
  301.         }
  302.       ],
  303.       "condition/0/conditions/0": [
  304.         {
  305.           "path": "condition/0/conditions/0",
  306.           "timestamp": "2025-07-01T14:48:45.415954+00:00",
  307.           "result": {
  308.             "result": true
  309.           }
  310.         }
  311.       ],
  312.       "condition/0/conditions/0/entity_id/0": [
  313.         {
  314.           "path": "condition/0/conditions/0/entity_id/0",
  315.           "timestamp": "2025-07-01T14:48:45.416024+00:00",
  316.           "result": {
  317.             "result": true,
  318.             "state": "on",
  319.             "wanted_state": "on"
  320.           }
  321.         }
  322.       ],
  323.       "condition/1": [
  324.         {
  325.           "path": "condition/1",
  326.           "timestamp": "2025-07-01T14:48:45.416445+00:00",
  327.           "result": {
  328.             "result": true
  329.           }
  330.         }
  331.       ],
  332.       "condition/1/conditions/0": [
  333.         {
  334.           "path": "condition/1/conditions/0",
  335.           "timestamp": "2025-07-01T14:48:45.416533+00:00",
  336.           "result": {
  337.             "result": false,
  338.             "entities": []
  339.           }
  340.         }
  341.       ],
  342.       "condition/1/conditions/1": [
  343.         {
  344.           "path": "condition/1/conditions/1",
  345.           "timestamp": "2025-07-01T14:48:45.417102+00:00",
  346.           "result": {
  347.             "result": true,
  348.             "entities": []
  349.           }
  350.         }
  351.       ]
  352.     },
  353.     "config": {
  354.       "trigger_variables": {
  355.         "blind": "cover.dg_rl_ank",
  356.         "open_position": 100,
  357.         "close_position": 0,
  358.         "ventilate_position": 99,
  359.         "shading_position": 1,
  360.         "position_tolerance": 0,
  361.         "open_tilt_position": 50,
  362.         "close_tilt_position": 50,
  363.         "ventilate_tilt_position": 50,
  364.         "shading_tilt_elevation_1": 20,
  365.         "shading_tilt_elevation_2": 30,
  366.         "shading_tilt_elevation_3": 48,
  367.         "shading_tilt_position_0": 0,
  368.         "shading_tilt_position_1": 20,
  369.         "shading_tilt_position_2": 37,
  370.         "shading_tilt_position_3": 50,
  371.         "auto_options": [
  372.           "auto_up_enabled",
  373.           "auto_down_enabled",
  374.           "auto_sun_enabled",
  375.           "auto_shading_enabled",
  376.           "auto_ventilate_enabled"
  377.         ],
  378.         "time_up_early": "07:00:00",
  379.         "time_up_early_non_workday": "08:00:00",
  380.         "time_up_late": "08:00:00",
  381.         "time_up_late_non_workday": "09:00:00",
  382.         "time_down_early": "20:00:00",
  383.         "time_down_early_non_workday": "20:00:00",
  384.         "time_down_late": "22:00:00",
  385.         "time_down_late_non_workday": "22:00:00",
  386.         "workday_sensor_today": "binary_sensor.workday_sensor",
  387.         "workday_sensor_tomorrow": "binary_sensor.workday_sensor_tomorrow",
  388.         "default_brightness_sensor": [],
  389.         "brightness_up": 0,
  390.         "brightness_down": 0,
  391.         "default_sun_sensor": "sun.sun",
  392.         "sun_elevation_up": 5,
  393.         "sun_elevation_down": -6,
  394.         "resident_sensor": [],
  395.         "contact_window_tilted": [],
  396.         "contact_window_opened": "binary_sensor.tfk_ank",
  397.         "lockout_tilted_options": [
  398.           "lockout_tilted_closing",
  399.           "lockout_tilted_shading_start"
  400.         ],
  401.         "lockout_tilted_when_closing": "{{ 'lockout_tilted_closing' in lockout_tilted_options }}",
  402.         "lockout_tilted_when_shading_starts": "{{ 'lockout_tilted_shading_start' in lockout_tilted_options }}",
  403.         "lockout_tilted_when_shading_ends": "{{ 'lockout_tilted_shading_end' in lockout_tilted_options }}",
  404.         "time_control": "time_control_input",
  405.         "time_schedule_helper": [],
  406.         "shading_brightness_sensor": "sensor.helligkeit_aussen",
  407.         "shading_temperatur_sensor1": "sensor.dg_wt_sz_temperatur",
  408.         "shading_temperatur_sensor2": "sensor.raspberrymatic_sv_wm_temperatur",
  409.         "shading_min_temperatur1": 20,
  410.         "shading_min_temperatur2": 22,
  411.         "shading_temperature_hysteresis1": 0.2,
  412.         "shading_temperature_hysteresis2": 0.2,
  413.         "shading_azimuth_start": 150,
  414.         "shading_azimuth_end": 330,
  415.         "shading_elevation_min": 25,
  416.         "shading_elevation_max": 90,
  417.         "shading_sun_brightness_start": 35000,
  418.         "shading_sun_brightness_end": 10000,
  419.         "shading_forecast_sensor": [],
  420.         "shading_forecast_type": "weather_attributes",
  421.         "shading_forecast_temp": [],
  422.         "shading_weather_conditions": [
  423.           "sunny",
  424.           "partlycloudy",
  425.           "cloudy",
  426.           "clear"
  427.         ],
  428.         "is_shading_enabled": "{{ 'auto_shading_enabled' in auto_options }}",
  429.         "cover_tilt_config": "cover_tilt_disabled",
  430.         "is_cover_tilt_enabled": "{{ 'cover_tilt_enabled' in cover_tilt_config }}",
  431.         "is_up_enabled": "{{ 'auto_up_enabled' in auto_options }}",
  432.         "is_down_enabled": "{{ 'auto_down_enabled' in auto_options }}",
  433.         "is_brightness_enabled": "{{ 'auto_brightness_enabled' in auto_options }}",
  434.         "is_sun_elevation_enabled": "{{ 'auto_sun_enabled' in auto_options }}",
  435.         "is_ventilation_enabled": "{{ 'auto_ventilate_enabled' in auto_options }}",
  436.         "is_time_field_enabled": "{{ 'time_control_input' in time_control }}",
  437.         "is_schedule_helper_enabled": "{{ 'time_control_schedule' in time_control and time_schedule_helper != [] }}",
  438.         "is_time_control_disabled": "{{ 'time_control_disabled' in time_control }}",
  439.         "reset_override_config": "reset_disabled",
  440.         "reset_override_time": "00:01:00",
  441.         "reset_override_timeout": 5,
  442.         "is_reset_disabled": "{{ 'reset_disabled' in reset_override_config }}",
  443.         "is_reset_fixed_time": "{{ 'reset_fixed_time' in reset_override_config }}",
  444.         "is_reset_timeout": "{{ 'reset_timeout' in reset_override_config }}",
  445.         "cover_status_options": "cover_helper_enabled",
  446.         "cover_status_helper": "input_text.cover_status_helper_ankleide"
  447.       },
  448.       "variables": {
  449.         "version": "2025.06.19",
  450.         "blind_entities": "{{ expand(blind) | map(attribute='entity_id') | list }}",
  451.         "current_position": "{{ state_attr(blind, 'current_position') | int(default=101) }}",
  452.         "current_tilt_position": "{{ state_attr(blind,'current_tilt_position') | int(default=101) }}",
  453.         "current_sun_azimuth": "{{ state_attr(default_sun_sensor, 'azimuth') }}",
  454.         "current_sun_elevation": "{{ state_attr(default_sun_sensor, 'elevation') }}",
  455.         "is_today_off": "{{ workday_sensor_today != [] and is_state(workday_sensor_today, 'off') }}",
  456.         "is_tomorrow_off": "{{ workday_sensor_tomorrow != [] and is_state(workday_sensor_tomorrow, 'off') }}",
  457.         "is_tomorrow_on": "{{ workday_sensor_tomorrow != [] and is_state(workday_sensor_tomorrow, 'on') }}",
  458.         "drive_delay_fix": 90,
  459.         "drive_delay_random": 0,
  460.         "drive_time": 90,
  461.         "time_up_early_today": "{{ time_up_early_non_workday if is_today_off else time_up_early }}",
  462.         "time_up_late_today": "{{ time_up_late_non_workday if is_today_off else time_up_late }}",
  463.         "time_down_early_today": "{{\n  time_down_early_non_workday if is_tomorrow_off else\n  time_down_early if is_tomorrow_on else\n  time_down_early_non_workday if is_today_off else\n  time_down_early\n}}",
  464.         "time_down_late_today": "{{\n  time_down_late_non_workday if is_tomorrow_off else\n  time_down_late if is_tomorrow_on else\n  time_down_late_non_workday if is_today_off else\n  time_down_late\n}}",
  465.         "auto_up_force": [],
  466.         "auto_down_force": [],
  467.         "auto_ventilate_force": [],
  468.         "auto_shading_start_force": [],
  469.         "auto_up_force_disabled": "{{ auto_up_force == [] or (auto_up_force != [] and states(auto_up_force) in ['false', 'off']) }}",
  470.         "auto_down_force_disabled": "{{ auto_down_force == [] or (auto_down_force != [] and states(auto_down_force) in ['false', 'off']) }}",
  471.         "auto_ventilate_force_disabled": "{{ auto_ventilate_force == [] or (auto_ventilate_force != [] and states(auto_ventilate_force) in ['false', 'off']) }}",
  472.         "auto_shading_start_force_disabled": "{{ auto_shading_start_force == [] or (auto_shading_start_force != [] and states(auto_shading_start_force) in ['false', 'off']) }}",
  473.         "is_cover_tilt_enabled_and_possible": "{{ is_cover_tilt_enabled and state_attr(blind, 'current_tilt_position') != none }}",
  474.         "cover_tilt_reposition_config": "cover_tilt_reposition_disabled",
  475.         "is_cover_tilt_reposition_enabled": "{{ 'cover_tilt_reposition_enabled' in cover_tilt_reposition_config }}",
  476.         "shading_tilt_position": "{% set elevation = current_sun_elevation | int(default=0) %} {% if elevation >= shading_tilt_elevation_3 | int %}\n  {{ shading_tilt_position_3 | int }}\n{% elif elevation >= shading_tilt_elevation_2 | int %}\n  {{ shading_tilt_position_2 | int }}\n{% elif elevation >= shading_tilt_elevation_1 | int %}\n  {{ shading_tilt_position_1 | int }}\n{% else %}\n  {{ shading_tilt_position_0 | int }}\n{% endif %}",
  477.         "shading_waitingtime_start": 300,
  478.         "shading_waitingtime_end": 600,
  479.         "is_shading_end_immediate_by_sun_position": false,
  480.         "shading_start_behavior": "trigger_periodic",
  481.         "shading_end_behavior": "open_position",
  482.         "start_shading_trigger_reset": "{{ 'trigger_reset' in shading_start_behavior }}",
  483.         "start_shading_trigger_periodic": "{{ 'trigger_periodic' in shading_start_behavior }}",
  484.         "is_status_helper_enabled": "{{\n  'cover_helper_enabled' in cover_status_options and\n  cover_status_helper != [] and\n  states(cover_status_helper) not in ['', 'unknown', 'unavailable', 'none', []] and\n  states(cover_status_helper) | regex_match(\"((\\[[^\\}]+)?\\{s*[^\\}\\{]{3,}?:.*\\}([^\\{]+\\])?)\")\n}}",
  485.         "helper_state_json": "{% if is_status_helper_enabled %}\n  {{ states(cover_status_helper) | from_json }}\n{% else %}\n  {{\n    {\n      'open': {'a': 0, 't': 0},\n      'close': {'a': 0, 't': 0},\n      'shading': {'a': 0, 't': 0, 'p': 0, 'q': 0},\n      'vpart': {'a': 0, 't': 0},\n      'vfull': {'a': 0, 't': 0},\n      'manual': {'a': 0, 't': 0},\n      'v': 5,\n      't': as_timestamp(now()) | round(0)\n    } | to_json | from_json\n  }}\n{% endif %}\n",
  486.         "is_helper_open": "{{ is_status_helper_enabled and (helper_state_json | regex_search('open')) and (helper_state_json.open.a | default(false) | bool) }}",
  487.         "is_helper_closed": "{{ is_status_helper_enabled and (helper_state_json | regex_search('close')) and (helper_state_json.close.a | default(false) | bool) }}",
  488.         "is_helper_shaded": "{{\n  'shading' in helper_state_json and\n  helper_state_json.shading.a | default(false) | bool and\n  not (helper_state_json.shading.p | default(false) | bool and\n      helper_state_json.shading.q | default(false) | bool)\n}}",
  489.         "is_helper_shading_start": "{{ is_status_helper_enabled and (helper_state_json | regex_search('shading')) and (helper_state_json.shading.p | default(false) | bool) }}",
  490.         "is_helper_shading_end": "{{ is_status_helper_enabled and (helper_state_json | regex_search('shading')) and (helper_state_json.shading.q | default(false) | bool) }}",
  491.         "is_helper_vent_partial": "{{ is_status_helper_enabled and (helper_state_json | regex_search('vpart')) and (helper_state_json.vpart.a | default(false) | bool) }}",
  492.         "is_helper_vent_full": "{{ is_status_helper_enabled and (helper_state_json | regex_search('vfull')) and (helper_state_json.vfull.a | default(false) | bool) }}",
  493.         "is_helper_manual": "{{ is_status_helper_enabled and (helper_state_json | regex_search('manual')) and (helper_state_json.manual.a | default(false) | bool) }}",
  494.         "ts_helper_open": "{{ helper_state_json.open.t | default(0) if (is_status_helper_enabled and (helper_state_json | regex_search('open'))) else 0 }}",
  495.         "ts_helper_closed": "{{ helper_state_json.close.t | default(0) if (is_status_helper_enabled and (helper_state_json | regex_search('close'))) else 0 }}",
  496.         "ts_helper_shaded": "{{ helper_state_json.shading.t | default(0) if (is_status_helper_enabled and (helper_state_json | regex_search('shading'))) else 0 }}",
  497.         "ts_helper_vent_partial": "{{ helper_state_json.vpart.t | default(0) if (is_status_helper_enabled and (helper_state_json | regex_search('vpart'))) else 0 }}",
  498.         "ts_helper_vent_full": "{{ helper_state_json.vfull.t | default(0) if (is_status_helper_enabled and (helper_state_json | regex_search('vfull'))) else 0 }}",
  499.         "ts_helper_manual": "{{ helper_state_json.manual.t | default(0) if (is_status_helper_enabled and (helper_state_json | regex_search('manual'))) else 0 }}",
  500.         "in_open_position": "{% set min = open_position - position_tolerance %} {% set max = open_position + position_tolerance %} {{\n  (current_position >= min and current_position <= max)\n  and (\n    (not is_cover_tilt_enabled_and_possible)\n    or (is_cover_tilt_enabled_and_possible and current_tilt_position == open_tilt_position)\n  )\n}}",
  501.         "in_close_position": "{% set min = close_position - position_tolerance %} {% set max = close_position + position_tolerance %} {{\n  (current_position >= min and current_position <= max)\n  and (\n    (not is_cover_tilt_enabled_and_possible)\n    or (is_cover_tilt_enabled_and_possible and current_tilt_position == close_tilt_position)\n  )\n}}",
  502.         "in_shading_position": "{% set min = shading_position - position_tolerance %} {% set max = shading_position + position_tolerance %} {{\n  is_shading_enabled\n  and (current_position >= min and current_position <= max)\n  and (\n    (not is_cover_tilt_enabled_and_possible)\n    or (current_tilt_position == shading_tilt_position)\n  )\n}}",
  503.         "in_ventilate_position": "{% set min = ventilate_position - position_tolerance %} {% set max = ventilate_position + position_tolerance %} {{\n  is_ventilation_enabled\n  and (current_position >= min and current_position <= max)\n  and (\n    (not is_cover_tilt_enabled_and_possible)\n    or (current_tilt_position ==  ventilate_tilt_position)\n  )\n}}",
  504.         "individual_config": [],
  505.         "prevent_higher_position_closing": "{{ 'prevent_higher_position_closing' in individual_config }}",
  506.         "prevent_lowering_when_closing_if_shaded": "{{ 'prevent_lowering_when_closing_if_shaded' in individual_config }}",
  507.         "prevent_forecast_service": "{{ 'weather_attributes' in shading_forecast_type }}",
  508.         "prevent_shading_end_if_closed": "{{ 'prevent_shading_end_if_closed' in individual_config }}",
  509.         "prevent_opening_after_shading_end": "{{ 'prevent_opening_after_shading_end' in individual_config }}",
  510.         "prevent_opening_after_ventilation_end": "{{ 'prevent_opening_after_ventilation_end' in individual_config }}",
  511.         "prevent_default_cover_actions": "{{ 'prevent_default_cover_actions' in individual_config }}",
  512.         "prevent_shading_multiple_times": "{{ 'prevent_shading_multiple_times' in individual_config }}",
  513.         "prevent_opening_multiple_times": "{{ 'prevent_opening_multiple_times' in individual_config }}",
  514.         "prevent_closing_multiple_times": "{{ 'prevent_closing_multiple_times' in individual_config }}",
  515.         "resident_config": [],
  516.         "resident_opening_enabled": "{{ 'resident_opening_enabled' in resident_config }}",
  517.         "resident_closing_enabled": "{{ 'resident_closing_enabled' in resident_config }}",
  518.         "resident_allow_shading": "{{ 'resident_allow_shading' in resident_config }}",
  519.         "resident_allow_opening": "{{ 'resident_allow_opening' in resident_config }}",
  520.         "resident_allow_ventilation": "{{ 'resident_allow_ventilation' in resident_config }}",
  521.         "ignore_after_manual_config": [],
  522.         "override_opening_after_manual": "{{ 'ignore_opening_after_manual' in ignore_after_manual_config }}",
  523.         "override_closing_after_manual": "{{ 'ignore_closing_after_manual' in ignore_after_manual_config }}",
  524.         "override_ventilation_after_manual": "{{ 'ignore_ventilation_after_manual' in ignore_after_manual_config }}",
  525.         "override_shading_after_manual": "{{ 'ignore_shading_after_manual' in ignore_after_manual_config }}",
  526.         "auto_ventilate_options": [],
  527.         "ventilation_delay_enabled": "{{ 'ventilation_delay_enabled' in auto_ventilate_options }}",
  528.         "ventilation_if_lower_enabled": "{{ 'ventilation_if_lower_enabled' in auto_ventilate_options }}",
  529.         "ventilation_after_shading_end": "{{ 'ventilation_after_shading_end' in auto_ventilate_options }}",
  530.         "check_config": false,
  531.         "check_config_debuglevel": "info",
  532.         "check_status_helper_length": "{{ state_attr(cover_status_helper, 'max') if is_status_helper_enabled else None }}"
  533.       },
  534.       "mode": "single",
  535.       "max_exceeded": "silent",
  536.       "triggers": [
  537.         {
  538.           "platform": "template",
  539.           "value_template": "{% set is_today_off = workday_sensor_today != [] and is_state(workday_sensor_today, 'off') %} {% set time_compare = time_up_early_non_workday if is_today_off else time_up_early %} {{ now() >= today_at(time_compare) }}",
  540.           "enabled": "{{ is_time_field_enabled }}",
  541.           "id": "t_open_1"
  542.         },
  543.         {
  544.           "platform": "template",
  545.           "value_template": "{% set is_today_off = workday_sensor_today != [] and is_state(workday_sensor_today, 'off') %} {% set early = time_up_early_non_workday if is_today_off else time_up_early %} {% set late = time_up_late_non_workday if is_today_off else time_up_late %} {{ early != late and now() >= today_at(late) }}",
  546.           "enabled": "{{ is_time_field_enabled }}",
  547.           "id": "t_open_2"
  548.         },
  549.         {
  550.           "platform": "template",
  551.           "value_template": "{{ states(time_schedule_helper) in ['true', 'on'] }}",
  552.           "enabled": "{{ is_schedule_helper_enabled and time_schedule_helper != [] }}",
  553.           "id": "t_open_3"
  554.         },
  555.         {
  556.           "platform": "template",
  557.           "value_template": "{{ states(default_brightness_sensor) | float(default=brightness_up) > brightness_up }}",
  558.           "for": {
  559.             "seconds": 30
  560.           },
  561.           "enabled": "{{ is_brightness_enabled and default_brightness_sensor != [] }}",
  562.           "id": "t_open_4"
  563.         },
  564.         {
  565.           "platform": "template",
  566.           "value_template": "{{ state_attr(default_sun_sensor, 'elevation') | float(default=sun_elevation_up) > sun_elevation_up }}",
  567.           "for": {
  568.             "seconds": 30
  569.           },
  570.           "enabled": "{{ is_sun_elevation_enabled and default_sun_sensor != [] }}",
  571.           "id": "t_open_5"
  572.         },
  573.         {
  574.           "platform": "state",
  575.           "entity_id": [],
  576.           "from": "on",
  577.           "to": "off",
  578.           "id": "t_open_6"
  579.         },
  580.         {
  581.           "platform": "state",
  582.           "entity_id": [],
  583.           "from": "off",
  584.           "to": "on",
  585.           "id": "t_force_open"
  586.         },
  587.         {
  588.           "platform": "template",
  589.           "value_template": "{% set is_tomorrow_off = workday_sensor_tomorrow != [] and is_state(workday_sensor_tomorrow, 'off') %} {% set is_tomorrow_on = workday_sensor_tomorrow != [] and is_state(workday_sensor_tomorrow, 'on') %} {% set is_today_off = workday_sensor_today != [] and is_state(workday_sensor_today, 'off') %} {% set time_compare =\n  time_down_early_non_workday if is_tomorrow_off else\n  time_down_early if is_tomorrow_on else\n  time_down_early_non_workday if is_today_off else\n  time_down_early %}\n{{ now() >= today_at(time_compare) }}",
  590.           "enabled": "{{ is_time_field_enabled }}",
  591.           "id": "t_close_1"
  592.         },
  593.         {
  594.           "platform": "template",
  595.           "value_template": "{% set is_tomorrow_off = workday_sensor_tomorrow != [] and is_state(workday_sensor_tomorrow, 'off') %} {% set is_tomorrow_on = workday_sensor_tomorrow != [] and is_state(workday_sensor_tomorrow, 'on') %} {% set is_today_off = workday_sensor_today != [] and is_state(workday_sensor_today, 'off') %} {% set time_compare =\n  time_down_late_non_workday if is_tomorrow_off else\n  time_down_late if is_tomorrow_on else\n  time_down_late_non_workday if is_today_off else\n  time_down_late %}\n{{ (time_down_early_non_workday != time_compare and time_down_early != time_compare) and now() >= today_at(time_compare) }}",
  596.           "enabled": "{{ is_time_field_enabled }}",
  597.           "id": "t_close_2"
  598.         },
  599.         {
  600.           "platform": "template",
  601.           "value_template": "{{ states(time_schedule_helper) in ['false', 'off'] }}",
  602.           "enabled": "{{ is_schedule_helper_enabled and time_schedule_helper != [] }}",
  603.           "id": "t_close_3"
  604.         },
  605.         {
  606.           "platform": "template",
  607.           "value_template": "{{ states(default_brightness_sensor) | float(default=brightness_down) < brightness_down }}",
  608.           "for": {
  609.             "seconds": 30
  610.           },
  611.           "enabled": "{{ is_brightness_enabled and default_brightness_sensor != [] }}",
  612.           "id": "t_close_4"
  613.         },
  614.         {
  615.           "platform": "template",
  616.           "value_template": "{{ state_attr(default_sun_sensor, 'elevation') | float(default=sun_elevation_down) < sun_elevation_down }}",
  617.           "for": {
  618.             "seconds": 30
  619.           },
  620.           "enabled": "{{ is_sun_elevation_enabled and default_sun_sensor != [] }}",
  621.           "id": "t_close_5"
  622.         },
  623.         {
  624.           "platform": "state",
  625.           "entity_id": [],
  626.           "from": "off",
  627.           "to": "on",
  628.           "id": "t_close_6"
  629.         },
  630.         {
  631.           "platform": "state",
  632.           "entity_id": [],
  633.           "from": "off",
  634.           "to": "on",
  635.           "id": "t_force_close"
  636.         },
  637.         {
  638.           "platform": "template",
  639.           "value_template": "{{ states(contact_window_tilted) in ['true', 'on'] }}",
  640.           "enabled": "{{ is_ventilation_enabled and contact_window_tilted != [] }}",
  641.           "id": "t_contact_tilted_on",
  642.           "for": {
  643.             "seconds": 0
  644.           }
  645.         },
  646.         {
  647.           "platform": "template",
  648.           "value_template": "{{ states(contact_window_tilted) in ['false', 'off'] }}",
  649.           "enabled": "{{ is_ventilation_enabled and contact_window_tilted != [] }}",
  650.           "id": "t_contact_tilted_off",
  651.           "for": {
  652.             "seconds": 0
  653.           }
  654.         },
  655.         {
  656.           "platform": "template",
  657.           "value_template": "{{ states(contact_window_opened) in ['true', 'on'] }}",
  658.           "enabled": "{{ is_ventilation_enabled and contact_window_opened != [] }}",
  659.           "id": "t_contact_opened_on",
  660.           "for": {
  661.             "seconds": 0
  662.           }
  663.         },
  664.         {
  665.           "platform": "template",
  666.           "value_template": "{{ states(contact_window_opened) in ['false', 'off'] }}",
  667.           "enabled": "{{ is_ventilation_enabled and contact_window_opened != [] }}",
  668.           "id": "t_contact_opened_off",
  669.           "for": {
  670.             "seconds": 0
  671.           }
  672.         },
  673.         {
  674.           "platform": "state",
  675.           "entity_id": [],
  676.           "from": "off",
  677.           "to": "on",
  678.           "id": "t_force_vent"
  679.         },
  680.         {
  681.           "platform": "template",
  682.           "value_template": "{{\n  state_attr(default_sun_sensor, 'azimuth') | float(default=shading_azimuth_start) > shading_azimuth_start and\n  state_attr(default_sun_sensor, 'azimuth') | float(default=shading_azimuth_end) < shading_azimuth_end and\n  state_attr(default_sun_sensor, 'elevation') | float(default=shading_elevation_min) > shading_elevation_min and\n  state_attr(default_sun_sensor, 'elevation') | float(default=shading_elevation_max) < shading_elevation_max\n}}",
  683.           "enabled": "{{ is_shading_enabled and default_sun_sensor != [] }}",
  684.           "id": "t_shading_start_pending_1"
  685.         },
  686.         {
  687.           "platform": "template",
  688.           "value_template": "{{ states(shading_brightness_sensor) | float(default=shading_sun_brightness_start) > shading_sun_brightness_start }}",
  689.           "enabled": "{{ is_shading_enabled and shading_brightness_sensor != [] }}",
  690.           "id": "t_shading_start_pending_2"
  691.         },
  692.         {
  693.           "platform": "template",
  694.           "value_template": "{{ states(shading_temperatur_sensor1) | float(default=shading_min_temperatur1) > shading_min_temperatur1 }}",
  695.           "enabled": "{{ is_shading_enabled and shading_temperatur_sensor1 != [] }}",
  696.           "id": "t_shading_start_pending_3"
  697.         },
  698.         {
  699.           "platform": "template",
  700.           "value_template": "{{ states(shading_temperatur_sensor2) | float(default=shading_min_temperatur2) > shading_min_temperatur2 }}",
  701.           "enabled": "{{ is_shading_enabled and shading_temperatur_sensor2 != [] }}",
  702.           "id": "t_shading_start_pending_4"
  703.         },
  704.         {
  705.           "platform": "template",
  706.           "value_template": "{{ states(shading_forecast_sensor) in shading_weather_conditions }}",
  707.           "enabled": "{{ is_shading_enabled and shading_forecast_sensor != [] }}",
  708.           "id": "t_shading_start_pending_5"
  709.         },
  710.         {
  711.           "platform": "template",
  712.           "value_template": "{{\n  states(cover_status_helper) not in ['', 'unknown', 'unavailable', 'none', []] and\n  states(cover_status_helper) | regex_match(\"((\\[[^\\}]+)?\\{s*[^\\}\\{]{3,}?:.*\\}([^\\{]+\\])?)\") and\n  states(cover_status_helper)|from_json|regex_search('shading') and\n  (states(cover_status_helper)|from_json).shading.p is defined and\n  (states(cover_status_helper)|from_json).shading.p > 0 and\n  now() >= ( (states(cover_status_helper)|from_json).shading.p) | as_datetime | as_local\n}}",
  713.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] }}",
  714.           "id": "t_shading_start_execution"
  715.         },
  716.         {
  717.           "platform": "state",
  718.           "entity_id": [],
  719.           "from": "off",
  720.           "to": "on",
  721.           "id": "t_force_shading_start"
  722.         },
  723.         {
  724.           "platform": "template",
  725.           "value_template": "{{\n  states(cover_status_helper) not in ['', 'unknown', 'unavailable', 'none'] and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"a\"\\s*:\\s*1') and\n  state_attr(default_sun_sensor, 'elevation') < shading_tilt_elevation_1\n}}",
  726.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and is_cover_tilt_enabled and default_sun_sensor != [] }}",
  727.           "id": "t_shading_tilt_1"
  728.         },
  729.         {
  730.           "platform": "template",
  731.           "value_template": "{{\n  states(cover_status_helper) not in ['', 'unknown', 'unavailable', 'none'] and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"a\"\\s*:\\s*1') and\n  state_attr(default_sun_sensor, 'elevation') < shading_tilt_elevation_2 and\n  state_attr(default_sun_sensor, 'elevation') >= shading_tilt_elevation_1\n}}",
  732.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and is_cover_tilt_enabled and default_sun_sensor != [] }}",
  733.           "id": "t_shading_tilt_2"
  734.         },
  735.         {
  736.           "platform": "template",
  737.           "value_template": "{{\n  states(cover_status_helper) not in ['', 'unknown', 'unavailable', 'none'] and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"a\"\\s*:\\s*1') and\n  state_attr(default_sun_sensor, 'elevation') < shading_tilt_elevation_3 and\n  state_attr(default_sun_sensor, 'elevation') >= shading_tilt_elevation_2\n}}",
  738.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and is_cover_tilt_enabled and default_sun_sensor != [] }}",
  739.           "id": "t_shading_tilt_3"
  740.         },
  741.         {
  742.           "platform": "template",
  743.           "value_template": "{{\n  states(cover_status_helper) not in ['', 'unknown', 'unavailable', 'none'] and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"a\"\\s*:\\s*1') and\n  state_attr(default_sun_sensor, 'elevation') >= shading_tilt_elevation_3\n}}",
  744.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and is_cover_tilt_enabled and default_sun_sensor != [] }}",
  745.           "id": "t_shading_tilt_4"
  746.         },
  747.         {
  748.           "platform": "template",
  749.           "value_template": "{{\n  states(cover_status_helper) not in ['', 'unknown', 'unavailable', 'none'] and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"a\"\\s*:\\s*1') and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"p\"\\s*:\\s*0') and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"q\"\\s*:\\s*0') and\n  states(shading_temperatur_sensor1) | float(default=shading_min_temperatur1) < (shading_min_temperatur1 - shading_temperature_hysteresis1)\n}}",
  750.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and shading_temperatur_sensor1 != [] }}",
  751.           "id": "t_shading_end_pending_1"
  752.         },
  753.         {
  754.           "platform": "template",
  755.           "value_template": "{{\n  states(cover_status_helper) not in ['', 'unknown', 'unavailable', 'none'] and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"a\"\\s*:\\s*1') and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"p\"\\s*:\\s*0') and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"q\"\\s*:\\s*0') and\n  states(shading_temperatur_sensor2) | float(default=shading_min_temperatur2) < (shading_min_temperatur2 - shading_temperature_hysteresis2)\n}}",
  756.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and shading_temperatur_sensor2 != [] }}",
  757.           "id": "t_shading_end_pending_2"
  758.         },
  759.         {
  760.           "platform": "template",
  761.           "value_template": "{{\n  states(cover_status_helper) not in ['', 'unknown', 'unavailable', 'none'] and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"a\"\\s*:\\s*1') and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"p\"\\s*:\\s*0') and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"q\"\\s*:\\s*0') and\n  states(shading_brightness_sensor) | float(default=shading_sun_brightness_end) < shading_sun_brightness_end\n}}",
  762.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and shading_brightness_sensor != [] }}",
  763.           "id": "t_shading_end_pending_3"
  764.         },
  765.         {
  766.           "platform": "template",
  767.           "value_template": "{{\n  states(cover_status_helper) not in ['', 'unknown', 'unavailable', 'none'] and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"a\"\\s*:\\s*1') and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"p\"\\s*:\\s*0') and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"q\"\\s*:\\s*0') and\n  states(shading_forecast_sensor) not in shading_weather_conditions\n}}",
  768.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and shading_weather_conditions != [] and shading_forecast_sensor != [] }}",
  769.           "id": "t_shading_end_pending_4"
  770.         },
  771.         {
  772.           "platform": "template",
  773.           "value_template": "{{\n  states(cover_status_helper) not in ['', 'unknown', 'unavailable', 'none'] and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"a\"\\s*:\\s*1') and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"p\"\\s*:\\s*0') and\n  states(cover_status_helper) | regex_search('\"shading\"\\s*:\\s*\\{[^}]*\"q\"\\s*:\\s*0') and\n  (\n    (state_attr(default_sun_sensor, 'azimuth') | float(default=shading_azimuth_end) > shading_azimuth_end) or\n    (state_attr(default_sun_sensor, 'elevation') | float(default=shading_elevation_max) > shading_elevation_max) or\n    (state_attr(default_sun_sensor, 'elevation') | float(default=shading_elevation_min) < shading_elevation_min)\n  )\n}}",
  774.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and default_sun_sensor != [] }}",
  775.           "id": "t_shading_end_pending_5"
  776.         },
  777.         {
  778.           "platform": "template",
  779.           "value_template": "{{\n  states(cover_status_helper) not in ['', 'unknown', 'unavailable', 'none', []] and\n  states(cover_status_helper) | regex_match(\"((\\[[^\\}]+)?\\{s*[^\\}\\{]{3,}?:.*\\}([^\\{]+\\])?)\") and\n  states(cover_status_helper)|from_json|regex_search('shading') and\n  (states(cover_status_helper)|from_json).shading.q is defined and\n  (states(cover_status_helper)|from_json).shading.q > 0 and\n  now() >= ( (states(cover_status_helper)|from_json).shading.q) | as_datetime | as_local\n}}",
  780.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] }}",
  781.           "id": "t_shading_end_execution"
  782.         },
  783.         {
  784.           "platform": "template",
  785.           "value_template": "{{ now() >= today_at('23:55:00') }}",
  786.           "id": "t_shading_reset",
  787.           "enabled": "{{ is_shading_enabled }}"
  788.         },
  789.         {
  790.           "platform": "state",
  791.           "entity_id": "cover.dg_rl_ank",
  792.           "attribute": "current_position",
  793.           "id": "t_manual_1",
  794.           "for": "00:01:00"
  795.         },
  796.         {
  797.           "platform": "template",
  798.           "value_template": "{{ now() >= today_at(reset_override_time) }}",
  799.           "enabled": "{{ is_reset_fixed_time }}",
  800.           "id": "t_manual_2",
  801.           "for": "00:00:02"
  802.         },
  803.         {
  804.           "platform": "template",
  805.           "value_template": "{{\n  states(cover_status_helper) not in ['', 'unknown', 'unavailable', 'none', []] and\n  states(cover_status_helper) | regex_match(\"((\\[[^\\}]+)?\\{s*[^\\}\\{]{3,}?:.*\\}([^\\{]+\\])?)\") and\n  states(cover_status_helper)|from_json|regex_search('manual') and\n  (states(cover_status_helper)|from_json).manual.t is defined and\n  (states(cover_status_helper)|from_json).manual.a is defined and\n  (states(cover_status_helper)|from_json).manual.a | bool is true and\n   now() >= ( (states(cover_status_helper)|from_json).manual.t + 60 * reset_override_timeout) | as_datetime | as_local\n }}",
  806.           "enabled": "{{ is_reset_timeout and cover_status_helper != [] }}",
  807.           "id": "t_manual_3",
  808.           "for": "00:00:02"
  809.         },
  810.         {
  811.           "platform": "state",
  812.           "entity_id": "cover.dg_rl_ank",
  813.           "attribute": "current_tilt_position",
  814.           "id": "t_manual_4",
  815.           "for": "00:01:00"
  816.         }
  817.       ],
  818.       "conditions": [
  819.         {
  820.           "condition": [
  821.             {
  822.               "condition": "state",
  823.               "entity_id": "input_boolean.rollo_automatik",
  824.               "state": "on"
  825.             }
  826.           ]
  827.         },
  828.         {
  829.           "or": [
  830.             "{{ trigger.to_state is not defined }}",
  831.             "{{ trigger.to_state is defined and trigger.to_state.state not in ['unavailable', 'unknown','none', 'query failed'] }}"
  832.           ]
  833.         }
  834.       ],
  835.       "actions": [
  836.         {
  837.           "variables": {
  838.             "cover_move_action": {
  839.               "sequence": [
  840.                 {
  841.                   "repeat": {
  842.                     "for_each": "{{ blind_entities | list }}",
  843.                     "sequence": [
  844.                       {
  845.                         "choose": [
  846.                           {
  847.                             "conditions": [
  848.                               "{{ not prevent_default_cover_actions }}",
  849.                               "{{ target_position | default(101)  == 0 }}"
  850.                             ],
  851.                             "sequence": [
  852.                               {
  853.                                 "alias": "Close Cover",
  854.                                 "service": "cover.close_cover",
  855.                                 "target": {
  856.                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  857.                                 }
  858.                               }
  859.                             ]
  860.                           },
  861.                           {
  862.                             "conditions": [
  863.                               "{{ not prevent_default_cover_actions }}",
  864.                               "{{ target_position | default(101) == 100 }}"
  865.                             ],
  866.                             "sequence": [
  867.                               {
  868.                                 "alias": "Open Cover",
  869.                                 "service": "cover.open_cover",
  870.                                 "target": {
  871.                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  872.                                 }
  873.                               }
  874.                             ]
  875.                           },
  876.                           {
  877.                             "conditions": [
  878.                               "{{ not prevent_default_cover_actions }}",
  879.                               "{{ target_position | default(101) not in [0, 100] }}"
  880.                             ],
  881.                             "sequence": [
  882.                               {
  883.                                 "alias": "Moving the cover to target position",
  884.                                 "service": "cover.set_cover_position",
  885.                                 "data": {
  886.                                   "position": "{{ target_position | default(101) }}"
  887.                                 },
  888.                                 "target": {
  889.                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  890.                                 }
  891.                               }
  892.                             ]
  893.                           }
  894.                         ]
  895.                       },
  896.                       {
  897.                         "delay": {
  898.                           "seconds": "{{ (range(1, 3) | random | int) }}"
  899.                         }
  900.                       }
  901.                     ]
  902.                   }
  903.                 }
  904.               ]
  905.             },
  906.             "tilt_move_action": {
  907.               "sequence": [
  908.                 {
  909.                   "if": [
  910.                     "{{ not prevent_default_cover_actions }}",
  911.                     "{{ is_cover_tilt_enabled_and_possible }}",
  912.                     "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  913.                   ],
  914.                   "then": [
  915.                     {
  916.                       "repeat": {
  917.                         "for_each": "{{ blind_entities | list }}",
  918.                         "sequence": [
  919.                           {
  920.                             "if": [
  921.                               "{{ tilt_first | default(false) }}"
  922.                             ],
  923.                             "then": [
  924.                               {
  925.                                 "alias": "Reset Tilt",
  926.                                 "service": "cover.set_cover_tilt_position",
  927.                                 "data": {
  928.                                   "tilt_position": 0
  929.                                 },
  930.                                 "target": {
  931.                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  932.                                 }
  933.                               },
  934.                               {
  935.                                 "delay": {
  936.                                   "seconds": 0
  937.                                 }
  938.                               }
  939.                             ]
  940.                           },
  941.                           {
  942.                             "alias": "Tilt Delay",
  943.                             "delay": {
  944.                               "seconds": 0
  945.                             }
  946.                           },
  947.                           {
  948.                             "alias": "Moving the cover to tilt position",
  949.                             "service": "cover.set_cover_tilt_position",
  950.                             "data": {
  951.                               "tilt_position": "{{ target_tilt_position | default(101) }}"
  952.                             },
  953.                             "target": {
  954.                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  955.                             }
  956.                           },
  957.                           {
  958.                             "delay": {
  959.                               "seconds": "{{ (range(1, 3) | random | int) }}"
  960.                             }
  961.                           }
  962.                         ]
  963.                       }
  964.                     }
  965.                   ]
  966.                 }
  967.               ]
  968.             },
  969.             "helper_update": {
  970.               "if": [
  971.                 "{{ is_status_helper_enabled }}"
  972.               ],
  973.               "then": [
  974.                 {
  975.                   "alias": "Update cover status helper",
  976.                   "service": "input_text.set_value",
  977.                   "data": {
  978.                     "entity_id": "input_text.cover_status_helper_ankleide",
  979.                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  980.                   }
  981.                 }
  982.               ]
  983.             }
  984.           }
  985.         },
  986.         {
  987.           "if": [
  988.             "{{ is_shading_enabled }}",
  989.             "{{ not prevent_forecast_service }}",
  990.             "{{ (shading_forecast_sensor != [] ) }}",
  991.             "{{ states(shading_forecast_sensor) not in ['unavailable', 'unknown', 'query failed']  }}",
  992.             "{{ trigger.id is defined }}",
  993.             "{{ trigger.id | regex_match('^(t_shading_start|t_open_1|t_open_3)') }}",
  994.             "{{ shading_forecast_sensor.startswith('weather.') }}"
  995.           ],
  996.           "then": [
  997.             {
  998.               "action": "weather.get_forecasts",
  999.               "target": {
  1000.                 "entity_id": []
  1001.               },
  1002.               "data": {
  1003.                 "type": "weather_attributes"
  1004.               },
  1005.               "response_variable": "weather_forecast"
  1006.             }
  1007.           ]
  1008.         },
  1009.         {
  1010.           "if": [
  1011.             "{{ 'cover_helper_enabled' in cover_status_options }}",
  1012.             "{{ cover_status_helper != [] }}",
  1013.             {
  1014.               "or": [
  1015.                 "{{ states(cover_status_helper) in ['', 'unknown', 'unavailable', 'none'] }}",
  1016.                 "{{ not states(cover_status_helper) | regex_match(\"((\\[[^\\}]+)?\\{s*[^\\}\\{]{3,}?:.*\\}([^\\{]+\\])?)\") }}"
  1017.               ]
  1018.             }
  1019.           ],
  1020.           "then": [
  1021.             {
  1022.               "action": "input_text.set_value",
  1023.               "data": {
  1024.                 "entity_id": "input_text.cover_status_helper_ankleide",
  1025.                 "value": "{{ helper_state_json | to_json }}"
  1026.               }
  1027.             }
  1028.           ]
  1029.         },
  1030.         {
  1031.           "if": [
  1032.             "{{ is_status_helper_enabled }}",
  1033.             "{{ helper_state_json.v != 5 }}"
  1034.           ],
  1035.           "then": [
  1036.             {
  1037.               "variables": {
  1038.                 "update_values": {
  1039.                   "open": {
  1040.                     "a": "{{ is_helper_open|int }}",
  1041.                     "t": "{{ ts_helper_open }}"
  1042.                   },
  1043.                   "close": {
  1044.                     "a": "{{ is_helper_closed|int }}",
  1045.                     "t": "{{ ts_helper_closed }}"
  1046.                   },
  1047.                   "shading": {
  1048.                     "a": "{{ is_helper_shaded|int }}",
  1049.                     "t": "{{ ts_helper_shaded }}",
  1050.                     "p": 0,
  1051.                     "q": 0
  1052.                   },
  1053.                   "vpart": {
  1054.                     "a": "{{ is_helper_vent_partial|int }}",
  1055.                     "t": "{{ ts_helper_vent_partial }}"
  1056.                   },
  1057.                   "vfull": {
  1058.                     "a": "{{ is_helper_vent_full|int }}",
  1059.                     "t": "{{ ts_helper_vent_full }}"
  1060.                   },
  1061.                   "manual": {
  1062.                     "a": "{{ is_helper_manual|int }}",
  1063.                     "t": "{{ ts_helper_manual }}"
  1064.                   },
  1065.                   "v": 5,
  1066.                   "t": "{{ helper_state_json.t | round(0) }}"
  1067.                 }
  1068.               }
  1069.             },
  1070.             {
  1071.               "if": [
  1072.                 "{{ is_status_helper_enabled }}"
  1073.               ],
  1074.               "then": [
  1075.                 {
  1076.                   "alias": "Update cover status helper",
  1077.                   "data": {
  1078.                     "entity_id": "input_text.cover_status_helper_ankleide",
  1079.                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  1080.                   },
  1081.                   "action": "input_text.set_value"
  1082.                 }
  1083.               ]
  1084.             }
  1085.           ]
  1086.         },
  1087.         {
  1088.           "choose": [
  1089.             {
  1090.               "alias": "Check for opening",
  1091.               "conditions": [
  1092.                 "{{ is_up_enabled }}",
  1093.                 "{{ trigger.id is defined }}",
  1094.                 "{{ trigger.id | regex_match('^(t_open)') }}",
  1095.                 {
  1096.                   "condition": []
  1097.                 },
  1098.                 {
  1099.                   "and": [
  1100.                     "{{ auto_down_force_disabled }}",
  1101.                     "{{ auto_ventilate_force_disabled }}",
  1102.                     "{{ auto_shading_start_force_disabled }}"
  1103.                   ]
  1104.                 },
  1105.                 "{{ not (is_status_helper_enabled and is_helper_manual and override_opening_after_manual) }}",
  1106.                 {
  1107.                   "or": [
  1108.                     "{{ not is_status_helper_enabled }}",
  1109.                     "{{ not prevent_opening_multiple_times }}",
  1110.                     "{{ is_status_helper_enabled and prevent_opening_multiple_times and (now().day != ts_helper_open|timestamp_custom('%-d')|int) }}"
  1111.                   ]
  1112.                 },
  1113.                 {
  1114.                   "or": [
  1115.                     "{{ trigger.id != 't_open_6' }}",
  1116.                     "{{ trigger.id == 't_open_6' and resident_opening_enabled }}"
  1117.                   ]
  1118.                 },
  1119.                 {
  1120.                   "or": [
  1121.                     "{{ resident_sensor == [] }}",
  1122.                     "{{ states(resident_sensor) in ['false', 'off'] }}",
  1123.                     {
  1124.                       "and": [
  1125.                         "{{ resident_allow_opening }}",
  1126.                         "{{ states(resident_sensor) in ['true', 'on'] }}"
  1127.                       ]
  1128.                     }
  1129.                   ]
  1130.                 },
  1131.                 {
  1132.                   "or": [
  1133.                     {
  1134.                       "and": [
  1135.                         "{{ is_time_control_disabled }}"
  1136.                       ]
  1137.                     },
  1138.                     {
  1139.                       "and": [
  1140.                         "{{ is_time_field_enabled }}",
  1141.                         "{{ now() >= today_at(time_up_late_today) }}",
  1142.                         "{{ now() <= today_at(time_down_late_today) - timedelta(seconds = 5) }}"
  1143.                       ]
  1144.                     },
  1145.                     {
  1146.                       "and": [
  1147.                         "{{ is_schedule_helper_enabled }}",
  1148.                         "{{ time_schedule_helper != [] }}",
  1149.                         "{{ not is_brightness_enabled }}",
  1150.                         "{{ not is_sun_elevation_enabled }}",
  1151.                         "{{ is_state(time_schedule_helper, 'on') }}",
  1152.                         "{{ trigger.id in ['t_open_3', 't_open_6'] }}"
  1153.                       ]
  1154.                     },
  1155.                     {
  1156.                       "and": [
  1157.                         {
  1158.                           "or": [
  1159.                             {
  1160.                               "and": [
  1161.                                 "{{ is_time_control_disabled }}"
  1162.                               ]
  1163.                             },
  1164.                             {
  1165.                               "and": [
  1166.                                 "{{ is_time_field_enabled }}",
  1167.                                 "{{ now() >= today_at(time_up_early_today) }}",
  1168.                                 "{{ now() <= today_at(time_up_late_today) + timedelta(seconds = 5) }}"
  1169.                               ]
  1170.                             },
  1171.                             {
  1172.                               "and": [
  1173.                                 "{{ is_schedule_helper_enabled }}",
  1174.                                 "{{ time_schedule_helper != [] }}",
  1175.                                 "{{ is_state(time_schedule_helper, 'on') }}",
  1176.                                 "{{ now() >= today_at([time_up_early, time_up_early_non_workday] | min) - timedelta(seconds = 5) }}",
  1177.                                 "{{ now() <= today_at([time_up_late, time_up_late_non_workday] | max) + timedelta(seconds = 5) }}"
  1178.                               ]
  1179.                             }
  1180.                           ]
  1181.                         },
  1182.                         {
  1183.                           "or": [
  1184.                             {
  1185.                               "or": [
  1186.                                 "{{ is_brightness_enabled and default_brightness_sensor == [] }}",
  1187.                                 "{{ is_brightness_enabled and default_brightness_sensor != [] and (states(default_brightness_sensor) | float(default=brightness_up) > brightness_up) }}"
  1188.                               ]
  1189.                             },
  1190.                             {
  1191.                               "or": [
  1192.                                 "{{ is_sun_elevation_enabled and default_sun_sensor == [] }}",
  1193.                                 "{{ is_sun_elevation_enabled and default_sun_sensor != [] and (current_sun_elevation | float(default=sun_elevation_up) > sun_elevation_up) }}"
  1194.                               ]
  1195.                             }
  1196.                           ]
  1197.                         }
  1198.                       ]
  1199.                     }
  1200.                   ]
  1201.                 }
  1202.               ],
  1203.               "sequence": [
  1204.                 {
  1205.                   "delay": {
  1206.                     "seconds": "{{ range(drive_delay_fix|int(0), drive_delay_fix|int(0) + drive_delay_random|int(0) +1) | random }}"
  1207.                   }
  1208.                 },
  1209.                 {
  1210.                   "choose": [
  1211.                     {
  1212.                       "alias": "Shading detected. Move to shading position",
  1213.                       "conditions": [
  1214.                         "{{ is_status_helper_enabled }}",
  1215.                         "{{ is_helper_shaded }}",
  1216.                         "{{ not in_shading_position }}"
  1217.                       ],
  1218.                       "sequence": [
  1219.                         {
  1220.                           "choose": [],
  1221.                           "default": []
  1222.                         },
  1223.                         {
  1224.                           "variables": {
  1225.                             "target_position": 1,
  1226.                             "target_tilt_position": "{{ shading_tilt_position | int }}",
  1227.                             "update_values": {
  1228.                               "open": {
  1229.                                 "a": 1,
  1230.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  1231.                               },
  1232.                               "close": {
  1233.                                 "a": 0,
  1234.                                 "t": "{{ helper_state_json.close.t }}"
  1235.                               },
  1236.                               "shading": {
  1237.                                 "a": 1,
  1238.                                 "t": "{{ helper_state_json.shading.t }}",
  1239.                                 "p": 0,
  1240.                                 "q": 0
  1241.                               },
  1242.                               "vpart": {
  1243.                                 "a": 0,
  1244.                                 "t": "{{ helper_state_json.vpart.t }}"
  1245.                               },
  1246.                               "vfull": {
  1247.                                 "a": 0,
  1248.                                 "t": "{{ helper_state_json.vfull.t }}"
  1249.                               },
  1250.                               "manual": {
  1251.                                 "a": 0,
  1252.                                 "t": "{{ helper_state_json.manual.t }}"
  1253.                               },
  1254.                               "t": "{{ as_timestamp(now()) | round(0) }}"
  1255.                             }
  1256.                           }
  1257.                         },
  1258.                         {
  1259.                           "sequence": [
  1260.                             {
  1261.                               "repeat": {
  1262.                                 "for_each": "{{ blind_entities | list }}",
  1263.                                 "sequence": [
  1264.                                   {
  1265.                                     "choose": [
  1266.                                       {
  1267.                                         "conditions": [
  1268.                                           "{{ not prevent_default_cover_actions }}",
  1269.                                           "{{ target_position | default(101)  == 0 }}"
  1270.                                         ],
  1271.                                         "sequence": [
  1272.                                           {
  1273.                                             "alias": "Close Cover",
  1274.                                             "target": {
  1275.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1276.                                             },
  1277.                                             "action": "cover.close_cover"
  1278.                                           }
  1279.                                         ]
  1280.                                       },
  1281.                                       {
  1282.                                         "conditions": [
  1283.                                           "{{ not prevent_default_cover_actions }}",
  1284.                                           "{{ target_position | default(101) == 100 }}"
  1285.                                         ],
  1286.                                         "sequence": [
  1287.                                           {
  1288.                                             "alias": "Open Cover",
  1289.                                             "target": {
  1290.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1291.                                             },
  1292.                                             "action": "cover.open_cover"
  1293.                                           }
  1294.                                         ]
  1295.                                       },
  1296.                                       {
  1297.                                         "conditions": [
  1298.                                           "{{ not prevent_default_cover_actions }}",
  1299.                                           "{{ target_position | default(101) not in [0, 100] }}"
  1300.                                         ],
  1301.                                         "sequence": [
  1302.                                           {
  1303.                                             "alias": "Moving the cover to target position",
  1304.                                             "data": {
  1305.                                               "position": "{{ target_position | default(101) }}"
  1306.                                             },
  1307.                                             "target": {
  1308.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1309.                                             },
  1310.                                             "action": "cover.set_cover_position"
  1311.                                           }
  1312.                                         ]
  1313.                                       }
  1314.                                     ]
  1315.                                   },
  1316.                                   {
  1317.                                     "delay": {
  1318.                                       "seconds": "{{ (range(1, 3) | random | int) }}"
  1319.                                     }
  1320.                                   }
  1321.                                 ]
  1322.                               }
  1323.                             }
  1324.                           ]
  1325.                         },
  1326.                         {
  1327.                           "sequence": [
  1328.                             {
  1329.                               "if": [
  1330.                                 "{{ not prevent_default_cover_actions }}",
  1331.                                 "{{ is_cover_tilt_enabled_and_possible }}",
  1332.                                 "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  1333.                               ],
  1334.                               "then": [
  1335.                                 {
  1336.                                   "repeat": {
  1337.                                     "for_each": "{{ blind_entities | list }}",
  1338.                                     "sequence": [
  1339.                                       {
  1340.                                         "if": [
  1341.                                           "{{ tilt_first | default(false) }}"
  1342.                                         ],
  1343.                                         "then": [
  1344.                                           {
  1345.                                             "alias": "Reset Tilt",
  1346.                                             "data": {
  1347.                                               "tilt_position": 0
  1348.                                             },
  1349.                                             "target": {
  1350.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1351.                                             },
  1352.                                             "action": "cover.set_cover_tilt_position"
  1353.                                           },
  1354.                                           {
  1355.                                             "delay": {
  1356.                                               "seconds": 0
  1357.                                             }
  1358.                                           }
  1359.                                         ]
  1360.                                       },
  1361.                                       {
  1362.                                         "alias": "Tilt Delay",
  1363.                                         "delay": {
  1364.                                           "seconds": 0
  1365.                                         }
  1366.                                       },
  1367.                                       {
  1368.                                         "alias": "Moving the cover to tilt position",
  1369.                                         "data": {
  1370.                                           "tilt_position": "{{ target_tilt_position | default(101) }}"
  1371.                                         },
  1372.                                         "target": {
  1373.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1374.                                         },
  1375.                                         "action": "cover.set_cover_tilt_position"
  1376.                                       },
  1377.                                       {
  1378.                                         "delay": {
  1379.                                           "seconds": "{{ (range(1, 3) | random | int) }}"
  1380.                                         }
  1381.                                       }
  1382.                                     ]
  1383.                                   }
  1384.                                 }
  1385.                               ]
  1386.                             }
  1387.                           ]
  1388.                         },
  1389.                         {
  1390.                           "if": [
  1391.                             "{{ is_status_helper_enabled }}"
  1392.                           ],
  1393.                           "then": [
  1394.                             {
  1395.                               "alias": "Update cover status helper",
  1396.                               "data": {
  1397.                                 "entity_id": "input_text.cover_status_helper_ankleide",
  1398.                                 "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  1399.                               },
  1400.                               "action": "input_text.set_value"
  1401.                             }
  1402.                           ]
  1403.                         },
  1404.                         {
  1405.                           "choose": [],
  1406.                           "default": []
  1407.                         }
  1408.                       ]
  1409.                     },
  1410.                     {
  1411.                       "alias": "Normal opening of the cover",
  1412.                       "conditions": [
  1413.                         "{{ not in_shading_position }}",
  1414.                         {
  1415.                           "or": [
  1416.                             "{{ is_status_helper_enabled and not is_helper_open }}",
  1417.                             "{{ not in_open_position }}"
  1418.                           ]
  1419.                         }
  1420.                       ],
  1421.                       "sequence": [
  1422.                         {
  1423.                           "choose": [],
  1424.                           "default": []
  1425.                         },
  1426.                         {
  1427.                           "variables": {
  1428.                             "target_position": 100,
  1429.                             "target_tilt_position": "{{ open_tilt_position | int }}",
  1430.                             "update_values": {
  1431.                               "open": {
  1432.                                 "a": 1,
  1433.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  1434.                               },
  1435.                               "close": {
  1436.                                 "a": 0,
  1437.                                 "t": "{{ helper_state_json.close.t }}"
  1438.                               },
  1439.                               "shading": {
  1440.                                 "a": 0,
  1441.                                 "t": "{{ helper_state_json.shading.t }}",
  1442.                                 "p": 0,
  1443.                                 "q": 0
  1444.                               },
  1445.                               "vpart": {
  1446.                                 "a": 0,
  1447.                                 "t": "{{ helper_state_json.vpart.t }}"
  1448.                               },
  1449.                               "vfull": {
  1450.                                 "a": 0,
  1451.                                 "t": "{{ helper_state_json.vfull.t }}"
  1452.                               },
  1453.                               "manual": {
  1454.                                 "a": 0,
  1455.                                 "t": "{{ helper_state_json.manual.t }}"
  1456.                               },
  1457.                               "t": "{{ as_timestamp(now()) | round(0) }}"
  1458.                             }
  1459.                           }
  1460.                         },
  1461.                         {
  1462.                           "sequence": [
  1463.                             {
  1464.                               "repeat": {
  1465.                                 "for_each": "{{ blind_entities | list }}",
  1466.                                 "sequence": [
  1467.                                   {
  1468.                                     "choose": [
  1469.                                       {
  1470.                                         "conditions": [
  1471.                                           "{{ not prevent_default_cover_actions }}",
  1472.                                           "{{ target_position | default(101)  == 0 }}"
  1473.                                         ],
  1474.                                         "sequence": [
  1475.                                           {
  1476.                                             "alias": "Close Cover",
  1477.                                             "target": {
  1478.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1479.                                             },
  1480.                                             "action": "cover.close_cover"
  1481.                                           }
  1482.                                         ]
  1483.                                       },
  1484.                                       {
  1485.                                         "conditions": [
  1486.                                           "{{ not prevent_default_cover_actions }}",
  1487.                                           "{{ target_position | default(101) == 100 }}"
  1488.                                         ],
  1489.                                         "sequence": [
  1490.                                           {
  1491.                                             "alias": "Open Cover",
  1492.                                             "target": {
  1493.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1494.                                             },
  1495.                                             "action": "cover.open_cover"
  1496.                                           }
  1497.                                         ]
  1498.                                       },
  1499.                                       {
  1500.                                         "conditions": [
  1501.                                           "{{ not prevent_default_cover_actions }}",
  1502.                                           "{{ target_position | default(101) not in [0, 100] }}"
  1503.                                         ],
  1504.                                         "sequence": [
  1505.                                           {
  1506.                                             "alias": "Moving the cover to target position",
  1507.                                             "data": {
  1508.                                               "position": "{{ target_position | default(101) }}"
  1509.                                             },
  1510.                                             "target": {
  1511.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1512.                                             },
  1513.                                             "action": "cover.set_cover_position"
  1514.                                           }
  1515.                                         ]
  1516.                                       }
  1517.                                     ]
  1518.                                   },
  1519.                                   {
  1520.                                     "delay": {
  1521.                                       "seconds": "{{ (range(1, 3) | random | int) }}"
  1522.                                     }
  1523.                                   }
  1524.                                 ]
  1525.                               }
  1526.                             }
  1527.                           ]
  1528.                         },
  1529.                         {
  1530.                           "sequence": [
  1531.                             {
  1532.                               "if": [
  1533.                                 "{{ not prevent_default_cover_actions }}",
  1534.                                 "{{ is_cover_tilt_enabled_and_possible }}",
  1535.                                 "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  1536.                               ],
  1537.                               "then": [
  1538.                                 {
  1539.                                   "repeat": {
  1540.                                     "for_each": "{{ blind_entities | list }}",
  1541.                                     "sequence": [
  1542.                                       {
  1543.                                         "if": [
  1544.                                           "{{ tilt_first | default(false) }}"
  1545.                                         ],
  1546.                                         "then": [
  1547.                                           {
  1548.                                             "alias": "Reset Tilt",
  1549.                                             "data": {
  1550.                                               "tilt_position": 0
  1551.                                             },
  1552.                                             "target": {
  1553.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1554.                                             },
  1555.                                             "action": "cover.set_cover_tilt_position"
  1556.                                           },
  1557.                                           {
  1558.                                             "delay": {
  1559.                                               "seconds": 0
  1560.                                             }
  1561.                                           }
  1562.                                         ]
  1563.                                       },
  1564.                                       {
  1565.                                         "alias": "Tilt Delay",
  1566.                                         "delay": {
  1567.                                           "seconds": 0
  1568.                                         }
  1569.                                       },
  1570.                                       {
  1571.                                         "alias": "Moving the cover to tilt position",
  1572.                                         "data": {
  1573.                                           "tilt_position": "{{ target_tilt_position | default(101) }}"
  1574.                                         },
  1575.                                         "target": {
  1576.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1577.                                         },
  1578.                                         "action": "cover.set_cover_tilt_position"
  1579.                                       },
  1580.                                       {
  1581.                                         "delay": {
  1582.                                           "seconds": "{{ (range(1, 3) | random | int) }}"
  1583.                                         }
  1584.                                       }
  1585.                                     ]
  1586.                                   }
  1587.                                 }
  1588.                               ]
  1589.                             }
  1590.                           ]
  1591.                         },
  1592.                         {
  1593.                           "if": [
  1594.                             "{{ is_status_helper_enabled }}"
  1595.                           ],
  1596.                           "then": [
  1597.                             {
  1598.                               "alias": "Update cover status helper",
  1599.                               "data": {
  1600.                                 "entity_id": "input_text.cover_status_helper_ankleide",
  1601.                                 "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  1602.                               },
  1603.                               "action": "input_text.set_value"
  1604.                             }
  1605.                           ]
  1606.                         },
  1607.                         {
  1608.                           "choose": [],
  1609.                           "default": []
  1610.                         }
  1611.                       ]
  1612.                     }
  1613.                   ]
  1614.                 }
  1615.               ]
  1616.             },
  1617.             {
  1618.               "alias": "Check for closing cover",
  1619.               "conditions": [
  1620.                 "{{ is_down_enabled }}",
  1621.                 "{{ trigger.id is defined }}",
  1622.                 "{{ trigger.id | regex_match('^(t_close)') }}",
  1623.                 {
  1624.                   "condition": []
  1625.                 },
  1626.                 {
  1627.                   "and": [
  1628.                     "{{ auto_up_force_disabled }}",
  1629.                     "{{ auto_ventilate_force_disabled }}",
  1630.                     "{{ auto_shading_start_force_disabled }}"
  1631.                   ]
  1632.                 },
  1633.                 {
  1634.                   "or": [
  1635.                     "{{ is_status_helper_enabled and not is_helper_closed }}",
  1636.                     "{{ not in_close_position }}"
  1637.                   ]
  1638.                 },
  1639.                 "{{ not (is_status_helper_enabled and is_helper_manual and override_closing_after_manual) }}",
  1640.                 {
  1641.                   "or": [
  1642.                     "{{ not is_status_helper_enabled }}",
  1643.                     "{{ not prevent_closing_multiple_times }}",
  1644.                     "{{ is_status_helper_enabled and prevent_closing_multiple_times and (ts_helper_closed < today_at(time_down_early_today) | as_timestamp) }}"
  1645.                   ]
  1646.                 },
  1647.                 {
  1648.                   "or": [
  1649.                     {
  1650.                       "and": [
  1651.                         "{{ is_time_control_disabled }}"
  1652.                       ]
  1653.                     },
  1654.                     {
  1655.                       "and": [
  1656.                         "{{ is_time_field_enabled }}",
  1657.                         "{{ now() >= today_at(time_down_late_today) }}"
  1658.                       ]
  1659.                     },
  1660.                     {
  1661.                       "and": [
  1662.                         "{{ is_schedule_helper_enabled }}",
  1663.                         "{{ time_schedule_helper != [] }}",
  1664.                         "{{ is_state(time_schedule_helper, 'off') }}",
  1665.                         "{{ trigger.id == 't_close_3' }}"
  1666.                       ]
  1667.                     },
  1668.                     {
  1669.                       "and": [
  1670.                         {
  1671.                           "or": [
  1672.                             {
  1673.                               "and": [
  1674.                                 "{{ is_time_control_disabled }}"
  1675.                               ]
  1676.                             },
  1677.                             {
  1678.                               "and": [
  1679.                                 "{{ is_time_field_enabled }}",
  1680.                                 "{{ now() >= today_at(time_down_early_today) }}",
  1681.                                 "{{ now() <= today_at(time_down_late_today) + timedelta(seconds = 5) }}"
  1682.                               ]
  1683.                             },
  1684.                             {
  1685.                               "and": [
  1686.                                 "{{ is_schedule_helper_enabled }}",
  1687.                                 "{{ time_schedule_helper != [] }}",
  1688.                                 "{{ is_state(time_schedule_helper, 'on') }}",
  1689.                                 "{{ now() >= today_at([time_down_early, time_down_early_non_workday] | min) - timedelta(seconds = 5) }}",
  1690.                                 "{{ now() <= today_at([time_down_late, time_down_late_non_workday] | max) + timedelta(seconds = 5) }}"
  1691.                               ]
  1692.                             }
  1693.                           ]
  1694.                         },
  1695.                         {
  1696.                           "or": [
  1697.                             {
  1698.                               "or": [
  1699.                                 "{{ is_brightness_enabled and default_brightness_sensor == [] }}",
  1700.                                 "{{ is_brightness_enabled and default_brightness_sensor != [] and (states(default_brightness_sensor) | float(default=brightness_down) < brightness_down) }}"
  1701.                               ]
  1702.                             },
  1703.                             {
  1704.                               "or": [
  1705.                                 "{{ is_sun_elevation_enabled and default_sun_sensor == [] }}",
  1706.                                 "{{ is_sun_elevation_enabled and default_sun_sensor != [] and (current_sun_elevation | float(default=sun_elevation_down) < sun_elevation_down) }}"
  1707.                               ]
  1708.                             }
  1709.                           ]
  1710.                         }
  1711.                       ]
  1712.                     },
  1713.                     {
  1714.                       "and": [
  1715.                         "{{ trigger.id == 't_close_6' }}",
  1716.                         "{{ resident_sensor != [] }}",
  1717.                         "{{ states(resident_sensor) in ['true', 'on'] }}",
  1718.                         "{{ resident_closing_enabled }}"
  1719.                       ]
  1720.                     }
  1721.                   ]
  1722.                 }
  1723.               ],
  1724.               "sequence": [
  1725.                 {
  1726.                   "choose": [
  1727.                     {
  1728.                       "alias": "Lockout protection when closing",
  1729.                       "conditions": [
  1730.                         "{{ is_ventilation_enabled }}",
  1731.                         "{{ is_status_helper_enabled }}",
  1732.                         {
  1733.                           "or": [
  1734.                             {
  1735.                               "and": [
  1736.                                 "{{ contact_window_opened != [] }}",
  1737.                                 "{{ states(contact_window_opened) in ['true', 'on'] }}"
  1738.                               ]
  1739.                             },
  1740.                             {
  1741.                               "and": [
  1742.                                 "{{ lockout_tilted_when_closing }}",
  1743.                                 "{{ contact_window_tilted != [] }}",
  1744.                                 "{{ states(contact_window_tilted) in ['true', 'on'] }}"
  1745.                               ]
  1746.                             }
  1747.                           ]
  1748.                         }
  1749.                       ],
  1750.                       "sequence": [
  1751.                         {
  1752.                           "variables": {
  1753.                             "update_values": {
  1754.                               "open": {
  1755.                                 "a": 0,
  1756.                                 "t": "{{ helper_state_json.open.t }}"
  1757.                               },
  1758.                               "close": {
  1759.                                 "a": 1,
  1760.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  1761.                               },
  1762.                               "shading": {
  1763.                                 "a": 0,
  1764.                                 "t": "{{ helper_state_json.shading.t }}",
  1765.                                 "p": 0,
  1766.                                 "q": 0
  1767.                               },
  1768.                               "vpart": {
  1769.                                 "a": 0,
  1770.                                 "t": "{{ helper_state_json.vpart.t }}"
  1771.                               },
  1772.                               "vfull": {
  1773.                                 "a": 1,
  1774.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  1775.                               },
  1776.                               "manual": {
  1777.                                 "a": 0,
  1778.                                 "t": "{{ helper_state_json.manual.t }}"
  1779.                               },
  1780.                               "t": "{{ as_timestamp(now()) | round(0) }}"
  1781.                             }
  1782.                           }
  1783.                         },
  1784.                         {
  1785.                           "if": [
  1786.                             "{{ is_status_helper_enabled }}"
  1787.                           ],
  1788.                           "then": [
  1789.                             {
  1790.                               "alias": "Update cover status helper",
  1791.                               "data": {
  1792.                                 "entity_id": "input_text.cover_status_helper_ankleide",
  1793.                                 "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  1794.                               },
  1795.                               "action": "input_text.set_value"
  1796.                             }
  1797.                           ]
  1798.                         }
  1799.                       ]
  1800.                     },
  1801.                     {
  1802.                       "alias": "Window tilted. No lockout. Move to ventilation position instead of closing",
  1803.                       "conditions": [
  1804.                         "{{ is_ventilation_enabled }}",
  1805.                         "{{ is_status_helper_enabled }}",
  1806.                         "{{ contact_window_tilted != [] }}",
  1807.                         "{{ states(contact_window_tilted) in ['true', 'on'] }}",
  1808.                         "{{ not lockout_tilted_when_closing }}",
  1809.                         {
  1810.                           "or": [
  1811.                             "{{ contact_window_opened == [] }}",
  1812.                             "{{ states(contact_window_opened) in ['false', 'off'] }}"
  1813.                           ]
  1814.                         }
  1815.                       ],
  1816.                       "sequence": [
  1817.                         {
  1818.                           "choose": [],
  1819.                           "default": []
  1820.                         },
  1821.                         {
  1822.                           "delay": {
  1823.                             "seconds": "{{ range(drive_delay_fix|int(0), drive_delay_fix|int(0) + drive_delay_random|int(0) +1) | random }}"
  1824.                           }
  1825.                         },
  1826.                         {
  1827.                           "variables": {
  1828.                             "target_position": 99,
  1829.                             "target_tilt_position": 50,
  1830.                             "update_values": {
  1831.                               "open": {
  1832.                                 "a": 0,
  1833.                                 "t": "{{ helper_state_json.open.t }}"
  1834.                               },
  1835.                               "close": {
  1836.                                 "a": 1,
  1837.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  1838.                               },
  1839.                               "shading": {
  1840.                                 "a": 0,
  1841.                                 "t": "{{ helper_state_json.shading.t }}",
  1842.                                 "p": 0,
  1843.                                 "q": 0
  1844.                               },
  1845.                               "vpart": {
  1846.                                 "a": 1,
  1847.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  1848.                               },
  1849.                               "vfull": {
  1850.                                 "a": 0,
  1851.                                 "t": "{{ helper_state_json.vfull.t }}"
  1852.                               },
  1853.                               "manual": {
  1854.                                 "a": 0,
  1855.                                 "t": "{{ helper_state_json.manual.t }}"
  1856.                               },
  1857.                               "t": "{{ as_timestamp(now()) | round(0) }}"
  1858.                             }
  1859.                           }
  1860.                         },
  1861.                         {
  1862.                           "sequence": [
  1863.                             {
  1864.                               "repeat": {
  1865.                                 "for_each": "{{ blind_entities | list }}",
  1866.                                 "sequence": [
  1867.                                   {
  1868.                                     "choose": [
  1869.                                       {
  1870.                                         "conditions": [
  1871.                                           "{{ not prevent_default_cover_actions }}",
  1872.                                           "{{ target_position | default(101)  == 0 }}"
  1873.                                         ],
  1874.                                         "sequence": [
  1875.                                           {
  1876.                                             "alias": "Close Cover",
  1877.                                             "target": {
  1878.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1879.                                             },
  1880.                                             "action": "cover.close_cover"
  1881.                                           }
  1882.                                         ]
  1883.                                       },
  1884.                                       {
  1885.                                         "conditions": [
  1886.                                           "{{ not prevent_default_cover_actions }}",
  1887.                                           "{{ target_position | default(101) == 100 }}"
  1888.                                         ],
  1889.                                         "sequence": [
  1890.                                           {
  1891.                                             "alias": "Open Cover",
  1892.                                             "target": {
  1893.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1894.                                             },
  1895.                                             "action": "cover.open_cover"
  1896.                                           }
  1897.                                         ]
  1898.                                       },
  1899.                                       {
  1900.                                         "conditions": [
  1901.                                           "{{ not prevent_default_cover_actions }}",
  1902.                                           "{{ target_position | default(101) not in [0, 100] }}"
  1903.                                         ],
  1904.                                         "sequence": [
  1905.                                           {
  1906.                                             "alias": "Moving the cover to target position",
  1907.                                             "data": {
  1908.                                               "position": "{{ target_position | default(101) }}"
  1909.                                             },
  1910.                                             "target": {
  1911.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1912.                                             },
  1913.                                             "action": "cover.set_cover_position"
  1914.                                           }
  1915.                                         ]
  1916.                                       }
  1917.                                     ]
  1918.                                   },
  1919.                                   {
  1920.                                     "delay": {
  1921.                                       "seconds": "{{ (range(1, 3) | random | int) }}"
  1922.                                     }
  1923.                                   }
  1924.                                 ]
  1925.                               }
  1926.                             }
  1927.                           ]
  1928.                         },
  1929.                         {
  1930.                           "sequence": [
  1931.                             {
  1932.                               "if": [
  1933.                                 "{{ not prevent_default_cover_actions }}",
  1934.                                 "{{ is_cover_tilt_enabled_and_possible }}",
  1935.                                 "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  1936.                               ],
  1937.                               "then": [
  1938.                                 {
  1939.                                   "repeat": {
  1940.                                     "for_each": "{{ blind_entities | list }}",
  1941.                                     "sequence": [
  1942.                                       {
  1943.                                         "if": [
  1944.                                           "{{ tilt_first | default(false) }}"
  1945.                                         ],
  1946.                                         "then": [
  1947.                                           {
  1948.                                             "alias": "Reset Tilt",
  1949.                                             "data": {
  1950.                                               "tilt_position": 0
  1951.                                             },
  1952.                                             "target": {
  1953.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1954.                                             },
  1955.                                             "action": "cover.set_cover_tilt_position"
  1956.                                           },
  1957.                                           {
  1958.                                             "delay": {
  1959.                                               "seconds": 0
  1960.                                             }
  1961.                                           }
  1962.                                         ]
  1963.                                       },
  1964.                                       {
  1965.                                         "alias": "Tilt Delay",
  1966.                                         "delay": {
  1967.                                           "seconds": 0
  1968.                                         }
  1969.                                       },
  1970.                                       {
  1971.                                         "alias": "Moving the cover to tilt position",
  1972.                                         "data": {
  1973.                                           "tilt_position": "{{ target_tilt_position | default(101) }}"
  1974.                                         },
  1975.                                         "target": {
  1976.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1977.                                         },
  1978.                                         "action": "cover.set_cover_tilt_position"
  1979.                                       },
  1980.                                       {
  1981.                                         "delay": {
  1982.                                           "seconds": "{{ (range(1, 3) | random | int) }}"
  1983.                                         }
  1984.                                       }
  1985.                                     ]
  1986.                                   }
  1987.                                 }
  1988.                               ]
  1989.                             }
  1990.                           ]
  1991.                         },
  1992.                         {
  1993.                           "if": [
  1994.                             "{{ is_status_helper_enabled }}"
  1995.                           ],
  1996.                           "then": [
  1997.                             {
  1998.                               "alias": "Update cover status helper",
  1999.                               "data": {
  2000.                                 "entity_id": "input_text.cover_status_helper_ankleide",
  2001.                                 "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2002.                               },
  2003.                               "action": "input_text.set_value"
  2004.                             }
  2005.                           ]
  2006.                         },
  2007.                         {
  2008.                           "choose": [],
  2009.                           "default": []
  2010.                         }
  2011.                       ]
  2012.                     },
  2013.                     {
  2014.                       "alias": "Only status change if cover is already 'near' the close position",
  2015.                       "conditions": [
  2016.                         {
  2017.                           "or": [
  2018.                             {
  2019.                               "and": [
  2020.                                 "{{ is_status_helper_enabled }}",
  2021.                                 "{{ prevent_lowering_when_closing_if_shaded }}",
  2022.                                 "{{ is_helper_shaded }}",
  2023.                                 "{{ close_position > shading_position }}"
  2024.                               ]
  2025.                             },
  2026.                             {
  2027.                               "and": [
  2028.                                 "{{ prevent_lowering_when_closing_if_shaded }}",
  2029.                                 "{{ in_shading_position }}",
  2030.                                 "{{ close_position > shading_position }}"
  2031.                               ]
  2032.                             },
  2033.                             {
  2034.                               "and": [
  2035.                                 "{{ prevent_higher_position_closing }}",
  2036.                                 "{{ (current_position <= close_position) }}"
  2037.                               ]
  2038.                             }
  2039.                           ]
  2040.                         }
  2041.                       ],
  2042.                       "sequence": [
  2043.                         {
  2044.                           "variables": {
  2045.                             "update_values": {
  2046.                               "open": {
  2047.                                 "a": 0,
  2048.                                 "t": "{{ helper_state_json.open.t }}"
  2049.                               },
  2050.                               "close": {
  2051.                                 "a": 1,
  2052.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  2053.                               },
  2054.                               "shading": {
  2055.                                 "a": 0,
  2056.                                 "t": "{{ helper_state_json.shading.t }}",
  2057.                                 "p": 0,
  2058.                                 "q": 0
  2059.                               },
  2060.                               "vpart": {
  2061.                                 "a": 0,
  2062.                                 "t": "{{ helper_state_json.vpart.t }}"
  2063.                               },
  2064.                               "vfull": {
  2065.                                 "a": 0,
  2066.                                 "t": "{{ helper_state_json.vfull.t }}"
  2067.                               },
  2068.                               "t": "{{ as_timestamp(now()) | round(0) }}"
  2069.                             }
  2070.                           }
  2071.                         },
  2072.                         {
  2073.                           "if": [
  2074.                             "{{ is_status_helper_enabled }}"
  2075.                           ],
  2076.                           "then": [
  2077.                             {
  2078.                               "alias": "Update cover status helper",
  2079.                               "data": {
  2080.                                 "entity_id": "input_text.cover_status_helper_ankleide",
  2081.                                 "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2082.                               },
  2083.                               "action": "input_text.set_value"
  2084.                             }
  2085.                           ]
  2086.                         }
  2087.                       ]
  2088.                     }
  2089.                   ],
  2090.                   "default": [
  2091.                     {
  2092.                       "choose": [],
  2093.                       "default": []
  2094.                     },
  2095.                     {
  2096.                       "alias": "Normal closing of the cover",
  2097.                       "delay": {
  2098.                         "seconds": "{{ range(drive_delay_fix|int(0), drive_delay_fix|int(0) + drive_delay_random|int(0) +1) | random }}"
  2099.                       }
  2100.                     },
  2101.                     {
  2102.                       "variables": {
  2103.                         "target_position": 0,
  2104.                         "target_tilt_position": 50,
  2105.                         "update_values": {
  2106.                           "open": {
  2107.                             "a": 0,
  2108.                             "t": "{{ helper_state_json.open.t }}"
  2109.                           },
  2110.                           "close": {
  2111.                             "a": 1,
  2112.                             "t": "{{ as_timestamp(now()) | round(0) }}"
  2113.                           },
  2114.                           "shading": {
  2115.                             "a": 0,
  2116.                             "t": "{{ helper_state_json.shading.t }}",
  2117.                             "p": 0,
  2118.                             "q": 0
  2119.                           },
  2120.                           "vpart": {
  2121.                             "a": 0,
  2122.                             "t": "{{ helper_state_json.vpart.t }}"
  2123.                           },
  2124.                           "vfull": {
  2125.                             "a": 0,
  2126.                             "t": "{{ helper_state_json.vfull.t }}"
  2127.                           },
  2128.                           "manual": {
  2129.                             "a": 0,
  2130.                             "t": "{{ helper_state_json.manual.t }}"
  2131.                           },
  2132.                           "t": "{{ as_timestamp(now()) | round(0) }}"
  2133.                         }
  2134.                       }
  2135.                     },
  2136.                     {
  2137.                       "sequence": [
  2138.                         {
  2139.                           "repeat": {
  2140.                             "for_each": "{{ blind_entities | list }}",
  2141.                             "sequence": [
  2142.                               {
  2143.                                 "choose": [
  2144.                                   {
  2145.                                     "conditions": [
  2146.                                       "{{ not prevent_default_cover_actions }}",
  2147.                                       "{{ target_position | default(101)  == 0 }}"
  2148.                                     ],
  2149.                                     "sequence": [
  2150.                                       {
  2151.                                         "alias": "Close Cover",
  2152.                                         "target": {
  2153.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2154.                                         },
  2155.                                         "action": "cover.close_cover"
  2156.                                       }
  2157.                                     ]
  2158.                                   },
  2159.                                   {
  2160.                                     "conditions": [
  2161.                                       "{{ not prevent_default_cover_actions }}",
  2162.                                       "{{ target_position | default(101) == 100 }}"
  2163.                                     ],
  2164.                                     "sequence": [
  2165.                                       {
  2166.                                         "alias": "Open Cover",
  2167.                                         "target": {
  2168.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2169.                                         },
  2170.                                         "action": "cover.open_cover"
  2171.                                       }
  2172.                                     ]
  2173.                                   },
  2174.                                   {
  2175.                                     "conditions": [
  2176.                                       "{{ not prevent_default_cover_actions }}",
  2177.                                       "{{ target_position | default(101) not in [0, 100] }}"
  2178.                                     ],
  2179.                                     "sequence": [
  2180.                                       {
  2181.                                         "alias": "Moving the cover to target position",
  2182.                                         "data": {
  2183.                                           "position": "{{ target_position | default(101) }}"
  2184.                                         },
  2185.                                         "target": {
  2186.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2187.                                         },
  2188.                                         "action": "cover.set_cover_position"
  2189.                                       }
  2190.                                     ]
  2191.                                   }
  2192.                                 ]
  2193.                               },
  2194.                               {
  2195.                                 "delay": {
  2196.                                   "seconds": "{{ (range(1, 3) | random | int) }}"
  2197.                                 }
  2198.                               }
  2199.                             ]
  2200.                           }
  2201.                         }
  2202.                       ]
  2203.                     },
  2204.                     {
  2205.                       "sequence": [
  2206.                         {
  2207.                           "if": [
  2208.                             "{{ not prevent_default_cover_actions }}",
  2209.                             "{{ is_cover_tilt_enabled_and_possible }}",
  2210.                             "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  2211.                           ],
  2212.                           "then": [
  2213.                             {
  2214.                               "repeat": {
  2215.                                 "for_each": "{{ blind_entities | list }}",
  2216.                                 "sequence": [
  2217.                                   {
  2218.                                     "if": [
  2219.                                       "{{ tilt_first | default(false) }}"
  2220.                                     ],
  2221.                                     "then": [
  2222.                                       {
  2223.                                         "alias": "Reset Tilt",
  2224.                                         "data": {
  2225.                                           "tilt_position": 0
  2226.                                         },
  2227.                                         "target": {
  2228.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2229.                                         },
  2230.                                         "action": "cover.set_cover_tilt_position"
  2231.                                       },
  2232.                                       {
  2233.                                         "delay": {
  2234.                                           "seconds": 0
  2235.                                         }
  2236.                                       }
  2237.                                     ]
  2238.                                   },
  2239.                                   {
  2240.                                     "alias": "Tilt Delay",
  2241.                                     "delay": {
  2242.                                       "seconds": 0
  2243.                                     }
  2244.                                   },
  2245.                                   {
  2246.                                     "alias": "Moving the cover to tilt position",
  2247.                                     "data": {
  2248.                                       "tilt_position": "{{ target_tilt_position | default(101) }}"
  2249.                                     },
  2250.                                     "target": {
  2251.                                       "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2252.                                     },
  2253.                                     "action": "cover.set_cover_tilt_position"
  2254.                                   },
  2255.                                   {
  2256.                                     "delay": {
  2257.                                       "seconds": "{{ (range(1, 3) | random | int) }}"
  2258.                                     }
  2259.                                   }
  2260.                                 ]
  2261.                               }
  2262.                             }
  2263.                           ]
  2264.                         }
  2265.                       ]
  2266.                     },
  2267.                     {
  2268.                       "if": [
  2269.                         "{{ is_status_helper_enabled }}"
  2270.                       ],
  2271.                       "then": [
  2272.                         {
  2273.                           "alias": "Update cover status helper",
  2274.                           "data": {
  2275.                             "entity_id": "input_text.cover_status_helper_ankleide",
  2276.                             "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2277.                           },
  2278.                           "action": "input_text.set_value"
  2279.                         }
  2280.                       ]
  2281.                     },
  2282.                     {
  2283.                       "choose": [],
  2284.                       "default": []
  2285.                     }
  2286.                   ]
  2287.                 }
  2288.               ]
  2289.             },
  2290.             {
  2291.               "alias": "Check for shading start",
  2292.               "conditions": [
  2293.                 "{{ is_shading_enabled }}",
  2294.                 "{{ trigger.id is defined }}",
  2295.                 "{{ trigger.id | regex_match('^(t_shading_start|t_open_1|t_open_3)') }}",
  2296.                 "{{ is_status_helper_enabled }}",
  2297.                 {
  2298.                   "condition": []
  2299.                 },
  2300.                 {
  2301.                   "and": [
  2302.                     "{{ auto_up_force_disabled }}",
  2303.                     "{{ auto_down_force_disabled }}",
  2304.                     "{{ auto_ventilate_force_disabled }}"
  2305.                   ]
  2306.                 },
  2307.                 {
  2308.                   "or": [
  2309.                     "{{ not is_helper_shaded }}",
  2310.                     "{{ not (is_helper_vent_partial or is_helper_vent_full) }}"
  2311.                   ]
  2312.                 },
  2313.                 {
  2314.                   "or": [
  2315.                     {
  2316.                       "and": [
  2317.                         "{{ not is_cover_tilt_enabled_and_possible }}",
  2318.                         "{{ not in_shading_position }}"
  2319.                       ]
  2320.                     },
  2321.                     {
  2322.                       "and": [
  2323.                         "{{ is_cover_tilt_enabled_and_possible }}",
  2324.                         "{{ current_position >= shading_position }}"
  2325.                       ]
  2326.                     }
  2327.                   ]
  2328.                 },
  2329.                 "{{ not (is_helper_manual and override_shading_after_manual) }}",
  2330.                 {
  2331.                   "or": [
  2332.                     "{{ not prevent_shading_multiple_times }}",
  2333.                     "{{ prevent_shading_multiple_times and (now().day != ts_helper_shaded|timestamp_custom('%-d') | int) }}",
  2334.                     "{{ trigger.id | regex_match('^(t_shading_start_execution)') }}"
  2335.                   ]
  2336.                 }
  2337.               ],
  2338.               "sequence": [
  2339.                 {
  2340.                   "if": [
  2341.                     "{{ current_sun_azimuth > shading_azimuth_start and current_sun_azimuth < shading_azimuth_end }}",
  2342.                     "{{ current_sun_elevation > shading_elevation_min and current_sun_elevation < shading_elevation_max }}",
  2343.                     {
  2344.                       "or": [
  2345.                         "{{ shading_brightness_sensor == [] }}",
  2346.                         "{{ states(shading_brightness_sensor) | float(default=shading_sun_brightness_start) > shading_sun_brightness_start }}"
  2347.                       ]
  2348.                     },
  2349.                     {
  2350.                       "or": [
  2351.                         "{{ shading_temperatur_sensor1 == [] }}",
  2352.                         "{{ states(shading_temperatur_sensor1) | float(default=shading_min_temperatur1) > shading_min_temperatur1 }}"
  2353.                       ]
  2354.                     },
  2355.                     {
  2356.                       "or": [
  2357.                         "{{ shading_temperatur_sensor2 == [] }}",
  2358.                         "{{ states(shading_temperatur_sensor2) | float(default=shading_min_temperatur2) > shading_min_temperatur2 }}"
  2359.                       ]
  2360.                     },
  2361.                     {
  2362.                       "or": [
  2363.                         "{{ shading_forecast_sensor == [] }}",
  2364.                         "{{ shading_forecast_temp == [] }}",
  2365.                         {
  2366.                           "and": [
  2367.                             "{{ shading_forecast_sensor.startswith('sensor.') }}",
  2368.                             "{{ states(shading_forecast_sensor) | float(default=shading_forecast_temp - 1) > shading_forecast_temp }}"
  2369.                           ]
  2370.                         },
  2371.                         {
  2372.                           "and": [
  2373.                             "{{ shading_forecast_sensor.startswith('weather.') }}",
  2374.                             "{{ prevent_forecast_service }}",
  2375.                             "{{ state_attr(shading_forecast_sensor, 'temperature') | float(default=shading_forecast_temp - 1) > shading_forecast_temp }}"
  2376.                           ]
  2377.                         },
  2378.                         {
  2379.                           "and": [
  2380.                             "{{ shading_forecast_sensor.startswith('weather.') }}",
  2381.                             "{{ not prevent_forecast_service }}",
  2382.                             "{{ weather_forecast is defined }}",
  2383.                             "{{ weather_forecast[shading_forecast_sensor].forecast[0].temperature | float(default=shading_forecast_temp - 1) > shading_forecast_temp }}"
  2384.                           ]
  2385.                         },
  2386.                         "{{ (shading_temperatur_sensor2 != [] ) and (states(shading_temperatur_sensor2) | float(default=shading_forecast_temp) > shading_forecast_temp) }}"
  2387.                       ]
  2388.                     },
  2389.                     {
  2390.                       "or": [
  2391.                         "{{ shading_forecast_sensor == [] }}",
  2392.                         "{{ shading_weather_conditions == [] }}",
  2393.                         "{{ shading_forecast_sensor.startswith('sensor.') }}",
  2394.                         {
  2395.                           "and": [
  2396.                             "{{ shading_forecast_sensor.startswith('weather.') }}",
  2397.                             "{{ prevent_forecast_service }}",
  2398.                             "{{ states(shading_forecast_sensor) in shading_weather_conditions }}"
  2399.                           ]
  2400.                         },
  2401.                         {
  2402.                           "and": [
  2403.                             "{{ shading_forecast_sensor.startswith('weather.') }}",
  2404.                             "{{ not prevent_forecast_service }}",
  2405.                             "{{ weather_forecast is defined }}",
  2406.                             "{{ weather_forecast[shading_forecast_sensor].forecast[0].condition in shading_weather_conditions }}"
  2407.                           ]
  2408.                         }
  2409.                       ]
  2410.                     }
  2411.                   ],
  2412.                   "then": [
  2413.                     {
  2414.                       "choose": [
  2415.                         {
  2416.                           "alias": "Shading detected. Save next execution time and pending status",
  2417.                           "conditions": [
  2418.                             "{{ trigger.id | regex_match('^(t_shading_start_pending)') }}",
  2419.                             "{{ not is_helper_shading_start }}"
  2420.                           ],
  2421.                           "sequence": [
  2422.                             {
  2423.                               "variables": {
  2424.                                 "update_values": {
  2425.                                   "shading": {
  2426.                                     "a": 1,
  2427.                                     "t": "{{ as_timestamp(now()) | round(0) }}",
  2428.                                     "p": "{{ (as_timestamp(now()) | round(0) + (shading_waitingtime_start | int)) | round(0) }}",
  2429.                                     "q": 0
  2430.                                   },
  2431.                                   "t": "{{ as_timestamp(now()) | round(0) }}"
  2432.                                 }
  2433.                               }
  2434.                             },
  2435.                             {
  2436.                               "if": [
  2437.                                 "{{ is_status_helper_enabled }}"
  2438.                               ],
  2439.                               "then": [
  2440.                                 {
  2441.                                   "alias": "Update cover status helper",
  2442.                                   "data": {
  2443.                                     "entity_id": "input_text.cover_status_helper_ankleide",
  2444.                                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2445.                                   },
  2446.                                   "action": "input_text.set_value"
  2447.                                 }
  2448.                               ]
  2449.                             }
  2450.                           ]
  2451.                         },
  2452.                         {
  2453.                           "alias": "Consider lockout protection when shading starts",
  2454.                           "conditions": [
  2455.                             "{{ trigger.id | regex_match('^(t_shading_start_execution)') }}",
  2456.                             "{{ is_helper_shading_start }}",
  2457.                             "{{ is_ventilation_enabled }}",
  2458.                             {
  2459.                               "or": [
  2460.                                 {
  2461.                                   "and": [
  2462.                                     "{{ contact_window_opened != [] }}",
  2463.                                     "{{ states(contact_window_opened) in ['true', 'on'] }}"
  2464.                                   ]
  2465.                                 },
  2466.                                 {
  2467.                                   "and": [
  2468.                                     "{{ lockout_tilted_when_shading_starts }}",
  2469.                                     "{{ contact_window_tilted != [] }}",
  2470.                                     "{{ states(contact_window_tilted) in ['true', 'on'] }}"
  2471.                                   ]
  2472.                                 }
  2473.                               ]
  2474.                             }
  2475.                           ],
  2476.                           "sequence": [
  2477.                             {
  2478.                               "variables": {
  2479.                                 "update_values": {
  2480.                                   "open": {
  2481.                                     "a": 1,
  2482.                                     "t": "{{ as_timestamp(now()) | round(0) }}"
  2483.                                   },
  2484.                                   "close": {
  2485.                                     "a": 0,
  2486.                                     "t": "{{ helper_state_json.close.t }}"
  2487.                                   },
  2488.                                   "shading": {
  2489.                                     "a": 1,
  2490.                                     "t": "{{ as_timestamp(now()) | round(0) }}",
  2491.                                     "p": 0,
  2492.                                     "q": 0
  2493.                                   },
  2494.                                   "vpart": {
  2495.                                     "a": 0,
  2496.                                     "t": "{{ helper_state_json.vpart.t }}"
  2497.                                   },
  2498.                                   "vfull": {
  2499.                                     "a": 1,
  2500.                                     "t": "{{ as_timestamp(now()) | round(0) }}"
  2501.                                   },
  2502.                                   "manual": {
  2503.                                     "a": 0,
  2504.                                     "t": "{{ helper_state_json.manual.t }}"
  2505.                                   },
  2506.                                   "t": "{{ as_timestamp(now()) | round(0) }}"
  2507.                                 }
  2508.                               }
  2509.                             },
  2510.                             {
  2511.                               "if": [
  2512.                                 "{{ is_status_helper_enabled }}"
  2513.                               ],
  2514.                               "then": [
  2515.                                 {
  2516.                                   "alias": "Update cover status helper",
  2517.                                   "data": {
  2518.                                     "entity_id": "input_text.cover_status_helper_ankleide",
  2519.                                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2520.                                   },
  2521.                                   "action": "input_text.set_value"
  2522.                                 }
  2523.                               ]
  2524.                             }
  2525.                           ]
  2526.                         },
  2527.                         {
  2528.                           "alias": "Start Shading",
  2529.                           "conditions": [
  2530.                             "{{ trigger.id | regex_match('^(t_shading_start_execution)') }}",
  2531.                             "{{ is_helper_shading_start }}",
  2532.                             {
  2533.                               "or": [
  2534.                                 {
  2535.                                   "and": [
  2536.                                     "{{ not is_cover_tilt_enabled_and_possible }}",
  2537.                                     "{{ current_position > shading_position }}"
  2538.                                   ]
  2539.                                 },
  2540.                                 {
  2541.                                   "and": [
  2542.                                     "{{ is_cover_tilt_enabled_and_possible }}",
  2543.                                     "{{ current_position >= shading_position }}"
  2544.                                   ]
  2545.                                 }
  2546.                               ]
  2547.                             },
  2548.                             {
  2549.                               "or": [
  2550.                                 {
  2551.                                   "and": [
  2552.                                     "{{ is_time_control_disabled }}"
  2553.                                   ]
  2554.                                 },
  2555.                                 {
  2556.                                   "and": [
  2557.                                     "{{ is_time_field_enabled }}",
  2558.                                     "{{ now() >= today_at(time_up_early_today) }}",
  2559.                                     "{{ now() <= today_at(time_down_late_today) + timedelta(seconds = 5) }}"
  2560.                                   ]
  2561.                                 },
  2562.                                 {
  2563.                                   "and": [
  2564.                                     "{{ is_schedule_helper_enabled }}",
  2565.                                     "{{ time_schedule_helper != [] }}",
  2566.                                     "{{ is_state(time_schedule_helper, 'on') }}"
  2567.                                   ]
  2568.                                 }
  2569.                               ]
  2570.                             },
  2571.                             {
  2572.                               "or": [
  2573.                                 "{{ resident_sensor == [] }}",
  2574.                                 "{{ states(resident_sensor) in ['false', 'off'] }}",
  2575.                                 {
  2576.                                   "and": [
  2577.                                     "{{ resident_allow_shading }}",
  2578.                                     "{{ states(resident_sensor) in ['true', 'on'] }}"
  2579.                                   ]
  2580.                                 }
  2581.                               ]
  2582.                             }
  2583.                           ],
  2584.                           "sequence": [
  2585.                             {
  2586.                               "delay": {
  2587.                                 "seconds": "{{ range(drive_delay_fix | int(0), drive_delay_fix | int(0) + drive_delay_random | int(0) +1) | random }}"
  2588.                               }
  2589.                             },
  2590.                             {
  2591.                               "choose": [],
  2592.                               "default": []
  2593.                             },
  2594.                             {
  2595.                               "variables": {
  2596.                                 "target_position": 1,
  2597.                                 "target_tilt_position": "{{ shading_tilt_position | int }}",
  2598.                                 "update_values": {
  2599.                                   "open": {
  2600.                                     "a": 1,
  2601.                                     "t": "{{ as_timestamp(now()) | round(0) }}"
  2602.                                   },
  2603.                                   "close": {
  2604.                                     "a": 0,
  2605.                                     "t": "{{ helper_state_json.close.t }}"
  2606.                                   },
  2607.                                   "shading": {
  2608.                                     "a": 1,
  2609.                                     "t": "{{ as_timestamp(now()) | round(0) }}",
  2610.                                     "p": 0,
  2611.                                     "q": 0
  2612.                                   },
  2613.                                   "vpart": {
  2614.                                     "a": 0,
  2615.                                     "t": "{{ helper_state_json.vpart.t }}"
  2616.                                   },
  2617.                                   "vfull": {
  2618.                                     "a": 0,
  2619.                                     "t": "{{ helper_state_json.vfull.t }}"
  2620.                                   },
  2621.                                   "manual": {
  2622.                                     "a": 0,
  2623.                                     "t": "{{ helper_state_json.manual.t }}"
  2624.                                   },
  2625.                                   "t": "{{ as_timestamp(now()) | round(0) }}"
  2626.                                 }
  2627.                               }
  2628.                             },
  2629.                             {
  2630.                               "sequence": [
  2631.                                 {
  2632.                                   "repeat": {
  2633.                                     "for_each": "{{ blind_entities | list }}",
  2634.                                     "sequence": [
  2635.                                       {
  2636.                                         "choose": [
  2637.                                           {
  2638.                                             "conditions": [
  2639.                                               "{{ not prevent_default_cover_actions }}",
  2640.                                               "{{ target_position | default(101)  == 0 }}"
  2641.                                             ],
  2642.                                             "sequence": [
  2643.                                               {
  2644.                                                 "alias": "Close Cover",
  2645.                                                 "target": {
  2646.                                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2647.                                                 },
  2648.                                                 "action": "cover.close_cover"
  2649.                                               }
  2650.                                             ]
  2651.                                           },
  2652.                                           {
  2653.                                             "conditions": [
  2654.                                               "{{ not prevent_default_cover_actions }}",
  2655.                                               "{{ target_position | default(101) == 100 }}"
  2656.                                             ],
  2657.                                             "sequence": [
  2658.                                               {
  2659.                                                 "alias": "Open Cover",
  2660.                                                 "target": {
  2661.                                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2662.                                                 },
  2663.                                                 "action": "cover.open_cover"
  2664.                                               }
  2665.                                             ]
  2666.                                           },
  2667.                                           {
  2668.                                             "conditions": [
  2669.                                               "{{ not prevent_default_cover_actions }}",
  2670.                                               "{{ target_position | default(101) not in [0, 100] }}"
  2671.                                             ],
  2672.                                             "sequence": [
  2673.                                               {
  2674.                                                 "alias": "Moving the cover to target position",
  2675.                                                 "data": {
  2676.                                                   "position": "{{ target_position | default(101) }}"
  2677.                                                 },
  2678.                                                 "target": {
  2679.                                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2680.                                                 },
  2681.                                                 "action": "cover.set_cover_position"
  2682.                                               }
  2683.                                             ]
  2684.                                           }
  2685.                                         ]
  2686.                                       },
  2687.                                       {
  2688.                                         "delay": {
  2689.                                           "seconds": "{{ (range(1, 3) | random | int) }}"
  2690.                                         }
  2691.                                       }
  2692.                                     ]
  2693.                                   }
  2694.                                 }
  2695.                               ]
  2696.                             },
  2697.                             {
  2698.                               "sequence": [
  2699.                                 {
  2700.                                   "if": [
  2701.                                     "{{ not prevent_default_cover_actions }}",
  2702.                                     "{{ is_cover_tilt_enabled_and_possible }}",
  2703.                                     "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  2704.                                   ],
  2705.                                   "then": [
  2706.                                     {
  2707.                                       "repeat": {
  2708.                                         "for_each": "{{ blind_entities | list }}",
  2709.                                         "sequence": [
  2710.                                           {
  2711.                                             "if": [
  2712.                                               "{{ tilt_first | default(false) }}"
  2713.                                             ],
  2714.                                             "then": [
  2715.                                               {
  2716.                                                 "alias": "Reset Tilt",
  2717.                                                 "data": {
  2718.                                                   "tilt_position": 0
  2719.                                                 },
  2720.                                                 "target": {
  2721.                                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2722.                                                 },
  2723.                                                 "action": "cover.set_cover_tilt_position"
  2724.                                               },
  2725.                                               {
  2726.                                                 "delay": {
  2727.                                                   "seconds": 0
  2728.                                                 }
  2729.                                               }
  2730.                                             ]
  2731.                                           },
  2732.                                           {
  2733.                                             "alias": "Tilt Delay",
  2734.                                             "delay": {
  2735.                                               "seconds": 0
  2736.                                             }
  2737.                                           },
  2738.                                           {
  2739.                                             "alias": "Moving the cover to tilt position",
  2740.                                             "data": {
  2741.                                               "tilt_position": "{{ target_tilt_position | default(101) }}"
  2742.                                             },
  2743.                                             "target": {
  2744.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2745.                                             },
  2746.                                             "action": "cover.set_cover_tilt_position"
  2747.                                           },
  2748.                                           {
  2749.                                             "delay": {
  2750.                                               "seconds": "{{ (range(1, 3) | random | int) }}"
  2751.                                             }
  2752.                                           }
  2753.                                         ]
  2754.                                       }
  2755.                                     }
  2756.                                   ]
  2757.                                 }
  2758.                               ]
  2759.                             },
  2760.                             {
  2761.                               "if": [
  2762.                                 "{{ is_status_helper_enabled }}"
  2763.                               ],
  2764.                               "then": [
  2765.                                 {
  2766.                                   "alias": "Update cover status helper",
  2767.                                   "data": {
  2768.                                     "entity_id": "input_text.cover_status_helper_ankleide",
  2769.                                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2770.                                   },
  2771.                                   "action": "input_text.set_value"
  2772.                                 }
  2773.                               ]
  2774.                             },
  2775.                             {
  2776.                               "choose": [],
  2777.                               "default": []
  2778.                             }
  2779.                           ]
  2780.                         },
  2781.                         {
  2782.                           "alias": "Save shading state for the future",
  2783.                           "conditions": [
  2784.                             "{{ trigger.id | regex_match('^(t_shading_start_execution)') }}",
  2785.                             "{{ is_helper_shading_start }}",
  2786.                             "{{ is_helper_closed }}"
  2787.                           ],
  2788.                           "sequence": [
  2789.                             {
  2790.                               "variables": {
  2791.                                 "update_values": {
  2792.                                   "shading": {
  2793.                                     "a": 1,
  2794.                                     "t": "{{ as_timestamp(now()) | round(0) }}",
  2795.                                     "p": 0,
  2796.                                     "q": 0
  2797.                                   },
  2798.                                   "t": "{{ as_timestamp(now()) | round(0) }}"
  2799.                                 }
  2800.                               }
  2801.                             },
  2802.                             {
  2803.                               "if": [
  2804.                                 "{{ is_status_helper_enabled }}"
  2805.                               ],
  2806.                               "then": [
  2807.                                 {
  2808.                                   "alias": "Update cover status helper",
  2809.                                   "data": {
  2810.                                     "entity_id": "input_text.cover_status_helper_ankleide",
  2811.                                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2812.                                   },
  2813.                                   "action": "input_text.set_value"
  2814.                                 }
  2815.                               ]
  2816.                             }
  2817.                           ]
  2818.                         }
  2819.                       ]
  2820.                     }
  2821.                   ],
  2822.                   "else": [
  2823.                     {
  2824.                       "choose": [
  2825.                         {
  2826.                           "alias": "Shading conditions were not met consistently and it should be checked again periodically in a few seconds",
  2827.                           "conditions": [
  2828.                             "{{ trigger.id | regex_match('^(t_shading_start_execution)') }}",
  2829.                             "{{ is_helper_shading_start }}",
  2830.                             "{{ start_shading_trigger_periodic }}",
  2831.                             {
  2832.                               "or": [
  2833.                                 {
  2834.                                   "and": [
  2835.                                     "{{ is_time_control_disabled }}",
  2836.                                     "{{ is_helper_open }}"
  2837.                                   ]
  2838.                                 },
  2839.                                 {
  2840.                                   "and": [
  2841.                                     "{{ is_time_field_enabled }}",
  2842.                                     "{{ now() >= today_at(time_up_early_today) }}",
  2843.                                     "{{ now() <= today_at(time_down_late_today) + timedelta(seconds = 5) }}"
  2844.                                   ]
  2845.                                 },
  2846.                                 {
  2847.                                   "and": [
  2848.                                     "{{ is_schedule_helper_enabled }}",
  2849.                                     "{{ time_schedule_helper != [] }}",
  2850.                                     "{{ is_state(time_schedule_helper, 'on') }}"
  2851.                                   ]
  2852.                                 }
  2853.                               ]
  2854.                             }
  2855.                           ],
  2856.                           "sequence": [
  2857.                             {
  2858.                               "variables": {
  2859.                                 "update_values": {
  2860.                                   "shading": {
  2861.                                     "a": 1,
  2862.                                     "t": "{{ as_timestamp(now()) | round(0) }}",
  2863.                                     "p": "{{ (as_timestamp(now()) | round(0) + (shading_waitingtime_start | int)) | round(0) }}",
  2864.                                     "q": 0
  2865.                                   },
  2866.                                   "t": "{{ as_timestamp(now()) | round(0) }}"
  2867.                                 }
  2868.                               }
  2869.                             },
  2870.                             {
  2871.                               "if": [
  2872.                                 "{{ is_status_helper_enabled }}"
  2873.                               ],
  2874.                               "then": [
  2875.                                 {
  2876.                                   "alias": "Update cover status helper",
  2877.                                   "data": {
  2878.                                     "entity_id": "input_text.cover_status_helper_ankleide",
  2879.                                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2880.                                   },
  2881.                                   "action": "input_text.set_value"
  2882.                                 }
  2883.                               ]
  2884.                             }
  2885.                           ]
  2886.                         },
  2887.                         {
  2888.                           "alias": "Shading conditions were not consistently met and the next new trigger should be waited for",
  2889.                           "conditions": [
  2890.                             "{{ trigger.id | regex_match('^(t_shading_start_execution)') }}",
  2891.                             "{{ is_helper_shading_start }}",
  2892.                             "{{ start_shading_trigger_reset }}"
  2893.                           ],
  2894.                           "sequence": [
  2895.                             {
  2896.                               "variables": {
  2897.                                 "update_values": {
  2898.                                   "shading": {
  2899.                                     "a": 0,
  2900.                                     "t": "{{ as_timestamp(now()) | round(0) }}",
  2901.                                     "p": 0,
  2902.                                     "q": 0
  2903.                                   },
  2904.                                   "t": "{{ as_timestamp(now()) | round(0) }}"
  2905.                                 }
  2906.                               }
  2907.                             },
  2908.                             {
  2909.                               "if": [
  2910.                                 "{{ is_status_helper_enabled }}"
  2911.                               ],
  2912.                               "then": [
  2913.                                 {
  2914.                                   "alias": "Update cover status helper",
  2915.                                   "data": {
  2916.                                     "entity_id": "input_text.cover_status_helper_ankleide",
  2917.                                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2918.                                   },
  2919.                                   "action": "input_text.set_value"
  2920.                                 }
  2921.                               ]
  2922.                             }
  2923.                           ]
  2924.                         }
  2925.                       ]
  2926.                     }
  2927.                   ]
  2928.                 }
  2929.               ]
  2930.             },
  2931.             {
  2932.               "alias": "Check for shading tilt",
  2933.               "conditions": [
  2934.                 "{{ is_shading_enabled }}",
  2935.                 "{{ trigger.id is defined }}",
  2936.                 "{{ trigger.id | regex_match('^(t_shading_tilt)') }}",
  2937.                 "{{ is_status_helper_enabled }}",
  2938.                 {
  2939.                   "and": [
  2940.                     "{{ is_helper_shaded }}",
  2941.                     "{{ not is_helper_shading_start }}"
  2942.                   ]
  2943.                 },
  2944.                 "{{ is_cover_tilt_enabled_and_possible }}",
  2945.                 {
  2946.                   "condition": []
  2947.                 },
  2948.                 {
  2949.                   "and": [
  2950.                     "{{ auto_up_force_disabled }}",
  2951.                     "{{ auto_down_force_disabled }}",
  2952.                     "{{ auto_ventilate_force_disabled }}"
  2953.                   ]
  2954.                 },
  2955.                 "{{ not (is_helper_vent_partial or is_helper_vent_full) }}",
  2956.                 "{{ not (is_helper_manual and override_shading_after_manual) }}"
  2957.               ],
  2958.               "sequence": [
  2959.                 {
  2960.                   "variables": {
  2961.                     "target_tilt_position": "{{ shading_tilt_position | int }}",
  2962.                     "tilt_first": true,
  2963.                     "update_values": {
  2964.                       "t": "{{ as_timestamp(now()) | round(0) }}"
  2965.                     }
  2966.                   }
  2967.                 },
  2968.                 {
  2969.                   "sequence": [
  2970.                     {
  2971.                       "if": [
  2972.                         "{{ not prevent_default_cover_actions }}",
  2973.                         "{{ is_cover_tilt_enabled_and_possible }}",
  2974.                         "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  2975.                       ],
  2976.                       "then": [
  2977.                         {
  2978.                           "repeat": {
  2979.                             "for_each": "{{ blind_entities | list }}",
  2980.                             "sequence": [
  2981.                               {
  2982.                                 "if": [
  2983.                                   "{{ tilt_first | default(false) }}"
  2984.                                 ],
  2985.                                 "then": [
  2986.                                   {
  2987.                                     "alias": "Reset Tilt",
  2988.                                     "data": {
  2989.                                       "tilt_position": 0
  2990.                                     },
  2991.                                     "target": {
  2992.                                       "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2993.                                     },
  2994.                                     "action": "cover.set_cover_tilt_position"
  2995.                                   },
  2996.                                   {
  2997.                                     "delay": {
  2998.                                       "seconds": 0
  2999.                                     }
  3000.                                   }
  3001.                                 ]
  3002.                               },
  3003.                               {
  3004.                                 "alias": "Tilt Delay",
  3005.                                 "delay": {
  3006.                                   "seconds": 0
  3007.                                 }
  3008.                               },
  3009.                               {
  3010.                                 "alias": "Moving the cover to tilt position",
  3011.                                 "data": {
  3012.                                   "tilt_position": "{{ target_tilt_position | default(101) }}"
  3013.                                 },
  3014.                                 "target": {
  3015.                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  3016.                                 },
  3017.                                 "action": "cover.set_cover_tilt_position"
  3018.                               },
  3019.                               {
  3020.                                 "delay": {
  3021.                                   "seconds": "{{ (range(1, 3) | random | int) }}"
  3022.                                 }
  3023.                               }
  3024.                             ]
  3025.                           }
  3026.                         }
  3027.                       ]
  3028.                     }
  3029.                   ]
  3030.                 },
  3031.                 {
  3032.                   "if": [
  3033.                     "{{ is_status_helper_enabled }}"
  3034.                   ],
  3035.                   "then": [
  3036.                     {
  3037.                       "alias": "Update cover status helper",
  3038.                       "data": {
  3039.                         "entity_id": "input_text.cover_status_helper_ankleide",
  3040.                         "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  3041.                       },
  3042.                       "action": "input_text.set_value"
  3043.                     }
  3044.                   ]
  3045.                 }
  3046.               ]
  3047.             },
  3048.             {
  3049.               "alias": "Check for shading end",
  3050.               "conditions": [
  3051.                 "{{ is_shading_enabled }}",
  3052.                 "{{ trigger.id is defined }}",
  3053.                 "{{ trigger.id | regex_match('^(t_shading_end)') }}",
  3054.                 "{{ is_status_helper_enabled }}",
  3055.                 {
  3056.                   "condition": []
  3057.                 },
  3058.                 {
  3059.                   "and": [
  3060.                     "{{ auto_up_force_disabled }}",
  3061.                     "{{ auto_down_force_disabled }}",
  3062.                     "{{ auto_ventilate_force_disabled }}",
  3063.                     "{{ auto_shading_start_force_disabled }}"
  3064.                   ]
  3065.                 },
  3066.                 {
  3067.                   "or": [
  3068.                     {
  3069.                       "and": [
  3070.                         "{{ is_time_control_disabled }}"
  3071.                       ]
  3072.                     },
  3073.                     {
  3074.                       "and": [
  3075.                         "{{ is_time_field_enabled }}",
  3076.                         "{{ now() >= today_at(time_up_early_today) }}",
  3077.                         "{{ now() <= today_at(time_down_late_today) + timedelta(seconds = 5) }}"
  3078.                       ]
  3079.                     },
  3080.                     {
  3081.                       "and": [
  3082.                         "{{ is_schedule_helper_enabled }}",
  3083.                         "{{ time_schedule_helper != [] }}",
  3084.                         "{{ is_state(time_schedule_helper, 'on') }}"
  3085.                       ]
  3086.                     }
  3087.                   ]
  3088.                 },
  3089.                 "{{ not (is_helper_manual and override_shading_after_manual) }}",
  3090.                 "{{ not is_helper_closed }}",
  3091.                 {
  3092.                   "or": [
  3093.                     "{{ is_helper_shaded }}",
  3094.                     "{{ in_shading_position }}"
  3095.                   ]
  3096.                 },
  3097.                 {
  3098.                   "or": [
  3099.                     "{{ not prevent_shading_end_if_closed }}",
  3100.                     "{{ prevent_shading_end_if_closed and not in_close_position}}"
  3101.                   ]
  3102.                 },
  3103.                 {
  3104.                   "or": [
  3105.                     "{{ resident_sensor == [] }}",
  3106.                     "{{ states(resident_sensor) in ['false', 'off'] }}"
  3107.                   ]
  3108.                 }
  3109.               ],
  3110.               "sequence": [
  3111.                 {
  3112.                   "choose": [
  3113.                     {
  3114.                       "alias": "Shading end detected. Save next execution time and pending status",
  3115.                       "conditions": [
  3116.                         "{{ trigger.id | regex_match('^(t_shading_end_pending)') }}",
  3117.                         "{{ not is_helper_shading_end }}"
  3118.                       ],
  3119.                       "sequence": [
  3120.                         {
  3121.                           "variables": {
  3122.                             "local_waitingtime_end": "{% set local_waitingtime_end = shading_waitingtime_end | default(0) | int %} {% if (is_shading_end_immediate_by_sun_position | default(false)) | bool and trigger.id == 't_shading_end_pending_5' %} {
Advertisement
Add Comment
Please, Sign In to add comment