Guest User

Untitled

a guest
Jul 1st, 2025
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 180.69 KB | None | 0 0
  1. {
  2.   "trace": {
  3.     "last_step": "action/4/choose/4/sequence/0/choose/0/sequence/1/then/0",
  4.     "run_id": "7eacad1346c7888fbbb0759d4c03bf14",
  5.     "state": "stopped",
  6.     "script_execution": "finished",
  7.     "timestamp": {
  8.       "start": "2025-07-01T14:37:48.348311+00:00",
  9.       "finish": "2025-07-01T14:37:48.519567+00:00"
  10.     },
  11.     "domain": "automation",
  12.     "item_id": "1750688188481",
  13.     "trigger": "sensor.helligkeit_aussen via template",
  14.     "trace": {
  15.       "trigger/32": [
  16.         {
  17.           "path": "trigger/32",
  18.           "timestamp": "2025-07-01T14:37:48.372094+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:12:36.422204+00:00",
  26.                 "mode": "single",
  27.                 "current": 0,
  28.                 "friendly_name": "Rollladen Ankleide"
  29.               },
  30.               "last_changed": "2025-06-30T21:24:14.841965+00:00",
  31.               "last_reported": "2025-07-01T14:12:36.621321+00:00",
  32.               "last_updated": "2025-07-01T14:12:36.621321+00:00",
  33.               "context": {
  34.                 "id": "01JZ35A7DEAJZ13PW7PC9SD52H",
  35.                 "parent_id": "01JZ35A6SRWRNZJZ8VSWKGZGRG",
  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": "39603.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:36:06.128865+00:00",
  52.                 "last_reported": "2025-07-01T14:36:06.128865+00:00",
  53.                 "last_updated": "2025-07-01T14:36:06.128865+00:00",
  54.                 "context": {
  55.                   "id": "01JZ36N82G34QT256GESJS11XE",
  56.                   "parent_id": null,
  57.                   "user_id": null
  58.                 }
  59.               },
  60.               "to_state": {
  61.                 "entity_id": "sensor.helligkeit_aussen",
  62.                 "state": "6248.4",
  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:37:47.336533+00:00",
  70.                 "last_reported": "2025-07-01T14:37:47.336533+00:00",
  71.                 "last_updated": "2025-07-01T14:37:47.336533+00:00",
  72.                 "context": {
  73.                   "id": "01JZ36RAXPCTRY6KH5JRRRHY6H",
  74.                   "parent_id": null,
  75.                   "user_id": null
  76.                 }
  77.               },
  78.               "id": "t_shading_end_pending_3",
  79.               "idx": "32",
  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": 247.82,
  183.             "current_sun_elevation": 45.41,
  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": 1751366731,
  226.                 "p": 0,
  227.                 "q": 0
  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": 1751366731
  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": false,
  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": 1751366731,
  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:37:48.372331+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:37:48.372446+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:37:48.372529+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:37:48.372738+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:37:48.372815+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:37:48.373547+00:00",
  346.           "result": {
  347.             "result": true,
  348.             "entities": []
  349.           }
  350.         }
  351.       ],
  352.       "action/0": [
  353.         {
  354.           "path": "action/0",
  355.           "timestamp": "2025-07-01T14:37:48.375276+00:00",
  356.           "changed_variables": {
  357.             "context": {
  358.               "id": "01JZ36RBXWW7ZMRD7Y0P0XZ0JN",
  359.               "parent_id": "01JZ36RAXPCTRY6KH5JRRRHY6H",
  360.               "user_id": null
  361.             },
  362.             "cover_move_action": {
  363.               "sequence": [
  364.                 {
  365.                   "repeat": {
  366.                     "for_each": [
  367.                       "cover.dg_rl_ank"
  368.                     ],
  369.                     "sequence": [
  370.                       {
  371.                         "choose": [
  372.                           {
  373.                             "conditions": [
  374.                               true,
  375.                               false
  376.                             ],
  377.                             "sequence": [
  378.                               {
  379.                                 "alias": "Close Cover",
  380.                                 "service": "cover.close_cover",
  381.                                 "target": {
  382.                                   "entity_id": ""
  383.                                 }
  384.                               }
  385.                             ]
  386.                           },
  387.                           {
  388.                             "conditions": [
  389.                               true,
  390.                               false
  391.                             ],
  392.                             "sequence": [
  393.                               {
  394.                                 "alias": "Open Cover",
  395.                                 "service": "cover.open_cover",
  396.                                 "target": {
  397.                                   "entity_id": ""
  398.                                 }
  399.                               }
  400.                             ]
  401.                           },
  402.                           {
  403.                             "conditions": [
  404.                               true,
  405.                               true
  406.                             ],
  407.                             "sequence": [
  408.                               {
  409.                                 "alias": "Moving the cover to target position",
  410.                                 "service": "cover.set_cover_position",
  411.                                 "data": {
  412.                                   "position": 101
  413.                                 },
  414.                                 "target": {
  415.                                   "entity_id": ""
  416.                                 }
  417.                               }
  418.                             ]
  419.                           }
  420.                         ]
  421.                       },
  422.                       {
  423.                         "delay": {
  424.                           "seconds": 1
  425.                         }
  426.                       }
  427.                     ]
  428.                   }
  429.                 }
  430.               ]
  431.             },
  432.             "tilt_move_action": {
  433.               "sequence": [
  434.                 {
  435.                   "if": [
  436.                     true,
  437.                     false,
  438.                     false
  439.                   ],
  440.                   "then": [
  441.                     {
  442.                       "repeat": {
  443.                         "for_each": [
  444.                           "cover.dg_rl_ank"
  445.                         ],
  446.                         "sequence": [
  447.                           {
  448.                             "if": [
  449.                               false
  450.                             ],
  451.                             "then": [
  452.                               {
  453.                                 "alias": "Reset Tilt",
  454.                                 "service": "cover.set_cover_tilt_position",
  455.                                 "data": {
  456.                                   "tilt_position": 0
  457.                                 },
  458.                                 "target": {
  459.                                   "entity_id": ""
  460.                                 }
  461.                               },
  462.                               {
  463.                                 "delay": {
  464.                                   "seconds": 0
  465.                                 }
  466.                               }
  467.                             ]
  468.                           },
  469.                           {
  470.                             "alias": "Tilt Delay",
  471.                             "delay": {
  472.                               "seconds": 0
  473.                             }
  474.                           },
  475.                           {
  476.                             "alias": "Moving the cover to tilt position",
  477.                             "service": "cover.set_cover_tilt_position",
  478.                             "data": {
  479.                               "tilt_position": 101
  480.                             },
  481.                             "target": {
  482.                               "entity_id": ""
  483.                             }
  484.                           },
  485.                           {
  486.                             "delay": {
  487.                               "seconds": 2
  488.                             }
  489.                           }
  490.                         ]
  491.                       }
  492.                     }
  493.                   ]
  494.                 }
  495.               ]
  496.             },
  497.             "helper_update": {
  498.               "if": [
  499.                 true
  500.               ],
  501.               "then": [
  502.                 {
  503.                   "alias": "Update cover status helper",
  504.                   "service": "input_text.set_value",
  505.                   "data": {
  506.                     "entity_id": "input_text.cover_status_helper_ankleide",
  507.                     "value": {
  508.                       "open": {
  509.                         "a": 1,
  510.                         "t": 1751366731
  511.                       },
  512.                       "close": {
  513.                         "a": 0,
  514.                         "t": 1751313693
  515.                       },
  516.                       "shading": {
  517.                         "a": 1,
  518.                         "t": 1751366731,
  519.                         "p": 0,
  520.                         "q": 0
  521.                       },
  522.                       "vpart": {
  523.                         "a": 0,
  524.                         "t": 0
  525.                       },
  526.                       "vfull": {
  527.                         "a": 0,
  528.                         "t": 0
  529.                       },
  530.                       "manual": {
  531.                         "a": 0,
  532.                         "t": 1751192507
  533.                       },
  534.                       "v": 5,
  535.                       "t": 1751366731
  536.                     }
  537.                   }
  538.                 }
  539.               ]
  540.             }
  541.           }
  542.         }
  543.       ],
  544.       "action/1": [
  545.         {
  546.           "path": "action/1",
  547.           "timestamp": "2025-07-01T14:37:48.389746+00:00"
  548.         }
  549.       ],
  550.       "action/1/if": [
  551.         {
  552.           "path": "action/1/if",
  553.           "timestamp": "2025-07-01T14:37:48.390468+00:00",
  554.           "result": {
  555.             "result": false
  556.           }
  557.         }
  558.       ],
  559.       "action/1/if/condition/0": [
  560.         {
  561.           "path": "action/1/if/condition/0",
  562.           "timestamp": "2025-07-01T14:37:48.391942+00:00",
  563.           "result": {
  564.             "result": true,
  565.             "entities": []
  566.           }
  567.         }
  568.       ],
  569.       "action/1/if/condition/1": [
  570.         {
  571.           "path": "action/1/if/condition/1",
  572.           "timestamp": "2025-07-01T14:37:48.393883+00:00",
  573.           "result": {
  574.             "result": false,
  575.             "entities": []
  576.           }
  577.         }
  578.       ],
  579.       "action/2": [
  580.         {
  581.           "path": "action/2",
  582.           "timestamp": "2025-07-01T14:37:48.396380+00:00"
  583.         }
  584.       ],
  585.       "action/2/if": [
  586.         {
  587.           "path": "action/2/if",
  588.           "timestamp": "2025-07-01T14:37:48.396889+00:00",
  589.           "result": {
  590.             "result": false
  591.           }
  592.         }
  593.       ],
  594.       "action/2/if/condition/0": [
  595.         {
  596.           "path": "action/2/if/condition/0",
  597.           "timestamp": "2025-07-01T14:37:48.398032+00:00",
  598.           "result": {
  599.             "result": true,
  600.             "entities": []
  601.           }
  602.         }
  603.       ],
  604.       "action/2/if/condition/1": [
  605.         {
  606.           "path": "action/2/if/condition/1",
  607.           "timestamp": "2025-07-01T14:37:48.399966+00:00",
  608.           "result": {
  609.             "result": true,
  610.             "entities": []
  611.           }
  612.         }
  613.       ],
  614.       "action/2/if/condition/2": [
  615.         {
  616.           "path": "action/2/if/condition/2",
  617.           "timestamp": "2025-07-01T14:37:48.401873+00:00",
  618.           "result": {
  619.             "result": false
  620.           }
  621.         }
  622.       ],
  623.       "action/2/if/condition/2/conditions/0": [
  624.         {
  625.           "path": "action/2/if/condition/2/conditions/0",
  626.           "timestamp": "2025-07-01T14:37:48.402948+00:00",
  627.           "result": {
  628.             "result": false,
  629.             "entities": [
  630.               "input_text.cover_status_helper_ankleide"
  631.             ]
  632.           }
  633.         }
  634.       ],
  635.       "action/2/if/condition/2/conditions/1": [
  636.         {
  637.           "path": "action/2/if/condition/2/conditions/1",
  638.           "timestamp": "2025-07-01T14:37:48.404991+00:00",
  639.           "result": {
  640.             "result": false,
  641.             "entities": [
  642.               "input_text.cover_status_helper_ankleide"
  643.             ]
  644.           }
  645.         }
  646.       ],
  647.       "action/3": [
  648.         {
  649.           "path": "action/3",
  650.           "timestamp": "2025-07-01T14:37:48.407545+00:00"
  651.         }
  652.       ],
  653.       "action/3/if": [
  654.         {
  655.           "path": "action/3/if",
  656.           "timestamp": "2025-07-01T14:37:48.408258+00:00",
  657.           "result": {
  658.             "result": false
  659.           }
  660.         }
  661.       ],
  662.       "action/3/if/condition/0": [
  663.         {
  664.           "path": "action/3/if/condition/0",
  665.           "timestamp": "2025-07-01T14:37:48.409380+00:00",
  666.           "result": {
  667.             "result": true,
  668.             "entities": []
  669.           }
  670.         }
  671.       ],
  672.       "action/3/if/condition/1": [
  673.         {
  674.           "path": "action/3/if/condition/1",
  675.           "timestamp": "2025-07-01T14:37:48.411333+00:00",
  676.           "result": {
  677.             "result": false,
  678.             "entities": []
  679.           }
  680.         }
  681.       ],
  682.       "action/4": [
  683.         {
  684.           "path": "action/4",
  685.           "timestamp": "2025-07-01T14:37:48.414149+00:00",
  686.           "changed_variables": {
  687.             "local_waitingtime_end": 600,
  688.             "update_values": {
  689.               "shading": {
  690.                 "a": 1,
  691.                 "t": 1751380669,
  692.                 "p": 0,
  693.                 "q": 1751381269
  694.               },
  695.               "t": 1751380669
  696.             }
  697.           },
  698.           "result": {
  699.             "choice": 4
  700.           }
  701.         }
  702.       ],
  703.       "action/4/choose/0": [
  704.         {
  705.           "path": "action/4/choose/0",
  706.           "timestamp": "2025-07-01T14:37:48.414804+00:00",
  707.           "result": {
  708.             "result": false
  709.           }
  710.         }
  711.       ],
  712.       "action/4/choose/0/conditions/0": [
  713.         {
  714.           "path": "action/4/choose/0/conditions/0",
  715.           "timestamp": "2025-07-01T14:37:48.415890+00:00",
  716.           "result": {
  717.             "result": true,
  718.             "entities": []
  719.           }
  720.         }
  721.       ],
  722.       "action/4/choose/0/conditions/1": [
  723.         {
  724.           "path": "action/4/choose/0/conditions/1",
  725.           "timestamp": "2025-07-01T14:37:48.418443+00:00",
  726.           "result": {
  727.             "result": true,
  728.             "entities": []
  729.           }
  730.         }
  731.       ],
  732.       "action/4/choose/0/conditions/2": [
  733.         {
  734.           "path": "action/4/choose/0/conditions/2",
  735.           "timestamp": "2025-07-01T14:37:48.420531+00:00",
  736.           "result": {
  737.             "result": false,
  738.             "entities": []
  739.           }
  740.         }
  741.       ],
  742.       "action/4/choose/1": [
  743.         {
  744.           "path": "action/4/choose/1",
  745.           "timestamp": "2025-07-01T14:37:48.422641+00:00",
  746.           "result": {
  747.             "result": false
  748.           }
  749.         }
  750.       ],
  751.       "action/4/choose/1/conditions/0": [
  752.         {
  753.           "path": "action/4/choose/1/conditions/0",
  754.           "timestamp": "2025-07-01T14:37:48.423798+00:00",
  755.           "result": {
  756.             "result": true,
  757.             "entities": []
  758.           }
  759.         }
  760.       ],
  761.       "action/4/choose/1/conditions/1": [
  762.         {
  763.           "path": "action/4/choose/1/conditions/1",
  764.           "timestamp": "2025-07-01T14:37:48.426467+00:00",
  765.           "result": {
  766.             "result": true,
  767.             "entities": []
  768.           }
  769.         }
  770.       ],
  771.       "action/4/choose/1/conditions/2": [
  772.         {
  773.           "path": "action/4/choose/1/conditions/2",
  774.           "timestamp": "2025-07-01T14:37:48.428727+00:00",
  775.           "result": {
  776.             "result": false,
  777.             "entities": []
  778.           }
  779.         }
  780.       ],
  781.       "action/4/choose/2": [
  782.         {
  783.           "path": "action/4/choose/2",
  784.           "timestamp": "2025-07-01T14:37:48.430876+00:00",
  785.           "result": {
  786.             "result": false
  787.           }
  788.         }
  789.       ],
  790.       "action/4/choose/2/conditions/0": [
  791.         {
  792.           "path": "action/4/choose/2/conditions/0",
  793.           "timestamp": "2025-07-01T14:37:48.432020+00:00",
  794.           "result": {
  795.             "result": true,
  796.             "entities": []
  797.           }
  798.         }
  799.       ],
  800.       "action/4/choose/2/conditions/1": [
  801.         {
  802.           "path": "action/4/choose/2/conditions/1",
  803.           "timestamp": "2025-07-01T14:37:48.434188+00:00",
  804.           "result": {
  805.             "result": true,
  806.             "entities": []
  807.           }
  808.         }
  809.       ],
  810.       "action/4/choose/2/conditions/2": [
  811.         {
  812.           "path": "action/4/choose/2/conditions/2",
  813.           "timestamp": "2025-07-01T14:37:48.436339+00:00",
  814.           "result": {
  815.             "result": false,
  816.             "entities": []
  817.           }
  818.         }
  819.       ],
  820.       "action/4/choose/3": [
  821.         {
  822.           "path": "action/4/choose/3",
  823.           "timestamp": "2025-07-01T14:37:48.439323+00:00",
  824.           "result": {
  825.             "result": false
  826.           }
  827.         }
  828.       ],
  829.       "action/4/choose/3/conditions/0": [
  830.         {
  831.           "path": "action/4/choose/3/conditions/0",
  832.           "timestamp": "2025-07-01T14:37:48.440446+00:00",
  833.           "result": {
  834.             "result": true,
  835.             "entities": []
  836.           }
  837.         }
  838.       ],
  839.       "action/4/choose/3/conditions/1": [
  840.         {
  841.           "path": "action/4/choose/3/conditions/1",
  842.           "timestamp": "2025-07-01T14:37:48.442276+00:00",
  843.           "result": {
  844.             "result": true,
  845.             "entities": []
  846.           }
  847.         }
  848.       ],
  849.       "action/4/choose/3/conditions/2": [
  850.         {
  851.           "path": "action/4/choose/3/conditions/2",
  852.           "timestamp": "2025-07-01T14:37:48.444319+00:00",
  853.           "result": {
  854.             "result": false,
  855.             "entities": []
  856.           }
  857.         }
  858.       ],
  859.       "action/4/choose/4": [
  860.         {
  861.           "path": "action/4/choose/4",
  862.           "timestamp": "2025-07-01T14:37:48.446963+00:00",
  863.           "result": {
  864.             "result": true
  865.           }
  866.         }
  867.       ],
  868.       "action/4/choose/4/conditions/0": [
  869.         {
  870.           "path": "action/4/choose/4/conditions/0",
  871.           "timestamp": "2025-07-01T14:37:48.448237+00:00",
  872.           "result": {
  873.             "result": true,
  874.             "entities": []
  875.           }
  876.         }
  877.       ],
  878.       "action/4/choose/4/conditions/1": [
  879.         {
  880.           "path": "action/4/choose/4/conditions/1",
  881.           "timestamp": "2025-07-01T14:37:48.450305+00:00",
  882.           "result": {
  883.             "result": true,
  884.             "entities": []
  885.           }
  886.         }
  887.       ],
  888.       "action/4/choose/4/conditions/2": [
  889.         {
  890.           "path": "action/4/choose/4/conditions/2",
  891.           "timestamp": "2025-07-01T14:37:48.452349+00:00",
  892.           "result": {
  893.             "result": true,
  894.             "entities": []
  895.           }
  896.         }
  897.       ],
  898.       "action/4/choose/4/conditions/3": [
  899.         {
  900.           "path": "action/4/choose/4/conditions/3",
  901.           "timestamp": "2025-07-01T14:37:48.454397+00:00",
  902.           "result": {
  903.             "result": true,
  904.             "entities": []
  905.           }
  906.         }
  907.       ],
  908.       "action/4/choose/4/conditions/4": [
  909.         {
  910.           "path": "action/4/choose/4/conditions/4",
  911.           "timestamp": "2025-07-01T14:37:48.456445+00:00",
  912.           "result": {
  913.             "result": true
  914.           }
  915.         }
  916.       ],
  917.       "action/4/choose/4/conditions/5": [
  918.         {
  919.           "path": "action/4/choose/4/conditions/5",
  920.           "timestamp": "2025-07-01T14:37:48.457620+00:00",
  921.           "result": {
  922.             "result": true
  923.           }
  924.         }
  925.       ],
  926.       "action/4/choose/4/conditions/5/conditions/0": [
  927.         {
  928.           "path": "action/4/choose/4/conditions/5/conditions/0",
  929.           "timestamp": "2025-07-01T14:37:48.458730+00:00",
  930.           "result": {
  931.             "result": true,
  932.             "entities": []
  933.           }
  934.         }
  935.       ],
  936.       "action/4/choose/4/conditions/5/conditions/1": [
  937.         {
  938.           "path": "action/4/choose/4/conditions/5/conditions/1",
  939.           "timestamp": "2025-07-01T14:37:48.460753+00:00",
  940.           "result": {
  941.             "result": true,
  942.             "entities": []
  943.           }
  944.         }
  945.       ],
  946.       "action/4/choose/4/conditions/5/conditions/2": [
  947.         {
  948.           "path": "action/4/choose/4/conditions/5/conditions/2",
  949.           "timestamp": "2025-07-01T14:37:48.462855+00:00",
  950.           "result": {
  951.             "result": true,
  952.             "entities": []
  953.           }
  954.         }
  955.       ],
  956.       "action/4/choose/4/conditions/5/conditions/3": [
  957.         {
  958.           "path": "action/4/choose/4/conditions/5/conditions/3",
  959.           "timestamp": "2025-07-01T14:37:48.464899+00:00",
  960.           "result": {
  961.             "result": true,
  962.             "entities": []
  963.           }
  964.         }
  965.       ],
  966.       "action/4/choose/4/conditions/6": [
  967.         {
  968.           "path": "action/4/choose/4/conditions/6",
  969.           "timestamp": "2025-07-01T14:37:48.466936+00:00",
  970.           "result": {
  971.             "result": true
  972.           }
  973.         }
  974.       ],
  975.       "action/4/choose/4/conditions/6/conditions/0": [
  976.         {
  977.           "path": "action/4/choose/4/conditions/6/conditions/0",
  978.           "timestamp": "2025-07-01T14:37:48.467981+00:00",
  979.           "result": {
  980.             "result": false
  981.           }
  982.         }
  983.       ],
  984.       "action/4/choose/4/conditions/6/conditions/0/conditions/0": [
  985.         {
  986.           "path": "action/4/choose/4/conditions/6/conditions/0/conditions/0",
  987.           "timestamp": "2025-07-01T14:37:48.469081+00:00",
  988.           "result": {
  989.             "result": false,
  990.             "entities": []
  991.           }
  992.         }
  993.       ],
  994.       "action/4/choose/4/conditions/6/conditions/1": [
  995.         {
  996.           "path": "action/4/choose/4/conditions/6/conditions/1",
  997.           "timestamp": "2025-07-01T14:37:48.472458+00:00",
  998.           "result": {
  999.             "result": true
  1000.           }
  1001.         }
  1002.       ],
  1003.       "action/4/choose/4/conditions/6/conditions/1/conditions/0": [
  1004.         {
  1005.           "path": "action/4/choose/4/conditions/6/conditions/1/conditions/0",
  1006.           "timestamp": "2025-07-01T14:37:48.473652+00:00",
  1007.           "result": {
  1008.             "result": true,
  1009.             "entities": []
  1010.           }
  1011.         }
  1012.       ],
  1013.       "action/4/choose/4/conditions/6/conditions/1/conditions/1": [
  1014.         {
  1015.           "path": "action/4/choose/4/conditions/6/conditions/1/conditions/1",
  1016.           "timestamp": "2025-07-01T14:37:48.475693+00:00",
  1017.           "result": {
  1018.             "result": true,
  1019.             "entities": []
  1020.           }
  1021.         }
  1022.       ],
  1023.       "action/4/choose/4/conditions/6/conditions/1/conditions/2": [
  1024.         {
  1025.           "path": "action/4/choose/4/conditions/6/conditions/1/conditions/2",
  1026.           "timestamp": "2025-07-01T14:37:48.477917+00:00",
  1027.           "result": {
  1028.             "result": true,
  1029.             "entities": []
  1030.           }
  1031.         }
  1032.       ],
  1033.       "action/4/choose/4/conditions/7": [
  1034.         {
  1035.           "path": "action/4/choose/4/conditions/7",
  1036.           "timestamp": "2025-07-01T14:37:48.480795+00:00",
  1037.           "result": {
  1038.             "result": true,
  1039.             "entities": []
  1040.           }
  1041.         }
  1042.       ],
  1043.       "action/4/choose/4/conditions/8": [
  1044.         {
  1045.           "path": "action/4/choose/4/conditions/8",
  1046.           "timestamp": "2025-07-01T14:37:48.482885+00:00",
  1047.           "result": {
  1048.             "result": true,
  1049.             "entities": []
  1050.           }
  1051.         }
  1052.       ],
  1053.       "action/4/choose/4/conditions/9": [
  1054.         {
  1055.           "path": "action/4/choose/4/conditions/9",
  1056.           "timestamp": "2025-07-01T14:37:48.485014+00:00",
  1057.           "result": {
  1058.             "result": true
  1059.           }
  1060.         }
  1061.       ],
  1062.       "action/4/choose/4/conditions/9/conditions/0": [
  1063.         {
  1064.           "path": "action/4/choose/4/conditions/9/conditions/0",
  1065.           "timestamp": "2025-07-01T14:37:48.486108+00:00",
  1066.           "result": {
  1067.             "result": true,
  1068.             "entities": []
  1069.           }
  1070.         }
  1071.       ],
  1072.       "action/4/choose/4/conditions/10": [
  1073.         {
  1074.           "path": "action/4/choose/4/conditions/10",
  1075.           "timestamp": "2025-07-01T14:37:48.488161+00:00",
  1076.           "result": {
  1077.             "result": true
  1078.           }
  1079.         }
  1080.       ],
  1081.       "action/4/choose/4/conditions/10/conditions/0": [
  1082.         {
  1083.           "path": "action/4/choose/4/conditions/10/conditions/0",
  1084.           "timestamp": "2025-07-01T14:37:48.489388+00:00",
  1085.           "result": {
  1086.             "result": true,
  1087.             "entities": []
  1088.           }
  1089.         }
  1090.       ],
  1091.       "action/4/choose/4/conditions/11": [
  1092.         {
  1093.           "path": "action/4/choose/4/conditions/11",
  1094.           "timestamp": "2025-07-01T14:37:48.491818+00:00",
  1095.           "result": {
  1096.             "result": true
  1097.           }
  1098.         }
  1099.       ],
  1100.       "action/4/choose/4/conditions/11/conditions/0": [
  1101.         {
  1102.           "path": "action/4/choose/4/conditions/11/conditions/0",
  1103.           "timestamp": "2025-07-01T14:37:48.492954+00:00",
  1104.           "result": {
  1105.             "result": true,
  1106.             "entities": []
  1107.           }
  1108.         }
  1109.       ],
  1110.       "action/4/choose/4/sequence/0": [
  1111.         {
  1112.           "path": "action/4/choose/4/sequence/0",
  1113.           "timestamp": "2025-07-01T14:37:48.495708+00:00",
  1114.           "changed_variables": {
  1115.             "local_waitingtime_end": 600,
  1116.             "update_values": {
  1117.               "shading": {
  1118.                 "a": 1,
  1119.                 "t": 1751380669,
  1120.                 "p": 0,
  1121.                 "q": 1751381269
  1122.               },
  1123.               "t": 1751380669
  1124.             }
  1125.           },
  1126.           "result": {
  1127.             "choice": 0
  1128.           }
  1129.         }
  1130.       ],
  1131.       "action/4/choose/4/sequence/0/choose/0": [
  1132.         {
  1133.           "path": "action/4/choose/4/sequence/0/choose/0",
  1134.           "timestamp": "2025-07-01T14:37:48.497884+00:00",
  1135.           "result": {
  1136.             "result": true
  1137.           }
  1138.         }
  1139.       ],
  1140.       "action/4/choose/4/sequence/0/choose/0/conditions/0": [
  1141.         {
  1142.           "path": "action/4/choose/4/sequence/0/choose/0/conditions/0",
  1143.           "timestamp": "2025-07-01T14:37:48.499091+00:00",
  1144.           "result": {
  1145.             "result": true,
  1146.             "entities": []
  1147.           }
  1148.         }
  1149.       ],
  1150.       "action/4/choose/4/sequence/0/choose/0/conditions/1": [
  1151.         {
  1152.           "path": "action/4/choose/4/sequence/0/choose/0/conditions/1",
  1153.           "timestamp": "2025-07-01T14:37:48.501216+00:00",
  1154.           "result": {
  1155.             "result": true,
  1156.             "entities": []
  1157.           }
  1158.         }
  1159.       ],
  1160.       "action/4/choose/4/sequence/0/choose/0/sequence/0": [
  1161.         {
  1162.           "path": "action/4/choose/4/sequence/0/choose/0/sequence/0",
  1163.           "timestamp": "2025-07-01T14:37:48.503874+00:00",
  1164.           "changed_variables": {
  1165.             "local_waitingtime_end": 600,
  1166.             "update_values": {
  1167.               "shading": {
  1168.                 "a": 1,
  1169.                 "t": 1751380669,
  1170.                 "p": 0,
  1171.                 "q": 1751381269
  1172.               },
  1173.               "t": 1751380669
  1174.             }
  1175.           }
  1176.         }
  1177.       ],
  1178.       "action/4/choose/4/sequence/0/choose/0/sequence/1": [
  1179.         {
  1180.           "path": "action/4/choose/4/sequence/0/choose/0/sequence/1",
  1181.           "timestamp": "2025-07-01T14:37:48.508132+00:00",
  1182.           "result": {
  1183.             "choice": "then"
  1184.           }
  1185.         }
  1186.       ],
  1187.       "action/4/choose/4/sequence/0/choose/0/sequence/1/if": [
  1188.         {
  1189.           "path": "action/4/choose/4/sequence/0/choose/0/sequence/1/if",
  1190.           "timestamp": "2025-07-01T14:37:48.509010+00:00",
  1191.           "result": {
  1192.             "result": true
  1193.           }
  1194.         }
  1195.       ],
  1196.       "action/4/choose/4/sequence/0/choose/0/sequence/1/if/condition/0": [
  1197.         {
  1198.           "path": "action/4/choose/4/sequence/0/choose/0/sequence/1/if/condition/0",
  1199.           "timestamp": "2025-07-01T14:37:48.510181+00:00",
  1200.           "result": {
  1201.             "result": true,
  1202.             "entities": []
  1203.           }
  1204.         }
  1205.       ],
  1206.       "action/4/choose/4/sequence/0/choose/0/sequence/1/then/0": [
  1207.         {
  1208.           "path": "action/4/choose/4/sequence/0/choose/0/sequence/1/then/0",
  1209.           "timestamp": "2025-07-01T14:37:48.512931+00:00",
  1210.           "result": {
  1211.             "params": {
  1212.               "domain": "input_text",
  1213.               "service": "set_value",
  1214.               "service_data": {
  1215.                 "entity_id": "input_text.cover_status_helper_ankleide",
  1216.                 "value": {
  1217.                   "open": {
  1218.                     "a": 1,
  1219.                     "t": 1751366731
  1220.                   },
  1221.                   "close": {
  1222.                     "a": 0,
  1223.                     "t": 1751313693
  1224.                   },
  1225.                   "shading": {
  1226.                     "a": 1,
  1227.                     "t": 1751380669,
  1228.                     "p": 0,
  1229.                     "q": 1751381269
  1230.                   },
  1231.                   "vpart": {
  1232.                     "a": 0,
  1233.                     "t": 0
  1234.                   },
  1235.                   "vfull": {
  1236.                     "a": 0,
  1237.                     "t": 0
  1238.                   },
  1239.                   "manual": {
  1240.                     "a": 0,
  1241.                     "t": 1751192507
  1242.                   },
  1243.                   "v": 5,
  1244.                   "t": 1751380669
  1245.                 }
  1246.               },
  1247.               "target": {}
  1248.             },
  1249.             "running_script": false
  1250.           }
  1251.         }
  1252.       ]
  1253.     },
  1254.     "config": {
  1255.       "trigger_variables": {
  1256.         "blind": "cover.dg_rl_ank",
  1257.         "open_position": 100,
  1258.         "close_position": 0,
  1259.         "ventilate_position": 99,
  1260.         "shading_position": 1,
  1261.         "position_tolerance": 0,
  1262.         "open_tilt_position": 50,
  1263.         "close_tilt_position": 50,
  1264.         "ventilate_tilt_position": 50,
  1265.         "shading_tilt_elevation_1": 20,
  1266.         "shading_tilt_elevation_2": 30,
  1267.         "shading_tilt_elevation_3": 48,
  1268.         "shading_tilt_position_0": 0,
  1269.         "shading_tilt_position_1": 20,
  1270.         "shading_tilt_position_2": 37,
  1271.         "shading_tilt_position_3": 50,
  1272.         "auto_options": [
  1273.           "auto_up_enabled",
  1274.           "auto_down_enabled",
  1275.           "auto_sun_enabled",
  1276.           "auto_shading_enabled",
  1277.           "auto_ventilate_enabled"
  1278.         ],
  1279.         "time_up_early": "07:00:00",
  1280.         "time_up_early_non_workday": "08:00:00",
  1281.         "time_up_late": "08:00:00",
  1282.         "time_up_late_non_workday": "09:00:00",
  1283.         "time_down_early": "20:00:00",
  1284.         "time_down_early_non_workday": "20:00:00",
  1285.         "time_down_late": "22:00:00",
  1286.         "time_down_late_non_workday": "22:00:00",
  1287.         "workday_sensor_today": "binary_sensor.workday_sensor",
  1288.         "workday_sensor_tomorrow": "binary_sensor.workday_sensor_tomorrow",
  1289.         "default_brightness_sensor": [],
  1290.         "brightness_up": 0,
  1291.         "brightness_down": 0,
  1292.         "default_sun_sensor": "sun.sun",
  1293.         "sun_elevation_up": 5,
  1294.         "sun_elevation_down": -6,
  1295.         "resident_sensor": [],
  1296.         "contact_window_tilted": [],
  1297.         "contact_window_opened": "binary_sensor.tfk_ank",
  1298.         "lockout_tilted_options": [
  1299.           "lockout_tilted_closing",
  1300.           "lockout_tilted_shading_start"
  1301.         ],
  1302.         "lockout_tilted_when_closing": "{{ 'lockout_tilted_closing' in lockout_tilted_options }}",
  1303.         "lockout_tilted_when_shading_starts": "{{ 'lockout_tilted_shading_start' in lockout_tilted_options }}",
  1304.         "lockout_tilted_when_shading_ends": "{{ 'lockout_tilted_shading_end' in lockout_tilted_options }}",
  1305.         "time_control": "time_control_input",
  1306.         "time_schedule_helper": [],
  1307.         "shading_brightness_sensor": "sensor.helligkeit_aussen",
  1308.         "shading_temperatur_sensor1": "sensor.dg_wt_sz_temperatur",
  1309.         "shading_temperatur_sensor2": "sensor.raspberrymatic_sv_wm_temperatur",
  1310.         "shading_min_temperatur1": 20,
  1311.         "shading_min_temperatur2": 22,
  1312.         "shading_temperature_hysteresis1": 0.2,
  1313.         "shading_temperature_hysteresis2": 0.2,
  1314.         "shading_azimuth_start": 150,
  1315.         "shading_azimuth_end": 330,
  1316.         "shading_elevation_min": 25,
  1317.         "shading_elevation_max": 90,
  1318.         "shading_sun_brightness_start": 35000,
  1319.         "shading_sun_brightness_end": 10000,
  1320.         "shading_forecast_sensor": [],
  1321.         "shading_forecast_type": "weather_attributes",
  1322.         "shading_forecast_temp": [],
  1323.         "shading_weather_conditions": [
  1324.           "sunny",
  1325.           "partlycloudy",
  1326.           "cloudy",
  1327.           "clear"
  1328.         ],
  1329.         "is_shading_enabled": "{{ 'auto_shading_enabled' in auto_options }}",
  1330.         "cover_tilt_config": "cover_tilt_disabled",
  1331.         "is_cover_tilt_enabled": "{{ 'cover_tilt_enabled' in cover_tilt_config }}",
  1332.         "is_up_enabled": "{{ 'auto_up_enabled' in auto_options }}",
  1333.         "is_down_enabled": "{{ 'auto_down_enabled' in auto_options }}",
  1334.         "is_brightness_enabled": "{{ 'auto_brightness_enabled' in auto_options }}",
  1335.         "is_sun_elevation_enabled": "{{ 'auto_sun_enabled' in auto_options }}",
  1336.         "is_ventilation_enabled": "{{ 'auto_ventilate_enabled' in auto_options }}",
  1337.         "is_time_field_enabled": "{{ 'time_control_input' in time_control }}",
  1338.         "is_schedule_helper_enabled": "{{ 'time_control_schedule' in time_control and time_schedule_helper != [] }}",
  1339.         "is_time_control_disabled": "{{ 'time_control_disabled' in time_control }}",
  1340.         "reset_override_config": "reset_disabled",
  1341.         "reset_override_time": "00:01:00",
  1342.         "reset_override_timeout": 5,
  1343.         "is_reset_disabled": "{{ 'reset_disabled' in reset_override_config }}",
  1344.         "is_reset_fixed_time": "{{ 'reset_fixed_time' in reset_override_config }}",
  1345.         "is_reset_timeout": "{{ 'reset_timeout' in reset_override_config }}",
  1346.         "cover_status_options": "cover_helper_enabled",
  1347.         "cover_status_helper": "input_text.cover_status_helper_ankleide"
  1348.       },
  1349.       "variables": {
  1350.         "version": "2025.06.19",
  1351.         "blind_entities": "{{ expand(blind) | map(attribute='entity_id') | list }}",
  1352.         "current_position": "{{ state_attr(blind, 'current_position') | int(default=101) }}",
  1353.         "current_tilt_position": "{{ state_attr(blind,'current_tilt_position') | int(default=101) }}",
  1354.         "current_sun_azimuth": "{{ state_attr(default_sun_sensor, 'azimuth') }}",
  1355.         "current_sun_elevation": "{{ state_attr(default_sun_sensor, 'elevation') }}",
  1356.         "is_today_off": "{{ workday_sensor_today != [] and is_state(workday_sensor_today, 'off') }}",
  1357.         "is_tomorrow_off": "{{ workday_sensor_tomorrow != [] and is_state(workday_sensor_tomorrow, 'off') }}",
  1358.         "is_tomorrow_on": "{{ workday_sensor_tomorrow != [] and is_state(workday_sensor_tomorrow, 'on') }}",
  1359.         "drive_delay_fix": 90,
  1360.         "drive_delay_random": 0,
  1361.         "drive_time": 90,
  1362.         "time_up_early_today": "{{ time_up_early_non_workday if is_today_off else time_up_early }}",
  1363.         "time_up_late_today": "{{ time_up_late_non_workday if is_today_off else time_up_late }}",
  1364.         "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}}",
  1365.         "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}}",
  1366.         "auto_up_force": [],
  1367.         "auto_down_force": [],
  1368.         "auto_ventilate_force": [],
  1369.         "auto_shading_start_force": [],
  1370.         "auto_up_force_disabled": "{{ auto_up_force == [] or (auto_up_force != [] and states(auto_up_force) in ['false', 'off']) }}",
  1371.         "auto_down_force_disabled": "{{ auto_down_force == [] or (auto_down_force != [] and states(auto_down_force) in ['false', 'off']) }}",
  1372.         "auto_ventilate_force_disabled": "{{ auto_ventilate_force == [] or (auto_ventilate_force != [] and states(auto_ventilate_force) in ['false', 'off']) }}",
  1373.         "auto_shading_start_force_disabled": "{{ auto_shading_start_force == [] or (auto_shading_start_force != [] and states(auto_shading_start_force) in ['false', 'off']) }}",
  1374.         "is_cover_tilt_enabled_and_possible": "{{ is_cover_tilt_enabled and state_attr(blind, 'current_tilt_position') != none }}",
  1375.         "cover_tilt_reposition_config": "cover_tilt_reposition_disabled",
  1376.         "is_cover_tilt_reposition_enabled": "{{ 'cover_tilt_reposition_enabled' in cover_tilt_reposition_config }}",
  1377.         "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 %}",
  1378.         "shading_waitingtime_start": 300,
  1379.         "shading_waitingtime_end": 600,
  1380.         "is_shading_end_immediate_by_sun_position": false,
  1381.         "shading_start_behavior": "trigger_periodic",
  1382.         "shading_end_behavior": "open_position",
  1383.         "start_shading_trigger_reset": "{{ 'trigger_reset' in shading_start_behavior }}",
  1384.         "start_shading_trigger_periodic": "{{ 'trigger_periodic' in shading_start_behavior }}",
  1385.         "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}}",
  1386.         "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",
  1387.         "is_helper_open": "{{ is_status_helper_enabled and (helper_state_json | regex_search('open')) and (helper_state_json.open.a | default(false) | bool) }}",
  1388.         "is_helper_closed": "{{ is_status_helper_enabled and (helper_state_json | regex_search('close')) and (helper_state_json.close.a | default(false) | bool) }}",
  1389.         "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}}",
  1390.         "is_helper_shading_start": "{{ is_status_helper_enabled and (helper_state_json | regex_search('shading')) and (helper_state_json.shading.p | default(false) | bool) }}",
  1391.         "is_helper_shading_end": "{{ is_status_helper_enabled and (helper_state_json | regex_search('shading')) and (helper_state_json.shading.q | default(false) | bool) }}",
  1392.         "is_helper_vent_partial": "{{ is_status_helper_enabled and (helper_state_json | regex_search('vpart')) and (helper_state_json.vpart.a | default(false) | bool) }}",
  1393.         "is_helper_vent_full": "{{ is_status_helper_enabled and (helper_state_json | regex_search('vfull')) and (helper_state_json.vfull.a | default(false) | bool) }}",
  1394.         "is_helper_manual": "{{ is_status_helper_enabled and (helper_state_json | regex_search('manual')) and (helper_state_json.manual.a | default(false) | bool) }}",
  1395.         "ts_helper_open": "{{ helper_state_json.open.t | default(0) if (is_status_helper_enabled and (helper_state_json | regex_search('open'))) else 0 }}",
  1396.         "ts_helper_closed": "{{ helper_state_json.close.t | default(0) if (is_status_helper_enabled and (helper_state_json | regex_search('close'))) else 0 }}",
  1397.         "ts_helper_shaded": "{{ helper_state_json.shading.t | default(0) if (is_status_helper_enabled and (helper_state_json | regex_search('shading'))) else 0 }}",
  1398.         "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 }}",
  1399.         "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 }}",
  1400.         "ts_helper_manual": "{{ helper_state_json.manual.t | default(0) if (is_status_helper_enabled and (helper_state_json | regex_search('manual'))) else 0 }}",
  1401.         "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}}",
  1402.         "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}}",
  1403.         "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}}",
  1404.         "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}}",
  1405.         "individual_config": [],
  1406.         "prevent_higher_position_closing": "{{ 'prevent_higher_position_closing' in individual_config }}",
  1407.         "prevent_lowering_when_closing_if_shaded": "{{ 'prevent_lowering_when_closing_if_shaded' in individual_config }}",
  1408.         "prevent_forecast_service": "{{ 'weather_attributes' in shading_forecast_type }}",
  1409.         "prevent_shading_end_if_closed": "{{ 'prevent_shading_end_if_closed' in individual_config }}",
  1410.         "prevent_opening_after_shading_end": "{{ 'prevent_opening_after_shading_end' in individual_config }}",
  1411.         "prevent_opening_after_ventilation_end": "{{ 'prevent_opening_after_ventilation_end' in individual_config }}",
  1412.         "prevent_default_cover_actions": "{{ 'prevent_default_cover_actions' in individual_config }}",
  1413.         "prevent_shading_multiple_times": "{{ 'prevent_shading_multiple_times' in individual_config }}",
  1414.         "prevent_opening_multiple_times": "{{ 'prevent_opening_multiple_times' in individual_config }}",
  1415.         "prevent_closing_multiple_times": "{{ 'prevent_closing_multiple_times' in individual_config }}",
  1416.         "resident_config": [],
  1417.         "resident_opening_enabled": "{{ 'resident_opening_enabled' in resident_config }}",
  1418.         "resident_closing_enabled": "{{ 'resident_closing_enabled' in resident_config }}",
  1419.         "resident_allow_shading": "{{ 'resident_allow_shading' in resident_config }}",
  1420.         "resident_allow_opening": "{{ 'resident_allow_opening' in resident_config }}",
  1421.         "resident_allow_ventilation": "{{ 'resident_allow_ventilation' in resident_config }}",
  1422.         "ignore_after_manual_config": [],
  1423.         "override_opening_after_manual": "{{ 'ignore_opening_after_manual' in ignore_after_manual_config }}",
  1424.         "override_closing_after_manual": "{{ 'ignore_closing_after_manual' in ignore_after_manual_config }}",
  1425.         "override_ventilation_after_manual": "{{ 'ignore_ventilation_after_manual' in ignore_after_manual_config }}",
  1426.         "override_shading_after_manual": "{{ 'ignore_shading_after_manual' in ignore_after_manual_config }}",
  1427.         "auto_ventilate_options": [],
  1428.         "ventilation_delay_enabled": "{{ 'ventilation_delay_enabled' in auto_ventilate_options }}",
  1429.         "ventilation_if_lower_enabled": "{{ 'ventilation_if_lower_enabled' in auto_ventilate_options }}",
  1430.         "ventilation_after_shading_end": "{{ 'ventilation_after_shading_end' in auto_ventilate_options }}",
  1431.         "check_config": false,
  1432.         "check_config_debuglevel": "info",
  1433.         "check_status_helper_length": "{{ state_attr(cover_status_helper, 'max') if is_status_helper_enabled else None }}"
  1434.       },
  1435.       "mode": "single",
  1436.       "max_exceeded": "silent",
  1437.       "triggers": [
  1438.         {
  1439.           "platform": "template",
  1440.           "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) }}",
  1441.           "enabled": "{{ is_time_field_enabled }}",
  1442.           "id": "t_open_1"
  1443.         },
  1444.         {
  1445.           "platform": "template",
  1446.           "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) }}",
  1447.           "enabled": "{{ is_time_field_enabled }}",
  1448.           "id": "t_open_2"
  1449.         },
  1450.         {
  1451.           "platform": "template",
  1452.           "value_template": "{{ states(time_schedule_helper) in ['true', 'on'] }}",
  1453.           "enabled": "{{ is_schedule_helper_enabled and time_schedule_helper != [] }}",
  1454.           "id": "t_open_3"
  1455.         },
  1456.         {
  1457.           "platform": "template",
  1458.           "value_template": "{{ states(default_brightness_sensor) | float(default=brightness_up) > brightness_up }}",
  1459.           "for": {
  1460.             "seconds": 30
  1461.           },
  1462.           "enabled": "{{ is_brightness_enabled and default_brightness_sensor != [] }}",
  1463.           "id": "t_open_4"
  1464.         },
  1465.         {
  1466.           "platform": "template",
  1467.           "value_template": "{{ state_attr(default_sun_sensor, 'elevation') | float(default=sun_elevation_up) > sun_elevation_up }}",
  1468.           "for": {
  1469.             "seconds": 30
  1470.           },
  1471.           "enabled": "{{ is_sun_elevation_enabled and default_sun_sensor != [] }}",
  1472.           "id": "t_open_5"
  1473.         },
  1474.         {
  1475.           "platform": "state",
  1476.           "entity_id": [],
  1477.           "from": "on",
  1478.           "to": "off",
  1479.           "id": "t_open_6"
  1480.         },
  1481.         {
  1482.           "platform": "state",
  1483.           "entity_id": [],
  1484.           "from": "off",
  1485.           "to": "on",
  1486.           "id": "t_force_open"
  1487.         },
  1488.         {
  1489.           "platform": "template",
  1490.           "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) }}",
  1491.           "enabled": "{{ is_time_field_enabled }}",
  1492.           "id": "t_close_1"
  1493.         },
  1494.         {
  1495.           "platform": "template",
  1496.           "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) }}",
  1497.           "enabled": "{{ is_time_field_enabled }}",
  1498.           "id": "t_close_2"
  1499.         },
  1500.         {
  1501.           "platform": "template",
  1502.           "value_template": "{{ states(time_schedule_helper) in ['false', 'off'] }}",
  1503.           "enabled": "{{ is_schedule_helper_enabled and time_schedule_helper != [] }}",
  1504.           "id": "t_close_3"
  1505.         },
  1506.         {
  1507.           "platform": "template",
  1508.           "value_template": "{{ states(default_brightness_sensor) | float(default=brightness_down) < brightness_down }}",
  1509.           "for": {
  1510.             "seconds": 30
  1511.           },
  1512.           "enabled": "{{ is_brightness_enabled and default_brightness_sensor != [] }}",
  1513.           "id": "t_close_4"
  1514.         },
  1515.         {
  1516.           "platform": "template",
  1517.           "value_template": "{{ state_attr(default_sun_sensor, 'elevation') | float(default=sun_elevation_down) < sun_elevation_down }}",
  1518.           "for": {
  1519.             "seconds": 30
  1520.           },
  1521.           "enabled": "{{ is_sun_elevation_enabled and default_sun_sensor != [] }}",
  1522.           "id": "t_close_5"
  1523.         },
  1524.         {
  1525.           "platform": "state",
  1526.           "entity_id": [],
  1527.           "from": "off",
  1528.           "to": "on",
  1529.           "id": "t_close_6"
  1530.         },
  1531.         {
  1532.           "platform": "state",
  1533.           "entity_id": [],
  1534.           "from": "off",
  1535.           "to": "on",
  1536.           "id": "t_force_close"
  1537.         },
  1538.         {
  1539.           "platform": "template",
  1540.           "value_template": "{{ states(contact_window_tilted) in ['true', 'on'] }}",
  1541.           "enabled": "{{ is_ventilation_enabled and contact_window_tilted != [] }}",
  1542.           "id": "t_contact_tilted_on",
  1543.           "for": {
  1544.             "seconds": 0
  1545.           }
  1546.         },
  1547.         {
  1548.           "platform": "template",
  1549.           "value_template": "{{ states(contact_window_tilted) in ['false', 'off'] }}",
  1550.           "enabled": "{{ is_ventilation_enabled and contact_window_tilted != [] }}",
  1551.           "id": "t_contact_tilted_off",
  1552.           "for": {
  1553.             "seconds": 0
  1554.           }
  1555.         },
  1556.         {
  1557.           "platform": "template",
  1558.           "value_template": "{{ states(contact_window_opened) in ['true', 'on'] }}",
  1559.           "enabled": "{{ is_ventilation_enabled and contact_window_opened != [] }}",
  1560.           "id": "t_contact_opened_on",
  1561.           "for": {
  1562.             "seconds": 0
  1563.           }
  1564.         },
  1565.         {
  1566.           "platform": "template",
  1567.           "value_template": "{{ states(contact_window_opened) in ['false', 'off'] }}",
  1568.           "enabled": "{{ is_ventilation_enabled and contact_window_opened != [] }}",
  1569.           "id": "t_contact_opened_off",
  1570.           "for": {
  1571.             "seconds": 0
  1572.           }
  1573.         },
  1574.         {
  1575.           "platform": "state",
  1576.           "entity_id": [],
  1577.           "from": "off",
  1578.           "to": "on",
  1579.           "id": "t_force_vent"
  1580.         },
  1581.         {
  1582.           "platform": "template",
  1583.           "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}}",
  1584.           "enabled": "{{ is_shading_enabled and default_sun_sensor != [] }}",
  1585.           "id": "t_shading_start_pending_1"
  1586.         },
  1587.         {
  1588.           "platform": "template",
  1589.           "value_template": "{{ states(shading_brightness_sensor) | float(default=shading_sun_brightness_start) > shading_sun_brightness_start }}",
  1590.           "enabled": "{{ is_shading_enabled and shading_brightness_sensor != [] }}",
  1591.           "id": "t_shading_start_pending_2"
  1592.         },
  1593.         {
  1594.           "platform": "template",
  1595.           "value_template": "{{ states(shading_temperatur_sensor1) | float(default=shading_min_temperatur1) > shading_min_temperatur1 }}",
  1596.           "enabled": "{{ is_shading_enabled and shading_temperatur_sensor1 != [] }}",
  1597.           "id": "t_shading_start_pending_3"
  1598.         },
  1599.         {
  1600.           "platform": "template",
  1601.           "value_template": "{{ states(shading_temperatur_sensor2) | float(default=shading_min_temperatur2) > shading_min_temperatur2 }}",
  1602.           "enabled": "{{ is_shading_enabled and shading_temperatur_sensor2 != [] }}",
  1603.           "id": "t_shading_start_pending_4"
  1604.         },
  1605.         {
  1606.           "platform": "template",
  1607.           "value_template": "{{ states(shading_forecast_sensor) in shading_weather_conditions }}",
  1608.           "enabled": "{{ is_shading_enabled and shading_forecast_sensor != [] }}",
  1609.           "id": "t_shading_start_pending_5"
  1610.         },
  1611.         {
  1612.           "platform": "template",
  1613.           "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}}",
  1614.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] }}",
  1615.           "id": "t_shading_start_execution"
  1616.         },
  1617.         {
  1618.           "platform": "state",
  1619.           "entity_id": [],
  1620.           "from": "off",
  1621.           "to": "on",
  1622.           "id": "t_force_shading_start"
  1623.         },
  1624.         {
  1625.           "platform": "template",
  1626.           "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}}",
  1627.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and is_cover_tilt_enabled and default_sun_sensor != [] }}",
  1628.           "id": "t_shading_tilt_1"
  1629.         },
  1630.         {
  1631.           "platform": "template",
  1632.           "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}}",
  1633.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and is_cover_tilt_enabled and default_sun_sensor != [] }}",
  1634.           "id": "t_shading_tilt_2"
  1635.         },
  1636.         {
  1637.           "platform": "template",
  1638.           "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}}",
  1639.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and is_cover_tilt_enabled and default_sun_sensor != [] }}",
  1640.           "id": "t_shading_tilt_3"
  1641.         },
  1642.         {
  1643.           "platform": "template",
  1644.           "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}}",
  1645.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and is_cover_tilt_enabled and default_sun_sensor != [] }}",
  1646.           "id": "t_shading_tilt_4"
  1647.         },
  1648.         {
  1649.           "platform": "template",
  1650.           "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}}",
  1651.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and shading_temperatur_sensor1 != [] }}",
  1652.           "id": "t_shading_end_pending_1"
  1653.         },
  1654.         {
  1655.           "platform": "template",
  1656.           "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}}",
  1657.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and shading_temperatur_sensor2 != [] }}",
  1658.           "id": "t_shading_end_pending_2"
  1659.         },
  1660.         {
  1661.           "platform": "template",
  1662.           "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}}",
  1663.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and shading_brightness_sensor != [] }}",
  1664.           "id": "t_shading_end_pending_3"
  1665.         },
  1666.         {
  1667.           "platform": "template",
  1668.           "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}}",
  1669.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and shading_weather_conditions != [] and shading_forecast_sensor != [] }}",
  1670.           "id": "t_shading_end_pending_4"
  1671.         },
  1672.         {
  1673.           "platform": "template",
  1674.           "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}}",
  1675.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] and default_sun_sensor != [] }}",
  1676.           "id": "t_shading_end_pending_5"
  1677.         },
  1678.         {
  1679.           "platform": "template",
  1680.           "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}}",
  1681.           "enabled": "{{ is_shading_enabled and cover_status_helper != [] }}",
  1682.           "id": "t_shading_end_execution"
  1683.         },
  1684.         {
  1685.           "platform": "template",
  1686.           "value_template": "{{ now() >= today_at('23:55:00') }}",
  1687.           "id": "t_shading_reset",
  1688.           "enabled": "{{ is_shading_enabled }}"
  1689.         },
  1690.         {
  1691.           "platform": "state",
  1692.           "entity_id": "cover.dg_rl_ank",
  1693.           "attribute": "current_position",
  1694.           "id": "t_manual_1",
  1695.           "for": "00:01:00"
  1696.         },
  1697.         {
  1698.           "platform": "template",
  1699.           "value_template": "{{ now() >= today_at(reset_override_time) }}",
  1700.           "enabled": "{{ is_reset_fixed_time }}",
  1701.           "id": "t_manual_2",
  1702.           "for": "00:00:02"
  1703.         },
  1704.         {
  1705.           "platform": "template",
  1706.           "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 }}",
  1707.           "enabled": "{{ is_reset_timeout and cover_status_helper != [] }}",
  1708.           "id": "t_manual_3",
  1709.           "for": "00:00:02"
  1710.         },
  1711.         {
  1712.           "platform": "state",
  1713.           "entity_id": "cover.dg_rl_ank",
  1714.           "attribute": "current_tilt_position",
  1715.           "id": "t_manual_4",
  1716.           "for": "00:01:00"
  1717.         }
  1718.       ],
  1719.       "conditions": [
  1720.         {
  1721.           "condition": [
  1722.             {
  1723.               "condition": "state",
  1724.               "entity_id": "input_boolean.rollo_automatik",
  1725.               "state": "on"
  1726.             }
  1727.           ]
  1728.         },
  1729.         {
  1730.           "or": [
  1731.             "{{ trigger.to_state is not defined }}",
  1732.             "{{ trigger.to_state is defined and trigger.to_state.state not in ['unavailable', 'unknown','none', 'query failed'] }}"
  1733.           ]
  1734.         }
  1735.       ],
  1736.       "actions": [
  1737.         {
  1738.           "variables": {
  1739.             "cover_move_action": {
  1740.               "sequence": [
  1741.                 {
  1742.                   "repeat": {
  1743.                     "for_each": "{{ blind_entities | list }}",
  1744.                     "sequence": [
  1745.                       {
  1746.                         "choose": [
  1747.                           {
  1748.                             "conditions": [
  1749.                               "{{ not prevent_default_cover_actions }}",
  1750.                               "{{ target_position | default(101)  == 0 }}"
  1751.                             ],
  1752.                             "sequence": [
  1753.                               {
  1754.                                 "alias": "Close Cover",
  1755.                                 "service": "cover.close_cover",
  1756.                                 "target": {
  1757.                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1758.                                 }
  1759.                               }
  1760.                             ]
  1761.                           },
  1762.                           {
  1763.                             "conditions": [
  1764.                               "{{ not prevent_default_cover_actions }}",
  1765.                               "{{ target_position | default(101) == 100 }}"
  1766.                             ],
  1767.                             "sequence": [
  1768.                               {
  1769.                                 "alias": "Open Cover",
  1770.                                 "service": "cover.open_cover",
  1771.                                 "target": {
  1772.                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1773.                                 }
  1774.                               }
  1775.                             ]
  1776.                           },
  1777.                           {
  1778.                             "conditions": [
  1779.                               "{{ not prevent_default_cover_actions }}",
  1780.                               "{{ target_position | default(101) not in [0, 100] }}"
  1781.                             ],
  1782.                             "sequence": [
  1783.                               {
  1784.                                 "alias": "Moving the cover to target position",
  1785.                                 "service": "cover.set_cover_position",
  1786.                                 "data": {
  1787.                                   "position": "{{ target_position | default(101) }}"
  1788.                                 },
  1789.                                 "target": {
  1790.                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1791.                                 }
  1792.                               }
  1793.                             ]
  1794.                           }
  1795.                         ]
  1796.                       },
  1797.                       {
  1798.                         "delay": {
  1799.                           "seconds": "{{ (range(1, 3) | random | int) }}"
  1800.                         }
  1801.                       }
  1802.                     ]
  1803.                   }
  1804.                 }
  1805.               ]
  1806.             },
  1807.             "tilt_move_action": {
  1808.               "sequence": [
  1809.                 {
  1810.                   "if": [
  1811.                     "{{ not prevent_default_cover_actions }}",
  1812.                     "{{ is_cover_tilt_enabled_and_possible }}",
  1813.                     "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  1814.                   ],
  1815.                   "then": [
  1816.                     {
  1817.                       "repeat": {
  1818.                         "for_each": "{{ blind_entities | list }}",
  1819.                         "sequence": [
  1820.                           {
  1821.                             "if": [
  1822.                               "{{ tilt_first | default(false) }}"
  1823.                             ],
  1824.                             "then": [
  1825.                               {
  1826.                                 "alias": "Reset Tilt",
  1827.                                 "service": "cover.set_cover_tilt_position",
  1828.                                 "data": {
  1829.                                   "tilt_position": 0
  1830.                                 },
  1831.                                 "target": {
  1832.                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1833.                                 }
  1834.                               },
  1835.                               {
  1836.                                 "delay": {
  1837.                                   "seconds": 0
  1838.                                 }
  1839.                               }
  1840.                             ]
  1841.                           },
  1842.                           {
  1843.                             "alias": "Tilt Delay",
  1844.                             "delay": {
  1845.                               "seconds": 0
  1846.                             }
  1847.                           },
  1848.                           {
  1849.                             "alias": "Moving the cover to tilt position",
  1850.                             "service": "cover.set_cover_tilt_position",
  1851.                             "data": {
  1852.                               "tilt_position": "{{ target_tilt_position | default(101) }}"
  1853.                             },
  1854.                             "target": {
  1855.                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  1856.                             }
  1857.                           },
  1858.                           {
  1859.                             "delay": {
  1860.                               "seconds": "{{ (range(1, 3) | random | int) }}"
  1861.                             }
  1862.                           }
  1863.                         ]
  1864.                       }
  1865.                     }
  1866.                   ]
  1867.                 }
  1868.               ]
  1869.             },
  1870.             "helper_update": {
  1871.               "if": [
  1872.                 "{{ is_status_helper_enabled }}"
  1873.               ],
  1874.               "then": [
  1875.                 {
  1876.                   "alias": "Update cover status helper",
  1877.                   "service": "input_text.set_value",
  1878.                   "data": {
  1879.                     "entity_id": "input_text.cover_status_helper_ankleide",
  1880.                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  1881.                   }
  1882.                 }
  1883.               ]
  1884.             }
  1885.           }
  1886.         },
  1887.         {
  1888.           "if": [
  1889.             "{{ is_shading_enabled }}",
  1890.             "{{ not prevent_forecast_service }}",
  1891.             "{{ (shading_forecast_sensor != [] ) }}",
  1892.             "{{ states(shading_forecast_sensor) not in ['unavailable', 'unknown', 'query failed']  }}",
  1893.             "{{ trigger.id is defined }}",
  1894.             "{{ trigger.id | regex_match('^(t_shading_start|t_open_1|t_open_3)') }}",
  1895.             "{{ shading_forecast_sensor.startswith('weather.') }}"
  1896.           ],
  1897.           "then": [
  1898.             {
  1899.               "action": "weather.get_forecasts",
  1900.               "target": {
  1901.                 "entity_id": []
  1902.               },
  1903.               "data": {
  1904.                 "type": "weather_attributes"
  1905.               },
  1906.               "response_variable": "weather_forecast"
  1907.             }
  1908.           ]
  1909.         },
  1910.         {
  1911.           "if": [
  1912.             "{{ 'cover_helper_enabled' in cover_status_options }}",
  1913.             "{{ cover_status_helper != [] }}",
  1914.             {
  1915.               "or": [
  1916.                 "{{ states(cover_status_helper) in ['', 'unknown', 'unavailable', 'none'] }}",
  1917.                 "{{ not states(cover_status_helper) | regex_match(\"((\\[[^\\}]+)?\\{s*[^\\}\\{]{3,}?:.*\\}([^\\{]+\\])?)\") }}"
  1918.               ]
  1919.             }
  1920.           ],
  1921.           "then": [
  1922.             {
  1923.               "action": "input_text.set_value",
  1924.               "data": {
  1925.                 "entity_id": "input_text.cover_status_helper_ankleide",
  1926.                 "value": "{{ helper_state_json | to_json }}"
  1927.               }
  1928.             }
  1929.           ]
  1930.         },
  1931.         {
  1932.           "if": [
  1933.             "{{ is_status_helper_enabled }}",
  1934.             "{{ helper_state_json.v != 5 }}"
  1935.           ],
  1936.           "then": [
  1937.             {
  1938.               "variables": {
  1939.                 "update_values": {
  1940.                   "open": {
  1941.                     "a": "{{ is_helper_open|int }}",
  1942.                     "t": "{{ ts_helper_open }}"
  1943.                   },
  1944.                   "close": {
  1945.                     "a": "{{ is_helper_closed|int }}",
  1946.                     "t": "{{ ts_helper_closed }}"
  1947.                   },
  1948.                   "shading": {
  1949.                     "a": "{{ is_helper_shaded|int }}",
  1950.                     "t": "{{ ts_helper_shaded }}",
  1951.                     "p": 0,
  1952.                     "q": 0
  1953.                   },
  1954.                   "vpart": {
  1955.                     "a": "{{ is_helper_vent_partial|int }}",
  1956.                     "t": "{{ ts_helper_vent_partial }}"
  1957.                   },
  1958.                   "vfull": {
  1959.                     "a": "{{ is_helper_vent_full|int }}",
  1960.                     "t": "{{ ts_helper_vent_full }}"
  1961.                   },
  1962.                   "manual": {
  1963.                     "a": "{{ is_helper_manual|int }}",
  1964.                     "t": "{{ ts_helper_manual }}"
  1965.                   },
  1966.                   "v": 5,
  1967.                   "t": "{{ helper_state_json.t | round(0) }}"
  1968.                 }
  1969.               }
  1970.             },
  1971.             {
  1972.               "if": [
  1973.                 "{{ is_status_helper_enabled }}"
  1974.               ],
  1975.               "then": [
  1976.                 {
  1977.                   "alias": "Update cover status helper",
  1978.                   "data": {
  1979.                     "entity_id": "input_text.cover_status_helper_ankleide",
  1980.                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  1981.                   },
  1982.                   "action": "input_text.set_value"
  1983.                 }
  1984.               ]
  1985.             }
  1986.           ]
  1987.         },
  1988.         {
  1989.           "choose": [
  1990.             {
  1991.               "alias": "Check for opening",
  1992.               "conditions": [
  1993.                 "{{ is_up_enabled }}",
  1994.                 "{{ trigger.id is defined }}",
  1995.                 "{{ trigger.id | regex_match('^(t_open)') }}",
  1996.                 {
  1997.                   "condition": []
  1998.                 },
  1999.                 {
  2000.                   "and": [
  2001.                     "{{ auto_down_force_disabled }}",
  2002.                     "{{ auto_ventilate_force_disabled }}",
  2003.                     "{{ auto_shading_start_force_disabled }}"
  2004.                   ]
  2005.                 },
  2006.                 "{{ not (is_status_helper_enabled and is_helper_manual and override_opening_after_manual) }}",
  2007.                 {
  2008.                   "or": [
  2009.                     "{{ not is_status_helper_enabled }}",
  2010.                     "{{ not prevent_opening_multiple_times }}",
  2011.                     "{{ is_status_helper_enabled and prevent_opening_multiple_times and (now().day != ts_helper_open|timestamp_custom('%-d')|int) }}"
  2012.                   ]
  2013.                 },
  2014.                 {
  2015.                   "or": [
  2016.                     "{{ trigger.id != 't_open_6' }}",
  2017.                     "{{ trigger.id == 't_open_6' and resident_opening_enabled }}"
  2018.                   ]
  2019.                 },
  2020.                 {
  2021.                   "or": [
  2022.                     "{{ resident_sensor == [] }}",
  2023.                     "{{ states(resident_sensor) in ['false', 'off'] }}",
  2024.                     {
  2025.                       "and": [
  2026.                         "{{ resident_allow_opening }}",
  2027.                         "{{ states(resident_sensor) in ['true', 'on'] }}"
  2028.                       ]
  2029.                     }
  2030.                   ]
  2031.                 },
  2032.                 {
  2033.                   "or": [
  2034.                     {
  2035.                       "and": [
  2036.                         "{{ is_time_control_disabled }}"
  2037.                       ]
  2038.                     },
  2039.                     {
  2040.                       "and": [
  2041.                         "{{ is_time_field_enabled }}",
  2042.                         "{{ now() >= today_at(time_up_late_today) }}",
  2043.                         "{{ now() <= today_at(time_down_late_today) - timedelta(seconds = 5) }}"
  2044.                       ]
  2045.                     },
  2046.                     {
  2047.                       "and": [
  2048.                         "{{ is_schedule_helper_enabled }}",
  2049.                         "{{ time_schedule_helper != [] }}",
  2050.                         "{{ not is_brightness_enabled }}",
  2051.                         "{{ not is_sun_elevation_enabled }}",
  2052.                         "{{ is_state(time_schedule_helper, 'on') }}",
  2053.                         "{{ trigger.id in ['t_open_3', 't_open_6'] }}"
  2054.                       ]
  2055.                     },
  2056.                     {
  2057.                       "and": [
  2058.                         {
  2059.                           "or": [
  2060.                             {
  2061.                               "and": [
  2062.                                 "{{ is_time_control_disabled }}"
  2063.                               ]
  2064.                             },
  2065.                             {
  2066.                               "and": [
  2067.                                 "{{ is_time_field_enabled }}",
  2068.                                 "{{ now() >= today_at(time_up_early_today) }}",
  2069.                                 "{{ now() <= today_at(time_up_late_today) + timedelta(seconds = 5) }}"
  2070.                               ]
  2071.                             },
  2072.                             {
  2073.                               "and": [
  2074.                                 "{{ is_schedule_helper_enabled }}",
  2075.                                 "{{ time_schedule_helper != [] }}",
  2076.                                 "{{ is_state(time_schedule_helper, 'on') }}",
  2077.                                 "{{ now() >= today_at([time_up_early, time_up_early_non_workday] | min) - timedelta(seconds = 5) }}",
  2078.                                 "{{ now() <= today_at([time_up_late, time_up_late_non_workday] | max) + timedelta(seconds = 5) }}"
  2079.                               ]
  2080.                             }
  2081.                           ]
  2082.                         },
  2083.                         {
  2084.                           "or": [
  2085.                             {
  2086.                               "or": [
  2087.                                 "{{ is_brightness_enabled and default_brightness_sensor == [] }}",
  2088.                                 "{{ is_brightness_enabled and default_brightness_sensor != [] and (states(default_brightness_sensor) | float(default=brightness_up) > brightness_up) }}"
  2089.                               ]
  2090.                             },
  2091.                             {
  2092.                               "or": [
  2093.                                 "{{ is_sun_elevation_enabled and default_sun_sensor == [] }}",
  2094.                                 "{{ is_sun_elevation_enabled and default_sun_sensor != [] and (current_sun_elevation | float(default=sun_elevation_up) > sun_elevation_up) }}"
  2095.                               ]
  2096.                             }
  2097.                           ]
  2098.                         }
  2099.                       ]
  2100.                     }
  2101.                   ]
  2102.                 }
  2103.               ],
  2104.               "sequence": [
  2105.                 {
  2106.                   "delay": {
  2107.                     "seconds": "{{ range(drive_delay_fix|int(0), drive_delay_fix|int(0) + drive_delay_random|int(0) +1) | random }}"
  2108.                   }
  2109.                 },
  2110.                 {
  2111.                   "choose": [
  2112.                     {
  2113.                       "alias": "Shading detected. Move to shading position",
  2114.                       "conditions": [
  2115.                         "{{ is_status_helper_enabled }}",
  2116.                         "{{ is_helper_shaded }}",
  2117.                         "{{ not in_shading_position }}"
  2118.                       ],
  2119.                       "sequence": [
  2120.                         {
  2121.                           "choose": [],
  2122.                           "default": []
  2123.                         },
  2124.                         {
  2125.                           "variables": {
  2126.                             "target_position": 1,
  2127.                             "target_tilt_position": "{{ shading_tilt_position | int }}",
  2128.                             "update_values": {
  2129.                               "open": {
  2130.                                 "a": 1,
  2131.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  2132.                               },
  2133.                               "close": {
  2134.                                 "a": 0,
  2135.                                 "t": "{{ helper_state_json.close.t }}"
  2136.                               },
  2137.                               "shading": {
  2138.                                 "a": 1,
  2139.                                 "t": "{{ helper_state_json.shading.t }}",
  2140.                                 "p": 0,
  2141.                                 "q": 0
  2142.                               },
  2143.                               "vpart": {
  2144.                                 "a": 0,
  2145.                                 "t": "{{ helper_state_json.vpart.t }}"
  2146.                               },
  2147.                               "vfull": {
  2148.                                 "a": 0,
  2149.                                 "t": "{{ helper_state_json.vfull.t }}"
  2150.                               },
  2151.                               "manual": {
  2152.                                 "a": 0,
  2153.                                 "t": "{{ helper_state_json.manual.t }}"
  2154.                               },
  2155.                               "t": "{{ as_timestamp(now()) | round(0) }}"
  2156.                             }
  2157.                           }
  2158.                         },
  2159.                         {
  2160.                           "sequence": [
  2161.                             {
  2162.                               "repeat": {
  2163.                                 "for_each": "{{ blind_entities | list }}",
  2164.                                 "sequence": [
  2165.                                   {
  2166.                                     "choose": [
  2167.                                       {
  2168.                                         "conditions": [
  2169.                                           "{{ not prevent_default_cover_actions }}",
  2170.                                           "{{ target_position | default(101)  == 0 }}"
  2171.                                         ],
  2172.                                         "sequence": [
  2173.                                           {
  2174.                                             "alias": "Close Cover",
  2175.                                             "target": {
  2176.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2177.                                             },
  2178.                                             "action": "cover.close_cover"
  2179.                                           }
  2180.                                         ]
  2181.                                       },
  2182.                                       {
  2183.                                         "conditions": [
  2184.                                           "{{ not prevent_default_cover_actions }}",
  2185.                                           "{{ target_position | default(101) == 100 }}"
  2186.                                         ],
  2187.                                         "sequence": [
  2188.                                           {
  2189.                                             "alias": "Open Cover",
  2190.                                             "target": {
  2191.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2192.                                             },
  2193.                                             "action": "cover.open_cover"
  2194.                                           }
  2195.                                         ]
  2196.                                       },
  2197.                                       {
  2198.                                         "conditions": [
  2199.                                           "{{ not prevent_default_cover_actions }}",
  2200.                                           "{{ target_position | default(101) not in [0, 100] }}"
  2201.                                         ],
  2202.                                         "sequence": [
  2203.                                           {
  2204.                                             "alias": "Moving the cover to target position",
  2205.                                             "data": {
  2206.                                               "position": "{{ target_position | default(101) }}"
  2207.                                             },
  2208.                                             "target": {
  2209.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2210.                                             },
  2211.                                             "action": "cover.set_cover_position"
  2212.                                           }
  2213.                                         ]
  2214.                                       }
  2215.                                     ]
  2216.                                   },
  2217.                                   {
  2218.                                     "delay": {
  2219.                                       "seconds": "{{ (range(1, 3) | random | int) }}"
  2220.                                     }
  2221.                                   }
  2222.                                 ]
  2223.                               }
  2224.                             }
  2225.                           ]
  2226.                         },
  2227.                         {
  2228.                           "sequence": [
  2229.                             {
  2230.                               "if": [
  2231.                                 "{{ not prevent_default_cover_actions }}",
  2232.                                 "{{ is_cover_tilt_enabled_and_possible }}",
  2233.                                 "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  2234.                               ],
  2235.                               "then": [
  2236.                                 {
  2237.                                   "repeat": {
  2238.                                     "for_each": "{{ blind_entities | list }}",
  2239.                                     "sequence": [
  2240.                                       {
  2241.                                         "if": [
  2242.                                           "{{ tilt_first | default(false) }}"
  2243.                                         ],
  2244.                                         "then": [
  2245.                                           {
  2246.                                             "alias": "Reset Tilt",
  2247.                                             "data": {
  2248.                                               "tilt_position": 0
  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": 0
  2258.                                             }
  2259.                                           }
  2260.                                         ]
  2261.                                       },
  2262.                                       {
  2263.                                         "alias": "Tilt Delay",
  2264.                                         "delay": {
  2265.                                           "seconds": 0
  2266.                                         }
  2267.                                       },
  2268.                                       {
  2269.                                         "alias": "Moving the cover to tilt position",
  2270.                                         "data": {
  2271.                                           "tilt_position": "{{ target_tilt_position | default(101) }}"
  2272.                                         },
  2273.                                         "target": {
  2274.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2275.                                         },
  2276.                                         "action": "cover.set_cover_tilt_position"
  2277.                                       },
  2278.                                       {
  2279.                                         "delay": {
  2280.                                           "seconds": "{{ (range(1, 3) | random | int) }}"
  2281.                                         }
  2282.                                       }
  2283.                                     ]
  2284.                                   }
  2285.                                 }
  2286.                               ]
  2287.                             }
  2288.                           ]
  2289.                         },
  2290.                         {
  2291.                           "if": [
  2292.                             "{{ is_status_helper_enabled }}"
  2293.                           ],
  2294.                           "then": [
  2295.                             {
  2296.                               "alias": "Update cover status helper",
  2297.                               "data": {
  2298.                                 "entity_id": "input_text.cover_status_helper_ankleide",
  2299.                                 "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2300.                               },
  2301.                               "action": "input_text.set_value"
  2302.                             }
  2303.                           ]
  2304.                         },
  2305.                         {
  2306.                           "choose": [],
  2307.                           "default": []
  2308.                         }
  2309.                       ]
  2310.                     },
  2311.                     {
  2312.                       "alias": "Normal opening of the cover",
  2313.                       "conditions": [
  2314.                         "{{ not in_shading_position }}",
  2315.                         {
  2316.                           "or": [
  2317.                             "{{ is_status_helper_enabled and not is_helper_open }}",
  2318.                             "{{ not in_open_position }}"
  2319.                           ]
  2320.                         }
  2321.                       ],
  2322.                       "sequence": [
  2323.                         {
  2324.                           "choose": [],
  2325.                           "default": []
  2326.                         },
  2327.                         {
  2328.                           "variables": {
  2329.                             "target_position": 100,
  2330.                             "target_tilt_position": "{{ open_tilt_position | int }}",
  2331.                             "update_values": {
  2332.                               "open": {
  2333.                                 "a": 1,
  2334.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  2335.                               },
  2336.                               "close": {
  2337.                                 "a": 0,
  2338.                                 "t": "{{ helper_state_json.close.t }}"
  2339.                               },
  2340.                               "shading": {
  2341.                                 "a": 0,
  2342.                                 "t": "{{ helper_state_json.shading.t }}",
  2343.                                 "p": 0,
  2344.                                 "q": 0
  2345.                               },
  2346.                               "vpart": {
  2347.                                 "a": 0,
  2348.                                 "t": "{{ helper_state_json.vpart.t }}"
  2349.                               },
  2350.                               "vfull": {
  2351.                                 "a": 0,
  2352.                                 "t": "{{ helper_state_json.vfull.t }}"
  2353.                               },
  2354.                               "manual": {
  2355.                                 "a": 0,
  2356.                                 "t": "{{ helper_state_json.manual.t }}"
  2357.                               },
  2358.                               "t": "{{ as_timestamp(now()) | round(0) }}"
  2359.                             }
  2360.                           }
  2361.                         },
  2362.                         {
  2363.                           "sequence": [
  2364.                             {
  2365.                               "repeat": {
  2366.                                 "for_each": "{{ blind_entities | list }}",
  2367.                                 "sequence": [
  2368.                                   {
  2369.                                     "choose": [
  2370.                                       {
  2371.                                         "conditions": [
  2372.                                           "{{ not prevent_default_cover_actions }}",
  2373.                                           "{{ target_position | default(101)  == 0 }}"
  2374.                                         ],
  2375.                                         "sequence": [
  2376.                                           {
  2377.                                             "alias": "Close Cover",
  2378.                                             "target": {
  2379.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2380.                                             },
  2381.                                             "action": "cover.close_cover"
  2382.                                           }
  2383.                                         ]
  2384.                                       },
  2385.                                       {
  2386.                                         "conditions": [
  2387.                                           "{{ not prevent_default_cover_actions }}",
  2388.                                           "{{ target_position | default(101) == 100 }}"
  2389.                                         ],
  2390.                                         "sequence": [
  2391.                                           {
  2392.                                             "alias": "Open Cover",
  2393.                                             "target": {
  2394.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2395.                                             },
  2396.                                             "action": "cover.open_cover"
  2397.                                           }
  2398.                                         ]
  2399.                                       },
  2400.                                       {
  2401.                                         "conditions": [
  2402.                                           "{{ not prevent_default_cover_actions }}",
  2403.                                           "{{ target_position | default(101) not in [0, 100] }}"
  2404.                                         ],
  2405.                                         "sequence": [
  2406.                                           {
  2407.                                             "alias": "Moving the cover to target position",
  2408.                                             "data": {
  2409.                                               "position": "{{ target_position | default(101) }}"
  2410.                                             },
  2411.                                             "target": {
  2412.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2413.                                             },
  2414.                                             "action": "cover.set_cover_position"
  2415.                                           }
  2416.                                         ]
  2417.                                       }
  2418.                                     ]
  2419.                                   },
  2420.                                   {
  2421.                                     "delay": {
  2422.                                       "seconds": "{{ (range(1, 3) | random | int) }}"
  2423.                                     }
  2424.                                   }
  2425.                                 ]
  2426.                               }
  2427.                             }
  2428.                           ]
  2429.                         },
  2430.                         {
  2431.                           "sequence": [
  2432.                             {
  2433.                               "if": [
  2434.                                 "{{ not prevent_default_cover_actions }}",
  2435.                                 "{{ is_cover_tilt_enabled_and_possible }}",
  2436.                                 "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  2437.                               ],
  2438.                               "then": [
  2439.                                 {
  2440.                                   "repeat": {
  2441.                                     "for_each": "{{ blind_entities | list }}",
  2442.                                     "sequence": [
  2443.                                       {
  2444.                                         "if": [
  2445.                                           "{{ tilt_first | default(false) }}"
  2446.                                         ],
  2447.                                         "then": [
  2448.                                           {
  2449.                                             "alias": "Reset Tilt",
  2450.                                             "data": {
  2451.                                               "tilt_position": 0
  2452.                                             },
  2453.                                             "target": {
  2454.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2455.                                             },
  2456.                                             "action": "cover.set_cover_tilt_position"
  2457.                                           },
  2458.                                           {
  2459.                                             "delay": {
  2460.                                               "seconds": 0
  2461.                                             }
  2462.                                           }
  2463.                                         ]
  2464.                                       },
  2465.                                       {
  2466.                                         "alias": "Tilt Delay",
  2467.                                         "delay": {
  2468.                                           "seconds": 0
  2469.                                         }
  2470.                                       },
  2471.                                       {
  2472.                                         "alias": "Moving the cover to tilt position",
  2473.                                         "data": {
  2474.                                           "tilt_position": "{{ target_tilt_position | default(101) }}"
  2475.                                         },
  2476.                                         "target": {
  2477.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2478.                                         },
  2479.                                         "action": "cover.set_cover_tilt_position"
  2480.                                       },
  2481.                                       {
  2482.                                         "delay": {
  2483.                                           "seconds": "{{ (range(1, 3) | random | int) }}"
  2484.                                         }
  2485.                                       }
  2486.                                     ]
  2487.                                   }
  2488.                                 }
  2489.                               ]
  2490.                             }
  2491.                           ]
  2492.                         },
  2493.                         {
  2494.                           "if": [
  2495.                             "{{ is_status_helper_enabled }}"
  2496.                           ],
  2497.                           "then": [
  2498.                             {
  2499.                               "alias": "Update cover status helper",
  2500.                               "data": {
  2501.                                 "entity_id": "input_text.cover_status_helper_ankleide",
  2502.                                 "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2503.                               },
  2504.                               "action": "input_text.set_value"
  2505.                             }
  2506.                           ]
  2507.                         },
  2508.                         {
  2509.                           "choose": [],
  2510.                           "default": []
  2511.                         }
  2512.                       ]
  2513.                     }
  2514.                   ]
  2515.                 }
  2516.               ]
  2517.             },
  2518.             {
  2519.               "alias": "Check for closing cover",
  2520.               "conditions": [
  2521.                 "{{ is_down_enabled }}",
  2522.                 "{{ trigger.id is defined }}",
  2523.                 "{{ trigger.id | regex_match('^(t_close)') }}",
  2524.                 {
  2525.                   "condition": []
  2526.                 },
  2527.                 {
  2528.                   "and": [
  2529.                     "{{ auto_up_force_disabled }}",
  2530.                     "{{ auto_ventilate_force_disabled }}",
  2531.                     "{{ auto_shading_start_force_disabled }}"
  2532.                   ]
  2533.                 },
  2534.                 {
  2535.                   "or": [
  2536.                     "{{ is_status_helper_enabled and not is_helper_closed }}",
  2537.                     "{{ not in_close_position }}"
  2538.                   ]
  2539.                 },
  2540.                 "{{ not (is_status_helper_enabled and is_helper_manual and override_closing_after_manual) }}",
  2541.                 {
  2542.                   "or": [
  2543.                     "{{ not is_status_helper_enabled }}",
  2544.                     "{{ not prevent_closing_multiple_times }}",
  2545.                     "{{ is_status_helper_enabled and prevent_closing_multiple_times and (ts_helper_closed < today_at(time_down_early_today) | as_timestamp) }}"
  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_down_late_today) }}"
  2559.                       ]
  2560.                     },
  2561.                     {
  2562.                       "and": [
  2563.                         "{{ is_schedule_helper_enabled }}",
  2564.                         "{{ time_schedule_helper != [] }}",
  2565.                         "{{ is_state(time_schedule_helper, 'off') }}",
  2566.                         "{{ trigger.id == 't_close_3' }}"
  2567.                       ]
  2568.                     },
  2569.                     {
  2570.                       "and": [
  2571.                         {
  2572.                           "or": [
  2573.                             {
  2574.                               "and": [
  2575.                                 "{{ is_time_control_disabled }}"
  2576.                               ]
  2577.                             },
  2578.                             {
  2579.                               "and": [
  2580.                                 "{{ is_time_field_enabled }}",
  2581.                                 "{{ now() >= today_at(time_down_early_today) }}",
  2582.                                 "{{ now() <= today_at(time_down_late_today) + timedelta(seconds = 5) }}"
  2583.                               ]
  2584.                             },
  2585.                             {
  2586.                               "and": [
  2587.                                 "{{ is_schedule_helper_enabled }}",
  2588.                                 "{{ time_schedule_helper != [] }}",
  2589.                                 "{{ is_state(time_schedule_helper, 'on') }}",
  2590.                                 "{{ now() >= today_at([time_down_early, time_down_early_non_workday] | min) - timedelta(seconds = 5) }}",
  2591.                                 "{{ now() <= today_at([time_down_late, time_down_late_non_workday] | max) + timedelta(seconds = 5) }}"
  2592.                               ]
  2593.                             }
  2594.                           ]
  2595.                         },
  2596.                         {
  2597.                           "or": [
  2598.                             {
  2599.                               "or": [
  2600.                                 "{{ is_brightness_enabled and default_brightness_sensor == [] }}",
  2601.                                 "{{ is_brightness_enabled and default_brightness_sensor != [] and (states(default_brightness_sensor) | float(default=brightness_down) < brightness_down) }}"
  2602.                               ]
  2603.                             },
  2604.                             {
  2605.                               "or": [
  2606.                                 "{{ is_sun_elevation_enabled and default_sun_sensor == [] }}",
  2607.                                 "{{ is_sun_elevation_enabled and default_sun_sensor != [] and (current_sun_elevation | float(default=sun_elevation_down) < sun_elevation_down) }}"
  2608.                               ]
  2609.                             }
  2610.                           ]
  2611.                         }
  2612.                       ]
  2613.                     },
  2614.                     {
  2615.                       "and": [
  2616.                         "{{ trigger.id == 't_close_6' }}",
  2617.                         "{{ resident_sensor != [] }}",
  2618.                         "{{ states(resident_sensor) in ['true', 'on'] }}",
  2619.                         "{{ resident_closing_enabled }}"
  2620.                       ]
  2621.                     }
  2622.                   ]
  2623.                 }
  2624.               ],
  2625.               "sequence": [
  2626.                 {
  2627.                   "choose": [
  2628.                     {
  2629.                       "alias": "Lockout protection when closing",
  2630.                       "conditions": [
  2631.                         "{{ is_ventilation_enabled }}",
  2632.                         "{{ is_status_helper_enabled }}",
  2633.                         {
  2634.                           "or": [
  2635.                             {
  2636.                               "and": [
  2637.                                 "{{ contact_window_opened != [] }}",
  2638.                                 "{{ states(contact_window_opened) in ['true', 'on'] }}"
  2639.                               ]
  2640.                             },
  2641.                             {
  2642.                               "and": [
  2643.                                 "{{ lockout_tilted_when_closing }}",
  2644.                                 "{{ contact_window_tilted != [] }}",
  2645.                                 "{{ states(contact_window_tilted) in ['true', 'on'] }}"
  2646.                               ]
  2647.                             }
  2648.                           ]
  2649.                         }
  2650.                       ],
  2651.                       "sequence": [
  2652.                         {
  2653.                           "variables": {
  2654.                             "update_values": {
  2655.                               "open": {
  2656.                                 "a": 0,
  2657.                                 "t": "{{ helper_state_json.open.t }}"
  2658.                               },
  2659.                               "close": {
  2660.                                 "a": 1,
  2661.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  2662.                               },
  2663.                               "shading": {
  2664.                                 "a": 0,
  2665.                                 "t": "{{ helper_state_json.shading.t }}",
  2666.                                 "p": 0,
  2667.                                 "q": 0
  2668.                               },
  2669.                               "vpart": {
  2670.                                 "a": 0,
  2671.                                 "t": "{{ helper_state_json.vpart.t }}"
  2672.                               },
  2673.                               "vfull": {
  2674.                                 "a": 1,
  2675.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  2676.                               },
  2677.                               "manual": {
  2678.                                 "a": 0,
  2679.                                 "t": "{{ helper_state_json.manual.t }}"
  2680.                               },
  2681.                               "t": "{{ as_timestamp(now()) | round(0) }}"
  2682.                             }
  2683.                           }
  2684.                         },
  2685.                         {
  2686.                           "if": [
  2687.                             "{{ is_status_helper_enabled }}"
  2688.                           ],
  2689.                           "then": [
  2690.                             {
  2691.                               "alias": "Update cover status helper",
  2692.                               "data": {
  2693.                                 "entity_id": "input_text.cover_status_helper_ankleide",
  2694.                                 "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2695.                               },
  2696.                               "action": "input_text.set_value"
  2697.                             }
  2698.                           ]
  2699.                         }
  2700.                       ]
  2701.                     },
  2702.                     {
  2703.                       "alias": "Window tilted. No lockout. Move to ventilation position instead of closing",
  2704.                       "conditions": [
  2705.                         "{{ is_ventilation_enabled }}",
  2706.                         "{{ is_status_helper_enabled }}",
  2707.                         "{{ contact_window_tilted != [] }}",
  2708.                         "{{ states(contact_window_tilted) in ['true', 'on'] }}",
  2709.                         "{{ not lockout_tilted_when_closing }}",
  2710.                         {
  2711.                           "or": [
  2712.                             "{{ contact_window_opened == [] }}",
  2713.                             "{{ states(contact_window_opened) in ['false', 'off'] }}"
  2714.                           ]
  2715.                         }
  2716.                       ],
  2717.                       "sequence": [
  2718.                         {
  2719.                           "choose": [],
  2720.                           "default": []
  2721.                         },
  2722.                         {
  2723.                           "delay": {
  2724.                             "seconds": "{{ range(drive_delay_fix|int(0), drive_delay_fix|int(0) + drive_delay_random|int(0) +1) | random }}"
  2725.                           }
  2726.                         },
  2727.                         {
  2728.                           "variables": {
  2729.                             "target_position": 99,
  2730.                             "target_tilt_position": 50,
  2731.                             "update_values": {
  2732.                               "open": {
  2733.                                 "a": 0,
  2734.                                 "t": "{{ helper_state_json.open.t }}"
  2735.                               },
  2736.                               "close": {
  2737.                                 "a": 1,
  2738.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  2739.                               },
  2740.                               "shading": {
  2741.                                 "a": 0,
  2742.                                 "t": "{{ helper_state_json.shading.t }}",
  2743.                                 "p": 0,
  2744.                                 "q": 0
  2745.                               },
  2746.                               "vpart": {
  2747.                                 "a": 1,
  2748.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  2749.                               },
  2750.                               "vfull": {
  2751.                                 "a": 0,
  2752.                                 "t": "{{ helper_state_json.vfull.t }}"
  2753.                               },
  2754.                               "manual": {
  2755.                                 "a": 0,
  2756.                                 "t": "{{ helper_state_json.manual.t }}"
  2757.                               },
  2758.                               "t": "{{ as_timestamp(now()) | round(0) }}"
  2759.                             }
  2760.                           }
  2761.                         },
  2762.                         {
  2763.                           "sequence": [
  2764.                             {
  2765.                               "repeat": {
  2766.                                 "for_each": "{{ blind_entities | list }}",
  2767.                                 "sequence": [
  2768.                                   {
  2769.                                     "choose": [
  2770.                                       {
  2771.                                         "conditions": [
  2772.                                           "{{ not prevent_default_cover_actions }}",
  2773.                                           "{{ target_position | default(101)  == 0 }}"
  2774.                                         ],
  2775.                                         "sequence": [
  2776.                                           {
  2777.                                             "alias": "Close Cover",
  2778.                                             "target": {
  2779.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2780.                                             },
  2781.                                             "action": "cover.close_cover"
  2782.                                           }
  2783.                                         ]
  2784.                                       },
  2785.                                       {
  2786.                                         "conditions": [
  2787.                                           "{{ not prevent_default_cover_actions }}",
  2788.                                           "{{ target_position | default(101) == 100 }}"
  2789.                                         ],
  2790.                                         "sequence": [
  2791.                                           {
  2792.                                             "alias": "Open Cover",
  2793.                                             "target": {
  2794.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2795.                                             },
  2796.                                             "action": "cover.open_cover"
  2797.                                           }
  2798.                                         ]
  2799.                                       },
  2800.                                       {
  2801.                                         "conditions": [
  2802.                                           "{{ not prevent_default_cover_actions }}",
  2803.                                           "{{ target_position | default(101) not in [0, 100] }}"
  2804.                                         ],
  2805.                                         "sequence": [
  2806.                                           {
  2807.                                             "alias": "Moving the cover to target position",
  2808.                                             "data": {
  2809.                                               "position": "{{ target_position | default(101) }}"
  2810.                                             },
  2811.                                             "target": {
  2812.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2813.                                             },
  2814.                                             "action": "cover.set_cover_position"
  2815.                                           }
  2816.                                         ]
  2817.                                       }
  2818.                                     ]
  2819.                                   },
  2820.                                   {
  2821.                                     "delay": {
  2822.                                       "seconds": "{{ (range(1, 3) | random | int) }}"
  2823.                                     }
  2824.                                   }
  2825.                                 ]
  2826.                               }
  2827.                             }
  2828.                           ]
  2829.                         },
  2830.                         {
  2831.                           "sequence": [
  2832.                             {
  2833.                               "if": [
  2834.                                 "{{ not prevent_default_cover_actions }}",
  2835.                                 "{{ is_cover_tilt_enabled_and_possible }}",
  2836.                                 "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  2837.                               ],
  2838.                               "then": [
  2839.                                 {
  2840.                                   "repeat": {
  2841.                                     "for_each": "{{ blind_entities | list }}",
  2842.                                     "sequence": [
  2843.                                       {
  2844.                                         "if": [
  2845.                                           "{{ tilt_first | default(false) }}"
  2846.                                         ],
  2847.                                         "then": [
  2848.                                           {
  2849.                                             "alias": "Reset Tilt",
  2850.                                             "data": {
  2851.                                               "tilt_position": 0
  2852.                                             },
  2853.                                             "target": {
  2854.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2855.                                             },
  2856.                                             "action": "cover.set_cover_tilt_position"
  2857.                                           },
  2858.                                           {
  2859.                                             "delay": {
  2860.                                               "seconds": 0
  2861.                                             }
  2862.                                           }
  2863.                                         ]
  2864.                                       },
  2865.                                       {
  2866.                                         "alias": "Tilt Delay",
  2867.                                         "delay": {
  2868.                                           "seconds": 0
  2869.                                         }
  2870.                                       },
  2871.                                       {
  2872.                                         "alias": "Moving the cover to tilt position",
  2873.                                         "data": {
  2874.                                           "tilt_position": "{{ target_tilt_position | default(101) }}"
  2875.                                         },
  2876.                                         "target": {
  2877.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  2878.                                         },
  2879.                                         "action": "cover.set_cover_tilt_position"
  2880.                                       },
  2881.                                       {
  2882.                                         "delay": {
  2883.                                           "seconds": "{{ (range(1, 3) | random | int) }}"
  2884.                                         }
  2885.                                       }
  2886.                                     ]
  2887.                                   }
  2888.                                 }
  2889.                               ]
  2890.                             }
  2891.                           ]
  2892.                         },
  2893.                         {
  2894.                           "if": [
  2895.                             "{{ is_status_helper_enabled }}"
  2896.                           ],
  2897.                           "then": [
  2898.                             {
  2899.                               "alias": "Update cover status helper",
  2900.                               "data": {
  2901.                                 "entity_id": "input_text.cover_status_helper_ankleide",
  2902.                                 "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2903.                               },
  2904.                               "action": "input_text.set_value"
  2905.                             }
  2906.                           ]
  2907.                         },
  2908.                         {
  2909.                           "choose": [],
  2910.                           "default": []
  2911.                         }
  2912.                       ]
  2913.                     },
  2914.                     {
  2915.                       "alias": "Only status change if cover is already 'near' the close position",
  2916.                       "conditions": [
  2917.                         {
  2918.                           "or": [
  2919.                             {
  2920.                               "and": [
  2921.                                 "{{ is_status_helper_enabled }}",
  2922.                                 "{{ prevent_lowering_when_closing_if_shaded }}",
  2923.                                 "{{ is_helper_shaded }}",
  2924.                                 "{{ close_position > shading_position }}"
  2925.                               ]
  2926.                             },
  2927.                             {
  2928.                               "and": [
  2929.                                 "{{ prevent_lowering_when_closing_if_shaded }}",
  2930.                                 "{{ in_shading_position }}",
  2931.                                 "{{ close_position > shading_position }}"
  2932.                               ]
  2933.                             },
  2934.                             {
  2935.                               "and": [
  2936.                                 "{{ prevent_higher_position_closing }}",
  2937.                                 "{{ (current_position <= close_position) }}"
  2938.                               ]
  2939.                             }
  2940.                           ]
  2941.                         }
  2942.                       ],
  2943.                       "sequence": [
  2944.                         {
  2945.                           "variables": {
  2946.                             "update_values": {
  2947.                               "open": {
  2948.                                 "a": 0,
  2949.                                 "t": "{{ helper_state_json.open.t }}"
  2950.                               },
  2951.                               "close": {
  2952.                                 "a": 1,
  2953.                                 "t": "{{ as_timestamp(now()) | round(0) }}"
  2954.                               },
  2955.                               "shading": {
  2956.                                 "a": 0,
  2957.                                 "t": "{{ helper_state_json.shading.t }}",
  2958.                                 "p": 0,
  2959.                                 "q": 0
  2960.                               },
  2961.                               "vpart": {
  2962.                                 "a": 0,
  2963.                                 "t": "{{ helper_state_json.vpart.t }}"
  2964.                               },
  2965.                               "vfull": {
  2966.                                 "a": 0,
  2967.                                 "t": "{{ helper_state_json.vfull.t }}"
  2968.                               },
  2969.                               "t": "{{ as_timestamp(now()) | round(0) }}"
  2970.                             }
  2971.                           }
  2972.                         },
  2973.                         {
  2974.                           "if": [
  2975.                             "{{ is_status_helper_enabled }}"
  2976.                           ],
  2977.                           "then": [
  2978.                             {
  2979.                               "alias": "Update cover status helper",
  2980.                               "data": {
  2981.                                 "entity_id": "input_text.cover_status_helper_ankleide",
  2982.                                 "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  2983.                               },
  2984.                               "action": "input_text.set_value"
  2985.                             }
  2986.                           ]
  2987.                         }
  2988.                       ]
  2989.                     }
  2990.                   ],
  2991.                   "default": [
  2992.                     {
  2993.                       "choose": [],
  2994.                       "default": []
  2995.                     },
  2996.                     {
  2997.                       "alias": "Normal closing of the cover",
  2998.                       "delay": {
  2999.                         "seconds": "{{ range(drive_delay_fix|int(0), drive_delay_fix|int(0) + drive_delay_random|int(0) +1) | random }}"
  3000.                       }
  3001.                     },
  3002.                     {
  3003.                       "variables": {
  3004.                         "target_position": 0,
  3005.                         "target_tilt_position": 50,
  3006.                         "update_values": {
  3007.                           "open": {
  3008.                             "a": 0,
  3009.                             "t": "{{ helper_state_json.open.t }}"
  3010.                           },
  3011.                           "close": {
  3012.                             "a": 1,
  3013.                             "t": "{{ as_timestamp(now()) | round(0) }}"
  3014.                           },
  3015.                           "shading": {
  3016.                             "a": 0,
  3017.                             "t": "{{ helper_state_json.shading.t }}",
  3018.                             "p": 0,
  3019.                             "q": 0
  3020.                           },
  3021.                           "vpart": {
  3022.                             "a": 0,
  3023.                             "t": "{{ helper_state_json.vpart.t }}"
  3024.                           },
  3025.                           "vfull": {
  3026.                             "a": 0,
  3027.                             "t": "{{ helper_state_json.vfull.t }}"
  3028.                           },
  3029.                           "manual": {
  3030.                             "a": 0,
  3031.                             "t": "{{ helper_state_json.manual.t }}"
  3032.                           },
  3033.                           "t": "{{ as_timestamp(now()) | round(0) }}"
  3034.                         }
  3035.                       }
  3036.                     },
  3037.                     {
  3038.                       "sequence": [
  3039.                         {
  3040.                           "repeat": {
  3041.                             "for_each": "{{ blind_entities | list }}",
  3042.                             "sequence": [
  3043.                               {
  3044.                                 "choose": [
  3045.                                   {
  3046.                                     "conditions": [
  3047.                                       "{{ not prevent_default_cover_actions }}",
  3048.                                       "{{ target_position | default(101)  == 0 }}"
  3049.                                     ],
  3050.                                     "sequence": [
  3051.                                       {
  3052.                                         "alias": "Close Cover",
  3053.                                         "target": {
  3054.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  3055.                                         },
  3056.                                         "action": "cover.close_cover"
  3057.                                       }
  3058.                                     ]
  3059.                                   },
  3060.                                   {
  3061.                                     "conditions": [
  3062.                                       "{{ not prevent_default_cover_actions }}",
  3063.                                       "{{ target_position | default(101) == 100 }}"
  3064.                                     ],
  3065.                                     "sequence": [
  3066.                                       {
  3067.                                         "alias": "Open Cover",
  3068.                                         "target": {
  3069.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  3070.                                         },
  3071.                                         "action": "cover.open_cover"
  3072.                                       }
  3073.                                     ]
  3074.                                   },
  3075.                                   {
  3076.                                     "conditions": [
  3077.                                       "{{ not prevent_default_cover_actions }}",
  3078.                                       "{{ target_position | default(101) not in [0, 100] }}"
  3079.                                     ],
  3080.                                     "sequence": [
  3081.                                       {
  3082.                                         "alias": "Moving the cover to target position",
  3083.                                         "data": {
  3084.                                           "position": "{{ target_position | default(101) }}"
  3085.                                         },
  3086.                                         "target": {
  3087.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  3088.                                         },
  3089.                                         "action": "cover.set_cover_position"
  3090.                                       }
  3091.                                     ]
  3092.                                   }
  3093.                                 ]
  3094.                               },
  3095.                               {
  3096.                                 "delay": {
  3097.                                   "seconds": "{{ (range(1, 3) | random | int) }}"
  3098.                                 }
  3099.                               }
  3100.                             ]
  3101.                           }
  3102.                         }
  3103.                       ]
  3104.                     },
  3105.                     {
  3106.                       "sequence": [
  3107.                         {
  3108.                           "if": [
  3109.                             "{{ not prevent_default_cover_actions }}",
  3110.                             "{{ is_cover_tilt_enabled_and_possible }}",
  3111.                             "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  3112.                           ],
  3113.                           "then": [
  3114.                             {
  3115.                               "repeat": {
  3116.                                 "for_each": "{{ blind_entities | list }}",
  3117.                                 "sequence": [
  3118.                                   {
  3119.                                     "if": [
  3120.                                       "{{ tilt_first | default(false) }}"
  3121.                                     ],
  3122.                                     "then": [
  3123.                                       {
  3124.                                         "alias": "Reset Tilt",
  3125.                                         "data": {
  3126.                                           "tilt_position": 0
  3127.                                         },
  3128.                                         "target": {
  3129.                                           "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  3130.                                         },
  3131.                                         "action": "cover.set_cover_tilt_position"
  3132.                                       },
  3133.                                       {
  3134.                                         "delay": {
  3135.                                           "seconds": 0
  3136.                                         }
  3137.                                       }
  3138.                                     ]
  3139.                                   },
  3140.                                   {
  3141.                                     "alias": "Tilt Delay",
  3142.                                     "delay": {
  3143.                                       "seconds": 0
  3144.                                     }
  3145.                                   },
  3146.                                   {
  3147.                                     "alias": "Moving the cover to tilt position",
  3148.                                     "data": {
  3149.                                       "tilt_position": "{{ target_tilt_position | default(101) }}"
  3150.                                     },
  3151.                                     "target": {
  3152.                                       "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  3153.                                     },
  3154.                                     "action": "cover.set_cover_tilt_position"
  3155.                                   },
  3156.                                   {
  3157.                                     "delay": {
  3158.                                       "seconds": "{{ (range(1, 3) | random | int) }}"
  3159.                                     }
  3160.                                   }
  3161.                                 ]
  3162.                               }
  3163.                             }
  3164.                           ]
  3165.                         }
  3166.                       ]
  3167.                     },
  3168.                     {
  3169.                       "if": [
  3170.                         "{{ is_status_helper_enabled }}"
  3171.                       ],
  3172.                       "then": [
  3173.                         {
  3174.                           "alias": "Update cover status helper",
  3175.                           "data": {
  3176.                             "entity_id": "input_text.cover_status_helper_ankleide",
  3177.                             "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  3178.                           },
  3179.                           "action": "input_text.set_value"
  3180.                         }
  3181.                       ]
  3182.                     },
  3183.                     {
  3184.                       "choose": [],
  3185.                       "default": []
  3186.                     }
  3187.                   ]
  3188.                 }
  3189.               ]
  3190.             },
  3191.             {
  3192.               "alias": "Check for shading start",
  3193.               "conditions": [
  3194.                 "{{ is_shading_enabled }}",
  3195.                 "{{ trigger.id is defined }}",
  3196.                 "{{ trigger.id | regex_match('^(t_shading_start|t_open_1|t_open_3)') }}",
  3197.                 "{{ is_status_helper_enabled }}",
  3198.                 {
  3199.                   "condition": []
  3200.                 },
  3201.                 {
  3202.                   "and": [
  3203.                     "{{ auto_up_force_disabled }}",
  3204.                     "{{ auto_down_force_disabled }}",
  3205.                     "{{ auto_ventilate_force_disabled }}"
  3206.                   ]
  3207.                 },
  3208.                 {
  3209.                   "or": [
  3210.                     "{{ not is_helper_shaded }}",
  3211.                     "{{ not (is_helper_vent_partial or is_helper_vent_full) }}"
  3212.                   ]
  3213.                 },
  3214.                 {
  3215.                   "or": [
  3216.                     {
  3217.                       "and": [
  3218.                         "{{ not is_cover_tilt_enabled_and_possible }}",
  3219.                         "{{ not in_shading_position }}"
  3220.                       ]
  3221.                     },
  3222.                     {
  3223.                       "and": [
  3224.                         "{{ is_cover_tilt_enabled_and_possible }}",
  3225.                         "{{ current_position >= shading_position }}"
  3226.                       ]
  3227.                     }
  3228.                   ]
  3229.                 },
  3230.                 "{{ not (is_helper_manual and override_shading_after_manual) }}",
  3231.                 {
  3232.                   "or": [
  3233.                     "{{ not prevent_shading_multiple_times }}",
  3234.                     "{{ prevent_shading_multiple_times and (now().day != ts_helper_shaded|timestamp_custom('%-d') | int) }}",
  3235.                     "{{ trigger.id | regex_match('^(t_shading_start_execution)') }}"
  3236.                   ]
  3237.                 }
  3238.               ],
  3239.               "sequence": [
  3240.                 {
  3241.                   "if": [
  3242.                     "{{ current_sun_azimuth > shading_azimuth_start and current_sun_azimuth < shading_azimuth_end }}",
  3243.                     "{{ current_sun_elevation > shading_elevation_min and current_sun_elevation < shading_elevation_max }}",
  3244.                     {
  3245.                       "or": [
  3246.                         "{{ shading_brightness_sensor == [] }}",
  3247.                         "{{ states(shading_brightness_sensor) | float(default=shading_sun_brightness_start) > shading_sun_brightness_start }}"
  3248.                       ]
  3249.                     },
  3250.                     {
  3251.                       "or": [
  3252.                         "{{ shading_temperatur_sensor1 == [] }}",
  3253.                         "{{ states(shading_temperatur_sensor1) | float(default=shading_min_temperatur1) > shading_min_temperatur1 }}"
  3254.                       ]
  3255.                     },
  3256.                     {
  3257.                       "or": [
  3258.                         "{{ shading_temperatur_sensor2 == [] }}",
  3259.                         "{{ states(shading_temperatur_sensor2) | float(default=shading_min_temperatur2) > shading_min_temperatur2 }}"
  3260.                       ]
  3261.                     },
  3262.                     {
  3263.                       "or": [
  3264.                         "{{ shading_forecast_sensor == [] }}",
  3265.                         "{{ shading_forecast_temp == [] }}",
  3266.                         {
  3267.                           "and": [
  3268.                             "{{ shading_forecast_sensor.startswith('sensor.') }}",
  3269.                             "{{ states(shading_forecast_sensor) | float(default=shading_forecast_temp - 1) > shading_forecast_temp }}"
  3270.                           ]
  3271.                         },
  3272.                         {
  3273.                           "and": [
  3274.                             "{{ shading_forecast_sensor.startswith('weather.') }}",
  3275.                             "{{ prevent_forecast_service }}",
  3276.                             "{{ state_attr(shading_forecast_sensor, 'temperature') | float(default=shading_forecast_temp - 1) > shading_forecast_temp }}"
  3277.                           ]
  3278.                         },
  3279.                         {
  3280.                           "and": [
  3281.                             "{{ shading_forecast_sensor.startswith('weather.') }}",
  3282.                             "{{ not prevent_forecast_service }}",
  3283.                             "{{ weather_forecast is defined }}",
  3284.                             "{{ weather_forecast[shading_forecast_sensor].forecast[0].temperature | float(default=shading_forecast_temp - 1) > shading_forecast_temp }}"
  3285.                           ]
  3286.                         },
  3287.                         "{{ (shading_temperatur_sensor2 != [] ) and (states(shading_temperatur_sensor2) | float(default=shading_forecast_temp) > shading_forecast_temp) }}"
  3288.                       ]
  3289.                     },
  3290.                     {
  3291.                       "or": [
  3292.                         "{{ shading_forecast_sensor == [] }}",
  3293.                         "{{ shading_weather_conditions == [] }}",
  3294.                         "{{ shading_forecast_sensor.startswith('sensor.') }}",
  3295.                         {
  3296.                           "and": [
  3297.                             "{{ shading_forecast_sensor.startswith('weather.') }}",
  3298.                             "{{ prevent_forecast_service }}",
  3299.                             "{{ states(shading_forecast_sensor) in shading_weather_conditions }}"
  3300.                           ]
  3301.                         },
  3302.                         {
  3303.                           "and": [
  3304.                             "{{ shading_forecast_sensor.startswith('weather.') }}",
  3305.                             "{{ not prevent_forecast_service }}",
  3306.                             "{{ weather_forecast is defined }}",
  3307.                             "{{ weather_forecast[shading_forecast_sensor].forecast[0].condition in shading_weather_conditions }}"
  3308.                           ]
  3309.                         }
  3310.                       ]
  3311.                     }
  3312.                   ],
  3313.                   "then": [
  3314.                     {
  3315.                       "choose": [
  3316.                         {
  3317.                           "alias": "Shading detected. Save next execution time and pending status",
  3318.                           "conditions": [
  3319.                             "{{ trigger.id | regex_match('^(t_shading_start_pending)') }}",
  3320.                             "{{ not is_helper_shading_start }}"
  3321.                           ],
  3322.                           "sequence": [
  3323.                             {
  3324.                               "variables": {
  3325.                                 "update_values": {
  3326.                                   "shading": {
  3327.                                     "a": 1,
  3328.                                     "t": "{{ as_timestamp(now()) | round(0) }}",
  3329.                                     "p": "{{ (as_timestamp(now()) | round(0) + (shading_waitingtime_start | int)) | round(0) }}",
  3330.                                     "q": 0
  3331.                                   },
  3332.                                   "t": "{{ as_timestamp(now()) | round(0) }}"
  3333.                                 }
  3334.                               }
  3335.                             },
  3336.                             {
  3337.                               "if": [
  3338.                                 "{{ is_status_helper_enabled }}"
  3339.                               ],
  3340.                               "then": [
  3341.                                 {
  3342.                                   "alias": "Update cover status helper",
  3343.                                   "data": {
  3344.                                     "entity_id": "input_text.cover_status_helper_ankleide",
  3345.                                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  3346.                                   },
  3347.                                   "action": "input_text.set_value"
  3348.                                 }
  3349.                               ]
  3350.                             }
  3351.                           ]
  3352.                         },
  3353.                         {
  3354.                           "alias": "Consider lockout protection when shading starts",
  3355.                           "conditions": [
  3356.                             "{{ trigger.id | regex_match('^(t_shading_start_execution)') }}",
  3357.                             "{{ is_helper_shading_start }}",
  3358.                             "{{ is_ventilation_enabled }}",
  3359.                             {
  3360.                               "or": [
  3361.                                 {
  3362.                                   "and": [
  3363.                                     "{{ contact_window_opened != [] }}",
  3364.                                     "{{ states(contact_window_opened) in ['true', 'on'] }}"
  3365.                                   ]
  3366.                                 },
  3367.                                 {
  3368.                                   "and": [
  3369.                                     "{{ lockout_tilted_when_shading_starts }}",
  3370.                                     "{{ contact_window_tilted != [] }}",
  3371.                                     "{{ states(contact_window_tilted) in ['true', 'on'] }}"
  3372.                                   ]
  3373.                                 }
  3374.                               ]
  3375.                             }
  3376.                           ],
  3377.                           "sequence": [
  3378.                             {
  3379.                               "variables": {
  3380.                                 "update_values": {
  3381.                                   "open": {
  3382.                                     "a": 1,
  3383.                                     "t": "{{ as_timestamp(now()) | round(0) }}"
  3384.                                   },
  3385.                                   "close": {
  3386.                                     "a": 0,
  3387.                                     "t": "{{ helper_state_json.close.t }}"
  3388.                                   },
  3389.                                   "shading": {
  3390.                                     "a": 1,
  3391.                                     "t": "{{ as_timestamp(now()) | round(0) }}",
  3392.                                     "p": 0,
  3393.                                     "q": 0
  3394.                                   },
  3395.                                   "vpart": {
  3396.                                     "a": 0,
  3397.                                     "t": "{{ helper_state_json.vpart.t }}"
  3398.                                   },
  3399.                                   "vfull": {
  3400.                                     "a": 1,
  3401.                                     "t": "{{ as_timestamp(now()) | round(0) }}"
  3402.                                   },
  3403.                                   "manual": {
  3404.                                     "a": 0,
  3405.                                     "t": "{{ helper_state_json.manual.t }}"
  3406.                                   },
  3407.                                   "t": "{{ as_timestamp(now()) | round(0) }}"
  3408.                                 }
  3409.                               }
  3410.                             },
  3411.                             {
  3412.                               "if": [
  3413.                                 "{{ is_status_helper_enabled }}"
  3414.                               ],
  3415.                               "then": [
  3416.                                 {
  3417.                                   "alias": "Update cover status helper",
  3418.                                   "data": {
  3419.                                     "entity_id": "input_text.cover_status_helper_ankleide",
  3420.                                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  3421.                                   },
  3422.                                   "action": "input_text.set_value"
  3423.                                 }
  3424.                               ]
  3425.                             }
  3426.                           ]
  3427.                         },
  3428.                         {
  3429.                           "alias": "Start Shading",
  3430.                           "conditions": [
  3431.                             "{{ trigger.id | regex_match('^(t_shading_start_execution)') }}",
  3432.                             "{{ is_helper_shading_start }}",
  3433.                             {
  3434.                               "or": [
  3435.                                 {
  3436.                                   "and": [
  3437.                                     "{{ not is_cover_tilt_enabled_and_possible }}",
  3438.                                     "{{ current_position > shading_position }}"
  3439.                                   ]
  3440.                                 },
  3441.                                 {
  3442.                                   "and": [
  3443.                                     "{{ is_cover_tilt_enabled_and_possible }}",
  3444.                                     "{{ current_position >= shading_position }}"
  3445.                                   ]
  3446.                                 }
  3447.                               ]
  3448.                             },
  3449.                             {
  3450.                               "or": [
  3451.                                 {
  3452.                                   "and": [
  3453.                                     "{{ is_time_control_disabled }}"
  3454.                                   ]
  3455.                                 },
  3456.                                 {
  3457.                                   "and": [
  3458.                                     "{{ is_time_field_enabled }}",
  3459.                                     "{{ now() >= today_at(time_up_early_today) }}",
  3460.                                     "{{ now() <= today_at(time_down_late_today) + timedelta(seconds = 5) }}"
  3461.                                   ]
  3462.                                 },
  3463.                                 {
  3464.                                   "and": [
  3465.                                     "{{ is_schedule_helper_enabled }}",
  3466.                                     "{{ time_schedule_helper != [] }}",
  3467.                                     "{{ is_state(time_schedule_helper, 'on') }}"
  3468.                                   ]
  3469.                                 }
  3470.                               ]
  3471.                             },
  3472.                             {
  3473.                               "or": [
  3474.                                 "{{ resident_sensor == [] }}",
  3475.                                 "{{ states(resident_sensor) in ['false', 'off'] }}",
  3476.                                 {
  3477.                                   "and": [
  3478.                                     "{{ resident_allow_shading }}",
  3479.                                     "{{ states(resident_sensor) in ['true', 'on'] }}"
  3480.                                   ]
  3481.                                 }
  3482.                               ]
  3483.                             }
  3484.                           ],
  3485.                           "sequence": [
  3486.                             {
  3487.                               "delay": {
  3488.                                 "seconds": "{{ range(drive_delay_fix | int(0), drive_delay_fix | int(0) + drive_delay_random | int(0) +1) | random }}"
  3489.                               }
  3490.                             },
  3491.                             {
  3492.                               "choose": [],
  3493.                               "default": []
  3494.                             },
  3495.                             {
  3496.                               "variables": {
  3497.                                 "target_position": 1,
  3498.                                 "target_tilt_position": "{{ shading_tilt_position | int }}",
  3499.                                 "update_values": {
  3500.                                   "open": {
  3501.                                     "a": 1,
  3502.                                     "t": "{{ as_timestamp(now()) | round(0) }}"
  3503.                                   },
  3504.                                   "close": {
  3505.                                     "a": 0,
  3506.                                     "t": "{{ helper_state_json.close.t }}"
  3507.                                   },
  3508.                                   "shading": {
  3509.                                     "a": 1,
  3510.                                     "t": "{{ as_timestamp(now()) | round(0) }}",
  3511.                                     "p": 0,
  3512.                                     "q": 0
  3513.                                   },
  3514.                                   "vpart": {
  3515.                                     "a": 0,
  3516.                                     "t": "{{ helper_state_json.vpart.t }}"
  3517.                                   },
  3518.                                   "vfull": {
  3519.                                     "a": 0,
  3520.                                     "t": "{{ helper_state_json.vfull.t }}"
  3521.                                   },
  3522.                                   "manual": {
  3523.                                     "a": 0,
  3524.                                     "t": "{{ helper_state_json.manual.t }}"
  3525.                                   },
  3526.                                   "t": "{{ as_timestamp(now()) | round(0) }}"
  3527.                                 }
  3528.                               }
  3529.                             },
  3530.                             {
  3531.                               "sequence": [
  3532.                                 {
  3533.                                   "repeat": {
  3534.                                     "for_each": "{{ blind_entities | list }}",
  3535.                                     "sequence": [
  3536.                                       {
  3537.                                         "choose": [
  3538.                                           {
  3539.                                             "conditions": [
  3540.                                               "{{ not prevent_default_cover_actions }}",
  3541.                                               "{{ target_position | default(101)  == 0 }}"
  3542.                                             ],
  3543.                                             "sequence": [
  3544.                                               {
  3545.                                                 "alias": "Close Cover",
  3546.                                                 "target": {
  3547.                                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  3548.                                                 },
  3549.                                                 "action": "cover.close_cover"
  3550.                                               }
  3551.                                             ]
  3552.                                           },
  3553.                                           {
  3554.                                             "conditions": [
  3555.                                               "{{ not prevent_default_cover_actions }}",
  3556.                                               "{{ target_position | default(101) == 100 }}"
  3557.                                             ],
  3558.                                             "sequence": [
  3559.                                               {
  3560.                                                 "alias": "Open Cover",
  3561.                                                 "target": {
  3562.                                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  3563.                                                 },
  3564.                                                 "action": "cover.open_cover"
  3565.                                               }
  3566.                                             ]
  3567.                                           },
  3568.                                           {
  3569.                                             "conditions": [
  3570.                                               "{{ not prevent_default_cover_actions }}",
  3571.                                               "{{ target_position | default(101) not in [0, 100] }}"
  3572.                                             ],
  3573.                                             "sequence": [
  3574.                                               {
  3575.                                                 "alias": "Moving the cover to target position",
  3576.                                                 "data": {
  3577.                                                   "position": "{{ target_position | default(101) }}"
  3578.                                                 },
  3579.                                                 "target": {
  3580.                                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  3581.                                                 },
  3582.                                                 "action": "cover.set_cover_position"
  3583.                                               }
  3584.                                             ]
  3585.                                           }
  3586.                                         ]
  3587.                                       },
  3588.                                       {
  3589.                                         "delay": {
  3590.                                           "seconds": "{{ (range(1, 3) | random | int) }}"
  3591.                                         }
  3592.                                       }
  3593.                                     ]
  3594.                                   }
  3595.                                 }
  3596.                               ]
  3597.                             },
  3598.                             {
  3599.                               "sequence": [
  3600.                                 {
  3601.                                   "if": [
  3602.                                     "{{ not prevent_default_cover_actions }}",
  3603.                                     "{{ is_cover_tilt_enabled_and_possible }}",
  3604.                                     "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  3605.                                   ],
  3606.                                   "then": [
  3607.                                     {
  3608.                                       "repeat": {
  3609.                                         "for_each": "{{ blind_entities | list }}",
  3610.                                         "sequence": [
  3611.                                           {
  3612.                                             "if": [
  3613.                                               "{{ tilt_first | default(false) }}"
  3614.                                             ],
  3615.                                             "then": [
  3616.                                               {
  3617.                                                 "alias": "Reset Tilt",
  3618.                                                 "data": {
  3619.                                                   "tilt_position": 0
  3620.                                                 },
  3621.                                                 "target": {
  3622.                                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  3623.                                                 },
  3624.                                                 "action": "cover.set_cover_tilt_position"
  3625.                                               },
  3626.                                               {
  3627.                                                 "delay": {
  3628.                                                   "seconds": 0
  3629.                                                 }
  3630.                                               }
  3631.                                             ]
  3632.                                           },
  3633.                                           {
  3634.                                             "alias": "Tilt Delay",
  3635.                                             "delay": {
  3636.                                               "seconds": 0
  3637.                                             }
  3638.                                           },
  3639.                                           {
  3640.                                             "alias": "Moving the cover to tilt position",
  3641.                                             "data": {
  3642.                                               "tilt_position": "{{ target_tilt_position | default(101) }}"
  3643.                                             },
  3644.                                             "target": {
  3645.                                               "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  3646.                                             },
  3647.                                             "action": "cover.set_cover_tilt_position"
  3648.                                           },
  3649.                                           {
  3650.                                             "delay": {
  3651.                                               "seconds": "{{ (range(1, 3) | random | int) }}"
  3652.                                             }
  3653.                                           }
  3654.                                         ]
  3655.                                       }
  3656.                                     }
  3657.                                   ]
  3658.                                 }
  3659.                               ]
  3660.                             },
  3661.                             {
  3662.                               "if": [
  3663.                                 "{{ is_status_helper_enabled }}"
  3664.                               ],
  3665.                               "then": [
  3666.                                 {
  3667.                                   "alias": "Update cover status helper",
  3668.                                   "data": {
  3669.                                     "entity_id": "input_text.cover_status_helper_ankleide",
  3670.                                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  3671.                                   },
  3672.                                   "action": "input_text.set_value"
  3673.                                 }
  3674.                               ]
  3675.                             },
  3676.                             {
  3677.                               "choose": [],
  3678.                               "default": []
  3679.                             }
  3680.                           ]
  3681.                         },
  3682.                         {
  3683.                           "alias": "Save shading state for the future",
  3684.                           "conditions": [
  3685.                             "{{ trigger.id | regex_match('^(t_shading_start_execution)') }}",
  3686.                             "{{ is_helper_shading_start }}",
  3687.                             "{{ is_helper_closed }}"
  3688.                           ],
  3689.                           "sequence": [
  3690.                             {
  3691.                               "variables": {
  3692.                                 "update_values": {
  3693.                                   "shading": {
  3694.                                     "a": 1,
  3695.                                     "t": "{{ as_timestamp(now()) | round(0) }}",
  3696.                                     "p": 0,
  3697.                                     "q": 0
  3698.                                   },
  3699.                                   "t": "{{ as_timestamp(now()) | round(0) }}"
  3700.                                 }
  3701.                               }
  3702.                             },
  3703.                             {
  3704.                               "if": [
  3705.                                 "{{ is_status_helper_enabled }}"
  3706.                               ],
  3707.                               "then": [
  3708.                                 {
  3709.                                   "alias": "Update cover status helper",
  3710.                                   "data": {
  3711.                                     "entity_id": "input_text.cover_status_helper_ankleide",
  3712.                                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  3713.                                   },
  3714.                                   "action": "input_text.set_value"
  3715.                                 }
  3716.                               ]
  3717.                             }
  3718.                           ]
  3719.                         }
  3720.                       ]
  3721.                     }
  3722.                   ],
  3723.                   "else": [
  3724.                     {
  3725.                       "choose": [
  3726.                         {
  3727.                           "alias": "Shading conditions were not met consistently and it should be checked again periodically in a few seconds",
  3728.                           "conditions": [
  3729.                             "{{ trigger.id | regex_match('^(t_shading_start_execution)') }}",
  3730.                             "{{ is_helper_shading_start }}",
  3731.                             "{{ start_shading_trigger_periodic }}",
  3732.                             {
  3733.                               "or": [
  3734.                                 {
  3735.                                   "and": [
  3736.                                     "{{ is_time_control_disabled }}",
  3737.                                     "{{ is_helper_open }}"
  3738.                                   ]
  3739.                                 },
  3740.                                 {
  3741.                                   "and": [
  3742.                                     "{{ is_time_field_enabled }}",
  3743.                                     "{{ now() >= today_at(time_up_early_today) }}",
  3744.                                     "{{ now() <= today_at(time_down_late_today) + timedelta(seconds = 5) }}"
  3745.                                   ]
  3746.                                 },
  3747.                                 {
  3748.                                   "and": [
  3749.                                     "{{ is_schedule_helper_enabled }}",
  3750.                                     "{{ time_schedule_helper != [] }}",
  3751.                                     "{{ is_state(time_schedule_helper, 'on') }}"
  3752.                                   ]
  3753.                                 }
  3754.                               ]
  3755.                             }
  3756.                           ],
  3757.                           "sequence": [
  3758.                             {
  3759.                               "variables": {
  3760.                                 "update_values": {
  3761.                                   "shading": {
  3762.                                     "a": 1,
  3763.                                     "t": "{{ as_timestamp(now()) | round(0) }}",
  3764.                                     "p": "{{ (as_timestamp(now()) | round(0) + (shading_waitingtime_start | int)) | round(0) }}",
  3765.                                     "q": 0
  3766.                                   },
  3767.                                   "t": "{{ as_timestamp(now()) | round(0) }}"
  3768.                                 }
  3769.                               }
  3770.                             },
  3771.                             {
  3772.                               "if": [
  3773.                                 "{{ is_status_helper_enabled }}"
  3774.                               ],
  3775.                               "then": [
  3776.                                 {
  3777.                                   "alias": "Update cover status helper",
  3778.                                   "data": {
  3779.                                     "entity_id": "input_text.cover_status_helper_ankleide",
  3780.                                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  3781.                                   },
  3782.                                   "action": "input_text.set_value"
  3783.                                 }
  3784.                               ]
  3785.                             }
  3786.                           ]
  3787.                         },
  3788.                         {
  3789.                           "alias": "Shading conditions were not consistently met and the next new trigger should be waited for",
  3790.                           "conditions": [
  3791.                             "{{ trigger.id | regex_match('^(t_shading_start_execution)') }}",
  3792.                             "{{ is_helper_shading_start }}",
  3793.                             "{{ start_shading_trigger_reset }}"
  3794.                           ],
  3795.                           "sequence": [
  3796.                             {
  3797.                               "variables": {
  3798.                                 "update_values": {
  3799.                                   "shading": {
  3800.                                     "a": 0,
  3801.                                     "t": "{{ as_timestamp(now()) | round(0) }}",
  3802.                                     "p": 0,
  3803.                                     "q": 0
  3804.                                   },
  3805.                                   "t": "{{ as_timestamp(now()) | round(0) }}"
  3806.                                 }
  3807.                               }
  3808.                             },
  3809.                             {
  3810.                               "if": [
  3811.                                 "{{ is_status_helper_enabled }}"
  3812.                               ],
  3813.                               "then": [
  3814.                                 {
  3815.                                   "alias": "Update cover status helper",
  3816.                                   "data": {
  3817.                                     "entity_id": "input_text.cover_status_helper_ankleide",
  3818.                                     "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  3819.                                   },
  3820.                                   "action": "input_text.set_value"
  3821.                                 }
  3822.                               ]
  3823.                             }
  3824.                           ]
  3825.                         }
  3826.                       ]
  3827.                     }
  3828.                   ]
  3829.                 }
  3830.               ]
  3831.             },
  3832.             {
  3833.               "alias": "Check for shading tilt",
  3834.               "conditions": [
  3835.                 "{{ is_shading_enabled }}",
  3836.                 "{{ trigger.id is defined }}",
  3837.                 "{{ trigger.id | regex_match('^(t_shading_tilt)') }}",
  3838.                 "{{ is_status_helper_enabled }}",
  3839.                 {
  3840.                   "and": [
  3841.                     "{{ is_helper_shaded }}",
  3842.                     "{{ not is_helper_shading_start }}"
  3843.                   ]
  3844.                 },
  3845.                 "{{ is_cover_tilt_enabled_and_possible }}",
  3846.                 {
  3847.                   "condition": []
  3848.                 },
  3849.                 {
  3850.                   "and": [
  3851.                     "{{ auto_up_force_disabled }}",
  3852.                     "{{ auto_down_force_disabled }}",
  3853.                     "{{ auto_ventilate_force_disabled }}"
  3854.                   ]
  3855.                 },
  3856.                 "{{ not (is_helper_vent_partial or is_helper_vent_full) }}",
  3857.                 "{{ not (is_helper_manual and override_shading_after_manual) }}"
  3858.               ],
  3859.               "sequence": [
  3860.                 {
  3861.                   "variables": {
  3862.                     "target_tilt_position": "{{ shading_tilt_position | int }}",
  3863.                     "tilt_first": true,
  3864.                     "update_values": {
  3865.                       "t": "{{ as_timestamp(now()) | round(0) }}"
  3866.                     }
  3867.                   }
  3868.                 },
  3869.                 {
  3870.                   "sequence": [
  3871.                     {
  3872.                       "if": [
  3873.                         "{{ not prevent_default_cover_actions }}",
  3874.                         "{{ is_cover_tilt_enabled_and_possible }}",
  3875.                         "{{ expand(blind_entities) | selectattr('attributes.current_tilt_position', 'defined') | list | count > 0 }}"
  3876.                       ],
  3877.                       "then": [
  3878.                         {
  3879.                           "repeat": {
  3880.                             "for_each": "{{ blind_entities | list }}",
  3881.                             "sequence": [
  3882.                               {
  3883.                                 "if": [
  3884.                                   "{{ tilt_first | default(false) }}"
  3885.                                 ],
  3886.                                 "then": [
  3887.                                   {
  3888.                                     "alias": "Reset Tilt",
  3889.                                     "data": {
  3890.                                       "tilt_position": 0
  3891.                                     },
  3892.                                     "target": {
  3893.                                       "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  3894.                                     },
  3895.                                     "action": "cover.set_cover_tilt_position"
  3896.                                   },
  3897.                                   {
  3898.                                     "delay": {
  3899.                                       "seconds": 0
  3900.                                     }
  3901.                                   }
  3902.                                 ]
  3903.                               },
  3904.                               {
  3905.                                 "alias": "Tilt Delay",
  3906.                                 "delay": {
  3907.                                   "seconds": 0
  3908.                                 }
  3909.                               },
  3910.                               {
  3911.                                 "alias": "Moving the cover to tilt position",
  3912.                                 "data": {
  3913.                                   "tilt_position": "{{ target_tilt_position | default(101) }}"
  3914.                                 },
  3915.                                 "target": {
  3916.                                   "entity_id": "{{ repeat.item if repeat is defined else '' }}"
  3917.                                 },
  3918.                                 "action": "cover.set_cover_tilt_position"
  3919.                               },
  3920.                               {
  3921.                                 "delay": {
  3922.                                   "seconds": "{{ (range(1, 3) | random | int) }}"
  3923.                                 }
  3924.                               }
  3925.                             ]
  3926.                           }
  3927.                         }
  3928.                       ]
  3929.                     }
  3930.                   ]
  3931.                 },
  3932.                 {
  3933.                   "if": [
  3934.                     "{{ is_status_helper_enabled }}"
  3935.                   ],
  3936.                   "then": [
  3937.                     {
  3938.                       "alias": "Update cover status helper",
  3939.                       "data": {
  3940.                         "entity_id": "input_text.cover_status_helper_ankleide",
  3941.                         "value": "{% set dict_var = helper_state_json %}\n{% set dict_new = dict(dict_var, **(update_values | default({})) ) %}\n{{ dict_new | to_json }}"
  3942.                       },
  3943.                       "action": "input_text.set_value"
  3944.                     }
  3945.                   ]
  3946.                 }
  3947.               ]
  3948.             },
  3949.             {
  3950.               "alias": "Check for shading end",
  3951.               "conditions": [
  3952.                 "{{ is_shading_enabled }}",
  3953.                 "{{ trigger.id is defined }}",
  3954.                 "{{ trigger.id | regex_match('^(t_shading_end)') }}",
  3955.                 "{{ is_status_helper_enabled }}",
  3956.                 {
  3957.                   "condition": []
  3958.                 },
  3959.                 {
  3960.                   "and": [
  3961.                     "{{ auto_up_force_disabled }}",
  3962.                     "{{ auto_down_force_disabled }}",
  3963.                     "{{ auto_ventilate_force_disabled }}",
  3964.                     "{{ auto_shading_start_force_disabled }}"
  3965.                   ]
  3966.                 },
  3967.                 {
  3968.                   "or": [
  3969.                     {
  3970.                       "and": [
  3971.                         "{{ is_time_control_disabled }}"
  3972.                       ]
  3973.                     },
  3974.                     {
  3975.                       "and": [
  3976.                         "{{ is_time_field_enabled }}",
  3977.                         "{{ now() >= today_at(time_up_early_today) }}",
  3978.                         "{{ now() <= today_at(time_down_late_today) + timedelta(seconds = 5) }}"
  3979.                       ]
  3980.                     },
  3981.                     {
  3982.                       "and": [
  3983.                         "{{ is_schedule_helper_enabled }}",
  3984.                         "{{ time_schedule_helper != [] }}",
  3985.                         "{{ is_state(time_schedule_helper, 'on') }}"
  3986.                       ]
  3987.                     }
  3988.                   ]
  3989.                 },
  3990.                 "{{ not (is_helper_manual and override_shading_after_manual) }}",
  3991.                 "{{ not is_helper_closed }}",
  3992.                 {
  3993.                   "or": [
  3994.                     "{{ is_helper_shaded }}",
  3995.                     "{{ in_shading_position }}"
  3996.                   ]
  3997.                 },
  3998.                 {
  3999.                   "or": [
  4000.                     "{{ not prevent_shading_end_if_closed }}",
  4001.                     "{{ prevent_shading_end_if_closed and not in_close_position}}"
  4002.                   ]
  4003.                 },
  4004.                 {
  4005.                   "or": [
  4006.                     "{{ resident_sensor == [] }}",
  4007.                     "{{ states(resident_sensor) in ['false', 'off'] }}"
  4008.                   ]
  4009.                 }
  4010.               ],
  4011.               "sequence": [
  4012.                 {
  4013.                   "choose": [
  4014.                     {
  4015.                       "alias": "Shading end detected. Save next execution time and pending status",
  4016.                       "conditions": [
  4017.                         "{{ trigger.id | regex_match('^(t_shading_end_pending)') }}",
  4018.                         "{{ not is_helper_shading_end }}"
  4019.                       ],
  4020.                       "sequence": [
  4021.                         {
  4022.                           "variables": {
  4023.                             "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