Advertisement
Guest User

Untitled

a guest
Apr 14th, 2024
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 448.50 KB | None | 0 0
  1. {
  2.   "trace": {
  3.     "last_step": "action/0/default/3/parallel/1/sequence/10",
  4.     "run_id": "2301e62fe47c728d5ce8b1d57c0fc5a2",
  5.     "state": "stopped",
  6.     "script_execution": "finished",
  7.     "timestamp": {
  8.       "start": "2024-04-14T16:47:09.847830+00:00",
  9.       "finish": "2024-04-14T16:49:23.994219+00:00"
  10.     },
  11.     "domain": "automation",
  12.     "item_id": "1696792357064",
  13.     "trigger": "state of binary_sensor.hue_motion_sensor_1_motion",
  14.     "trace": {
  15.       "trigger/0": [
  16.         {
  17.           "path": "trigger/0",
  18.           "timestamp": "2024-04-14T16:47:09.854598+00:00",
  19.           "changed_variables": {
  20.             "this": {
  21.               "entity_id": "automation.sensor_light_staircase_ff",
  22.               "state": "on",
  23.               "attributes": {
  24.                 "id": "1696792357064",
  25.                 "last_triggered": "2024-04-14T15:39:54.674777+00:00",
  26.                 "mode": "restart",
  27.                 "current": 0,
  28.                 "friendly_name": "Sensor Light Staircase FF"
  29.               },
  30.               "last_changed": "2024-04-14T16:37:23.129053+00:00",
  31.               "last_reported": "2024-04-14T16:37:23.129075+00:00",
  32.               "last_updated": "2024-04-14T16:37:23.129053+00:00",
  33.               "context": {
  34.                 "id": "01HVEQGXHSZ68NT2G19QY7P5NV",
  35.                 "parent_id": null,
  36.                 "user_id": null
  37.               }
  38.             },
  39.             "trigger": {
  40.               "id": "t0",
  41.               "idx": "0",
  42.               "alias": null,
  43.               "platform": "state",
  44.               "entity_id": "binary_sensor.hue_motion_sensor_1_motion",
  45.               "from_state": {
  46.                 "entity_id": "binary_sensor.hue_motion_sensor_1_motion",
  47.                 "state": "off",
  48.                 "attributes": {
  49.                   "device_class": "motion",
  50.                   "friendly_name": "Hue motion sensor 1 Motion"
  51.                 },
  52.                 "last_changed": "2024-04-14T16:37:13.204454+00:00",
  53.                 "last_reported": "2024-04-14T16:37:13.204454+00:00",
  54.                 "last_updated": "2024-04-14T16:37:13.204454+00:00",
  55.                 "context": {
  56.                   "id": "01HVEQGKVMCAP111CCMQ3QFHCS",
  57.                   "parent_id": null,
  58.                   "user_id": null
  59.                 }
  60.               },
  61.               "to_state": {
  62.                 "entity_id": "binary_sensor.hue_motion_sensor_1_motion",
  63.                 "state": "on",
  64.                 "attributes": {
  65.                   "device_class": "motion",
  66.                   "friendly_name": "Hue motion sensor 1 Motion"
  67.                 },
  68.                 "last_changed": "2024-04-14T16:47:09.847237+00:00",
  69.                 "last_reported": "2024-04-14T16:47:09.847237+00:00",
  70.                 "last_updated": "2024-04-14T16:47:09.847237+00:00",
  71.                 "context": {
  72.                   "id": "01HVER2TGQS44JVM0ZNME0WYB2",
  73.                   "parent_id": null,
  74.                   "user_id": null
  75.                 }
  76.               },
  77.               "for": null,
  78.               "attribute": null,
  79.               "description": "state of binary_sensor.hue_motion_sensor_1_motion"
  80.             },
  81.             "motion_trigger": [
  82.               "binary_sensor.hue_motion_sensor_1_motion"
  83.             ],
  84.             "light_switch": {
  85.               "entity_id": "scene.scene_staircase_ff_day"
  86.             },
  87.             "boolean_scenes_scripts": [],
  88.             "end_scenes": [
  89.               "scene.scene_staircase_ff_off"
  90.             ],
  91.             "time_delay": 2,
  92.             "include_light_control": [
  93.               "use_brightness",
  94.               "use_transition"
  95.             ],
  96.             "light_brightness": 80,
  97.             "brightness_value": 80,
  98.             "light_colour_temperature": 5000,
  99.             "temperature_value": [],
  100.             "light_transition_on": 5,
  101.             "light_transition_off": 10,
  102.             "transition_on_value": 5,
  103.             "transition_off_value": 10,
  104.             "include_dynamic_lighting": [],
  105.             "dynamic_lighting_lux_sensor": "sensor.hue_motion_sensor_1_illuminance",
  106.             "dynamic_lighting_max_lux": 400,
  107.             "dynamic_lighting_min_lux": 40,
  108.             "dynamic_lighting_max_brightness": 100,
  109.             "dynamic_lighting_min_brightness": 0,
  110.             "dynamic_lighting_max_colour_temp": 5000,
  111.             "dynamic_lighting_min_colour_temp": 3000,
  112.             "dynamic_lighting_sun_elevation_start_rising": -1.5,
  113.             "dynamic_lighting_sun_elevation_end_rising": 15,
  114.             "dynamic_lighting_sun_elevation_start_falling": 15,
  115.             "dynamic_lighting_sun_elevation_end_falling": -4,
  116.             "dynamic_lighting_heartbeat": 1,
  117.             "dynamic_lighting_step_value": 4,
  118.             "dynamic_lighting_dead_zone": 7,
  119.             "include_bypass": [],
  120.             "motion_bypass_lights_on": [],
  121.             "motion_bypass_lights_off": [],
  122.             "motion_bypass_lights_stop": [],
  123.             "bypass_time_delay": 0,
  124.             "include_bypass_auto_off": [],
  125.             "bypass_auto_off_delay": 60,
  126.             "include_sun": "sun_disabled",
  127.             "sun_elevation": -1.5,
  128.             "sun_elevation_rising": -4,
  129.             "include_ambient": "ambient_disabled",
  130.             "ambient_light_sensor": "sensor.hue_motion_sensor_1_illuminance",
  131.             "ambient_light_options": "ambient_light_option_enabled",
  132.             "ambient_light_value": 50,
  133.             "ambient_light_high_value": 80,
  134.             "include_time": "time_disabled",
  135.             "after_time": "00:00:00",
  136.             "before_time": "00:00:00",
  137.             "weekday_options": [
  138.               "mon",
  139.               "tue",
  140.               "wed",
  141.               "thu",
  142.               "fri",
  143.               "sat",
  144.               "sun"
  145.             ],
  146.             "include_device_tracker": "device_tracker_disabled",
  147.             "zone": "zone.home",
  148.             "people": [
  149.               "person.chris_home"
  150.             ],
  151.             "include_night_lights": "night_lights_enabled",
  152.             "night_lights": {
  153.               "entity_id": "scene.scene_staircase_ff_night"
  154.             },
  155.             "night_boolean_scenes_scripts": [],
  156.             "night_time_delay": 1,
  157.             "include_night_light_control": [
  158.               "use_transition",
  159.               "use_brightness",
  160.               "if_lights_are_on_adjust_when_crossing_over"
  161.             ],
  162.             "night_light_brightness": 1,
  163.             "night_brightness_value": 1,
  164.             "night_light_colour_temperature": 5000,
  165.             "night_temperature_value": [],
  166.             "night_light_transition_on": 5,
  167.             "night_light_transition_off": 10,
  168.             "night_transition_on_value": 5,
  169.             "night_transition_off_value": 10,
  170.             "night_lights_conditions": [
  171.               "sun_enabled",
  172.               "time_enabled"
  173.             ],
  174.             "night_lights_entity_state": [],
  175.             "night_lights_after_time": "21:30:00",
  176.             "night_lights_before_time": "07:00:00",
  177.             "night_lights_sun_elevation": -1.5,
  178.             "night_lights_sun_elevation_rising": -4,
  179.             "light_entities_off": [],
  180.             "switch_entities_off": [],
  181.             "light_entities": [],
  182.             "switch_entities": [],
  183.             "scene_entities": [
  184.               "scene.scene_staircase_ff_day"
  185.             ],
  186.             "script_entities": [],
  187.             "boolean_scenes_scripts_helper": [],
  188.             "end_scene_entities": [
  189.               "scene.scene_staircase_ff_off"
  190.             ],
  191.             "end_script_entities": [],
  192.             "night_light_entities_off": [],
  193.             "night_switch_entities_off": [],
  194.             "night_light_entities": [],
  195.             "night_switch_entities": [],
  196.             "night_scene_entities": [
  197.               "scene.scene_staircase_ff_night"
  198.             ],
  199.             "night_script_entities": [],
  200.             "night_boolean_scenes_scripts_helper": [],
  201.             "crossover_lights_light": [],
  202.             "crossover_lights_switch": [],
  203.             "crossover_night_lights_light_on": [],
  204.             "crossover_night_lights_light": [],
  205.             "crossover_night_lights_switch": [],
  206.             "crossover_lights_light_on": []
  207.           }
  208.         }
  209.       ],
  210.       "condition/0": [
  211.         {
  212.           "path": "condition/0",
  213.           "timestamp": "2024-04-14T16:47:09.854688+00:00",
  214.           "result": {
  215.             "result": true
  216.           }
  217.         }
  218.       ],
  219.       "condition/0/conditions/0": [
  220.         {
  221.           "path": "condition/0/conditions/0",
  222.           "timestamp": "2024-04-14T16:47:09.854766+00:00",
  223.           "result": {
  224.             "result": true
  225.           }
  226.         }
  227.       ],
  228.       "condition/0/conditions/0/conditions/0": [
  229.         {
  230.           "path": "condition/0/conditions/0/conditions/0",
  231.           "timestamp": "2024-04-14T16:47:09.854829+00:00",
  232.           "result": {
  233.             "result": true
  234.           }
  235.         }
  236.       ],
  237.       "condition/0/conditions/0/conditions/0/entity_id/0": [
  238.         {
  239.           "path": "condition/0/conditions/0/conditions/0/entity_id/0",
  240.           "timestamp": "2024-04-14T16:47:09.854895+00:00",
  241.           "result": {
  242.             "result": true,
  243.             "state": "on",
  244.             "wanted_state": "on"
  245.           }
  246.         }
  247.       ],
  248.       "condition/0/conditions/0/conditions/1": [
  249.         {
  250.           "path": "condition/0/conditions/0/conditions/1",
  251.           "timestamp": "2024-04-14T16:47:09.855005+00:00",
  252.           "result": {
  253.             "result": true
  254.           }
  255.         }
  256.       ],
  257.       "condition/1": [
  258.         {
  259.           "path": "condition/1",
  260.           "timestamp": "2024-04-14T16:47:09.855104+00:00",
  261.           "result": {
  262.             "result": true
  263.           }
  264.         }
  265.       ],
  266.       "condition/1/conditions/0": [
  267.         {
  268.           "path": "condition/1/conditions/0",
  269.           "timestamp": "2024-04-14T16:47:09.855163+00:00",
  270.           "result": {
  271.             "result": true,
  272.             "entities": []
  273.           }
  274.         }
  275.       ],
  276.       "condition/2": [
  277.         {
  278.           "path": "condition/2",
  279.           "timestamp": "2024-04-14T16:47:09.855563+00:00",
  280.           "result": {
  281.             "result": true
  282.           }
  283.         }
  284.       ],
  285.       "condition/2/conditions/0": [
  286.         {
  287.           "path": "condition/2/conditions/0",
  288.           "timestamp": "2024-04-14T16:47:09.855629+00:00",
  289.           "result": {
  290.             "result": true,
  291.             "entities": []
  292.           }
  293.         }
  294.       ],
  295.       "condition/3": [
  296.         {
  297.           "path": "condition/3",
  298.           "timestamp": "2024-04-14T16:47:09.855940+00:00",
  299.           "result": {
  300.             "result": true
  301.           }
  302.         }
  303.       ],
  304.       "condition/3/conditions/0": [
  305.         {
  306.           "path": "condition/3/conditions/0",
  307.           "timestamp": "2024-04-14T16:47:09.856007+00:00",
  308.           "result": {
  309.             "result": true,
  310.             "entities": []
  311.           }
  312.         }
  313.       ],
  314.       "condition/4": [
  315.         {
  316.           "path": "condition/4",
  317.           "timestamp": "2024-04-14T16:47:09.856299+00:00",
  318.           "result": {
  319.             "result": true
  320.           }
  321.         }
  322.       ],
  323.       "condition/4/conditions/0": [
  324.         {
  325.           "path": "condition/4/conditions/0",
  326.           "timestamp": "2024-04-14T16:47:09.856363+00:00",
  327.           "result": {
  328.             "result": true,
  329.             "entities": []
  330.           }
  331.         }
  332.       ],
  333.       "condition/5": [
  334.         {
  335.           "path": "condition/5",
  336.           "timestamp": "2024-04-14T16:47:09.856644+00:00",
  337.           "result": {
  338.             "result": true
  339.           }
  340.         }
  341.       ],
  342.       "condition/5/conditions/0": [
  343.         {
  344.           "path": "condition/5/conditions/0",
  345.           "timestamp": "2024-04-14T16:47:09.856706+00:00",
  346.           "result": {
  347.             "result": true,
  348.             "entities": []
  349.           }
  350.         }
  351.       ],
  352.       "action/0": [
  353.         {
  354.           "path": "action/0",
  355.           "timestamp": "2024-04-14T16:47:09.857513+00:00",
  356.           "changed_variables": {
  357.             "context": {
  358.               "id": "01HVER2TGQBE0S018FQH70ZMDX",
  359.               "parent_id": "01HVER2TGQS44JVM0ZNME0WYB2",
  360.               "user_id": null
  361.             }
  362.           },
  363.           "result": {
  364.             "choice": "default"
  365.           }
  366.         }
  367.       ],
  368.       "action/0/choose/0": [
  369.         {
  370.           "path": "action/0/choose/0",
  371.           "timestamp": "2024-04-14T16:47:09.869227+00:00",
  372.           "result": {
  373.             "result": false
  374.           }
  375.         }
  376.       ],
  377.       "action/0/choose/0/conditions/0": [
  378.         {
  379.           "path": "action/0/choose/0/conditions/0",
  380.           "timestamp": "2024-04-14T16:47:09.869351+00:00",
  381.           "result": {
  382.             "result": false
  383.           }
  384.         }
  385.       ],
  386.       "action/0/choose/0/conditions/0/conditions/0": [
  387.         {
  388.           "path": "action/0/choose/0/conditions/0/conditions/0",
  389.           "timestamp": "2024-04-14T16:47:09.869426+00:00",
  390.           "result": {
  391.             "result": true
  392.           }
  393.         }
  394.       ],
  395.       "action/0/choose/0/conditions/0/conditions/0/conditions/0": [
  396.         {
  397.           "path": "action/0/choose/0/conditions/0/conditions/0/conditions/0",
  398.           "timestamp": "2024-04-14T16:47:09.869490+00:00",
  399.           "result": {
  400.             "result": true,
  401.             "entities": []
  402.           }
  403.         }
  404.       ],
  405.       "action/0/choose/0/conditions/0/conditions/1": [
  406.         {
  407.           "path": "action/0/choose/0/conditions/0/conditions/1",
  408.           "timestamp": "2024-04-14T16:47:09.870688+00:00",
  409.           "result": {
  410.             "result": true
  411.           }
  412.         }
  413.       ],
  414.       "action/0/choose/0/conditions/0/conditions/1/conditions/0": [
  415.         {
  416.           "path": "action/0/choose/0/conditions/0/conditions/1/conditions/0",
  417.           "timestamp": "2024-04-14T16:47:09.870772+00:00",
  418.           "result": {
  419.             "result": true,
  420.             "entities": []
  421.           }
  422.         }
  423.       ],
  424.       "action/0/choose/0/conditions/0/conditions/2": [
  425.         {
  426.           "path": "action/0/choose/0/conditions/0/conditions/2",
  427.           "timestamp": "2024-04-14T16:47:09.871114+00:00",
  428.           "result": {
  429.             "result": false
  430.           }
  431.         }
  432.       ],
  433.       "action/0/choose/0/conditions/0/conditions/2/conditions/0": [
  434.         {
  435.           "path": "action/0/choose/0/conditions/0/conditions/2/conditions/0",
  436.           "timestamp": "2024-04-14T16:47:09.871187+00:00",
  437.           "result": {
  438.             "result": false,
  439.             "entities": []
  440.           }
  441.         }
  442.       ],
  443.       "action/0/choose/0/conditions/0/conditions/2/conditions/1": [
  444.         {
  445.           "path": "action/0/choose/0/conditions/0/conditions/2/conditions/1",
  446.           "timestamp": "2024-04-14T16:47:09.871534+00:00",
  447.           "result": {
  448.             "result": false,
  449.             "entities": []
  450.           }
  451.         }
  452.       ],
  453.       "action/0/choose/0/conditions/0/conditions/2/conditions/2": [
  454.         {
  455.           "path": "action/0/choose/0/conditions/0/conditions/2/conditions/2",
  456.           "timestamp": "2024-04-14T16:47:09.871829+00:00",
  457.           "result": {
  458.             "result": false
  459.           }
  460.         }
  461.       ],
  462.       "action/0/choose/0/conditions/0/conditions/2/conditions/2/conditions/0": [
  463.         {
  464.           "path": "action/0/choose/0/conditions/0/conditions/2/conditions/2/conditions/0",
  465.           "timestamp": "2024-04-14T16:47:09.871899+00:00",
  466.           "result": {
  467.             "result": true,
  468.             "entities": []
  469.           }
  470.         }
  471.       ],
  472.       "action/0/choose/0/conditions/0/conditions/2/conditions/2/conditions/1": [
  473.         {
  474.           "path": "action/0/choose/0/conditions/0/conditions/2/conditions/2/conditions/1",
  475.           "timestamp": "2024-04-14T16:47:09.872183+00:00",
  476.           "result": {
  477.             "after": {
  478.               "__type": "<class 'datetime.time'>",
  479.               "isoformat": "21:30:00"
  480.             },
  481.             "now_time": {
  482.               "__type": "<class 'datetime.time'>",
  483.               "isoformat": "18:47:09.872245"
  484.             },
  485.             "before": {
  486.               "__type": "<class 'datetime.time'>",
  487.               "isoformat": "07:00:00"
  488.             },
  489.             "result": false
  490.           }
  491.         }
  492.       ],
  493.       "action/0/default/0": [
  494.         {
  495.           "path": "action/0/default/0",
  496.           "timestamp": "2024-04-14T16:47:09.880165+00:00"
  497.         }
  498.       ],
  499.       "action/0/default/0/choose/0": [
  500.         {
  501.           "path": "action/0/default/0/choose/0",
  502.           "timestamp": "2024-04-14T16:47:09.880770+00:00",
  503.           "result": {
  504.             "result": false
  505.           }
  506.         }
  507.       ],
  508.       "action/0/default/0/choose/0/conditions/0": [
  509.         {
  510.           "path": "action/0/default/0/choose/0/conditions/0",
  511.           "timestamp": "2024-04-14T16:47:09.880836+00:00",
  512.           "result": {
  513.             "result": false
  514.           }
  515.         }
  516.       ],
  517.       "action/0/default/0/choose/1": [
  518.         {
  519.           "path": "action/0/default/0/choose/1",
  520.           "timestamp": "2024-04-14T16:47:09.880931+00:00",
  521.           "result": {
  522.             "result": false
  523.           }
  524.         }
  525.       ],
  526.       "action/0/default/0/choose/1/conditions/0": [
  527.         {
  528.           "path": "action/0/default/0/choose/1/conditions/0",
  529.           "timestamp": "2024-04-14T16:47:09.880982+00:00",
  530.           "result": {
  531.             "result": false
  532.           }
  533.         }
  534.       ],
  535.       "action/0/default/1": [
  536.         {
  537.           "path": "action/0/default/1",
  538.           "timestamp": "2024-04-14T16:47:09.881114+00:00"
  539.         }
  540.       ],
  541.       "action/0/default/1/choose/0": [
  542.         {
  543.           "path": "action/0/default/1/choose/0",
  544.           "timestamp": "2024-04-14T16:47:09.882573+00:00",
  545.           "result": {
  546.             "result": false
  547.           }
  548.         }
  549.       ],
  550.       "action/0/default/1/choose/0/conditions/0": [
  551.         {
  552.           "path": "action/0/default/1/choose/0/conditions/0",
  553.           "timestamp": "2024-04-14T16:47:09.882632+00:00",
  554.           "result": {
  555.             "result": false
  556.           }
  557.         }
  558.       ],
  559.       "action/0/default/1/choose/1": [
  560.         {
  561.           "path": "action/0/default/1/choose/1",
  562.           "timestamp": "2024-04-14T16:47:09.882715+00:00",
  563.           "result": {
  564.             "result": false
  565.           }
  566.         }
  567.       ],
  568.       "action/0/default/1/choose/1/conditions/0": [
  569.         {
  570.           "path": "action/0/default/1/choose/1/conditions/0",
  571.           "timestamp": "2024-04-14T16:47:09.882780+00:00",
  572.           "result": {
  573.             "result": false
  574.           }
  575.         }
  576.       ],
  577.       "action/0/default/2": [
  578.         {
  579.           "path": "action/0/default/2",
  580.           "timestamp": "2024-04-14T16:47:09.882902+00:00"
  581.         }
  582.       ],
  583.       "action/0/default/2/choose/0": [
  584.         {
  585.           "path": "action/0/default/2/choose/0",
  586.           "timestamp": "2024-04-14T16:47:09.883965+00:00",
  587.           "result": {
  588.             "result": false
  589.           }
  590.         }
  591.       ],
  592.       "action/0/default/2/choose/0/conditions/0": [
  593.         {
  594.           "path": "action/0/default/2/choose/0/conditions/0",
  595.           "timestamp": "2024-04-14T16:47:09.884010+00:00",
  596.           "result": {
  597.             "result": false
  598.           }
  599.         }
  600.       ],
  601.       "action/0/default/2/choose/1": [
  602.         {
  603.           "path": "action/0/default/2/choose/1",
  604.           "timestamp": "2024-04-14T16:47:09.884072+00:00",
  605.           "result": {
  606.             "result": false
  607.           }
  608.         }
  609.       ],
  610.       "action/0/default/2/choose/1/conditions/0": [
  611.         {
  612.           "path": "action/0/default/2/choose/1/conditions/0",
  613.           "timestamp": "2024-04-14T16:47:09.884113+00:00",
  614.           "result": {
  615.             "result": false
  616.           }
  617.         }
  618.       ],
  619.       "action/0/default/2/choose/2": [
  620.         {
  621.           "path": "action/0/default/2/choose/2",
  622.           "timestamp": "2024-04-14T16:47:09.884167+00:00",
  623.           "result": {
  624.             "result": false
  625.           }
  626.         }
  627.       ],
  628.       "action/0/default/2/choose/2/conditions/0": [
  629.         {
  630.           "path": "action/0/default/2/choose/2/conditions/0",
  631.           "timestamp": "2024-04-14T16:47:09.884201+00:00",
  632.           "result": {
  633.             "result": false
  634.           }
  635.         }
  636.       ],
  637.       "action/0/default/3": [
  638.         {
  639.           "path": "action/0/default/3",
  640.           "timestamp": "2024-04-14T16:47:09.884291+00:00"
  641.         }
  642.       ],
  643.       "action/0/default/3/parallel/0/sequence/0": [
  644.         {
  645.           "path": "action/0/default/3/parallel/0/sequence/0",
  646.           "timestamp": "2024-04-14T16:47:09.885956+00:00",
  647.           "result": {
  648.             "result": true
  649.           }
  650.         }
  651.       ],
  652.       "action/0/default/3/parallel/0/sequence/0/conditions/0": [
  653.         {
  654.           "path": "action/0/default/3/parallel/0/sequence/0/conditions/0",
  655.           "timestamp": "2024-04-14T16:47:09.886087+00:00",
  656.           "result": {
  657.             "result": true,
  658.             "entities": []
  659.           }
  660.         }
  661.       ],
  662.       "action/0/default/3/parallel/0/sequence/1": [
  663.         {
  664.           "path": "action/0/default/3/parallel/0/sequence/1",
  665.           "timestamp": "2024-04-14T16:47:09.886381+00:00"
  666.         }
  667.       ],
  668.       "action/0/default/3/parallel/0/sequence/1/choose/0": [
  669.         {
  670.           "path": "action/0/default/3/parallel/0/sequence/1/choose/0",
  671.           "timestamp": "2024-04-14T16:47:09.886622+00:00",
  672.           "result": {
  673.             "result": false
  674.           }
  675.         }
  676.       ],
  677.       "action/0/default/3/parallel/0/sequence/1/choose/0/conditions/0": [
  678.         {
  679.           "path": "action/0/default/3/parallel/0/sequence/1/choose/0/conditions/0",
  680.           "timestamp": "2024-04-14T16:47:09.886666+00:00",
  681.           "result": {
  682.             "result": false,
  683.             "entities": []
  684.           }
  685.         }
  686.       ],
  687.       "action/0/default/3/parallel/0/sequence/2": [
  688.         {
  689.           "path": "action/0/default/3/parallel/0/sequence/2",
  690.           "timestamp": "2024-04-14T16:47:09.886904+00:00"
  691.         }
  692.       ],
  693.       "action/0/default/3/parallel/0/sequence/2/choose/0": [
  694.         {
  695.           "path": "action/0/default/3/parallel/0/sequence/2/choose/0",
  696.           "timestamp": "2024-04-14T16:47:09.887134+00:00",
  697.           "result": {
  698.             "result": false
  699.           }
  700.         }
  701.       ],
  702.       "action/0/default/3/parallel/0/sequence/2/choose/0/conditions/0": [
  703.         {
  704.           "path": "action/0/default/3/parallel/0/sequence/2/choose/0/conditions/0",
  705.           "timestamp": "2024-04-14T16:47:09.887175+00:00",
  706.           "result": {
  707.             "result": false,
  708.             "entities": []
  709.           }
  710.         }
  711.       ],
  712.       "action/0/default/3/parallel/0/sequence/3": [
  713.         {
  714.           "path": "action/0/default/3/parallel/0/sequence/3",
  715.           "timestamp": "2024-04-14T16:47:09.887403+00:00"
  716.         }
  717.       ],
  718.       "action/0/default/3/parallel/0/sequence/3/choose/0": [
  719.         {
  720.           "path": "action/0/default/3/parallel/0/sequence/3/choose/0",
  721.           "timestamp": "2024-04-14T16:47:09.887833+00:00",
  722.           "result": {
  723.             "result": false
  724.           }
  725.         }
  726.       ],
  727.       "action/0/default/3/parallel/0/sequence/3/choose/0/conditions/0": [
  728.         {
  729.           "path": "action/0/default/3/parallel/0/sequence/3/choose/0/conditions/0",
  730.           "timestamp": "2024-04-14T16:47:09.887877+00:00",
  731.           "result": {
  732.             "result": false,
  733.             "entities": []
  734.           }
  735.         }
  736.       ],
  737.       "action/0/default/3/parallel/0/sequence/4": [
  738.         {
  739.           "path": "action/0/default/3/parallel/0/sequence/4",
  740.           "timestamp": "2024-04-14T16:47:09.888113+00:00"
  741.         }
  742.       ],
  743.       "action/0/default/3/parallel/0/sequence/4/choose/0": [
  744.         {
  745.           "path": "action/0/default/3/parallel/0/sequence/4/choose/0",
  746.           "timestamp": "2024-04-14T16:47:09.888340+00:00",
  747.           "result": {
  748.             "result": false
  749.           }
  750.         }
  751.       ],
  752.       "action/0/default/3/parallel/0/sequence/4/choose/0/conditions/0": [
  753.         {
  754.           "path": "action/0/default/3/parallel/0/sequence/4/choose/0/conditions/0",
  755.           "timestamp": "2024-04-14T16:47:09.888381+00:00",
  756.           "result": {
  757.             "result": false,
  758.             "entities": []
  759.           }
  760.         }
  761.       ],
  762.       "action/0/default/3/parallel/0/sequence/5": [
  763.         {
  764.           "path": "action/0/default/3/parallel/0/sequence/5",
  765.           "timestamp": "2024-04-14T16:47:09.888586+00:00"
  766.         }
  767.       ],
  768.       "action/0/default/3/parallel/0/sequence/5/choose/0": [
  769.         {
  770.           "path": "action/0/default/3/parallel/0/sequence/5/choose/0",
  771.           "timestamp": "2024-04-14T16:47:09.888732+00:00",
  772.           "result": {
  773.             "result": false
  774.           }
  775.         }
  776.       ],
  777.       "action/0/default/3/parallel/0/sequence/5/choose/0/conditions/0": [
  778.         {
  779.           "path": "action/0/default/3/parallel/0/sequence/5/choose/0/conditions/0",
  780.           "timestamp": "2024-04-14T16:47:09.888765+00:00",
  781.           "result": {
  782.             "result": false,
  783.             "entities": []
  784.           }
  785.         }
  786.       ],
  787.       "action/0/default/3/parallel/0/sequence/6": [
  788.         {
  789.           "path": "action/0/default/3/parallel/0/sequence/6",
  790.           "timestamp": "2024-04-14T16:47:09.888949+00:00"
  791.         }
  792.       ],
  793.       "action/0/default/3/parallel/0/sequence/6/choose/0": [
  794.         {
  795.           "path": "action/0/default/3/parallel/0/sequence/6/choose/0",
  796.           "timestamp": "2024-04-14T16:47:09.889095+00:00",
  797.           "result": {
  798.             "result": false
  799.           }
  800.         }
  801.       ],
  802.       "action/0/default/3/parallel/0/sequence/6/choose/0/conditions/0": [
  803.         {
  804.           "path": "action/0/default/3/parallel/0/sequence/6/choose/0/conditions/0",
  805.           "timestamp": "2024-04-14T16:47:09.889130+00:00",
  806.           "result": {
  807.             "result": false,
  808.             "entities": []
  809.           }
  810.         }
  811.       ],
  812.       "action/0/default/3/parallel/0/sequence/7": [
  813.         {
  814.           "path": "action/0/default/3/parallel/0/sequence/7",
  815.           "timestamp": "2024-04-14T16:47:09.889311+00:00",
  816.           "result": {
  817.             "stop": "Stop the automation",
  818.             "error": false
  819.           }
  820.         }
  821.       ],
  822.       "action/0/default/3/parallel/1/sequence/0": [
  823.         {
  824.           "path": "action/0/default/3/parallel/1/sequence/0",
  825.           "timestamp": "2024-04-14T16:47:09.889917+00:00"
  826.         }
  827.       ],
  828.       "action/0/default/3/parallel/1/sequence/0/choose/0": [
  829.         {
  830.           "path": "action/0/default/3/parallel/1/sequence/0/choose/0",
  831.           "timestamp": "2024-04-14T16:47:09.890550+00:00",
  832.           "result": {
  833.             "result": false
  834.           }
  835.         }
  836.       ],
  837.       "action/0/default/3/parallel/1/sequence/0/choose/0/conditions/0": [
  838.         {
  839.           "path": "action/0/default/3/parallel/1/sequence/0/choose/0/conditions/0",
  840.           "timestamp": "2024-04-14T16:47:09.890593+00:00",
  841.           "result": {
  842.             "result": false,
  843.             "entities": []
  844.           }
  845.         }
  846.       ],
  847.       "action/0/default/3/parallel/1/sequence/0/choose/1": [
  848.         {
  849.           "path": "action/0/default/3/parallel/1/sequence/0/choose/1",
  850.           "timestamp": "2024-04-14T16:47:09.890777+00:00",
  851.           "result": {
  852.             "result": false
  853.           }
  854.         }
  855.       ],
  856.       "action/0/default/3/parallel/1/sequence/0/choose/1/conditions/0": [
  857.         {
  858.           "path": "action/0/default/3/parallel/1/sequence/0/choose/1/conditions/0",
  859.           "timestamp": "2024-04-14T16:47:09.890814+00:00",
  860.           "result": {
  861.             "result": false,
  862.             "entities": []
  863.           }
  864.         }
  865.       ],
  866.       "action/0/default/3/parallel/1/sequence/0/choose/2": [
  867.         {
  868.           "path": "action/0/default/3/parallel/1/sequence/0/choose/2",
  869.           "timestamp": "2024-04-14T16:47:09.890974+00:00",
  870.           "result": {
  871.             "result": false
  872.           }
  873.         }
  874.       ],
  875.       "action/0/default/3/parallel/1/sequence/0/choose/2/conditions/0": [
  876.         {
  877.           "path": "action/0/default/3/parallel/1/sequence/0/choose/2/conditions/0",
  878.           "timestamp": "2024-04-14T16:47:09.891008+00:00",
  879.           "result": {
  880.             "result": false,
  881.             "entities": []
  882.           }
  883.         }
  884.       ],
  885.       "action/0/default/3/parallel/1/sequence/0/choose/3": [
  886.         {
  887.           "path": "action/0/default/3/parallel/1/sequence/0/choose/3",
  888.           "timestamp": "2024-04-14T16:47:09.891158+00:00",
  889.           "result": {
  890.             "result": false
  891.           }
  892.         }
  893.       ],
  894.       "action/0/default/3/parallel/1/sequence/0/choose/3/conditions/0": [
  895.         {
  896.           "path": "action/0/default/3/parallel/1/sequence/0/choose/3/conditions/0",
  897.           "timestamp": "2024-04-14T16:47:09.891193+00:00",
  898.           "result": {
  899.             "result": false,
  900.             "entities": []
  901.           }
  902.         }
  903.       ],
  904.       "action/0/default/3/parallel/1/sequence/0/choose/4": [
  905.         {
  906.           "path": "action/0/default/3/parallel/1/sequence/0/choose/4",
  907.           "timestamp": "2024-04-14T16:47:09.891340+00:00",
  908.           "result": {
  909.             "result": false
  910.           }
  911.         }
  912.       ],
  913.       "action/0/default/3/parallel/1/sequence/0/choose/4/conditions/0": [
  914.         {
  915.           "path": "action/0/default/3/parallel/1/sequence/0/choose/4/conditions/0",
  916.           "timestamp": "2024-04-14T16:47:09.891373+00:00",
  917.           "result": {
  918.             "result": false,
  919.             "entities": []
  920.           }
  921.         }
  922.       ],
  923.       "action/0/default/3/parallel/1/sequence/0/choose/5": [
  924.         {
  925.           "path": "action/0/default/3/parallel/1/sequence/0/choose/5",
  926.           "timestamp": "2024-04-14T16:47:09.891530+00:00",
  927.           "result": {
  928.             "result": false
  929.           }
  930.         }
  931.       ],
  932.       "action/0/default/3/parallel/1/sequence/0/choose/5/conditions/0": [
  933.         {
  934.           "path": "action/0/default/3/parallel/1/sequence/0/choose/5/conditions/0",
  935.           "timestamp": "2024-04-14T16:47:09.891563+00:00",
  936.           "result": {
  937.             "result": false,
  938.             "entities": []
  939.           }
  940.         }
  941.       ],
  942.       "action/0/default/3/parallel/1/sequence/0/choose/6": [
  943.         {
  944.           "path": "action/0/default/3/parallel/1/sequence/0/choose/6",
  945.           "timestamp": "2024-04-14T16:47:09.891704+00:00",
  946.           "result": {
  947.             "result": false
  948.           }
  949.         }
  950.       ],
  951.       "action/0/default/3/parallel/1/sequence/0/choose/6/conditions/0": [
  952.         {
  953.           "path": "action/0/default/3/parallel/1/sequence/0/choose/6/conditions/0",
  954.           "timestamp": "2024-04-14T16:47:09.891738+00:00",
  955.           "result": {
  956.             "result": false,
  957.             "entities": []
  958.           }
  959.         }
  960.       ],
  961.       "action/0/default/3/parallel/1/sequence/0/choose/7": [
  962.         {
  963.           "path": "action/0/default/3/parallel/1/sequence/0/choose/7",
  964.           "timestamp": "2024-04-14T16:47:09.891876+00:00",
  965.           "result": {
  966.             "result": false
  967.           }
  968.         }
  969.       ],
  970.       "action/0/default/3/parallel/1/sequence/0/choose/7/conditions/0": [
  971.         {
  972.           "path": "action/0/default/3/parallel/1/sequence/0/choose/7/conditions/0",
  973.           "timestamp": "2024-04-14T16:47:09.891908+00:00",
  974.           "result": {
  975.             "result": false,
  976.             "entities": []
  977.           }
  978.         }
  979.       ],
  980.       "action/0/default/3/parallel/1/sequence/1": [
  981.         {
  982.           "path": "action/0/default/3/parallel/1/sequence/1",
  983.           "timestamp": "2024-04-14T16:47:09.892080+00:00",
  984.           "result": {
  985.             "choice": 1
  986.           }
  987.         }
  988.       ],
  989.       "action/0/default/3/parallel/1/sequence/1/choose/0": [
  990.         {
  991.           "path": "action/0/default/3/parallel/1/sequence/1/choose/0",
  992.           "timestamp": "2024-04-14T16:47:09.892264+00:00",
  993.           "result": {
  994.             "result": false
  995.           }
  996.         }
  997.       ],
  998.       "action/0/default/3/parallel/1/sequence/1/choose/0/conditions/0": [
  999.         {
  1000.           "path": "action/0/default/3/parallel/1/sequence/1/choose/0/conditions/0",
  1001.           "timestamp": "2024-04-14T16:47:09.892299+00:00",
  1002.           "result": {
  1003.             "result": false,
  1004.             "entities": []
  1005.           }
  1006.         }
  1007.       ],
  1008.       "action/0/default/3/parallel/1/sequence/1/choose/1": [
  1009.         {
  1010.           "path": "action/0/default/3/parallel/1/sequence/1/choose/1",
  1011.           "timestamp": "2024-04-14T16:47:09.892475+00:00",
  1012.           "result": {
  1013.             "result": true
  1014.           }
  1015.         }
  1016.       ],
  1017.       "action/0/default/3/parallel/1/sequence/1/choose/1/conditions/0": [
  1018.         {
  1019.           "path": "action/0/default/3/parallel/1/sequence/1/choose/1/conditions/0",
  1020.           "timestamp": "2024-04-14T16:47:09.892507+00:00",
  1021.           "result": {
  1022.             "result": true,
  1023.             "entities": []
  1024.           }
  1025.         }
  1026.       ],
  1027.       "action/0/default/3/parallel/1/sequence/1/choose/1/sequence/0": [
  1028.         {
  1029.           "path": "action/0/default/3/parallel/1/sequence/1/choose/1/sequence/0",
  1030.           "timestamp": "2024-04-14T16:47:09.892751+00:00",
  1031.           "result": {
  1032.             "params": {
  1033.               "domain": "scene",
  1034.               "service": "turn_on",
  1035.               "service_data": {
  1036.                 "transition": 5,
  1037.                 "entity_id": [
  1038.                   "scene.scene_staircase_ff_day"
  1039.                 ]
  1040.               },
  1041.               "target": {
  1042.                 "entity_id": [
  1043.                   "scene.scene_staircase_ff_day"
  1044.                 ]
  1045.               }
  1046.             },
  1047.             "running_script": false
  1048.           }
  1049.         }
  1050.       ],
  1051.       "action/0/default/3/parallel/1/sequence/1/choose/1/sequence/1": [
  1052.         {
  1053.           "path": "action/0/default/3/parallel/1/sequence/1/choose/1/sequence/1",
  1054.           "timestamp": "2024-04-14T16:47:09.898527+00:00",
  1055.           "result": {
  1056.             "params": {
  1057.               "domain": "input_boolean",
  1058.               "service": "turn_on",
  1059.               "service_data": {
  1060.                 "entity_id": []
  1061.               },
  1062.               "target": {}
  1063.             },
  1064.             "running_script": false
  1065.           }
  1066.         }
  1067.       ],
  1068.       "action/0/default/3/parallel/1/sequence/2": [
  1069.         {
  1070.           "path": "action/0/default/3/parallel/1/sequence/2",
  1071.           "timestamp": "2024-04-14T16:47:09.898964+00:00",
  1072.           "result": {
  1073.             "params": {
  1074.               "domain": "switch",
  1075.               "service": "turn_on",
  1076.               "service_data": {},
  1077.               "target": {
  1078.                 "entity_id": []
  1079.               }
  1080.             },
  1081.             "running_script": false
  1082.           }
  1083.         }
  1084.       ],
  1085.       "action/0/default/3/parallel/1/sequence/3": [
  1086.         {
  1087.           "path": "action/0/default/3/parallel/1/sequence/3",
  1088.           "timestamp": "2024-04-14T16:47:09.899279+00:00",
  1089.           "result": {
  1090.             "params": {
  1091.               "domain": "script",
  1092.               "service": "turn_on",
  1093.               "service_data": {},
  1094.               "target": {
  1095.                 "entity_id": []
  1096.               }
  1097.             },
  1098.             "running_script": true
  1099.           }
  1100.         }
  1101.       ],
  1102.       "action/0/default/3/parallel/1/sequence/4": [
  1103.         {
  1104.           "path": "action/0/default/3/parallel/1/sequence/4",
  1105.           "timestamp": "2024-04-14T16:47:09.899587+00:00"
  1106.         }
  1107.       ],
  1108.       "action/0/default/3/parallel/1/sequence/4/choose/0": [
  1109.         {
  1110.           "path": "action/0/default/3/parallel/1/sequence/4/choose/0",
  1111.           "timestamp": "2024-04-14T16:47:09.899724+00:00",
  1112.           "result": {
  1113.             "result": false
  1114.           }
  1115.         }
  1116.       ],
  1117.       "action/0/default/3/parallel/1/sequence/4/choose/0/conditions/0": [
  1118.         {
  1119.           "path": "action/0/default/3/parallel/1/sequence/4/choose/0/conditions/0",
  1120.           "timestamp": "2024-04-14T16:47:09.899750+00:00",
  1121.           "result": {
  1122.             "result": false
  1123.           }
  1124.         }
  1125.       ],
  1126.       "action/0/default/3/parallel/1/sequence/5": [
  1127.         {
  1128.           "path": "action/0/default/3/parallel/1/sequence/5",
  1129.           "timestamp": "2024-04-14T16:47:09.899810+00:00",
  1130.           "changed_variables": {
  1131.             "wait": {
  1132.               "remaining": null,
  1133.               "trigger": {
  1134.                 "id": "0",
  1135.                 "idx": "0",
  1136.                 "alias": null,
  1137.                 "platform": "state",
  1138.                 "entity_id": "binary_sensor.hue_motion_sensor_1_motion",
  1139.                 "from_state": {
  1140.                   "entity_id": "binary_sensor.hue_motion_sensor_1_motion",
  1141.                   "state": "on",
  1142.                   "attributes": {
  1143.                     "device_class": "motion",
  1144.                     "friendly_name": "Hue motion sensor 1 Motion"
  1145.                   },
  1146.                   "last_changed": "2024-04-14T16:47:09.847237+00:00",
  1147.                   "last_reported": "2024-04-14T16:47:09.847237+00:00",
  1148.                   "last_updated": "2024-04-14T16:47:09.847237+00:00",
  1149.                   "context": {
  1150.                     "id": "01HVER2TGQS44JVM0ZNME0WYB2",
  1151.                     "parent_id": null,
  1152.                     "user_id": null
  1153.                   }
  1154.                 },
  1155.                 "to_state": {
  1156.                   "entity_id": "binary_sensor.hue_motion_sensor_1_motion",
  1157.                   "state": "off",
  1158.                   "attributes": {
  1159.                     "device_class": "motion",
  1160.                     "friendly_name": "Hue motion sensor 1 Motion"
  1161.                   },
  1162.                   "last_changed": "2024-04-14T16:47:23.973513+00:00",
  1163.                   "last_reported": "2024-04-14T16:47:23.973513+00:00",
  1164.                   "last_updated": "2024-04-14T16:47:23.973513+00:00",
  1165.                   "context": {
  1166.                     "id": "01HVER38A50E551HW4M0A6Y3CP",
  1167.                     "parent_id": null,
  1168.                     "user_id": null
  1169.                   }
  1170.                 },
  1171.                 "for": null,
  1172.                 "attribute": null,
  1173.                 "description": "state of binary_sensor.hue_motion_sensor_1_motion"
  1174.               }
  1175.             }
  1176.           },
  1177.           "result": {
  1178.             "choice": 0
  1179.           }
  1180.         }
  1181.       ],
  1182.       "action/0/default/3/parallel/1/sequence/5/choose/0": [
  1183.         {
  1184.           "path": "action/0/default/3/parallel/1/sequence/5/choose/0",
  1185.           "timestamp": "2024-04-14T16:47:09.899888+00:00",
  1186.           "result": {
  1187.             "result": true
  1188.           }
  1189.         }
  1190.       ],
  1191.       "action/0/default/3/parallel/1/sequence/5/choose/0/conditions/0": [
  1192.         {
  1193.           "path": "action/0/default/3/parallel/1/sequence/5/choose/0/conditions/0",
  1194.           "timestamp": "2024-04-14T16:47:09.899913+00:00",
  1195.           "result": {
  1196.             "result": true
  1197.           }
  1198.         }
  1199.       ],
  1200.       "action/0/default/3/parallel/1/sequence/5/choose/0/conditions/0/entity_id/0": [
  1201.         {
  1202.           "path": "action/0/default/3/parallel/1/sequence/5/choose/0/conditions/0/entity_id/0",
  1203.           "timestamp": "2024-04-14T16:47:09.899934+00:00",
  1204.           "result": {
  1205.             "result": true,
  1206.             "state": "on",
  1207.             "wanted_state": "on"
  1208.           }
  1209.         }
  1210.       ],
  1211.       "action/0/default/3/parallel/1/sequence/5/choose/0/sequence/0": [
  1212.         {
  1213.           "path": "action/0/default/3/parallel/1/sequence/5/choose/0/sequence/0",
  1214.           "timestamp": "2024-04-14T16:47:09.900065+00:00",
  1215.           "changed_variables": {
  1216.             "wait": {
  1217.               "remaining": null,
  1218.               "trigger": {
  1219.                 "id": "0",
  1220.                 "idx": "0",
  1221.                 "alias": null,
  1222.                 "platform": "state",
  1223.                 "entity_id": "binary_sensor.hue_motion_sensor_1_motion",
  1224.                 "from_state": {
  1225.                   "entity_id": "binary_sensor.hue_motion_sensor_1_motion",
  1226.                   "state": "on",
  1227.                   "attributes": {
  1228.                     "device_class": "motion",
  1229.                     "friendly_name": "Hue motion sensor 1 Motion"
  1230.                   },
  1231.                   "last_changed": "2024-04-14T16:47:09.847237+00:00",
  1232.                   "last_reported": "2024-04-14T16:47:09.847237+00:00",
  1233.                   "last_updated": "2024-04-14T16:47:09.847237+00:00",
  1234.                   "context": {
  1235.                     "id": "01HVER2TGQS44JVM0ZNME0WYB2",
  1236.                     "parent_id": null,
  1237.                     "user_id": null
  1238.                   }
  1239.                 },
  1240.                 "to_state": {
  1241.                   "entity_id": "binary_sensor.hue_motion_sensor_1_motion",
  1242.                   "state": "off",
  1243.                   "attributes": {
  1244.                     "device_class": "motion",
  1245.                     "friendly_name": "Hue motion sensor 1 Motion"
  1246.                   },
  1247.                   "last_changed": "2024-04-14T16:47:23.973513+00:00",
  1248.                   "last_reported": "2024-04-14T16:47:23.973513+00:00",
  1249.                   "last_updated": "2024-04-14T16:47:23.973513+00:00",
  1250.                   "context": {
  1251.                     "id": "01HVER38A50E551HW4M0A6Y3CP",
  1252.                     "parent_id": null,
  1253.                     "user_id": null
  1254.                   }
  1255.                 },
  1256.                 "for": null,
  1257.                 "attribute": null,
  1258.                 "description": "state of binary_sensor.hue_motion_sensor_1_motion"
  1259.               }
  1260.             }
  1261.           },
  1262.           "result": {
  1263.             "wait": {
  1264.               "remaining": null,
  1265.               "trigger": {
  1266.                 "id": "0",
  1267.                 "idx": "0",
  1268.                 "alias": null,
  1269.                 "platform": "state",
  1270.                 "entity_id": "binary_sensor.hue_motion_sensor_1_motion",
  1271.                 "from_state": {
  1272.                   "entity_id": "binary_sensor.hue_motion_sensor_1_motion",
  1273.                   "state": "on",
  1274.                   "attributes": {
  1275.                     "device_class": "motion",
  1276.                     "friendly_name": "Hue motion sensor 1 Motion"
  1277.                   },
  1278.                   "last_changed": "2024-04-14T16:47:09.847237+00:00",
  1279.                   "last_reported": "2024-04-14T16:47:09.847237+00:00",
  1280.                   "last_updated": "2024-04-14T16:47:09.847237+00:00",
  1281.                   "context": {
  1282.                     "id": "01HVER2TGQS44JVM0ZNME0WYB2",
  1283.                     "parent_id": null,
  1284.                     "user_id": null
  1285.                   }
  1286.                 },
  1287.                 "to_state": {
  1288.                   "entity_id": "binary_sensor.hue_motion_sensor_1_motion",
  1289.                   "state": "off",
  1290.                   "attributes": {
  1291.                     "device_class": "motion",
  1292.                     "friendly_name": "Hue motion sensor 1 Motion"
  1293.                   },
  1294.                   "last_changed": "2024-04-14T16:47:23.973513+00:00",
  1295.                   "last_reported": "2024-04-14T16:47:23.973513+00:00",
  1296.                   "last_updated": "2024-04-14T16:47:23.973513+00:00",
  1297.                   "context": {
  1298.                     "id": "01HVER38A50E551HW4M0A6Y3CP",
  1299.                     "parent_id": null,
  1300.                     "user_id": null
  1301.                   }
  1302.                 },
  1303.                 "for": null,
  1304.                 "attribute": null,
  1305.                 "description": "state of binary_sensor.hue_motion_sensor_1_motion"
  1306.               }
  1307.             }
  1308.           }
  1309.         }
  1310.       ],
  1311.       "action/0/default/3/parallel/1/sequence/6": [
  1312.         {
  1313.           "path": "action/0/default/3/parallel/1/sequence/6",
  1314.           "timestamp": "2024-04-14T16:47:23.975167+00:00",
  1315.           "result": {
  1316.             "delay": 120,
  1317.             "done": true
  1318.           }
  1319.         }
  1320.       ],
  1321.       "action/0/default/3/parallel/1/sequence/7": [
  1322.         {
  1323.           "path": "action/0/default/3/parallel/1/sequence/7",
  1324.           "timestamp": "2024-04-14T16:49:23.976864+00:00",
  1325.           "result": {
  1326.             "choice": 0
  1327.           }
  1328.         }
  1329.       ],
  1330.       "action/0/default/3/parallel/1/sequence/7/choose/0": [
  1331.         {
  1332.           "path": "action/0/default/3/parallel/1/sequence/7/choose/0",
  1333.           "timestamp": "2024-04-14T16:49:23.977240+00:00",
  1334.           "result": {
  1335.             "result": true
  1336.           }
  1337.         }
  1338.       ],
  1339.       "action/0/default/3/parallel/1/sequence/7/choose/0/conditions/0": [
  1340.         {
  1341.           "path": "action/0/default/3/parallel/1/sequence/7/choose/0/conditions/0",
  1342.           "timestamp": "2024-04-14T16:49:23.977331+00:00",
  1343.           "result": {
  1344.             "result": true,
  1345.             "entities": []
  1346.           }
  1347.         }
  1348.       ],
  1349.       "action/0/default/3/parallel/1/sequence/7/choose/0/sequence/0": [
  1350.         {
  1351.           "path": "action/0/default/3/parallel/1/sequence/7/choose/0/sequence/0",
  1352.           "timestamp": "2024-04-14T16:49:23.978018+00:00",
  1353.           "result": {
  1354.             "params": {
  1355.               "domain": "light",
  1356.               "service": "turn_off",
  1357.               "service_data": {
  1358.                 "transition": 10,
  1359.                 "entity_id": []
  1360.               },
  1361.               "target": {
  1362.                 "entity_id": []
  1363.               }
  1364.             },
  1365.             "running_script": false
  1366.           }
  1367.         }
  1368.       ],
  1369.       "action/0/default/3/parallel/1/sequence/7/choose/0/sequence/1": [
  1370.         {
  1371.           "path": "action/0/default/3/parallel/1/sequence/7/choose/0/sequence/1",
  1372.           "timestamp": "2024-04-14T16:49:23.979458+00:00",
  1373.           "result": {
  1374.             "params": {
  1375.               "domain": "scene",
  1376.               "service": "turn_on",
  1377.               "service_data": {
  1378.                 "entity_id": [
  1379.                   "scene.scene_staircase_ff_off"
  1380.                 ],
  1381.                 "transition": 10
  1382.               },
  1383.               "target": {}
  1384.             },
  1385.             "running_script": false
  1386.           }
  1387.         }
  1388.       ],
  1389.       "action/0/default/3/parallel/1/sequence/8": [
  1390.         {
  1391.           "path": "action/0/default/3/parallel/1/sequence/8",
  1392.           "timestamp": "2024-04-14T16:49:23.988861+00:00",
  1393.           "result": {
  1394.             "params": {
  1395.               "domain": "switch",
  1396.               "service": "turn_off",
  1397.               "service_data": {},
  1398.               "target": {
  1399.                 "entity_id": []
  1400.               }
  1401.             },
  1402.             "running_script": false
  1403.           }
  1404.         }
  1405.       ],
  1406.       "action/0/default/3/parallel/1/sequence/9": [
  1407.         {
  1408.           "path": "action/0/default/3/parallel/1/sequence/9",
  1409.           "timestamp": "2024-04-14T16:49:23.989920+00:00",
  1410.           "result": {
  1411.             "params": {
  1412.               "domain": "script",
  1413.               "service": "turn_on",
  1414.               "service_data": {
  1415.                 "entity_id": []
  1416.               },
  1417.               "target": {}
  1418.             },
  1419.             "running_script": true
  1420.           }
  1421.         }
  1422.       ],
  1423.       "action/0/default/3/parallel/1/sequence/10": [
  1424.         {
  1425.           "path": "action/0/default/3/parallel/1/sequence/10",
  1426.           "timestamp": "2024-04-14T16:49:23.990779+00:00",
  1427.           "result": {
  1428.             "params": {
  1429.               "domain": "input_boolean",
  1430.               "service": "turn_off",
  1431.               "service_data": {
  1432.                 "entity_id": []
  1433.               },
  1434.               "target": {}
  1435.             },
  1436.             "running_script": false
  1437.           }
  1438.         }
  1439.       ]
  1440.     },
  1441.     "config": {
  1442.       "mode": "restart",
  1443.       "max_exceeded": "silent",
  1444.       "variables": {
  1445.         "motion_trigger": [
  1446.           "binary_sensor.hue_motion_sensor_1_motion"
  1447.         ],
  1448.         "light_switch": {
  1449.           "entity_id": "scene.scene_staircase_ff_day"
  1450.         },
  1451.         "boolean_scenes_scripts": [],
  1452.         "end_scenes": [
  1453.           "scene.scene_staircase_ff_off"
  1454.         ],
  1455.         "time_delay": 2,
  1456.         "include_light_control": [
  1457.           "use_brightness",
  1458.           "use_transition"
  1459.         ],
  1460.         "light_brightness": 80,
  1461.         "brightness_value": "{{ iif ('use_brightness' in include_light_control , light_brightness, ) }}",
  1462.         "light_colour_temperature": 5000,
  1463.         "temperature_value": "{{ iif ('use_colour_temperature' in include_light_control , light_colour_temperature, [] ) }}",
  1464.         "light_transition_on": 5,
  1465.         "light_transition_off": 10,
  1466.         "transition_on_value": "{{ iif ('use_transition' in include_light_control, light_transition_on, ) }}",
  1467.         "transition_off_value": "{{ iif ('use_transition' in include_light_control, light_transition_off, ) }}",
  1468.         "include_dynamic_lighting": [],
  1469.         "dynamic_lighting_lux_sensor": "sensor.hue_motion_sensor_1_illuminance",
  1470.         "dynamic_lighting_max_lux": 400,
  1471.         "dynamic_lighting_min_lux": 40,
  1472.         "dynamic_lighting_max_brightness": 100,
  1473.         "dynamic_lighting_min_brightness": 0,
  1474.         "dynamic_lighting_max_colour_temp": 5000,
  1475.         "dynamic_lighting_min_colour_temp": 3000,
  1476.         "dynamic_lighting_sun_elevation_start_rising": -1.5,
  1477.         "dynamic_lighting_sun_elevation_end_rising": 15,
  1478.         "dynamic_lighting_sun_elevation_start_falling": 15,
  1479.         "dynamic_lighting_sun_elevation_end_falling": -4,
  1480.         "dynamic_lighting_heartbeat": 1,
  1481.         "dynamic_lighting_step_value": 4,
  1482.         "dynamic_lighting_dead_zone": 7,
  1483.         "include_bypass": [],
  1484.         "motion_bypass_lights_on": [],
  1485.         "motion_bypass_lights_off": [],
  1486.         "motion_bypass_lights_stop": [],
  1487.         "bypass_time_delay": 0,
  1488.         "include_bypass_auto_off": [],
  1489.         "bypass_auto_off_delay": 60,
  1490.         "include_sun": "sun_disabled",
  1491.         "sun_elevation": -1.5,
  1492.         "sun_elevation_rising": -4,
  1493.         "include_ambient": "ambient_disabled",
  1494.         "ambient_light_sensor": "sensor.hue_motion_sensor_1_illuminance",
  1495.         "ambient_light_options": "ambient_light_option_enabled",
  1496.         "ambient_light_value": 50,
  1497.         "ambient_light_high_value": 80,
  1498.         "include_time": "time_disabled",
  1499.         "after_time": "00:00:00",
  1500.         "before_time": "00:00:00",
  1501.         "weekday_options": [
  1502.           "mon",
  1503.           "tue",
  1504.           "wed",
  1505.           "thu",
  1506.           "fri",
  1507.           "sat",
  1508.           "sun"
  1509.         ],
  1510.         "include_device_tracker": "device_tracker_disabled",
  1511.         "zone": "zone.home",
  1512.         "people": [
  1513.           "person.chris_home"
  1514.         ],
  1515.         "include_night_lights": "night_lights_enabled",
  1516.         "night_lights": {
  1517.           "entity_id": "scene.scene_staircase_ff_night"
  1518.         },
  1519.         "night_boolean_scenes_scripts": [],
  1520.         "night_time_delay": 1,
  1521.         "include_night_light_control": [
  1522.           "use_transition",
  1523.           "use_brightness",
  1524.           "if_lights_are_on_adjust_when_crossing_over"
  1525.         ],
  1526.         "night_light_brightness": 1,
  1527.         "night_brightness_value": "{{ iif ('use_brightness' in include_night_light_control , night_light_brightness, ) }}",
  1528.         "night_light_colour_temperature": 5000,
  1529.         "night_temperature_value": "{{ iif ('use_colour_temperature' in include_night_light_control , night_light_colour_temperature, [] ) }}",
  1530.         "night_light_transition_on": 5,
  1531.         "night_light_transition_off": 10,
  1532.         "night_transition_on_value": "{{ iif ('use_transition' in include_night_light_control, night_light_transition_on, ) }}",
  1533.         "night_transition_off_value": "{{ iif ('use_transition' in include_night_light_control, night_light_transition_off, ) }}",
  1534.         "night_lights_conditions": [
  1535.           "sun_enabled",
  1536.           "time_enabled"
  1537.         ],
  1538.         "night_lights_entity_state": [],
  1539.         "night_lights_after_time": "21:30:00",
  1540.         "night_lights_before_time": "07:00:00",
  1541.         "night_lights_sun_elevation": -1.5,
  1542.         "night_lights_sun_elevation_rising": -4,
  1543.         "light_entities_off": "{{ expand(light_switch.entity_id) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}",
  1544.         "switch_entities_off": "{{ expand(light_switch.entity_id) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}",
  1545.         "light_entities": "{{ expand(light_switch.entity_id) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}",
  1546.         "switch_entities": "{{ expand(light_switch.entity_id) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}",
  1547.         "scene_entities": "{% set a = light_switch.entity_id %} {% if boolean_scenes_scripts == [] %}\n  {{ expand(a) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% elif is_state(boolean_scenes_scripts, 'off') %}\n  {{ expand(a) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}",
  1548.         "script_entities": "{% set a = light_switch.entity_id %} {% if boolean_scenes_scripts == [] %}\n  {{ expand(a) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% elif is_state(boolean_scenes_scripts, 'off') %}\n  {{ expand(a) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}",
  1549.         "boolean_scenes_scripts_helper": "{% if boolean_scenes_scripts | length > 0 and states(boolean_scenes_scripts) == 'off' %}\n  {{ boolean_scenes_scripts }}\n{% else %}\n  []\n{% endif %}",
  1550.         "end_scene_entities": "{{ end_scenes | select('match', '^scene\\..*') | list }}",
  1551.         "end_script_entities": "{{ end_scenes | select('match', '^script\\..*') | list }}",
  1552.         "night_light_entities_off": "{% set b =  night_lights and night_lights.entity_id %} {% if b %}\n  {{ expand(b) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}",
  1553.         "night_switch_entities_off": "{% set b =  night_lights and night_lights.entity_id %} {% if b %}\n  {{ expand(b) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}",
  1554.         "night_light_entities": "{% set b =  night_lights and night_lights.entity_id %} {% if b %}\n  {{ expand(b) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}",
  1555.         "night_switch_entities": "{% set b =  night_lights and night_lights.entity_id %} {% if b %}\n  {{ expand(b) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}",
  1556.         "night_scene_entities": "{% set b = night_lights and night_lights.entity_id %} {% if night_boolean_scenes_scripts == [] %}\n  {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% elif is_state(night_boolean_scenes_scripts, 'off') %}\n  {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}",
  1557.         "night_script_entities": "{% set b = night_lights and night_lights.entity_id %} {% if night_boolean_scenes_scripts == [] %}\n  {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% elif is_state(night_boolean_scenes_scripts, 'off') %}\n  {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}",
  1558.         "night_boolean_scenes_scripts_helper": "{% if night_boolean_scenes_scripts | length > 0 and states(night_boolean_scenes_scripts) == 'off' %}\n  {{ night_boolean_scenes_scripts }}\n{% else %}\n  []\n{% endif %}",
  1559.         "crossover_lights_light": "{% set a = light_switch.entity_id %} {% set b =  night_lights and night_lights.entity_id %} {% if a and b %}\n  {{ expand(a) | reject('in', expand(b)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}",
  1560.         "crossover_lights_switch": "{% set a = light_switch.entity_id %} {% set b =  night_lights and night_lights.entity_id %} {% if a and b %}\n  {{ expand(a) | reject('in', expand(b)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}",
  1561.         "crossover_night_lights_light_on": "{% set b =  night_lights and night_lights.entity_id %} {% if b %}\n  {{ expand(b) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}",
  1562.         "crossover_night_lights_light": "{% set a = light_switch.entity_id %} {% set b =  night_lights and night_lights.entity_id %} {% if a and b %}\n  {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}",
  1563.         "crossover_night_lights_switch": "{% set a = light_switch.entity_id %} {% set b =  night_lights and night_lights.entity_id %} {% if a and b %}\n  {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}",
  1564.         "crossover_lights_light_on": "{% set a = light_switch.entity_id %} {% if a %}\n  {{ expand(a) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n  []\n{% endif %}"
  1565.       },
  1566.       "trigger": [
  1567.         {
  1568.           "platform": "state",
  1569.           "id": "t0",
  1570.           "entity_id": [
  1571.             "binary_sensor.hue_motion_sensor_1_motion"
  1572.           ],
  1573.           "from": "off",
  1574.           "to": "on"
  1575.         },
  1576.         {
  1577.           "platform": "numeric_state",
  1578.           "id": "t1",
  1579.           "entity_id": "sun.sun",
  1580.           "attribute": "elevation",
  1581.           "below": -1.5
  1582.         },
  1583.         {
  1584.           "platform": "numeric_state",
  1585.           "id": "t2",
  1586.           "entity_id": "sensor.hue_motion_sensor_1_illuminance",
  1587.           "below": 50
  1588.         },
  1589.         {
  1590.           "platform": "time",
  1591.           "id": "t3",
  1592.           "at": "00:00:00"
  1593.         },
  1594.         {
  1595.           "platform": "state",
  1596.           "id": "t4",
  1597.           "entity_id": [],
  1598.           "from": "off",
  1599.           "to": "on"
  1600.         },
  1601.         {
  1602.           "platform": "time",
  1603.           "id": "t5",
  1604.           "at": "21:30:00"
  1605.         },
  1606.         {
  1607.           "platform": "numeric_state",
  1608.           "id": "t6",
  1609.           "entity_id": "sun.sun",
  1610.           "attribute": "elevation",
  1611.           "below": -1.5
  1612.         },
  1613.         {
  1614.           "platform": "state",
  1615.           "id": "t7_on",
  1616.           "entity_id": [],
  1617.           "from": "off",
  1618.           "to": "on"
  1619.         },
  1620.         {
  1621.           "platform": "state",
  1622.           "id": "t7_off",
  1623.           "entity_id": [],
  1624.           "from": "off",
  1625.           "to": "on"
  1626.         },
  1627.         {
  1628.           "platform": "state",
  1629.           "id": "t7_stop",
  1630.           "entity_id": [],
  1631.           "from": "off",
  1632.           "to": "on"
  1633.         },
  1634.         {
  1635.           "platform": "state",
  1636.           "id": "t8_on",
  1637.           "entity_id": [],
  1638.           "from": "on",
  1639.           "to": "off"
  1640.         },
  1641.         {
  1642.           "platform": "state",
  1643.           "id": "t8_off",
  1644.           "entity_id": [],
  1645.           "from": "on",
  1646.           "to": "off"
  1647.         },
  1648.         {
  1649.           "platform": "state",
  1650.           "id": "t8_stop",
  1651.           "entity_id": [],
  1652.           "from": "on",
  1653.           "to": "off"
  1654.         },
  1655.         {
  1656.           "platform": "numeric_state",
  1657.           "id": "t9",
  1658.           "entity_id": "sun.sun",
  1659.           "attribute": "elevation",
  1660.           "above": -4
  1661.         },
  1662.         {
  1663.           "platform": "numeric_state",
  1664.           "id": "t10",
  1665.           "entity_id": "sensor.hue_motion_sensor_1_illuminance",
  1666.           "above": 80
  1667.         },
  1668.         {
  1669.           "platform": "time",
  1670.           "id": "t11",
  1671.           "at": "00:00:00"
  1672.         },
  1673.         {
  1674.           "platform": "state",
  1675.           "id": "t12",
  1676.           "entity_id": [],
  1677.           "from": "on",
  1678.           "to": "off"
  1679.         },
  1680.         {
  1681.           "platform": "time",
  1682.           "id": "t13",
  1683.           "at": "07:00:00"
  1684.         },
  1685.         {
  1686.           "platform": "numeric_state",
  1687.           "id": "t14",
  1688.           "entity_id": "sun.sun",
  1689.           "attribute": "elevation",
  1690.           "above": -4
  1691.         },
  1692.         {
  1693.           "platform": "homeassistant",
  1694.           "id": "t15",
  1695.           "event": "start"
  1696.         }
  1697.       ],
  1698.       "condition": [
  1699.         {
  1700.           "condition": "or",
  1701.           "conditions": [
  1702.             {
  1703.               "condition": "and",
  1704.               "conditions": [
  1705.                 {
  1706.                   "condition": "state",
  1707.                   "entity_id": [
  1708.                     "binary_sensor.hue_motion_sensor_1_motion"
  1709.                   ],
  1710.                   "match": "any",
  1711.                   "state": "on"
  1712.                 },
  1713.                 {
  1714.                   "condition": "trigger",
  1715.                   "id": "t0"
  1716.                 }
  1717.               ]
  1718.             },
  1719.             {
  1720.               "condition": "and",
  1721.               "conditions": [
  1722.                 {
  1723.                   "condition": "state",
  1724.                   "entity_id": [
  1725.                     "binary_sensor.hue_motion_sensor_1_motion"
  1726.                   ],
  1727.                   "state": "on",
  1728.                   "match": "any"
  1729.                 },
  1730.                 "{{ include_sun == 'sun_enabled' }}",
  1731.                 {
  1732.                   "condition": "trigger",
  1733.                   "id": "t1"
  1734.                 }
  1735.               ]
  1736.             },
  1737.             {
  1738.               "condition": "and",
  1739.               "conditions": [
  1740.                 {
  1741.                   "condition": "state",
  1742.                   "entity_id": [
  1743.                     "binary_sensor.hue_motion_sensor_1_motion"
  1744.                   ],
  1745.                   "state": "on",
  1746.                   "match": "any"
  1747.                 },
  1748.                 "{{ include_ambient == 'ambient_enabled' }}",
  1749.                 {
  1750.                   "condition": "trigger",
  1751.                   "id": "t2"
  1752.                 }
  1753.               ]
  1754.             },
  1755.             {
  1756.               "condition": "and",
  1757.               "conditions": [
  1758.                 {
  1759.                   "condition": "state",
  1760.                   "entity_id": [
  1761.                     "binary_sensor.hue_motion_sensor_1_motion"
  1762.                   ],
  1763.                   "state": "on",
  1764.                   "match": "any"
  1765.                 },
  1766.                 "{{ include_time == 'time_enabled' }}",
  1767.                 {
  1768.                   "condition": "trigger",
  1769.                   "id": "t3"
  1770.                 }
  1771.               ]
  1772.             },
  1773.             {
  1774.               "condition": "and",
  1775.               "conditions": [
  1776.                 {
  1777.                   "condition": "trigger",
  1778.                   "id": "t4"
  1779.                 },
  1780.                 "{{ include_night_lights == 'night_lights_enabled' }}",
  1781.                 "{{ 'entity_state_enabled' in night_lights_conditions }}",
  1782.                 {
  1783.                   "condition": "state",
  1784.                   "entity_id": [],
  1785.                   "match": "any",
  1786.                   "state": "on"
  1787.                 },
  1788.                 {
  1789.                   "condition": "or",
  1790.                   "conditions": [
  1791.                     "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  1792.                     "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  1793.                     {
  1794.                       "condition": "template",
  1795.                       "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}"
  1796.                     },
  1797.                     {
  1798.                       "condition": "template",
  1799.                       "value_template": "{% if boolean_scenes_scripts != [] %}\n  {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}"
  1800.                     },
  1801.                     {
  1802.                       "condition": "template",
  1803.                       "value_template": "{% if night_boolean_scenes_scripts != [] %}\n  {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}"
  1804.                     }
  1805.                   ]
  1806.                 }
  1807.               ]
  1808.             },
  1809.             {
  1810.               "condition": "and",
  1811.               "conditions": [
  1812.                 {
  1813.                   "condition": "trigger",
  1814.                   "id": "t5"
  1815.                 },
  1816.                 "{{ include_night_lights == 'night_lights_enabled' }}",
  1817.                 "{{ 'time_enabled' in night_lights_conditions }}",
  1818.                 {
  1819.                   "condition": "or",
  1820.                   "conditions": [
  1821.                     "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  1822.                     "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  1823.                     {
  1824.                       "condition": "template",
  1825.                       "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}"
  1826.                     },
  1827.                     {
  1828.                       "condition": "template",
  1829.                       "value_template": "{% if boolean_scenes_scripts != [] %}\n  {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}"
  1830.                     },
  1831.                     {
  1832.                       "condition": "template",
  1833.                       "value_template": "{% if night_boolean_scenes_scripts != [] %}\n  {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}"
  1834.                     }
  1835.                   ]
  1836.                 }
  1837.               ]
  1838.             },
  1839.             {
  1840.               "condition": "and",
  1841.               "conditions": [
  1842.                 {
  1843.                   "condition": "trigger",
  1844.                   "id": "t6"
  1845.                 },
  1846.                 "{{ include_night_lights == 'night_lights_enabled' }}",
  1847.                 "{{ 'sun_enabled' in night_lights_conditions }}",
  1848.                 {
  1849.                   "condition": "or",
  1850.                   "conditions": [
  1851.                     "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  1852.                     "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  1853.                     {
  1854.                       "condition": "template",
  1855.                       "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}"
  1856.                     },
  1857.                     {
  1858.                       "condition": "template",
  1859.                       "value_template": "{% if boolean_scenes_scripts != [] %}\n  {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}"
  1860.                     },
  1861.                     {
  1862.                       "condition": "template",
  1863.                       "value_template": "{% if night_boolean_scenes_scripts != [] %}\n  {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}"
  1864.                     }
  1865.                   ]
  1866.                 }
  1867.               ]
  1868.             },
  1869.             {
  1870.               "condition": "and",
  1871.               "conditions": [
  1872.                 {
  1873.                   "condition": "trigger",
  1874.                   "id": "t7_on"
  1875.                 },
  1876.                 "{{ 'bypass_enabled_turn_on' in include_bypass }}"
  1877.               ]
  1878.             },
  1879.             {
  1880.               "condition": "and",
  1881.               "conditions": [
  1882.                 {
  1883.                   "condition": "trigger",
  1884.                   "id": "t7_off"
  1885.                 },
  1886.                 "{{ 'bypass_enabled_turn_off' in include_bypass }}"
  1887.               ]
  1888.             },
  1889.             {
  1890.               "condition": "and",
  1891.               "conditions": [
  1892.                 {
  1893.                   "condition": "trigger",
  1894.                   "id": "t7_stop"
  1895.                 },
  1896.                 "{{ 'bypass_enabled_stop' in include_bypass }}"
  1897.               ]
  1898.             },
  1899.             {
  1900.               "condition": "and",
  1901.               "conditions": [
  1902.                 {
  1903.                   "condition": "trigger",
  1904.                   "id": "t8_on"
  1905.                 },
  1906.                 "{{ 'bypass_enabled_turn_on' in include_bypass }}"
  1907.               ]
  1908.             },
  1909.             {
  1910.               "condition": "and",
  1911.               "conditions": [
  1912.                 {
  1913.                   "condition": "trigger",
  1914.                   "id": "t8_off"
  1915.                 },
  1916.                 "{{ 'bypass_enabled_turn_off' in  include_bypass }}"
  1917.               ]
  1918.             },
  1919.             {
  1920.               "condition": "and",
  1921.               "conditions": [
  1922.                 {
  1923.                   "condition": "trigger",
  1924.                   "id": "t8_stop"
  1925.                 },
  1926.                 "{{ 'bypass_enabled_stop' in include_bypass }}"
  1927.               ]
  1928.             },
  1929.             {
  1930.               "condition": "and",
  1931.               "conditions": [
  1932.                 {
  1933.                   "condition": "trigger",
  1934.                   "id": "t9"
  1935.                 },
  1936.                 "{{ include_sun == 'sun_enabled' }}",
  1937.                 {
  1938.                   "condition": "or",
  1939.                   "conditions": [
  1940.                     "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  1941.                     "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  1942.                     {
  1943.                       "condition": "template",
  1944.                       "value_template": "{% if boolean_scenes_scripts != [] %}\n  {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}"
  1945.                     },
  1946.                     {
  1947.                       "condition": "template",
  1948.                       "value_template": "{% if night_boolean_scenes_scripts != [] %}\n  {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}"
  1949.                     }
  1950.                   ]
  1951.                 }
  1952.               ]
  1953.             },
  1954.             {
  1955.               "condition": "and",
  1956.               "conditions": [
  1957.                 {
  1958.                   "condition": "trigger",
  1959.                   "id": "t10"
  1960.                 },
  1961.                 "{{ include_ambient == 'ambient_enabled' }}",
  1962.                 "{{ ambient_light_options == 'ambient_light_option_disabled' }}",
  1963.                 {
  1964.                   "condition": "or",
  1965.                   "conditions": [
  1966.                     "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  1967.                     "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  1968.                     {
  1969.                       "condition": "template",
  1970.                       "value_template": "{% if boolean_scenes_scripts != [] %}\n  {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}"
  1971.                     },
  1972.                     {
  1973.                       "condition": "template",
  1974.                       "value_template": "{% if night_boolean_scenes_scripts != [] %}\n  {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}"
  1975.                     }
  1976.                   ]
  1977.                 }
  1978.               ]
  1979.             },
  1980.             {
  1981.               "condition": "and",
  1982.               "conditions": [
  1983.                 {
  1984.                   "condition": "trigger",
  1985.                   "id": "t11"
  1986.                 },
  1987.                 "{{ include_time == 'time_enabled' }}",
  1988.                 {
  1989.                   "condition": "or",
  1990.                   "conditions": [
  1991.                     "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  1992.                     "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  1993.                     {
  1994.                       "condition": "template",
  1995.                       "value_template": "{% if boolean_scenes_scripts != [] %}\n  {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}"
  1996.                     },
  1997.                     {
  1998.                       "condition": "template",
  1999.                       "value_template": "{% if night_boolean_scenes_scripts != [] %}\n  {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}"
  2000.                     }
  2001.                   ]
  2002.                 }
  2003.               ]
  2004.             },
  2005.             {
  2006.               "condition": "and",
  2007.               "conditions": [
  2008.                 {
  2009.                   "condition": "trigger",
  2010.                   "id": "t12"
  2011.                 },
  2012.                 "{{ include_night_lights == 'night_lights_enabled' }}",
  2013.                 "{{ 'entity_state_enabled' in night_lights_conditions }}",
  2014.                 {
  2015.                   "condition": "state",
  2016.                   "entity_id": [],
  2017.                   "state": "off"
  2018.                 },
  2019.                 {
  2020.                   "condition": "or",
  2021.                   "conditions": [
  2022.                     "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  2023.                     "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  2024.                     {
  2025.                       "condition": "template",
  2026.                       "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}"
  2027.                     },
  2028.                     {
  2029.                       "condition": "template",
  2030.                       "value_template": "{% if boolean_scenes_scripts != [] %}\n  {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}"
  2031.                     },
  2032.                     {
  2033.                       "condition": "template",
  2034.                       "value_template": "{% if night_boolean_scenes_scripts != [] %}\n  {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}"
  2035.                     }
  2036.                   ]
  2037.                 }
  2038.               ]
  2039.             },
  2040.             {
  2041.               "condition": "and",
  2042.               "conditions": [
  2043.                 {
  2044.                   "condition": "trigger",
  2045.                   "id": "t13"
  2046.                 },
  2047.                 "{{ include_night_lights == 'night_lights_enabled' }}",
  2048.                 "{{ 'time_enabled' in night_lights_conditions }}",
  2049.                 {
  2050.                   "condition": "or",
  2051.                   "conditions": [
  2052.                     "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  2053.                     "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  2054.                     {
  2055.                       "condition": "template",
  2056.                       "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}"
  2057.                     },
  2058.                     {
  2059.                       "condition": "template",
  2060.                       "value_template": "{% if boolean_scenes_scripts != [] %}\n  {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}"
  2061.                     },
  2062.                     {
  2063.                       "condition": "template",
  2064.                       "value_template": "{% if night_boolean_scenes_scripts != [] %}\n  {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}"
  2065.                     }
  2066.                   ]
  2067.                 }
  2068.               ]
  2069.             },
  2070.             {
  2071.               "condition": "and",
  2072.               "conditions": [
  2073.                 {
  2074.                   "condition": "trigger",
  2075.                   "id": "t14"
  2076.                 },
  2077.                 "{{ include_night_lights == 'night_lights_enabled' }}",
  2078.                 "{{ 'sun_enabled' in night_lights_conditions }}",
  2079.                 {
  2080.                   "condition": "or",
  2081.                   "conditions": [
  2082.                     "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  2083.                     "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  2084.                     {
  2085.                       "condition": "template",
  2086.                       "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}"
  2087.                     },
  2088.                     {
  2089.                       "condition": "template",
  2090.                       "value_template": "{% if boolean_scenes_scripts != [] %}\n  {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}"
  2091.                     },
  2092.                     {
  2093.                       "condition": "template",
  2094.                       "value_template": "{% if night_boolean_scenes_scripts != [] %}\n  {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}"
  2095.                     }
  2096.                   ]
  2097.                 }
  2098.               ]
  2099.             },
  2100.             {
  2101.               "condition": "and",
  2102.               "conditions": [
  2103.                 {
  2104.                   "condition": "trigger",
  2105.                   "id": "t15"
  2106.                 },
  2107.                 {
  2108.                   "condition": "or",
  2109.                   "conditions": [
  2110.                     "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  2111.                     "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  2112.                     {
  2113.                       "condition": "template",
  2114.                       "value_template": "{% if boolean_scenes_scripts != [] %}\n  {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}"
  2115.                     },
  2116.                     {
  2117.                       "condition": "template",
  2118.                       "value_template": "{% if night_boolean_scenes_scripts != [] %}\n  {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}"
  2119.                     }
  2120.                   ]
  2121.                 }
  2122.               ]
  2123.             },
  2124.             {
  2125.               "condition": "and",
  2126.               "conditions": [
  2127.                 {
  2128.                   "condition": "state",
  2129.                   "entity_id": [
  2130.                     "binary_sensor.hue_motion_sensor_1_motion"
  2131.                   ],
  2132.                   "match": "any",
  2133.                   "state": "on"
  2134.                 },
  2135.                 {
  2136.                   "condition": "trigger",
  2137.                   "id": "t15"
  2138.                 }
  2139.               ]
  2140.             },
  2141.             {
  2142.               "condition": "and",
  2143.               "conditions": [
  2144.                 "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}",
  2145.                 {
  2146.                   "condition": "trigger",
  2147.                   "id": "t15"
  2148.                 },
  2149.                 {
  2150.                   "condition": "or",
  2151.                   "conditions": [
  2152.                     {
  2153.                       "condition": "state",
  2154.                       "entity_id": [],
  2155.                       "match": "any",
  2156.                       "state": "on"
  2157.                     },
  2158.                     {
  2159.                       "condition": "state",
  2160.                       "entity_id": [],
  2161.                       "match": "any",
  2162.                       "state": "on"
  2163.                     },
  2164.                     {
  2165.                       "condition": "state",
  2166.                       "entity_id": [],
  2167.                       "match": "any",
  2168.                       "state": "on"
  2169.                     }
  2170.                   ]
  2171.                 }
  2172.               ]
  2173.             }
  2174.           ]
  2175.         },
  2176.         {
  2177.           "condition": "or",
  2178.           "conditions": [
  2179.             "{{ include_bypass == [] }}",
  2180.             {
  2181.               "condition": "and",
  2182.               "conditions": [
  2183.                 "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  2184.                 {
  2185.                   "condition": "state",
  2186.                   "entity_id": [],
  2187.                   "state": "off"
  2188.                 },
  2189.                 {
  2190.                   "condition": "state",
  2191.                   "entity_id": [],
  2192.                   "state": "off"
  2193.                 },
  2194.                 {
  2195.                   "condition": "state",
  2196.                   "entity_id": [],
  2197.                   "state": "off"
  2198.                 }
  2199.               ]
  2200.             },
  2201.             {
  2202.               "condition": "and",
  2203.               "conditions": [
  2204.                 "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  2205.                 {
  2206.                   "condition": "state",
  2207.                   "entity_id": [],
  2208.                   "state": "off"
  2209.                 },
  2210.                 {
  2211.                   "condition": "state",
  2212.                   "entity_id": [],
  2213.                   "state": "off"
  2214.                 }
  2215.               ]
  2216.             },
  2217.             {
  2218.               "condition": "and",
  2219.               "conditions": [
  2220.                 "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  2221.                 {
  2222.                   "condition": "state",
  2223.                   "entity_id": [],
  2224.                   "state": "off"
  2225.                 },
  2226.                 {
  2227.                   "condition": "state",
  2228.                   "entity_id": [],
  2229.                   "state": "off"
  2230.                 }
  2231.               ]
  2232.             },
  2233.             {
  2234.               "condition": "and",
  2235.               "conditions": [
  2236.                 "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  2237.                 {
  2238.                   "condition": "state",
  2239.                   "entity_id": [],
  2240.                   "state": "off"
  2241.                 },
  2242.                 {
  2243.                   "condition": "state",
  2244.                   "entity_id": [],
  2245.                   "state": "off"
  2246.                 }
  2247.               ]
  2248.             },
  2249.             {
  2250.               "condition": "and",
  2251.               "conditions": [
  2252.                 "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  2253.                 {
  2254.                   "condition": "state",
  2255.                   "entity_id": [],
  2256.                   "state": "off"
  2257.                 }
  2258.               ]
  2259.             },
  2260.             {
  2261.               "condition": "and",
  2262.               "conditions": [
  2263.                 "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  2264.                 {
  2265.                   "condition": "state",
  2266.                   "entity_id": [],
  2267.                   "state": "off"
  2268.                 }
  2269.               ]
  2270.             },
  2271.             {
  2272.               "condition": "and",
  2273.               "conditions": [
  2274.                 "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  2275.                 {
  2276.                   "condition": "state",
  2277.                   "entity_id": [],
  2278.                   "state": "off"
  2279.                 }
  2280.               ]
  2281.             },
  2282.             {
  2283.               "condition": "trigger",
  2284.               "id": [
  2285.                 "t7_on",
  2286.                 "t7_off",
  2287.                 "t7_stop",
  2288.                 "t8_on",
  2289.                 "t8_off",
  2290.                 "t8_stop",
  2291.                 "t15"
  2292.               ]
  2293.             }
  2294.           ]
  2295.         },
  2296.         {
  2297.           "condition": "or",
  2298.           "conditions": [
  2299.             "{{ include_sun == 'sun_disabled' }}",
  2300.             "{{ include_sun == 'sun_enabled_night_lights' }}",
  2301.             "{{ (include_sun == 'sun_enabled') and (is_state_attr('sun.sun', 'rising', false)) and (state_attr('sun.sun','elevation') <= sun_elevation | float(90)) }}",
  2302.             "{{ (include_sun == 'sun_enabled') and (is_state_attr('sun.sun', 'rising', true)) and (state_attr('sun.sun','elevation') <= sun_elevation_rising | float(90)) }}",
  2303.             {
  2304.               "condition": "trigger",
  2305.               "id": [
  2306.                 "t7_on",
  2307.                 "t7_off",
  2308.                 "t7_stop",
  2309.                 "t8_on",
  2310.                 "t8_off",
  2311.                 "t8_stop",
  2312.                 "t9"
  2313.               ]
  2314.             }
  2315.           ]
  2316.         },
  2317.         {
  2318.           "condition": "or",
  2319.           "conditions": [
  2320.             "{{ include_ambient == 'ambient_disabled' }}",
  2321.             "{{ ambient_light_sensor == [] }}",
  2322.             "{{ (include_ambient == 'ambient_enabled') and (states[ambient_light_sensor].state | int < ambient_light_value | int) }}",
  2323.             "{{ (include_ambient == 'ambient_enabled') and (states[ambient_light_sensor].state | int < ambient_light_high_value | int) and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  2324.             "{{ (include_ambient == 'ambient_enabled') and (states[ambient_light_sensor].state | int < ambient_light_high_value | int) and ((include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}",
  2325.             "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}",
  2326.             "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}",
  2327.             {
  2328.               "condition": "and",
  2329.               "conditions": [
  2330.                 "{{ (include_ambient == 'ambient_enabled') and (states[ambient_light_sensor].state | int < ambient_light_high_value | int) }}",
  2331.                 {
  2332.                   "condition": "template",
  2333.                   "value_template": "{% if boolean_scenes_scripts != [] %}\n  {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}"
  2334.                 }
  2335.               ]
  2336.             },
  2337.             {
  2338.               "condition": "and",
  2339.               "conditions": [
  2340.                 "{{ (include_ambient == 'ambient_enabled') and (states[ambient_light_sensor].state | int < ambient_light_high_value | int) }}",
  2341.                 {
  2342.                   "condition": "template",
  2343.                   "value_template": "{% if night_boolean_scenes_scripts != [] %}\n  {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}"
  2344.                 }
  2345.               ]
  2346.             },
  2347.             {
  2348.               "condition": "and",
  2349.               "conditions": [
  2350.                 "{{ (include_ambient == 'ambient_enabled') and ( ambient_light_options == 'ambient_light_option_enabled' ) }}",
  2351.                 {
  2352.                   "condition": "template",
  2353.                   "value_template": "{% if boolean_scenes_scripts != [] %}\n  {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}"
  2354.                 }
  2355.               ]
  2356.             },
  2357.             {
  2358.               "condition": "and",
  2359.               "conditions": [
  2360.                 "{{ (include_ambient == 'ambient_enabled') and ( ambient_light_options == 'ambient_light_option_enabled' ) }}",
  2361.                 {
  2362.                   "condition": "template",
  2363.                   "value_template": "{% if night_boolean_scenes_scripts != [] %}\n  {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}"
  2364.                 }
  2365.               ]
  2366.             },
  2367.             {
  2368.               "condition": "trigger",
  2369.               "id": [
  2370.                 "t7_on",
  2371.                 "t7_off",
  2372.                 "t7_stop",
  2373.                 "t8_on",
  2374.                 "t8_off",
  2375.                 "t8_stop",
  2376.                 "t10"
  2377.               ]
  2378.             }
  2379.           ]
  2380.         },
  2381.         {
  2382.           "condition": "or",
  2383.           "conditions": [
  2384.             "{{ include_time == 'time_disabled' }}",
  2385.             {
  2386.               "condition": "and",
  2387.               "conditions": [
  2388.                 {
  2389.                   "condition": "time",
  2390.                   "after": "00:00:00",
  2391.                   "before": "00:00:00",
  2392.                   "weekday": [
  2393.                     "mon",
  2394.                     "tue",
  2395.                     "wed",
  2396.                     "thu",
  2397.                     "fri",
  2398.                     "sat",
  2399.                     "sun"
  2400.                   ]
  2401.                 },
  2402.                 "{{ include_time == 'time_enabled' }}"
  2403.               ]
  2404.             },
  2405.             {
  2406.               "condition": "trigger",
  2407.               "id": [
  2408.                 "t7_on",
  2409.                 "t7_off",
  2410.                 "t7_stop",
  2411.                 "t8_on",
  2412.                 "t8_off",
  2413.                 "t8_stop",
  2414.                 "t11"
  2415.               ]
  2416.             }
  2417.           ]
  2418.         },
  2419.         {
  2420.           "condition": "or",
  2421.           "conditions": [
  2422.             "{{ include_device_tracker == 'device_tracker_disabled' }}",
  2423.             {
  2424.               "condition": "and",
  2425.               "conditions": [
  2426.                 {
  2427.                   "condition": "numeric_state",
  2428.                   "entity_id": "zone.home",
  2429.                   "above": 0
  2430.                 },
  2431.                 "{{ include_device_tracker == 'zone_enabled' }}"
  2432.               ]
  2433.             },
  2434.             {
  2435.               "condition": "and",
  2436.               "conditions": [
  2437.                 "{{ (state_attr(zone, 'persons') + people) | count != dict.fromkeys(state_attr(zone, 'persons') + people) | count }}",
  2438.                 "{{ include_device_tracker == 'zone_people_enabled' }}"
  2439.               ]
  2440.             },
  2441.             {
  2442.               "condition": "trigger",
  2443.               "id": [
  2444.                 "t7_on",
  2445.                 "t7_off",
  2446.                 "t7_stop",
  2447.                 "t8_on",
  2448.                 "t8_off",
  2449.                 "t8_stop"
  2450.               ]
  2451.             }
  2452.           ]
  2453.         }
  2454.       ],
  2455.       "action": [
  2456.         {
  2457.           "choose": [
  2458.             {
  2459.               "alias": "Check if the night lights are enabled and within the night lights conditions",
  2460.               "conditions": [
  2461.                 {
  2462.                   "condition": "and",
  2463.                   "conditions": [
  2464.                     {
  2465.                       "alias": "Check if night lights is enabled",
  2466.                       "condition": "or",
  2467.                       "conditions": [
  2468.                         "{{ 'night_lights_enabled' in include_night_lights }}"
  2469.                       ]
  2470.                     },
  2471.                     {
  2472.                       "alias": "Check if night lights entity state is enabled",
  2473.                       "condition": "or",
  2474.                       "conditions": [
  2475.                         "{{ ('time_enabled' in night_lights_conditions) and not ('entity_state_enabled' in night_lights_conditions) }}",
  2476.                         "{{ ('sun_enabled' in night_lights_conditions) and not ('entity_state_enabled' in night_lights_conditions) }}",
  2477.                         {
  2478.                           "condition": "and",
  2479.                           "conditions": [
  2480.                             "{{ 'entity_state_enabled' in night_lights_conditions }}",
  2481.                             {
  2482.                               "condition": "state",
  2483.                               "entity_id": [],
  2484.                               "state": "on",
  2485.                               "match": "any"
  2486.                             }
  2487.                           ]
  2488.                         }
  2489.                       ]
  2490.                     },
  2491.                     {
  2492.                       "alias": "Check if night lights time is enabled",
  2493.                       "condition": "or",
  2494.                       "conditions": [
  2495.                         "{{ ('entity_state_enabled' in night_lights_conditions)  and not ('time_enabled' in night_lights_conditions) }}",
  2496.                         "{{ ('sun_enabled' in night_lights_conditions)  and not ('time_enabled' in night_lights_conditions) }}",
  2497.                         {
  2498.                           "condition": "and",
  2499.                           "conditions": [
  2500.                             "{{ 'time_enabled' in night_lights_conditions }}",
  2501.                             {
  2502.                               "condition": "time",
  2503.                               "after": "21:30:00",
  2504.                               "before": "07:00:00"
  2505.                             }
  2506.                           ]
  2507.                         }
  2508.                       ]
  2509.                     },
  2510.                     {
  2511.                       "alias": "Check if night lights sun is enabled",
  2512.                       "condition": "or",
  2513.                       "conditions": [
  2514.                         "{{ ('entity_state_enabled' in night_lights_conditions)  and not ('sun_enabled' in night_lights_conditions) }}",
  2515.                         "{{ ('time_enabled' in night_lights_conditions)  and not ('sun_enabled' in night_lights_conditions) }}",
  2516.                         "{{ ('sun_enabled' in night_lights_conditions) and (((is_state_attr('sun.sun', 'rising', false)) and (state_attr('sun.sun','elevation') <= night_lights_sun_elevation | float(90))) or ((is_state_attr('sun.sun', 'rising', true)) and (state_attr('sun.sun','elevation') <= night_lights_sun_elevation_rising | float(90)))) }}"
  2517.                       ]
  2518.                     }
  2519.                   ]
  2520.                 }
  2521.               ],
  2522.               "sequence": [
  2523.                 {
  2524.                   "choose": [
  2525.                     {
  2526.                       "alias": "By-pass is turned on  & check by-pass option - turn lights off",
  2527.                       "conditions": [
  2528.                         {
  2529.                           "condition": "trigger",
  2530.                           "id": "t7_off"
  2531.                         }
  2532.                       ],
  2533.                       "sequence": [
  2534.                         {
  2535.                           "alias": "Wait the number of minutes set in the by-pass time delay",
  2536.                           "delay": {
  2537.                             "minutes": 0
  2538.                           }
  2539.                         },
  2540.                         {
  2541.                           "choose": [
  2542.                             {
  2543.                               "alias": "If transition is selected",
  2544.                               "conditions": [
  2545.                                 {
  2546.                                   "condition": "template",
  2547.                                   "value_template": "{{ 'use_transition' in include_night_light_control }}"
  2548.                                 }
  2549.                               ],
  2550.                               "sequence": [
  2551.                                 {
  2552.                                   "alias": "Turn off the lights",
  2553.                                   "service": "light.turn_off",
  2554.                                   "target": {
  2555.                                     "entity_id": "{{ night_light_entities }}"
  2556.                                   },
  2557.                                   "data": {
  2558.                                     "transition": "{{ night_transition_off_value }}"
  2559.                                   }
  2560.                                 },
  2561.                                 {
  2562.                                   "alias": "Turn off the scenes",
  2563.                                   "service": "scene.turn_on",
  2564.                                   "data": {
  2565.                                     "entity_id": "{{ end_scene_entities }}",
  2566.                                     "transition": "{{ night_transition_off_value }}"
  2567.                                   }
  2568.                                 }
  2569.                               ]
  2570.                             },
  2571.                             {
  2572.                               "alias": "If transition is not selected",
  2573.                               "conditions": [
  2574.                                 {
  2575.                                   "condition": "template",
  2576.                                   "value_template": "{{ 'use_transition' not in include_night_light_control }}"
  2577.                                 }
  2578.                               ],
  2579.                               "sequence": [
  2580.                                 {
  2581.                                   "alias": "Turn off the lights",
  2582.                                   "service": "light.turn_off",
  2583.                                   "target": {
  2584.                                     "entity_id": "{{ night_light_entities }}"
  2585.                                   }
  2586.                                 },
  2587.                                 {
  2588.                                   "alias": "Turn off the scenes",
  2589.                                   "service": "scene.turn_on",
  2590.                                   "data": {
  2591.                                     "entity_id": "{{ end_scene_entities }}"
  2592.                                   }
  2593.                                 }
  2594.                               ]
  2595.                             }
  2596.                           ]
  2597.                         },
  2598.                         {
  2599.                           "alias": "Turn off the switches",
  2600.                           "service": "switch.turn_off",
  2601.                           "target": {
  2602.                             "entity_id": "{{ night_switch_entities }}"
  2603.                           }
  2604.                         },
  2605.                         {
  2606.                           "alias": "Turn off the script",
  2607.                           "service": "script.turn_on",
  2608.                           "data": {
  2609.                             "entity_id": "{{ end_script_entities }}"
  2610.                           }
  2611.                         },
  2612.                         {
  2613.                           "alias": "Turn off the boolean for scenes and scripts",
  2614.                           "service": "input_boolean.turn_off",
  2615.                           "data": {
  2616.                             "entity_id": []
  2617.                           }
  2618.                         },
  2619.                         {
  2620.                           "alias": "Turn off the boolean for scenes and scripts",
  2621.                           "service": "input_boolean.turn_off",
  2622.                           "data": {
  2623.                             "entity_id": []
  2624.                           }
  2625.                         },
  2626.                         {
  2627.                           "alias": "Check by-pass settings and preform the correct action",
  2628.                           "if": [
  2629.                             {
  2630.                               "alias": "Check if the by-pass auto off is enabled",
  2631.                               "condition": "template",
  2632.                               "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  2633.                             }
  2634.                           ],
  2635.                           "then": [
  2636.                             {
  2637.                               "alias": "Wait the number of minutes set in the by-pass auto off time delay",
  2638.                               "delay": {
  2639.                                 "minutes": 60
  2640.                               }
  2641.                             },
  2642.                             {
  2643.                               "alias": "Parallel Actions for the by-pass auto off",
  2644.                               "parallel": [
  2645.                                 {
  2646.                                   "sequence": [
  2647.                                     {
  2648.                                       "choose": [
  2649.                                         {
  2650.                                           "conditions": [
  2651.                                             {
  2652.                                               "condition": "template",
  2653.                                               "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}"
  2654.                                             }
  2655.                                           ],
  2656.                                           "sequence": [
  2657.                                             {
  2658.                                               "alias": "Turn off the by-pass",
  2659.                                               "service": "homeassistant.turn_off",
  2660.                                               "entity_id": []
  2661.                                             }
  2662.                                           ]
  2663.                                         }
  2664.                                       ]
  2665.                                     }
  2666.                                   ]
  2667.                                 },
  2668.                                 {
  2669.                                   "sequence": [
  2670.                                     {
  2671.                                       "choose": [
  2672.                                         {
  2673.                                           "conditions": [
  2674.                                             {
  2675.                                               "condition": "template",
  2676.                                               "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}"
  2677.                                             }
  2678.                                           ],
  2679.                                           "sequence": [
  2680.                                             {
  2681.                                               "alias": "Turn off the by-pass",
  2682.                                               "service": "homeassistant.turn_off",
  2683.                                               "entity_id": []
  2684.                                             }
  2685.                                           ]
  2686.                                         }
  2687.                                       ]
  2688.                                     }
  2689.                                   ]
  2690.                                 },
  2691.                                 {
  2692.                                   "sequence": [
  2693.                                     {
  2694.                                       "choose": [
  2695.                                         {
  2696.                                           "conditions": [
  2697.                                             {
  2698.                                               "condition": "template",
  2699.                                               "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  2700.                                             }
  2701.                                           ],
  2702.                                           "sequence": [
  2703.                                             {
  2704.                                               "alias": "Turn off the by-pass",
  2705.                                               "service": "homeassistant.turn_off",
  2706.                                               "entity_id": []
  2707.                                             }
  2708.                                           ]
  2709.                                         }
  2710.                                       ]
  2711.                                     }
  2712.                                   ]
  2713.                                 }
  2714.                               ]
  2715.                             },
  2716.                             {
  2717.                               "stop": "Stop the automation"
  2718.                             }
  2719.                           ],
  2720.                           "else": [
  2721.                             {
  2722.                               "stop": "Stop the automation"
  2723.                             }
  2724.                           ]
  2725.                         }
  2726.                       ]
  2727.                     },
  2728.                     {
  2729.                       "alias": "By-pass is turned on  & check by-pass option - Keep the current lights state",
  2730.                       "conditions": [
  2731.                         {
  2732.                           "condition": "trigger",
  2733.                           "id": "t7_stop"
  2734.                         }
  2735.                       ],
  2736.                       "sequence": [
  2737.                         {
  2738.                           "alias": "Check by-pass settings and preform the correct action",
  2739.                           "if": [
  2740.                             {
  2741.                               "alias": "Check if the by-pass auto off is enabled",
  2742.                               "condition": "template",
  2743.                               "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  2744.                             }
  2745.                           ],
  2746.                           "then": [
  2747.                             {
  2748.                               "alias": "Wait the number of minutes set in the by-pass auto off time delay",
  2749.                               "delay": {
  2750.                                 "minutes": 60
  2751.                               }
  2752.                             },
  2753.                             {
  2754.                               "alias": "Parallel Actions for the by-pass auto off",
  2755.                               "parallel": [
  2756.                                 {
  2757.                                   "sequence": [
  2758.                                     {
  2759.                                       "choose": [
  2760.                                         {
  2761.                                           "conditions": [
  2762.                                             {
  2763.                                               "condition": "template",
  2764.                                               "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}"
  2765.                                             }
  2766.                                           ],
  2767.                                           "sequence": [
  2768.                                             {
  2769.                                               "alias": "Turn off the by-pass",
  2770.                                               "service": "homeassistant.turn_off",
  2771.                                               "entity_id": []
  2772.                                             }
  2773.                                           ]
  2774.                                         }
  2775.                                       ]
  2776.                                     }
  2777.                                   ]
  2778.                                 },
  2779.                                 {
  2780.                                   "sequence": [
  2781.                                     {
  2782.                                       "choose": [
  2783.                                         {
  2784.                                           "conditions": [
  2785.                                             {
  2786.                                               "condition": "template",
  2787.                                               "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}"
  2788.                                             }
  2789.                                           ],
  2790.                                           "sequence": [
  2791.                                             {
  2792.                                               "alias": "Turn off the by-pass",
  2793.                                               "service": "homeassistant.turn_off",
  2794.                                               "entity_id": []
  2795.                                             }
  2796.                                           ]
  2797.                                         }
  2798.                                       ]
  2799.                                     }
  2800.                                   ]
  2801.                                 },
  2802.                                 {
  2803.                                   "sequence": [
  2804.                                     {
  2805.                                       "choose": [
  2806.                                         {
  2807.                                           "conditions": [
  2808.                                             {
  2809.                                               "condition": "template",
  2810.                                               "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  2811.                                             }
  2812.                                           ],
  2813.                                           "sequence": [
  2814.                                             {
  2815.                                               "alias": "Turn off the by-pass",
  2816.                                               "service": "homeassistant.turn_off",
  2817.                                               "entity_id": []
  2818.                                             }
  2819.                                           ]
  2820.                                         }
  2821.                                       ]
  2822.                                     }
  2823.                                   ]
  2824.                                 }
  2825.                               ]
  2826.                             },
  2827.                             {
  2828.                               "stop": "Stop the automation"
  2829.                             }
  2830.                           ],
  2831.                           "else": [
  2832.                             {
  2833.                               "stop": "Stop the automation"
  2834.                             }
  2835.                           ]
  2836.                         }
  2837.                       ]
  2838.                     }
  2839.                   ]
  2840.                 },
  2841.                 {
  2842.                   "choose": [
  2843.                     {
  2844.                       "alias": "By-pass is turned off  & check if the motion trigger is off",
  2845.                       "conditions": [
  2846.                         {
  2847.                           "condition": "trigger",
  2848.                           "id": [
  2849.                             "t8_on",
  2850.                             "t8_off",
  2851.                             "t8_stop"
  2852.                           ]
  2853.                         },
  2854.                         {
  2855.                           "condition": "state",
  2856.                           "entity_id": [
  2857.                             "binary_sensor.hue_motion_sensor_1_motion"
  2858.                           ],
  2859.                           "match": "all",
  2860.                           "state": "off"
  2861.                         }
  2862.                       ],
  2863.                       "sequence": [
  2864.                         {
  2865.                           "choose": [
  2866.                             {
  2867.                               "alias": "Check all by-pass are off",
  2868.                               "conditions": [
  2869.                                 {
  2870.                                   "condition": "or",
  2871.                                   "conditions": [
  2872.                                     {
  2873.                                       "condition": "and",
  2874.                                       "conditions": [
  2875.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  2876.                                         {
  2877.                                           "condition": "state",
  2878.                                           "entity_id": [],
  2879.                                           "state": "off"
  2880.                                         },
  2881.                                         {
  2882.                                           "condition": "state",
  2883.                                           "entity_id": [],
  2884.                                           "state": "off"
  2885.                                         },
  2886.                                         {
  2887.                                           "condition": "state",
  2888.                                           "entity_id": [],
  2889.                                           "state": "off"
  2890.                                         }
  2891.                                       ]
  2892.                                     },
  2893.                                     {
  2894.                                       "condition": "and",
  2895.                                       "conditions": [
  2896.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  2897.                                         {
  2898.                                           "condition": "state",
  2899.                                           "entity_id": [],
  2900.                                           "state": "off"
  2901.                                         },
  2902.                                         {
  2903.                                           "condition": "state",
  2904.                                           "entity_id": [],
  2905.                                           "state": "off"
  2906.                                         }
  2907.                                       ]
  2908.                                     },
  2909.                                     {
  2910.                                       "condition": "and",
  2911.                                       "conditions": [
  2912.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  2913.                                         {
  2914.                                           "condition": "state",
  2915.                                           "entity_id": [],
  2916.                                           "state": "off"
  2917.                                         },
  2918.                                         {
  2919.                                           "condition": "state",
  2920.                                           "entity_id": [],
  2921.                                           "state": "off"
  2922.                                         }
  2923.                                       ]
  2924.                                     },
  2925.                                     {
  2926.                                       "condition": "and",
  2927.                                       "conditions": [
  2928.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  2929.                                         {
  2930.                                           "condition": "state",
  2931.                                           "entity_id": [],
  2932.                                           "state": "off"
  2933.                                         },
  2934.                                         {
  2935.                                           "condition": "state",
  2936.                                           "entity_id": [],
  2937.                                           "state": "off"
  2938.                                         }
  2939.                                       ]
  2940.                                     },
  2941.                                     {
  2942.                                       "condition": "and",
  2943.                                       "conditions": [
  2944.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  2945.                                         {
  2946.                                           "condition": "state",
  2947.                                           "entity_id": [],
  2948.                                           "state": "off"
  2949.                                         }
  2950.                                       ]
  2951.                                     },
  2952.                                     {
  2953.                                       "condition": "and",
  2954.                                       "conditions": [
  2955.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  2956.                                         {
  2957.                                           "condition": "state",
  2958.                                           "entity_id": [],
  2959.                                           "state": "off"
  2960.                                         }
  2961.                                       ]
  2962.                                     },
  2963.                                     {
  2964.                                       "condition": "and",
  2965.                                       "conditions": [
  2966.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  2967.                                         {
  2968.                                           "condition": "state",
  2969.                                           "entity_id": [],
  2970.                                           "state": "off"
  2971.                                         }
  2972.                                       ]
  2973.                                     }
  2974.                                   ]
  2975.                                 }
  2976.                               ],
  2977.                               "sequence": [
  2978.                                 {
  2979.                                   "alias": "Wait the number of minutes set in the by-pass time delay",
  2980.                                   "delay": {
  2981.                                     "minutes": 0
  2982.                                   }
  2983.                                 },
  2984.                                 {
  2985.                                   "choose": [
  2986.                                     {
  2987.                                       "alias": "If transition is selected",
  2988.                                       "conditions": [
  2989.                                         {
  2990.                                           "condition": "template",
  2991.                                           "value_template": "{{ 'use_transition' in include_night_light_control }}"
  2992.                                         }
  2993.                                       ],
  2994.                                       "sequence": [
  2995.                                         {
  2996.                                           "alias": "Turn off the lights",
  2997.                                           "service": "light.turn_off",
  2998.                                           "target": {
  2999.                                             "entity_id": "{{ night_light_entities }}"
  3000.                                           },
  3001.                                           "data": {
  3002.                                             "transition": "{{ night_transition_off_value }}"
  3003.                                           }
  3004.                                         },
  3005.                                         {
  3006.                                           "alias": "Turn off the scenes",
  3007.                                           "service": "scene.turn_on",
  3008.                                           "data": {
  3009.                                             "entity_id": "{{ end_scene_entities }}",
  3010.                                             "transition": "{{ night_transition_off_value }}"
  3011.                                           }
  3012.                                         }
  3013.                                       ]
  3014.                                     },
  3015.                                     {
  3016.                                       "alias": "If transition is not selected",
  3017.                                       "conditions": [
  3018.                                         {
  3019.                                           "condition": "template",
  3020.                                           "value_template": "{{ 'use_transition' not in include_night_light_control }}"
  3021.                                         }
  3022.                                       ],
  3023.                                       "sequence": [
  3024.                                         {
  3025.                                           "alias": "Turn off the lights",
  3026.                                           "service": "light.turn_off",
  3027.                                           "target": {
  3028.                                             "entity_id": "{{ night_light_entities }}"
  3029.                                           }
  3030.                                         },
  3031.                                         {
  3032.                                           "alias": "Turn off the scenes",
  3033.                                           "service": "scene.turn_on",
  3034.                                           "data": {
  3035.                                             "entity_id": "{{ end_scene_entities }}"
  3036.                                           }
  3037.                                         }
  3038.                                       ]
  3039.                                     }
  3040.                                   ]
  3041.                                 },
  3042.                                 {
  3043.                                   "alias": "Turn off the switches",
  3044.                                   "service": "switch.turn_off",
  3045.                                   "target": {
  3046.                                     "entity_id": "{{ night_switch_entities }}"
  3047.                                   }
  3048.                                 },
  3049.                                 {
  3050.                                   "alias": "Turn off the script",
  3051.                                   "service": "script.turn_on",
  3052.                                   "data": {
  3053.                                     "entity_id": "{{ end_script_entities }}"
  3054.                                   }
  3055.                                 },
  3056.                                 {
  3057.                                   "alias": "Turn off the boolean for scenes and scripts",
  3058.                                   "service": "input_boolean.turn_off",
  3059.                                   "data": {
  3060.                                     "entity_id": []
  3061.                                   }
  3062.                                 },
  3063.                                 {
  3064.                                   "alias": "Turn off the boolean for scenes and scripts",
  3065.                                   "service": "input_boolean.turn_off",
  3066.                                   "data": {
  3067.                                     "entity_id": []
  3068.                                   }
  3069.                                 },
  3070.                                 {
  3071.                                   "stop": "Stop the automation"
  3072.                                 }
  3073.                               ]
  3074.                             },
  3075.                             {
  3076.                               "alias": "Motion trigger is off and check if any by-passes are on",
  3077.                               "conditions": [
  3078.                                 {
  3079.                                   "condition": "or",
  3080.                                   "conditions": [
  3081.                                     {
  3082.                                       "condition": "and",
  3083.                                       "conditions": [
  3084.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  3085.                                         {
  3086.                                           "condition": "or",
  3087.                                           "conditions": [
  3088.                                             {
  3089.                                               "condition": "state",
  3090.                                               "entity_id": [],
  3091.                                               "match": "any",
  3092.                                               "state": "on"
  3093.                                             },
  3094.                                             {
  3095.                                               "condition": "state",
  3096.                                               "entity_id": [],
  3097.                                               "match": "any",
  3098.                                               "state": "on"
  3099.                                             },
  3100.                                             {
  3101.                                               "condition": "state",
  3102.                                               "entity_id": [],
  3103.                                               "match": "any",
  3104.                                               "state": "on"
  3105.                                             }
  3106.                                           ]
  3107.                                         }
  3108.                                       ]
  3109.                                     },
  3110.                                     {
  3111.                                       "condition": "and",
  3112.                                       "conditions": [
  3113.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  3114.                                         {
  3115.                                           "condition": "or",
  3116.                                           "conditions": [
  3117.                                             {
  3118.                                               "condition": "state",
  3119.                                               "entity_id": [],
  3120.                                               "match": "any",
  3121.                                               "state": "on"
  3122.                                             },
  3123.                                             {
  3124.                                               "condition": "state",
  3125.                                               "entity_id": [],
  3126.                                               "match": "any",
  3127.                                               "state": "on"
  3128.                                             }
  3129.                                           ]
  3130.                                         }
  3131.                                       ]
  3132.                                     },
  3133.                                     {
  3134.                                       "condition": "and",
  3135.                                       "conditions": [
  3136.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  3137.                                         {
  3138.                                           "condition": "or",
  3139.                                           "conditions": [
  3140.                                             {
  3141.                                               "condition": "state",
  3142.                                               "entity_id": [],
  3143.                                               "match": "any",
  3144.                                               "state": "on"
  3145.                                             },
  3146.                                             {
  3147.                                               "condition": "state",
  3148.                                               "entity_id": [],
  3149.                                               "match": "any",
  3150.                                               "state": "on"
  3151.                                             }
  3152.                                           ]
  3153.                                         }
  3154.                                       ]
  3155.                                     },
  3156.                                     {
  3157.                                       "condition": "and",
  3158.                                       "conditions": [
  3159.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  3160.                                         {
  3161.                                           "condition": "or",
  3162.                                           "conditions": [
  3163.                                             {
  3164.                                               "condition": "state",
  3165.                                               "entity_id": [],
  3166.                                               "match": "any",
  3167.                                               "state": "on"
  3168.                                             },
  3169.                                             {
  3170.                                               "condition": "state",
  3171.                                               "entity_id": [],
  3172.                                               "match": "any",
  3173.                                               "state": "on"
  3174.                                             }
  3175.                                           ]
  3176.                                         }
  3177.                                       ]
  3178.                                     },
  3179.                                     {
  3180.                                       "condition": "and",
  3181.                                       "conditions": [
  3182.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  3183.                                         {
  3184.                                           "condition": "state",
  3185.                                           "entity_id": [],
  3186.                                           "match": "any",
  3187.                                           "state": "on"
  3188.                                         }
  3189.                                       ]
  3190.                                     },
  3191.                                     {
  3192.                                       "condition": "and",
  3193.                                       "conditions": [
  3194.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  3195.                                         {
  3196.                                           "condition": "state",
  3197.                                           "entity_id": [],
  3198.                                           "match": "any",
  3199.                                           "state": "on"
  3200.                                         }
  3201.                                       ]
  3202.                                     },
  3203.                                     {
  3204.                                       "condition": "and",
  3205.                                       "conditions": [
  3206.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  3207.                                         {
  3208.                                           "condition": "state",
  3209.                                           "entity_id": [],
  3210.                                           "match": "any",
  3211.                                           "state": "on"
  3212.                                         }
  3213.                                       ]
  3214.                                     }
  3215.                                   ]
  3216.                                 }
  3217.                               ],
  3218.                               "sequence": [
  3219.                                 {
  3220.                                   "alias": "Check by-pass settings and preform the correct action",
  3221.                                   "if": [
  3222.                                     {
  3223.                                       "alias": "Check if the by-pass auto off is enabled",
  3224.                                       "condition": "template",
  3225.                                       "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  3226.                                     }
  3227.                                   ],
  3228.                                   "then": [
  3229.                                     {
  3230.                                       "alias": "Wait the number of minutes set in the by-pass auto off time delay",
  3231.                                       "delay": {
  3232.                                         "minutes": 60
  3233.                                       }
  3234.                                     },
  3235.                                     {
  3236.                                       "alias": "Parallel Actions for the by-pass auto off",
  3237.                                       "parallel": [
  3238.                                         {
  3239.                                           "sequence": [
  3240.                                             {
  3241.                                               "choose": [
  3242.                                                 {
  3243.                                                   "conditions": [
  3244.                                                     {
  3245.                                                       "condition": "template",
  3246.                                                       "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}"
  3247.                                                     }
  3248.                                                   ],
  3249.                                                   "sequence": [
  3250.                                                     {
  3251.                                                       "alias": "Turn off the by-pass",
  3252.                                                       "service": "homeassistant.turn_off",
  3253.                                                       "entity_id": []
  3254.                                                     }
  3255.                                                   ]
  3256.                                                 }
  3257.                                               ]
  3258.                                             }
  3259.                                           ]
  3260.                                         },
  3261.                                         {
  3262.                                           "sequence": [
  3263.                                             {
  3264.                                               "choose": [
  3265.                                                 {
  3266.                                                   "conditions": [
  3267.                                                     {
  3268.                                                       "condition": "template",
  3269.                                                       "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}"
  3270.                                                     }
  3271.                                                   ],
  3272.                                                   "sequence": [
  3273.                                                     {
  3274.                                                       "alias": "Turn off the by-pass",
  3275.                                                       "service": "homeassistant.turn_off",
  3276.                                                       "entity_id": []
  3277.                                                     }
  3278.                                                   ]
  3279.                                                 }
  3280.                                               ]
  3281.                                             }
  3282.                                           ]
  3283.                                         },
  3284.                                         {
  3285.                                           "sequence": [
  3286.                                             {
  3287.                                               "choose": [
  3288.                                                 {
  3289.                                                   "conditions": [
  3290.                                                     {
  3291.                                                       "condition": "template",
  3292.                                                       "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  3293.                                                     }
  3294.                                                   ],
  3295.                                                   "sequence": [
  3296.                                                     {
  3297.                                                       "alias": "Turn off the by-pass",
  3298.                                                       "service": "homeassistant.turn_off",
  3299.                                                       "entity_id": []
  3300.                                                     }
  3301.                                                   ]
  3302.                                                 }
  3303.                                               ]
  3304.                                             }
  3305.                                           ]
  3306.                                         }
  3307.                                       ]
  3308.                                     }
  3309.                                   ]
  3310.                                 },
  3311.                                 {
  3312.                                   "stop": "Stop the automation"
  3313.                                 }
  3314.                               ]
  3315.                             }
  3316.                           ]
  3317.                         }
  3318.                       ]
  3319.                     },
  3320.                     {
  3321.                       "alias": "By-pass is turned off  & check if the motion trigger is on",
  3322.                       "conditions": [
  3323.                         {
  3324.                           "condition": "trigger",
  3325.                           "id": [
  3326.                             "t8_on",
  3327.                             "t8_off",
  3328.                             "t8_stop"
  3329.                           ]
  3330.                         },
  3331.                         {
  3332.                           "condition": "state",
  3333.                           "entity_id": [
  3334.                             "binary_sensor.hue_motion_sensor_1_motion"
  3335.                           ],
  3336.                           "match": "any",
  3337.                           "state": "on"
  3338.                         }
  3339.                       ],
  3340.                       "sequence": [
  3341.                         {
  3342.                           "choose": [
  3343.                             {
  3344.                               "alias": "Check all by-pass are off and check conditions if enabled ",
  3345.                               "conditions": [
  3346.                                 {
  3347.                                   "condition": "or",
  3348.                                   "conditions": [
  3349.                                     {
  3350.                                       "condition": "and",
  3351.                                       "conditions": [
  3352.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  3353.                                         {
  3354.                                           "condition": "state",
  3355.                                           "entity_id": [],
  3356.                                           "state": "off"
  3357.                                         },
  3358.                                         {
  3359.                                           "condition": "state",
  3360.                                           "entity_id": [],
  3361.                                           "state": "off"
  3362.                                         },
  3363.                                         {
  3364.                                           "condition": "state",
  3365.                                           "entity_id": [],
  3366.                                           "state": "off"
  3367.                                         }
  3368.                                       ]
  3369.                                     },
  3370.                                     {
  3371.                                       "condition": "and",
  3372.                                       "conditions": [
  3373.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  3374.                                         {
  3375.                                           "condition": "state",
  3376.                                           "entity_id": [],
  3377.                                           "state": "off"
  3378.                                         },
  3379.                                         {
  3380.                                           "condition": "state",
  3381.                                           "entity_id": [],
  3382.                                           "state": "off"
  3383.                                         }
  3384.                                       ]
  3385.                                     },
  3386.                                     {
  3387.                                       "condition": "and",
  3388.                                       "conditions": [
  3389.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  3390.                                         {
  3391.                                           "condition": "state",
  3392.                                           "entity_id": [],
  3393.                                           "state": "off"
  3394.                                         },
  3395.                                         {
  3396.                                           "condition": "state",
  3397.                                           "entity_id": [],
  3398.                                           "state": "off"
  3399.                                         }
  3400.                                       ]
  3401.                                     },
  3402.                                     {
  3403.                                       "condition": "and",
  3404.                                       "conditions": [
  3405.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  3406.                                         {
  3407.                                           "condition": "state",
  3408.                                           "entity_id": [],
  3409.                                           "state": "off"
  3410.                                         },
  3411.                                         {
  3412.                                           "condition": "state",
  3413.                                           "entity_id": [],
  3414.                                           "state": "off"
  3415.                                         }
  3416.                                       ]
  3417.                                     },
  3418.                                     {
  3419.                                       "condition": "and",
  3420.                                       "conditions": [
  3421.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  3422.                                         {
  3423.                                           "condition": "state",
  3424.                                           "entity_id": [],
  3425.                                           "state": "off"
  3426.                                         }
  3427.                                       ]
  3428.                                     },
  3429.                                     {
  3430.                                       "condition": "and",
  3431.                                       "conditions": [
  3432.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  3433.                                         {
  3434.                                           "condition": "state",
  3435.                                           "entity_id": [],
  3436.                                           "state": "off"
  3437.                                         }
  3438.                                       ]
  3439.                                     },
  3440.                                     {
  3441.                                       "condition": "and",
  3442.                                       "conditions": [
  3443.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  3444.                                         {
  3445.                                           "condition": "state",
  3446.                                           "entity_id": [],
  3447.                                           "state": "off"
  3448.                                         }
  3449.                                       ]
  3450.                                     }
  3451.                                   ]
  3452.                                 },
  3453.                                 {
  3454.                                   "condition": "or",
  3455.                                   "conditions": [
  3456.                                     "{{ (include_sun == 'sun_enabled') and (state_attr('sun.sun','elevation') >= sun_elevation | float(90)) }}",
  3457.                                     "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_disabled') and (states[ambient_light_sensor].state | int > ambient_light_value | int) }}",
  3458.                                     "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and (states[ambient_light_sensor].state | int > ambient_light_value | int) and (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) }}",
  3459.                                     "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and (states[ambient_light_sensor].state | int > ambient_light_value | int) and (is_state(night_boolean_scenes_scripts, 'off')) }}",
  3460.                                     {
  3461.                                       "condition": "and",
  3462.                                       "conditions": [
  3463.                                         {
  3464.                                           "condition": "time",
  3465.                                           "after": "00:00:00",
  3466.                                           "before": "00:00:00"
  3467.                                         },
  3468.                                         "{{ include_time == 'time_enabled' }}"
  3469.                                       ]
  3470.                                     }
  3471.                                   ]
  3472.                                 }
  3473.                               ],
  3474.                               "sequence": [
  3475.                                 {
  3476.                                   "alias": "Wait the number of minutes set in the by-pass time delay",
  3477.                                   "delay": {
  3478.                                     "minutes": 0
  3479.                                   }
  3480.                                 },
  3481.                                 {
  3482.                                   "choose": [
  3483.                                     {
  3484.                                       "alias": "If transition is selected",
  3485.                                       "conditions": [
  3486.                                         {
  3487.                                           "condition": "template",
  3488.                                           "value_template": "{{ 'use_transition' in include_night_light_control }}"
  3489.                                         }
  3490.                                       ],
  3491.                                       "sequence": [
  3492.                                         {
  3493.                                           "alias": "Turn off the lights",
  3494.                                           "service": "light.turn_off",
  3495.                                           "target": {
  3496.                                             "entity_id": "{{ night_light_entities }}"
  3497.                                           },
  3498.                                           "data": {
  3499.                                             "transition": "{{ night_transition_off_value }}"
  3500.                                           }
  3501.                                         },
  3502.                                         {
  3503.                                           "alias": "Turn off the scenes",
  3504.                                           "service": "scene.turn_on",
  3505.                                           "data": {
  3506.                                             "entity_id": "{{ end_scene_entities }}",
  3507.                                             "transition": "{{ night_transition_off_value }}"
  3508.                                           }
  3509.                                         }
  3510.                                       ]
  3511.                                     },
  3512.                                     {
  3513.                                       "alias": "If transition is not selected",
  3514.                                       "conditions": [
  3515.                                         {
  3516.                                           "condition": "template",
  3517.                                           "value_template": "{{ 'use_transition' not in include_night_light_control }}"
  3518.                                         }
  3519.                                       ],
  3520.                                       "sequence": [
  3521.                                         {
  3522.                                           "alias": "Turn off the lights",
  3523.                                           "service": "light.turn_off",
  3524.                                           "target": {
  3525.                                             "entity_id": "{{ night_light_entities }}"
  3526.                                           }
  3527.                                         },
  3528.                                         {
  3529.                                           "alias": "Turn off the scenes",
  3530.                                           "service": "scene.turn_on",
  3531.                                           "data": {
  3532.                                             "entity_id": "{{ end_scene_entities }}"
  3533.                                           }
  3534.                                         }
  3535.                                       ]
  3536.                                     }
  3537.                                   ]
  3538.                                 },
  3539.                                 {
  3540.                                   "alias": "Turn off the switches",
  3541.                                   "service": "switch.turn_off",
  3542.                                   "target": {
  3543.                                     "entity_id": "{{ night_switch_entities }}"
  3544.                                   }
  3545.                                 },
  3546.                                 {
  3547.                                   "alias": "Turn off the script",
  3548.                                   "service": "script.turn_on",
  3549.                                   "data": {
  3550.                                     "entity_id": "{{ end_script_entities }}"
  3551.                                   }
  3552.                                 },
  3553.                                 {
  3554.                                   "stop": "Stop the automation"
  3555.                                 }
  3556.                               ]
  3557.                             },
  3558.                             {
  3559.                               "alias": "Motion trigger is on and check if any by-passes are on",
  3560.                               "conditions": [
  3561.                                 {
  3562.                                   "condition": "or",
  3563.                                   "conditions": [
  3564.                                     {
  3565.                                       "condition": "and",
  3566.                                       "conditions": [
  3567.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  3568.                                         {
  3569.                                           "condition": "or",
  3570.                                           "conditions": [
  3571.                                             {
  3572.                                               "condition": "state",
  3573.                                               "entity_id": [],
  3574.                                               "match": "any",
  3575.                                               "state": "on"
  3576.                                             },
  3577.                                             {
  3578.                                               "condition": "state",
  3579.                                               "entity_id": [],
  3580.                                               "match": "any",
  3581.                                               "state": "on"
  3582.                                             },
  3583.                                             {
  3584.                                               "condition": "state",
  3585.                                               "entity_id": [],
  3586.                                               "match": "any",
  3587.                                               "state": "on"
  3588.                                             }
  3589.                                           ]
  3590.                                         }
  3591.                                       ]
  3592.                                     },
  3593.                                     {
  3594.                                       "condition": "and",
  3595.                                       "conditions": [
  3596.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  3597.                                         {
  3598.                                           "condition": "or",
  3599.                                           "conditions": [
  3600.                                             {
  3601.                                               "condition": "state",
  3602.                                               "entity_id": [],
  3603.                                               "match": "any",
  3604.                                               "state": "on"
  3605.                                             },
  3606.                                             {
  3607.                                               "condition": "state",
  3608.                                               "entity_id": [],
  3609.                                               "match": "any",
  3610.                                               "state": "on"
  3611.                                             }
  3612.                                           ]
  3613.                                         }
  3614.                                       ]
  3615.                                     },
  3616.                                     {
  3617.                                       "condition": "and",
  3618.                                       "conditions": [
  3619.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  3620.                                         {
  3621.                                           "condition": "or",
  3622.                                           "conditions": [
  3623.                                             {
  3624.                                               "condition": "state",
  3625.                                               "entity_id": [],
  3626.                                               "match": "any",
  3627.                                               "state": "on"
  3628.                                             },
  3629.                                             {
  3630.                                               "condition": "state",
  3631.                                               "entity_id": [],
  3632.                                               "match": "any",
  3633.                                               "state": "on"
  3634.                                             }
  3635.                                           ]
  3636.                                         }
  3637.                                       ]
  3638.                                     },
  3639.                                     {
  3640.                                       "condition": "and",
  3641.                                       "conditions": [
  3642.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  3643.                                         {
  3644.                                           "condition": "or",
  3645.                                           "conditions": [
  3646.                                             {
  3647.                                               "condition": "state",
  3648.                                               "entity_id": [],
  3649.                                               "match": "any",
  3650.                                               "state": "on"
  3651.                                             },
  3652.                                             {
  3653.                                               "condition": "state",
  3654.                                               "entity_id": [],
  3655.                                               "match": "any",
  3656.                                               "state": "on"
  3657.                                             }
  3658.                                           ]
  3659.                                         }
  3660.                                       ]
  3661.                                     },
  3662.                                     {
  3663.                                       "condition": "and",
  3664.                                       "conditions": [
  3665.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  3666.                                         {
  3667.                                           "condition": "state",
  3668.                                           "entity_id": [],
  3669.                                           "match": "any",
  3670.                                           "state": "on"
  3671.                                         }
  3672.                                       ]
  3673.                                     },
  3674.                                     {
  3675.                                       "condition": "and",
  3676.                                       "conditions": [
  3677.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  3678.                                         {
  3679.                                           "condition": "state",
  3680.                                           "entity_id": [],
  3681.                                           "match": "any",
  3682.                                           "state": "on"
  3683.                                         }
  3684.                                       ]
  3685.                                     },
  3686.                                     {
  3687.                                       "condition": "and",
  3688.                                       "conditions": [
  3689.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  3690.                                         {
  3691.                                           "condition": "state",
  3692.                                           "entity_id": [],
  3693.                                           "match": "any",
  3694.                                           "state": "on"
  3695.                                         }
  3696.                                       ]
  3697.                                     }
  3698.                                   ]
  3699.                                 }
  3700.                               ],
  3701.                               "sequence": [
  3702.                                 {
  3703.                                   "alias": "Check by-pass settings and preform the correct action",
  3704.                                   "if": [
  3705.                                     {
  3706.                                       "alias": "Check if the by-pass auto off is enabled",
  3707.                                       "condition": "template",
  3708.                                       "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  3709.                                     }
  3710.                                   ],
  3711.                                   "then": [
  3712.                                     {
  3713.                                       "alias": "Wait the number of minutes set in the by-pass auto off time delay",
  3714.                                       "delay": {
  3715.                                         "minutes": 60
  3716.                                       }
  3717.                                     },
  3718.                                     {
  3719.                                       "alias": "Parallel Actions for the by-pass auto off",
  3720.                                       "parallel": [
  3721.                                         {
  3722.                                           "sequence": [
  3723.                                             {
  3724.                                               "choose": [
  3725.                                                 {
  3726.                                                   "conditions": [
  3727.                                                     {
  3728.                                                       "condition": "template",
  3729.                                                       "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}"
  3730.                                                     }
  3731.                                                   ],
  3732.                                                   "sequence": [
  3733.                                                     {
  3734.                                                       "alias": "Turn off the by-pass",
  3735.                                                       "service": "homeassistant.turn_off",
  3736.                                                       "entity_id": []
  3737.                                                     }
  3738.                                                   ]
  3739.                                                 }
  3740.                                               ]
  3741.                                             }
  3742.                                           ]
  3743.                                         },
  3744.                                         {
  3745.                                           "sequence": [
  3746.                                             {
  3747.                                               "choose": [
  3748.                                                 {
  3749.                                                   "conditions": [
  3750.                                                     {
  3751.                                                       "condition": "template",
  3752.                                                       "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}"
  3753.                                                     }
  3754.                                                   ],
  3755.                                                   "sequence": [
  3756.                                                     {
  3757.                                                       "alias": "Turn off the by-pass",
  3758.                                                       "service": "homeassistant.turn_off",
  3759.                                                       "entity_id": []
  3760.                                                     }
  3761.                                                   ]
  3762.                                                 }
  3763.                                               ]
  3764.                                             }
  3765.                                           ]
  3766.                                         },
  3767.                                         {
  3768.                                           "sequence": [
  3769.                                             {
  3770.                                               "choose": [
  3771.                                                 {
  3772.                                                   "conditions": [
  3773.                                                     {
  3774.                                                       "condition": "template",
  3775.                                                       "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  3776.                                                     }
  3777.                                                   ],
  3778.                                                   "sequence": [
  3779.                                                     {
  3780.                                                       "alias": "Turn off the by-pass",
  3781.                                                       "service": "homeassistant.turn_off",
  3782.                                                       "entity_id": []
  3783.                                                     }
  3784.                                                   ]
  3785.                                                 }
  3786.                                               ]
  3787.                                             }
  3788.                                           ]
  3789.                                         }
  3790.                                       ]
  3791.                                     }
  3792.                                   ]
  3793.                                 },
  3794.                                 {
  3795.                                   "stop": "Stop the automation"
  3796.                                 }
  3797.                               ]
  3798.                             }
  3799.                           ]
  3800.                         }
  3801.                       ]
  3802.                     }
  3803.                   ]
  3804.                 },
  3805.                 {
  3806.                   "choose": [
  3807.                     {
  3808.                       "alias": "Sun, Ambient Light Sensor & time above setting to turn off",
  3809.                       "conditions": [
  3810.                         {
  3811.                           "condition": "trigger",
  3812.                           "id": [
  3813.                             "t9",
  3814.                             "t10",
  3815.                             "t11"
  3816.                           ]
  3817.                         }
  3818.                       ],
  3819.                       "sequence": [
  3820.                         {
  3821.                           "choose": [
  3822.                             {
  3823.                               "alias": "If transition is selected",
  3824.                               "conditions": [
  3825.                                 {
  3826.                                   "condition": "template",
  3827.                                   "value_template": "{{ 'use_transition' in include_night_light_control }}"
  3828.                                 }
  3829.                               ],
  3830.                               "sequence": [
  3831.                                 {
  3832.                                   "alias": "Turn off the lights",
  3833.                                   "service": "light.turn_off",
  3834.                                   "target": {
  3835.                                     "entity_id": "{{ night_light_entities }}"
  3836.                                   },
  3837.                                   "data": {
  3838.                                     "transition": "{{ night_transition_off_value }}"
  3839.                                   }
  3840.                                 },
  3841.                                 {
  3842.                                   "alias": "Turn off the scenes",
  3843.                                   "service": "scene.turn_on",
  3844.                                   "data": {
  3845.                                     "entity_id": "{{ end_scene_entities }}",
  3846.                                     "transition": "{{ night_transition_off_value }}"
  3847.                                   }
  3848.                                 }
  3849.                               ]
  3850.                             },
  3851.                             {
  3852.                               "alias": "If transition is not selected",
  3853.                               "conditions": [
  3854.                                 {
  3855.                                   "condition": "template",
  3856.                                   "value_template": "{{ 'use_transition' not in include_night_light_control }}"
  3857.                                 }
  3858.                               ],
  3859.                               "sequence": [
  3860.                                 {
  3861.                                   "alias": "Turn off the lights",
  3862.                                   "service": "light.turn_off",
  3863.                                   "target": {
  3864.                                     "entity_id": "{{ night_light_entities }}"
  3865.                                   }
  3866.                                 },
  3867.                                 {
  3868.                                   "alias": "Turn off the scenes",
  3869.                                   "service": "scene.turn_on",
  3870.                                   "data": {
  3871.                                     "entity_id": "{{ end_scene_entities }}"
  3872.                                   }
  3873.                                 }
  3874.                               ]
  3875.                             }
  3876.                           ]
  3877.                         },
  3878.                         {
  3879.                           "alias": "Turn off the switches",
  3880.                           "service": "switch.turn_off",
  3881.                           "target": {
  3882.                             "entity_id": "{{ night_switch_entities }}"
  3883.                           }
  3884.                         },
  3885.                         {
  3886.                           "alias": "Turn off the script",
  3887.                           "service": "script.turn_on",
  3888.                           "data": {
  3889.                             "entity_id": "{{ end_script_entities }}"
  3890.                           }
  3891.                         },
  3892.                         {
  3893.                           "alias": "Turn off the input boolean night lights",
  3894.                           "service": "input_boolean.turn_off",
  3895.                           "data": {
  3896.                             "entity_id": []
  3897.                           }
  3898.                         },
  3899.                         {
  3900.                           "stop": "Stop the automation"
  3901.                         }
  3902.                       ]
  3903.                     },
  3904.                     {
  3905.                       "alias": "Turn off normal lights when trigger by start night lights conditions",
  3906.                       "conditions": [
  3907.                         {
  3908.                           "condition": "trigger",
  3909.                           "id": [
  3910.                             "t4",
  3911.                             "t5",
  3912.                             "t6"
  3913.                           ]
  3914.                         }
  3915.                       ],
  3916.                       "sequence": [
  3917.                         {
  3918.                           "choose": [
  3919.                             {
  3920.                               "alias": "light - switch - scene - script is ON",
  3921.                               "conditions": [
  3922.                                 "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (is_state(boolean_scenes_scripts, 'on')) }}"
  3923.                               ],
  3924.                               "sequence": [
  3925.                                 {
  3926.                                   "choose": [
  3927.                                     {
  3928.                                       "alias": "If transition is selected",
  3929.                                       "conditions": [
  3930.                                         {
  3931.                                           "condition": "template",
  3932.                                           "value_template": "{{ 'use_transition' in include_light_control }}"
  3933.                                         }
  3934.                                       ],
  3935.                                       "sequence": [
  3936.                                         {
  3937.                                           "alias": "Turn off the lights",
  3938.                                           "service": "light.turn_off",
  3939.                                           "target": {
  3940.                                             "entity_id": "{{ crossover_lights_light }}"
  3941.                                           },
  3942.                                           "data": {
  3943.                                             "transition": "{{ transition_off_value }}"
  3944.                                           }
  3945.                                         }
  3946.                                       ]
  3947.                                     },
  3948.                                     {
  3949.                                       "alias": "If transition is not selected",
  3950.                                       "conditions": [
  3951.                                         {
  3952.                                           "condition": "template",
  3953.                                           "value_template": "{{ 'use_transition' not in include_light_control }}"
  3954.                                         }
  3955.                                       ],
  3956.                                       "sequence": [
  3957.                                         {
  3958.                                           "alias": "Turn off the lights",
  3959.                                           "service": "light.turn_off",
  3960.                                           "target": {
  3961.                                             "entity_id": "{{ crossover_lights_light }}"
  3962.                                           }
  3963.                                         }
  3964.                                       ]
  3965.                                     }
  3966.                                   ]
  3967.                                 },
  3968.                                 {
  3969.                                   "alias": "Turn off the switches",
  3970.                                   "service": "switch.turn_off",
  3971.                                   "target": {
  3972.                                     "entity_id": "{{ crossover_lights_switch }}"
  3973.                                   }
  3974.                                 },
  3975.                                 {
  3976.                                   "alias": "Turn off the script",
  3977.                                   "service": "script.turn_on",
  3978.                                   "data": {
  3979.                                     "entity_id": "{{ end_script_entities }}"
  3980.                                   }
  3981.                                 },
  3982.                                 {
  3983.                                   "choose": [
  3984.                                     {
  3985.                                       "alias": "If adjust light settings when crossing over if lights are ON is selected in night light control",
  3986.                                       "conditions": [
  3987.                                         {
  3988.                                           "condition": "template",
  3989.                                           "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}"
  3990.                                         }
  3991.                                       ],
  3992.                                       "sequence": [
  3993.                                         {
  3994.                                           "choose": [
  3995.                                             {
  3996.                                               "alias": "If transition is selected",
  3997.                                               "conditions": [
  3998.                                                 {
  3999.                                                   "condition": "template",
  4000.                                                   "value_template": "{{ 'use_transition' in include_light_control }}"
  4001.                                                 }
  4002.                                               ],
  4003.                                               "sequence": [
  4004.                                                 {
  4005.                                                   "alias": "Turn off the scenes",
  4006.                                                   "service": "scene.turn_on",
  4007.                                                   "data": {
  4008.                                                     "entity_id": "{{ end_scene_entities }}",
  4009.                                                     "transition": "{{ transition_off_value }}"
  4010.                                                   }
  4011.                                                 }
  4012.                                               ]
  4013.                                             },
  4014.                                             {
  4015.                                               "alias": "If transition is not selected",
  4016.                                               "conditions": [
  4017.                                                 {
  4018.                                                   "condition": "template",
  4019.                                                   "value_template": "{{ 'use_transition' not in include_light_control }}"
  4020.                                                 }
  4021.                                               ],
  4022.                                               "sequence": [
  4023.                                                 {
  4024.                                                   "alias": "Turn off the scenes",
  4025.                                                   "service": "scene.turn_on",
  4026.                                                   "data": {
  4027.                                                     "entity_id": "{{ end_scene_entities }}"
  4028.                                                   }
  4029.                                                 }
  4030.                                               ]
  4031.                                             }
  4032.                                           ]
  4033.                                         },
  4034.                                         {
  4035.                                           "alias": "Turn off the input boolean normal lights",
  4036.                                           "service": "input_boolean.turn_off",
  4037.                                           "data": {
  4038.                                             "entity_id": []
  4039.                                           }
  4040.                                         },
  4041.                                         {
  4042.                                           "choose": [
  4043.                                             {
  4044.                                               "alias": "Set the transition and brightness for the night lights switch",
  4045.                                               "conditions": [
  4046.                                                 {
  4047.                                                   "condition": "template",
  4048.                                                   "value_template": "{{ ('use_transition' in include_night_light_control) and ('use_brightness' in include_night_light_control) and ('use_colour_temperature' not in include_night_light_control) }}"
  4049.                                                 }
  4050.                                               ],
  4051.                                               "sequence": [
  4052.                                                 {
  4053.                                                   "service": "light.turn_on",
  4054.                                                   "target": {
  4055.                                                     "entity_id": "{{ crossover_night_lights_light_on }}"
  4056.                                                   },
  4057.                                                   "data": {
  4058.                                                     "transition": "{{ night_transition_on_value }}",
  4059.                                                     "brightness_pct": "{{ night_brightness_value }}"
  4060.                                                   }
  4061.                                                 }
  4062.                                               ]
  4063.                                             },
  4064.                                             {
  4065.                                               "alias": "Set the transition and colour temperature for the night lights switch",
  4066.                                               "conditions": [
  4067.                                                 {
  4068.                                                   "condition": "template",
  4069.                                                   "value_template": "{{ ('use_transition' in include_night_light_control) and ('use_brightness' not in include_night_light_control) and ('use_colour_temperature' in include_night_light_control) }}"
  4070.                                                 }
  4071.                                               ],
  4072.                                               "sequence": [
  4073.                                                 {
  4074.                                                   "service": "light.turn_on",
  4075.                                                   "target": {
  4076.                                                     "entity_id": "{{ crossover_night_lights_light_on }}"
  4077.                                                   },
  4078.                                                   "data": {
  4079.                                                     "transition": "{{ night_transition_on_value }}",
  4080.                                                     "kelvin": "{{ night_temperature_value }}"
  4081.                                                   }
  4082.                                                 }
  4083.                                               ]
  4084.                                             },
  4085.                                             {
  4086.                                               "alias": "Set the transition, brightness and colour temperature for the night lights switch",
  4087.                                               "conditions": [
  4088.                                                 {
  4089.                                                   "condition": "template",
  4090.                                                   "value_template": "{{ ('use_transition' in include_night_light_control) and ('use_brightness' in include_night_light_control) and ('use_colour_temperature' in include_night_light_control) }}"
  4091.                                                 }
  4092.                                               ],
  4093.                                               "sequence": [
  4094.                                                 {
  4095.                                                   "service": "light.turn_on",
  4096.                                                   "target": {
  4097.                                                     "entity_id": "{{ crossover_night_lights_light_on }}"
  4098.                                                   },
  4099.                                                   "data": {
  4100.                                                     "transition": "{{ night_transition_on_value }}",
  4101.                                                     "brightness_pct": "{{ night_brightness_value }}",
  4102.                                                     "kelvin": "{{ night_temperature_value }}"
  4103.                                                   }
  4104.                                                 }
  4105.                                               ]
  4106.                                             },
  4107.                                             {
  4108.                                               "alias": "Set the brightness for the night lights switch",
  4109.                                               "conditions": [
  4110.                                                 {
  4111.                                                   "condition": "template",
  4112.                                                   "value_template": "{{ ('use_transition' not in include_night_light_control) and ('use_brightness' in include_night_light_control) and ('use_colour_temperature' not in include_night_light_control) }}"
  4113.                                                 }
  4114.                                               ],
  4115.                                               "sequence": [
  4116.                                                 {
  4117.                                                   "service": "light.turn_on",
  4118.                                                   "target": {
  4119.                                                     "entity_id": "{{ crossover_night_lights_light_on }}"
  4120.                                                   },
  4121.                                                   "data": {
  4122.                                                     "brightness_pct": "{{ night_brightness_value }}"
  4123.                                                   }
  4124.                                                 }
  4125.                                               ]
  4126.                                             },
  4127.                                             {
  4128.                                               "alias": "Set the colour temperature for the night lights switch",
  4129.                                               "conditions": [
  4130.                                                 {
  4131.                                                   "condition": "template",
  4132.                                                   "value_template": "{{ ('use_transition' not in include_night_light_control) and ('use_brightness' not in include_night_light_control) and ('use_colour_temperature' in include_night_light_control) }}"
  4133.                                                 }
  4134.                                               ],
  4135.                                               "sequence": [
  4136.                                                 {
  4137.                                                   "service": "light.turn_on",
  4138.                                                   "target": {
  4139.                                                     "entity_id": "{{ crossover_night_lights_light_on }}"
  4140.                                                   },
  4141.                                                   "data": {
  4142.                                                     "kelvin": "{{ night_temperature_value }}"
  4143.                                                   }
  4144.                                                 }
  4145.                                               ]
  4146.                                             },
  4147.                                             {
  4148.                                               "alias": "Set the brightness and colour temperature for the night lights switch",
  4149.                                               "conditions": [
  4150.                                                 {
  4151.                                                   "condition": "template",
  4152.                                                   "value_template": "{{ ('use_transition' not in include_night_light_control) and ('use_brightness' in include_night_light_control) and ('use_colour_temperature' in include_night_light_control) }}"
  4153.                                                 }
  4154.                                               ],
  4155.                                               "sequence": [
  4156.                                                 {
  4157.                                                   "service": "light.turn_on",
  4158.                                                   "target": {
  4159.                                                     "entity_id": "{{ crossover_night_lights_light_on }}"
  4160.                                                   },
  4161.                                                   "data": {
  4162.                                                     "brightness_pct": "{{ night_brightness_value }}",
  4163.                                                     "kelvin": "{{ night_temperature_value }}"
  4164.                                                   }
  4165.                                                 }
  4166.                                               ]
  4167.                                             }
  4168.                                           ]
  4169.                                         }
  4170.                                       ]
  4171.                                     }
  4172.                                   ]
  4173.                                 }
  4174.                               ]
  4175.                             },
  4176.                             {
  4177.                               "alias": "light - switch - scene - script is ON",
  4178.                               "conditions": [
  4179.                                 "{{ 'manage_scripts_crossing_over' in include_night_light_control }}",
  4180.                                 "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(boolean_scenes_scripts, 'off')) }}"
  4181.                               ],
  4182.                               "sequence": [
  4183.                                 {
  4184.                                   "alias": "Turn off the script",
  4185.                                   "service": "script.turn_on",
  4186.                                   "data": {
  4187.                                     "entity_id": "{{ end_script_entities }}"
  4188.                                   }
  4189.                                 },
  4190.                                 {
  4191.                                   "stop": "Stop the automation"
  4192.                                 }
  4193.                               ]
  4194.                             }
  4195.                           ]
  4196.                         }
  4197.                       ]
  4198.                     },
  4199.                     {
  4200.                       "alias": "Safe Guard when HA restarts",
  4201.                       "conditions": [
  4202.                         {
  4203.                           "condition": "trigger",
  4204.                           "id": "t15"
  4205.                         }
  4206.                       ],
  4207.                       "sequence": [
  4208.                         {
  4209.                           "choose": [
  4210.                             {
  4211.                               "alias": "Check all by-pass are off and check conditions if enabled ",
  4212.                               "conditions": [
  4213.                                 {
  4214.                                   "condition": "or",
  4215.                                   "conditions": [
  4216.                                     {
  4217.                                       "condition": "and",
  4218.                                       "conditions": [
  4219.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  4220.                                         {
  4221.                                           "condition": "state",
  4222.                                           "entity_id": [],
  4223.                                           "state": "off"
  4224.                                         },
  4225.                                         {
  4226.                                           "condition": "state",
  4227.                                           "entity_id": [],
  4228.                                           "state": "off"
  4229.                                         },
  4230.                                         {
  4231.                                           "condition": "state",
  4232.                                           "entity_id": [],
  4233.                                           "state": "off"
  4234.                                         }
  4235.                                       ]
  4236.                                     },
  4237.                                     {
  4238.                                       "condition": "and",
  4239.                                       "conditions": [
  4240.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  4241.                                         {
  4242.                                           "condition": "state",
  4243.                                           "entity_id": [],
  4244.                                           "state": "off"
  4245.                                         },
  4246.                                         {
  4247.                                           "condition": "state",
  4248.                                           "entity_id": [],
  4249.                                           "state": "off"
  4250.                                         }
  4251.                                       ]
  4252.                                     },
  4253.                                     {
  4254.                                       "condition": "and",
  4255.                                       "conditions": [
  4256.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  4257.                                         {
  4258.                                           "condition": "state",
  4259.                                           "entity_id": [],
  4260.                                           "state": "off"
  4261.                                         },
  4262.                                         {
  4263.                                           "condition": "state",
  4264.                                           "entity_id": [],
  4265.                                           "state": "off"
  4266.                                         }
  4267.                                       ]
  4268.                                     },
  4269.                                     {
  4270.                                       "condition": "and",
  4271.                                       "conditions": [
  4272.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  4273.                                         {
  4274.                                           "condition": "state",
  4275.                                           "entity_id": [],
  4276.                                           "state": "off"
  4277.                                         },
  4278.                                         {
  4279.                                           "condition": "state",
  4280.                                           "entity_id": [],
  4281.                                           "state": "off"
  4282.                                         }
  4283.                                       ]
  4284.                                     },
  4285.                                     {
  4286.                                       "condition": "and",
  4287.                                       "conditions": [
  4288.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  4289.                                         {
  4290.                                           "condition": "state",
  4291.                                           "entity_id": [],
  4292.                                           "state": "off"
  4293.                                         }
  4294.                                       ]
  4295.                                     },
  4296.                                     {
  4297.                                       "condition": "and",
  4298.                                       "conditions": [
  4299.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  4300.                                         {
  4301.                                           "condition": "state",
  4302.                                           "entity_id": [],
  4303.                                           "state": "off"
  4304.                                         }
  4305.                                       ]
  4306.                                     },
  4307.                                     {
  4308.                                       "condition": "and",
  4309.                                       "conditions": [
  4310.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  4311.                                         {
  4312.                                           "condition": "state",
  4313.                                           "entity_id": [],
  4314.                                           "state": "off"
  4315.                                         }
  4316.                                       ]
  4317.                                     }
  4318.                                   ]
  4319.                                 }
  4320.                               ],
  4321.                               "sequence": [
  4322.                                 {
  4323.                                   "alias": "Small time delay required",
  4324.                                   "delay": {
  4325.                                     "seconds": 1
  4326.                                   }
  4327.                                 }
  4328.                               ]
  4329.                             },
  4330.                             {
  4331.                               "alias": "Check if any by-passes are on",
  4332.                               "conditions": [
  4333.                                 {
  4334.                                   "condition": "or",
  4335.                                   "conditions": [
  4336.                                     {
  4337.                                       "condition": "and",
  4338.                                       "conditions": [
  4339.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  4340.                                         {
  4341.                                           "condition": "or",
  4342.                                           "conditions": [
  4343.                                             {
  4344.                                               "condition": "state",
  4345.                                               "entity_id": [],
  4346.                                               "match": "any",
  4347.                                               "state": "on"
  4348.                                             },
  4349.                                             {
  4350.                                               "condition": "state",
  4351.                                               "entity_id": [],
  4352.                                               "match": "any",
  4353.                                               "state": "on"
  4354.                                             },
  4355.                                             {
  4356.                                               "condition": "state",
  4357.                                               "entity_id": [],
  4358.                                               "match": "any",
  4359.                                               "state": "on"
  4360.                                             }
  4361.                                           ]
  4362.                                         }
  4363.                                       ]
  4364.                                     },
  4365.                                     {
  4366.                                       "condition": "and",
  4367.                                       "conditions": [
  4368.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  4369.                                         {
  4370.                                           "condition": "or",
  4371.                                           "conditions": [
  4372.                                             {
  4373.                                               "condition": "state",
  4374.                                               "entity_id": [],
  4375.                                               "match": "any",
  4376.                                               "state": "on"
  4377.                                             },
  4378.                                             {
  4379.                                               "condition": "state",
  4380.                                               "entity_id": [],
  4381.                                               "match": "any",
  4382.                                               "state": "on"
  4383.                                             }
  4384.                                           ]
  4385.                                         }
  4386.                                       ]
  4387.                                     },
  4388.                                     {
  4389.                                       "condition": "and",
  4390.                                       "conditions": [
  4391.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  4392.                                         {
  4393.                                           "condition": "or",
  4394.                                           "conditions": [
  4395.                                             {
  4396.                                               "condition": "state",
  4397.                                               "entity_id": [],
  4398.                                               "match": "any",
  4399.                                               "state": "on"
  4400.                                             },
  4401.                                             {
  4402.                                               "condition": "state",
  4403.                                               "entity_id": [],
  4404.                                               "match": "any",
  4405.                                               "state": "on"
  4406.                                             }
  4407.                                           ]
  4408.                                         }
  4409.                                       ]
  4410.                                     },
  4411.                                     {
  4412.                                       "condition": "and",
  4413.                                       "conditions": [
  4414.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  4415.                                         {
  4416.                                           "condition": "or",
  4417.                                           "conditions": [
  4418.                                             {
  4419.                                               "condition": "state",
  4420.                                               "entity_id": [],
  4421.                                               "match": "any",
  4422.                                               "state": "on"
  4423.                                             },
  4424.                                             {
  4425.                                               "condition": "state",
  4426.                                               "entity_id": [],
  4427.                                               "match": "any",
  4428.                                               "state": "on"
  4429.                                             }
  4430.                                           ]
  4431.                                         }
  4432.                                       ]
  4433.                                     },
  4434.                                     {
  4435.                                       "condition": "and",
  4436.                                       "conditions": [
  4437.                                         "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  4438.                                         {
  4439.                                           "condition": "state",
  4440.                                           "entity_id": [],
  4441.                                           "match": "any",
  4442.                                           "state": "on"
  4443.                                         }
  4444.                                       ]
  4445.                                     },
  4446.                                     {
  4447.                                       "condition": "and",
  4448.                                       "conditions": [
  4449.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  4450.                                         {
  4451.                                           "condition": "state",
  4452.                                           "entity_id": [],
  4453.                                           "match": "any",
  4454.                                           "state": "on"
  4455.                                         }
  4456.                                       ]
  4457.                                     },
  4458.                                     {
  4459.                                       "condition": "and",
  4460.                                       "conditions": [
  4461.                                         "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  4462.                                         {
  4463.                                           "condition": "state",
  4464.                                           "entity_id": [],
  4465.                                           "match": "any",
  4466.                                           "state": "on"
  4467.                                         }
  4468.                                       ]
  4469.                                     }
  4470.                                   ]
  4471.                                 }
  4472.                               ],
  4473.                               "sequence": [
  4474.                                 {
  4475.                                   "alias": "Check by-pass auto off is enabled and preform the correct",
  4476.                                   "if": [
  4477.                                     {
  4478.                                       "alias": "Check if the by-pass auto off is enabled",
  4479.                                       "condition": "template",
  4480.                                       "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  4481.                                     }
  4482.                                   ],
  4483.                                   "then": [
  4484.                                     {
  4485.                                       "alias": "Wait the number of minutes set in the by-pass auto off time delay",
  4486.                                       "delay": {
  4487.                                         "minutes": 60
  4488.                                       }
  4489.                                     },
  4490.                                     {
  4491.                                       "alias": "Parallel Actions for the by-pass auto off",
  4492.                                       "parallel": [
  4493.                                         {
  4494.                                           "sequence": [
  4495.                                             {
  4496.                                               "choose": [
  4497.                                                 {
  4498.                                                   "conditions": [
  4499.                                                     {
  4500.                                                       "condition": "template",
  4501.                                                       "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}"
  4502.                                                     }
  4503.                                                   ],
  4504.                                                   "sequence": [
  4505.                                                     {
  4506.                                                       "alias": "Turn off the by-pass",
  4507.                                                       "service": "homeassistant.turn_off",
  4508.                                                       "entity_id": []
  4509.                                                     }
  4510.                                                   ]
  4511.                                                 }
  4512.                                               ]
  4513.                                             }
  4514.                                           ]
  4515.                                         },
  4516.                                         {
  4517.                                           "sequence": [
  4518.                                             {
  4519.                                               "choose": [
  4520.                                                 {
  4521.                                                   "conditions": [
  4522.                                                     {
  4523.                                                       "condition": "template",
  4524.                                                       "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}"
  4525.                                                     }
  4526.                                                   ],
  4527.                                                   "sequence": [
  4528.                                                     {
  4529.                                                       "alias": "Turn off the by-pass",
  4530.                                                       "service": "homeassistant.turn_off",
  4531.                                                       "entity_id": []
  4532.                                                     }
  4533.                                                   ]
  4534.                                                 }
  4535.                                               ]
  4536.                                             }
  4537.                                           ]
  4538.                                         },
  4539.                                         {
  4540.                                           "sequence": [
  4541.                                             {
  4542.                                               "choose": [
  4543.                                                 {
  4544.                                                   "conditions": [
  4545.                                                     {
  4546.                                                       "condition": "template",
  4547.                                                       "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  4548.                                                     }
  4549.                                                   ],
  4550.                                                   "sequence": [
  4551.                                                     {
  4552.                                                       "alias": "Turn off the by-pass",
  4553.                                                       "service": "homeassistant.turn_off",
  4554.                                                       "entity_id": []
  4555.                                                     }
  4556.                                                   ]
  4557.                                                 }
  4558.                                               ]
  4559.                                             }
  4560.                                           ]
  4561.                                         }
  4562.                                       ]
  4563.                                     }
  4564.                                   ]
  4565.                                 },
  4566.                                 {
  4567.                                   "stop": "Stop the automation"
  4568.                                 }
  4569.                               ]
  4570.                             }
  4571.                           ]
  4572.                         }
  4573.                       ]
  4574.                     }
  4575.                   ]
  4576.                 },
  4577.                 {
  4578.                   "choose": [
  4579.                     {
  4580.                       "alias": "Set the transition for the night lights switch",
  4581.                       "conditions": [
  4582.                         {
  4583.                           "condition": "template",
  4584.                           "value_template": "{{ ('use_transition' in include_night_light_control) and ('use_brightness' not in include_night_light_control) and ('use_colour_temperature' not in include_night_light_control) }}"
  4585.                         }
  4586.                       ],
  4587.                       "sequence": [
  4588.                         {
  4589.                           "service": "light.turn_on",
  4590.                           "target": {
  4591.                             "entity_id": "{{ night_light_entities_off }}"
  4592.                           },
  4593.                           "data": {
  4594.                             "transition": "{{ night_transition_on_value }}"
  4595.                           }
  4596.                         }
  4597.                       ]
  4598.                     },
  4599.                     {
  4600.                       "alias": "Set the transition and brightness for the night lights switch",
  4601.                       "conditions": [
  4602.                         {
  4603.                           "condition": "template",
  4604.                           "value_template": "{{ ('use_transition' in include_night_light_control) and ('use_brightness' in include_night_light_control) and ('use_colour_temperature' not in include_night_light_control) }}"
  4605.                         }
  4606.                       ],
  4607.                       "sequence": [
  4608.                         {
  4609.                           "service": "light.turn_on",
  4610.                           "target": {
  4611.                             "entity_id": "{{ night_light_entities_off }}"
  4612.                           },
  4613.                           "data": {
  4614.                             "transition": "{{ night_transition_on_value }}",
  4615.                             "brightness_pct": "{{ night_brightness_value }}"
  4616.                           }
  4617.                         }
  4618.                       ]
  4619.                     },
  4620.                     {
  4621.                       "alias": "Set the transition and colour temperature for the night lights switch",
  4622.                       "conditions": [
  4623.                         {
  4624.                           "condition": "template",
  4625.                           "value_template": "{{ ('use_transition' in include_night_light_control) and ('use_brightness' not in include_night_light_control) and ('use_colour_temperature' in include_night_light_control) }}"
  4626.                         }
  4627.                       ],
  4628.                       "sequence": [
  4629.                         {
  4630.                           "service": "light.turn_on",
  4631.                           "target": {
  4632.                             "entity_id": "{{ night_light_entities_off }}"
  4633.                           },
  4634.                           "data": {
  4635.                             "transition": "{{ night_transition_on_value }}",
  4636.                             "kelvin": "{{ night_temperature_value }}"
  4637.                           }
  4638.                         }
  4639.                       ]
  4640.                     },
  4641.                     {
  4642.                       "alias": "Set the transition, brightness and colour temperature for the night lights switch",
  4643.                       "conditions": [
  4644.                         {
  4645.                           "condition": "template",
  4646.                           "value_template": "{{ ('use_transition' in include_night_light_control) and ('use_brightness' in include_night_light_control) and ('use_colour_temperature' in include_night_light_control) }}"
  4647.                         }
  4648.                       ],
  4649.                       "sequence": [
  4650.                         {
  4651.                           "service": "light.turn_on",
  4652.                           "target": {
  4653.                             "entity_id": "{{ night_light_entities_off }}"
  4654.                           },
  4655.                           "data": {
  4656.                             "transition": "{{ night_transition_on_value }}",
  4657.                             "brightness_pct": "{{ night_brightness_value }}",
  4658.                             "kelvin": "{{ night_temperature_value }}"
  4659.                           }
  4660.                         }
  4661.                       ]
  4662.                     },
  4663.                     {
  4664.                       "alias": "Set the brightness for the night lights switch",
  4665.                       "conditions": [
  4666.                         {
  4667.                           "condition": "template",
  4668.                           "value_template": "{{ ('use_transition' not in include_night_light_control) and ('use_brightness' in include_night_light_control) and ('use_colour_temperature' not in include_night_light_control) }}"
  4669.                         }
  4670.                       ],
  4671.                       "sequence": [
  4672.                         {
  4673.                           "service": "light.turn_on",
  4674.                           "target": {
  4675.                             "entity_id": "{{ night_light_entities_off }}"
  4676.                           },
  4677.                           "data": {
  4678.                             "brightness_pct": "{{ night_brightness_value }}"
  4679.                           }
  4680.                         }
  4681.                       ]
  4682.                     },
  4683.                     {
  4684.                       "alias": "Set the colour temperature for the night lights switch",
  4685.                       "conditions": [
  4686.                         {
  4687.                           "condition": "template",
  4688.                           "value_template": "{{ ('use_transition' not in include_night_light_control) and ('use_brightness' not in include_night_light_control) and ('use_colour_temperature' in include_night_light_control) }}"
  4689.                         }
  4690.                       ],
  4691.                       "sequence": [
  4692.                         {
  4693.                           "service": "light.turn_on",
  4694.                           "target": {
  4695.                             "entity_id": "{{ night_light_entities_off }}"
  4696.                           },
  4697.                           "data": {
  4698.                             "kelvin": "{{ night_temperature_value }}"
  4699.                           }
  4700.                         }
  4701.                       ]
  4702.                     },
  4703.                     {
  4704.                       "alias": "Set the brightness and colour temperature for the night lights switch",
  4705.                       "conditions": [
  4706.                         {
  4707.                           "condition": "template",
  4708.                           "value_template": "{{ ('use_transition' not in include_night_light_control) and ('use_brightness' in include_night_light_control) and ('use_colour_temperature' in include_night_light_control) }}"
  4709.                         }
  4710.                       ],
  4711.                       "sequence": [
  4712.                         {
  4713.                           "service": "light.turn_on",
  4714.                           "target": {
  4715.                             "entity_id": "{{ night_light_entities_off }}"
  4716.                           },
  4717.                           "data": {
  4718.                             "brightness_pct": "{{ night_brightness_value }}",
  4719.                             "kelvin": "{{ night_temperature_value }}"
  4720.                           }
  4721.                         }
  4722.                       ]
  4723.                     },
  4724.                     {
  4725.                       "alias": "Set the default for the night lights switch",
  4726.                       "conditions": [
  4727.                         {
  4728.                           "condition": "template",
  4729.                           "value_template": "{{ ('use_transition' not in include_night_light_control) and ('use_brightness' not in include_night_light_control) and ('use_colour_temperature' not in include_night_light_control) }}"
  4730.                         }
  4731.                       ],
  4732.                       "sequence": [
  4733.                         {
  4734.                           "service": "light.turn_on",
  4735.                           "target": {
  4736.                             "entity_id": "{{ night_light_entities_off }}"
  4737.                           }
  4738.                         }
  4739.                       ]
  4740.                     }
  4741.                   ]
  4742.                 },
  4743.                 {
  4744.                   "choose": [
  4745.                     {
  4746.                       "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over",
  4747.                       "conditions": [
  4748.                         {
  4749.                           "condition": "template",
  4750.                           "value_template": "{% if boolean_scenes_scripts == [] %}\n  false\n{% elif is_state(boolean_scenes_scripts, 'on') %}\n  true\n{% else %}\n  false\n{% endif %}"
  4751.                         }
  4752.                       ],
  4753.                       "sequence": null
  4754.                     },
  4755.                     {
  4756.                       "alias": "If transition is selected",
  4757.                       "conditions": [
  4758.                         {
  4759.                           "condition": "template",
  4760.                           "value_template": "{{ 'use_transition' in include_night_light_control }}"
  4761.                         }
  4762.                       ],
  4763.                       "sequence": [
  4764.                         {
  4765.                           "alias": "Turn on the night scenes",
  4766.                           "service": "scene.turn_on",
  4767.                           "target": {
  4768.                             "entity_id": "{{ night_scene_entities }}"
  4769.                           },
  4770.                           "data": {
  4771.                             "transition": "{{ night_transition_on_value }}"
  4772.                           }
  4773.                         },
  4774.                         {
  4775.                           "alias": "Turn on the boolean for scenes and scripts",
  4776.                           "service": "input_boolean.turn_on",
  4777.                           "data": {
  4778.                             "entity_id": "{{ night_boolean_scenes_scripts_helper }}"
  4779.                           }
  4780.                         }
  4781.                       ]
  4782.                     },
  4783.                     {
  4784.                       "alias": "If transition is not selected",
  4785.                       "conditions": [
  4786.                         {
  4787.                           "condition": "template",
  4788.                           "value_template": "{{ 'use_transition' not in include_night_light_control }}"
  4789.                         }
  4790.                       ],
  4791.                       "sequence": [
  4792.                         {
  4793.                           "alias": "Turn on the night scenes",
  4794.                           "service": "scene.turn_on",
  4795.                           "target": {
  4796.                             "entity_id": "{{ night_scene_entities }}"
  4797.                           }
  4798.                         },
  4799.                         {
  4800.                           "alias": "Turn on the boolean for scenes and scripts",
  4801.                           "service": "input_boolean.turn_on",
  4802.                           "data": {
  4803.                             "entity_id": "{{ night_boolean_scenes_scripts_helper }}"
  4804.                           }
  4805.                         }
  4806.                       ]
  4807.                     }
  4808.                   ]
  4809.                 },
  4810.                 {
  4811.                   "alias": "Turn on the night switches",
  4812.                   "service": "switch.turn_on",
  4813.                   "target": {
  4814.                     "entity_id": "{{ night_switch_entities_off }}"
  4815.                   }
  4816.                 },
  4817.                 {
  4818.                   "alias": "Turn on the night scripts",
  4819.                   "service": "script.turn_on",
  4820.                   "target": {
  4821.                     "entity_id": "{{ night_script_entities }}"
  4822.                   }
  4823.                 },
  4824.                 {
  4825.                   "choose": [
  4826.                     {
  4827.                       "alias": "By-pass is enabled & check by-pass option - turn lights on",
  4828.                       "conditions": [
  4829.                         {
  4830.                           "condition": "trigger",
  4831.                           "id": "t7_on"
  4832.                         }
  4833.                       ],
  4834.                       "sequence": [
  4835.                         {
  4836.                           "alias": "Check by-pass settings and preform the correct action",
  4837.                           "if": [
  4838.                             {
  4839.                               "alias": "Check if the by-pass auto off is enabled",
  4840.                               "condition": "template",
  4841.                               "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  4842.                             }
  4843.                           ],
  4844.                           "then": [
  4845.                             {
  4846.                               "alias": "Wait the number of minutes set in the by-pass auto off time delay",
  4847.                               "delay": {
  4848.                                 "minutes": 60
  4849.                               }
  4850.                             },
  4851.                             {
  4852.                               "alias": "Parallel Actions for the by-pass auto off",
  4853.                               "parallel": [
  4854.                                 {
  4855.                                   "sequence": [
  4856.                                     {
  4857.                                       "choose": [
  4858.                                         {
  4859.                                           "conditions": [
  4860.                                             {
  4861.                                               "condition": "template",
  4862.                                               "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}"
  4863.                                             }
  4864.                                           ],
  4865.                                           "sequence": [
  4866.                                             {
  4867.                                               "alias": "Turn off the by-pass",
  4868.                                               "service": "homeassistant.turn_off",
  4869.                                               "entity_id": []
  4870.                                             }
  4871.                                           ]
  4872.                                         }
  4873.                                       ]
  4874.                                     }
  4875.                                   ]
  4876.                                 },
  4877.                                 {
  4878.                                   "sequence": [
  4879.                                     {
  4880.                                       "choose": [
  4881.                                         {
  4882.                                           "conditions": [
  4883.                                             {
  4884.                                               "condition": "template",
  4885.                                               "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}"
  4886.                                             }
  4887.                                           ],
  4888.                                           "sequence": [
  4889.                                             {
  4890.                                               "alias": "Turn off the by-pass",
  4891.                                               "service": "homeassistant.turn_off",
  4892.                                               "entity_id": []
  4893.                                             }
  4894.                                           ]
  4895.                                         }
  4896.                                       ]
  4897.                                     }
  4898.                                   ]
  4899.                                 },
  4900.                                 {
  4901.                                   "sequence": [
  4902.                                     {
  4903.                                       "choose": [
  4904.                                         {
  4905.                                           "conditions": [
  4906.                                             {
  4907.                                               "condition": "template",
  4908.                                               "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  4909.                                             }
  4910.                                           ],
  4911.                                           "sequence": [
  4912.                                             {
  4913.                                               "alias": "Turn off the by-pass",
  4914.                                               "service": "homeassistant.turn_off",
  4915.                                               "entity_id": []
  4916.                                             }
  4917.                                           ]
  4918.                                         }
  4919.                                       ]
  4920.                                     }
  4921.                                   ]
  4922.                                 }
  4923.                               ]
  4924.                             },
  4925.                             {
  4926.                               "stop": "Stop the automation"
  4927.                             }
  4928.                           ],
  4929.                           "else": [
  4930.                             {
  4931.                               "stop": "Stop the automation"
  4932.                             }
  4933.                           ]
  4934.                         }
  4935.                       ]
  4936.                     }
  4937.                   ]
  4938.                 },
  4939.                 {
  4940.                   "choose": [
  4941.                     {
  4942.                       "alias": "Check if the trigger is on and wait for it to go off",
  4943.                       "conditions": [
  4944.                         {
  4945.                           "condition": "state",
  4946.                           "entity_id": [
  4947.                             "binary_sensor.hue_motion_sensor_1_motion"
  4948.                           ],
  4949.                           "state": "on",
  4950.                           "match": "any"
  4951.                         }
  4952.                       ],
  4953.                       "sequence": [
  4954.                         {
  4955.                           "alias": "Wait until motion sensor is off",
  4956.                           "wait_for_trigger": {
  4957.                             "platform": "state",
  4958.                             "entity_id": [
  4959.                               "binary_sensor.hue_motion_sensor_1_motion"
  4960.                             ],
  4961.                             "from": "on",
  4962.                             "to": "off"
  4963.                           }
  4964.                         }
  4965.                       ]
  4966.                     }
  4967.                   ]
  4968.                 },
  4969.                 {
  4970.                   "alias": "Wait the number of minutes set in the night lights time delay",
  4971.                   "delay": {
  4972.                     "minutes": 1
  4973.                   }
  4974.                 },
  4975.                 {
  4976.                   "choose": [
  4977.                     {
  4978.                       "alias": "If transition is selected",
  4979.                       "conditions": [
  4980.                         {
  4981.                           "condition": "template",
  4982.                           "value_template": "{{ 'use_transition' in include_night_light_control }}"
  4983.                         }
  4984.                       ],
  4985.                       "sequence": [
  4986.                         {
  4987.                           "alias": "Turn off the lights",
  4988.                           "service": "light.turn_off",
  4989.                           "target": {
  4990.                             "entity_id": "{{ night_light_entities }}"
  4991.                           },
  4992.                           "data": {
  4993.                             "transition": "{{ night_transition_off_value }}"
  4994.                           }
  4995.                         },
  4996.                         {
  4997.                           "alias": "Turn off the scenes",
  4998.                           "service": "scene.turn_on",
  4999.                           "data": {
  5000.                             "entity_id": "{{ end_scene_entities }}",
  5001.                             "transition": "{{ night_transition_off_value }}"
  5002.                           }
  5003.                         }
  5004.                       ]
  5005.                     },
  5006.                     {
  5007.                       "alias": "If transition is not selected",
  5008.                       "conditions": [
  5009.                         {
  5010.                           "condition": "template",
  5011.                           "value_template": "{{ 'use_transition' not in include_night_light_control }}"
  5012.                         }
  5013.                       ],
  5014.                       "sequence": [
  5015.                         {
  5016.                           "alias": "Turn off the lights",
  5017.                           "service": "light.turn_off",
  5018.                           "target": {
  5019.                             "entity_id": "{{ night_light_entities }}"
  5020.                           }
  5021.                         },
  5022.                         {
  5023.                           "alias": "Turn off the scenes",
  5024.                           "service": "scene.turn_on",
  5025.                           "data": {
  5026.                             "entity_id": "{{ end_scene_entities }}"
  5027.                           }
  5028.                         }
  5029.                       ]
  5030.                     }
  5031.                   ]
  5032.                 },
  5033.                 {
  5034.                   "alias": "Turn off the switches",
  5035.                   "service": "switch.turn_off",
  5036.                   "target": {
  5037.                     "entity_id": "{{ night_switch_entities }}"
  5038.                   }
  5039.                 },
  5040.                 {
  5041.                   "alias": "Turn off the script",
  5042.                   "service": "script.turn_on",
  5043.                   "data": {
  5044.                     "entity_id": "{{ end_script_entities }}"
  5045.                   }
  5046.                 },
  5047.                 {
  5048.                   "alias": "Turn off the boolean for scenes and scripts",
  5049.                   "service": "input_boolean.turn_off",
  5050.                   "data": {
  5051.                     "entity_id": []
  5052.                   }
  5053.                 }
  5054.               ]
  5055.             }
  5056.           ],
  5057.           "default": [
  5058.             {
  5059.               "choose": [
  5060.                 {
  5061.                   "alias": "By-pass is turned on  & check by-pass option - turn lights off",
  5062.                   "conditions": [
  5063.                     {
  5064.                       "condition": "trigger",
  5065.                       "id": "t7_off"
  5066.                     }
  5067.                   ],
  5068.                   "sequence": [
  5069.                     {
  5070.                       "alias": "Wait the number of minutes set in the by-pass time delay",
  5071.                       "delay": {
  5072.                         "minutes": 0
  5073.                       }
  5074.                     },
  5075.                     {
  5076.                       "choose": [
  5077.                         {
  5078.                           "alias": "If transition is selected",
  5079.                           "conditions": [
  5080.                             {
  5081.                               "condition": "template",
  5082.                               "value_template": "{{ 'use_transition' in include_light_control }}"
  5083.                             }
  5084.                           ],
  5085.                           "sequence": [
  5086.                             {
  5087.                               "alias": "Turn off the lights",
  5088.                               "service": "light.turn_off",
  5089.                               "target": {
  5090.                                 "entity_id": "{{ light_entities }}"
  5091.                               },
  5092.                               "data": {
  5093.                                 "transition": "{{ transition_off_value }}"
  5094.                               }
  5095.                             },
  5096.                             {
  5097.                               "alias": "Turn off the scenes",
  5098.                               "service": "scene.turn_on",
  5099.                               "data": {
  5100.                                 "entity_id": "{{ end_scene_entities }}",
  5101.                                 "transition": "{{ transition_off_value }}"
  5102.                               }
  5103.                             }
  5104.                           ]
  5105.                         },
  5106.                         {
  5107.                           "alias": "If transition is not selected",
  5108.                           "conditions": [
  5109.                             {
  5110.                               "condition": "template",
  5111.                               "value_template": "{{ 'use_transition' not in include_light_control }}"
  5112.                             }
  5113.                           ],
  5114.                           "sequence": [
  5115.                             {
  5116.                               "alias": "Turn off the lights",
  5117.                               "service": "light.turn_off",
  5118.                               "target": {
  5119.                                 "entity_id": "{{ light_entities }}"
  5120.                               }
  5121.                             },
  5122.                             {
  5123.                               "alias": "Turn off the scenes",
  5124.                               "service": "scene.turn_on",
  5125.                               "data": {
  5126.                                 "entity_id": "{{ end_scene_entities }}"
  5127.                               }
  5128.                             }
  5129.                           ]
  5130.                         }
  5131.                       ]
  5132.                     },
  5133.                     {
  5134.                       "alias": "Turn off the switches",
  5135.                       "service": "switch.turn_off",
  5136.                       "target": {
  5137.                         "entity_id": "{{ switch_entities }}"
  5138.                       }
  5139.                     },
  5140.                     {
  5141.                       "alias": "Turn off the script",
  5142.                       "service": "script.turn_on",
  5143.                       "data": {
  5144.                         "entity_id": "{{ end_script_entities }}"
  5145.                       }
  5146.                     },
  5147.                     {
  5148.                       "alias": "Turn off the boolean for scenes and scripts",
  5149.                       "service": "input_boolean.turn_off",
  5150.                       "data": {
  5151.                         "entity_id": []
  5152.                       }
  5153.                     },
  5154.                     {
  5155.                       "alias": "Turn off the boolean for scenes and scripts",
  5156.                       "service": "input_boolean.turn_off",
  5157.                       "data": {
  5158.                         "entity_id": []
  5159.                       }
  5160.                     },
  5161.                     {
  5162.                       "alias": "Check by-pass settings and preform the correct action",
  5163.                       "if": [
  5164.                         {
  5165.                           "alias": "Check if the by-pass auto off is enabled",
  5166.                           "condition": "template",
  5167.                           "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  5168.                         }
  5169.                       ],
  5170.                       "then": [
  5171.                         {
  5172.                           "alias": "Wait the number of minutes set in the by-pass auto off time delay",
  5173.                           "delay": {
  5174.                             "minutes": 60
  5175.                           }
  5176.                         },
  5177.                         {
  5178.                           "alias": "Parallel Actions for the by-pass auto off",
  5179.                           "parallel": [
  5180.                             {
  5181.                               "sequence": [
  5182.                                 {
  5183.                                   "choose": [
  5184.                                     {
  5185.                                       "conditions": [
  5186.                                         {
  5187.                                           "condition": "template",
  5188.                                           "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}"
  5189.                                         }
  5190.                                       ],
  5191.                                       "sequence": [
  5192.                                         {
  5193.                                           "alias": "Turn off the by-pass",
  5194.                                           "service": "homeassistant.turn_off",
  5195.                                           "entity_id": []
  5196.                                         }
  5197.                                       ]
  5198.                                     }
  5199.                                   ]
  5200.                                 }
  5201.                               ]
  5202.                             },
  5203.                             {
  5204.                               "sequence": [
  5205.                                 {
  5206.                                   "choose": [
  5207.                                     {
  5208.                                       "conditions": [
  5209.                                         {
  5210.                                           "condition": "template",
  5211.                                           "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}"
  5212.                                         }
  5213.                                       ],
  5214.                                       "sequence": [
  5215.                                         {
  5216.                                           "alias": "Turn off the by-pass",
  5217.                                           "service": "homeassistant.turn_off",
  5218.                                           "entity_id": []
  5219.                                         }
  5220.                                       ]
  5221.                                     }
  5222.                                   ]
  5223.                                 }
  5224.                               ]
  5225.                             },
  5226.                             {
  5227.                               "sequence": [
  5228.                                 {
  5229.                                   "choose": [
  5230.                                     {
  5231.                                       "conditions": [
  5232.                                         {
  5233.                                           "condition": "template",
  5234.                                           "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  5235.                                         }
  5236.                                       ],
  5237.                                       "sequence": [
  5238.                                         {
  5239.                                           "alias": "Turn off the by-pass",
  5240.                                           "service": "homeassistant.turn_off",
  5241.                                           "entity_id": []
  5242.                                         }
  5243.                                       ]
  5244.                                     }
  5245.                                   ]
  5246.                                 }
  5247.                               ]
  5248.                             }
  5249.                           ]
  5250.                         },
  5251.                         {
  5252.                           "stop": "Stop the automation"
  5253.                         }
  5254.                       ],
  5255.                       "else": [
  5256.                         {
  5257.                           "stop": "Stop the automation"
  5258.                         }
  5259.                       ]
  5260.                     }
  5261.                   ]
  5262.                 },
  5263.                 {
  5264.                   "alias": "By-pass is turned on  & check by-pass option - Keep the current lights state",
  5265.                   "conditions": [
  5266.                     {
  5267.                       "condition": "trigger",
  5268.                       "id": "t7_stop"
  5269.                     }
  5270.                   ],
  5271.                   "sequence": [
  5272.                     {
  5273.                       "alias": "Check by-pass settings and preform the correct action",
  5274.                       "if": [
  5275.                         {
  5276.                           "alias": "Check if the by-pass auto off is enabled",
  5277.                           "condition": "template",
  5278.                           "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  5279.                         }
  5280.                       ],
  5281.                       "then": [
  5282.                         {
  5283.                           "alias": "Wait the number of minutes set in the by-pass auto off time delay",
  5284.                           "delay": {
  5285.                             "minutes": 60
  5286.                           }
  5287.                         },
  5288.                         {
  5289.                           "alias": "Parallel Actions for the by-pass auto off",
  5290.                           "parallel": [
  5291.                             {
  5292.                               "sequence": [
  5293.                                 {
  5294.                                   "choose": [
  5295.                                     {
  5296.                                       "conditions": [
  5297.                                         {
  5298.                                           "condition": "template",
  5299.                                           "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}"
  5300.                                         }
  5301.                                       ],
  5302.                                       "sequence": [
  5303.                                         {
  5304.                                           "alias": "Turn off the by-pass",
  5305.                                           "service": "homeassistant.turn_off",
  5306.                                           "entity_id": []
  5307.                                         }
  5308.                                       ]
  5309.                                     }
  5310.                                   ]
  5311.                                 }
  5312.                               ]
  5313.                             },
  5314.                             {
  5315.                               "sequence": [
  5316.                                 {
  5317.                                   "choose": [
  5318.                                     {
  5319.                                       "conditions": [
  5320.                                         {
  5321.                                           "condition": "template",
  5322.                                           "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}"
  5323.                                         }
  5324.                                       ],
  5325.                                       "sequence": [
  5326.                                         {
  5327.                                           "alias": "Turn off the by-pass",
  5328.                                           "service": "homeassistant.turn_off",
  5329.                                           "entity_id": []
  5330.                                         }
  5331.                                       ]
  5332.                                     }
  5333.                                   ]
  5334.                                 }
  5335.                               ]
  5336.                             },
  5337.                             {
  5338.                               "sequence": [
  5339.                                 {
  5340.                                   "choose": [
  5341.                                     {
  5342.                                       "conditions": [
  5343.                                         {
  5344.                                           "condition": "template",
  5345.                                           "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  5346.                                         }
  5347.                                       ],
  5348.                                       "sequence": [
  5349.                                         {
  5350.                                           "alias": "Turn off the by-pass",
  5351.                                           "service": "homeassistant.turn_off",
  5352.                                           "entity_id": []
  5353.                                         }
  5354.                                       ]
  5355.                                     }
  5356.                                   ]
  5357.                                 }
  5358.                               ]
  5359.                             }
  5360.                           ]
  5361.                         },
  5362.                         {
  5363.                           "stop": "Stop the automation"
  5364.                         }
  5365.                       ],
  5366.                       "else": [
  5367.                         {
  5368.                           "stop": "Stop the automation"
  5369.                         }
  5370.                       ]
  5371.                     }
  5372.                   ]
  5373.                 }
  5374.               ]
  5375.             },
  5376.             {
  5377.               "choose": [
  5378.                 {
  5379.                   "alias": "By-pass is turned off  & check if the motion trigger is off",
  5380.                   "conditions": [
  5381.                     {
  5382.                       "condition": "trigger",
  5383.                       "id": [
  5384.                         "t8_on",
  5385.                         "t8_off",
  5386.                         "t8_stop"
  5387.                       ]
  5388.                     },
  5389.                     {
  5390.                       "condition": "state",
  5391.                       "entity_id": [
  5392.                         "binary_sensor.hue_motion_sensor_1_motion"
  5393.                       ],
  5394.                       "match": "all",
  5395.                       "state": "off"
  5396.                     }
  5397.                   ],
  5398.                   "sequence": [
  5399.                     {
  5400.                       "choose": [
  5401.                         {
  5402.                           "alias": "Check all by-pass are off",
  5403.                           "conditions": [
  5404.                             {
  5405.                               "condition": "or",
  5406.                               "conditions": [
  5407.                                 {
  5408.                                   "condition": "and",
  5409.                                   "conditions": [
  5410.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  5411.                                     {
  5412.                                       "condition": "state",
  5413.                                       "entity_id": [],
  5414.                                       "state": "off"
  5415.                                     },
  5416.                                     {
  5417.                                       "condition": "state",
  5418.                                       "entity_id": [],
  5419.                                       "state": "off"
  5420.                                     },
  5421.                                     {
  5422.                                       "condition": "state",
  5423.                                       "entity_id": [],
  5424.                                       "state": "off"
  5425.                                     }
  5426.                                   ]
  5427.                                 },
  5428.                                 {
  5429.                                   "condition": "and",
  5430.                                   "conditions": [
  5431.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  5432.                                     {
  5433.                                       "condition": "state",
  5434.                                       "entity_id": [],
  5435.                                       "state": "off"
  5436.                                     },
  5437.                                     {
  5438.                                       "condition": "state",
  5439.                                       "entity_id": [],
  5440.                                       "state": "off"
  5441.                                     }
  5442.                                   ]
  5443.                                 },
  5444.                                 {
  5445.                                   "condition": "and",
  5446.                                   "conditions": [
  5447.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  5448.                                     {
  5449.                                       "condition": "state",
  5450.                                       "entity_id": [],
  5451.                                       "state": "off"
  5452.                                     },
  5453.                                     {
  5454.                                       "condition": "state",
  5455.                                       "entity_id": [],
  5456.                                       "state": "off"
  5457.                                     }
  5458.                                   ]
  5459.                                 },
  5460.                                 {
  5461.                                   "condition": "and",
  5462.                                   "conditions": [
  5463.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  5464.                                     {
  5465.                                       "condition": "state",
  5466.                                       "entity_id": [],
  5467.                                       "state": "off"
  5468.                                     },
  5469.                                     {
  5470.                                       "condition": "state",
  5471.                                       "entity_id": [],
  5472.                                       "state": "off"
  5473.                                     }
  5474.                                   ]
  5475.                                 },
  5476.                                 {
  5477.                                   "condition": "and",
  5478.                                   "conditions": [
  5479.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  5480.                                     {
  5481.                                       "condition": "state",
  5482.                                       "entity_id": [],
  5483.                                       "state": "off"
  5484.                                     }
  5485.                                   ]
  5486.                                 },
  5487.                                 {
  5488.                                   "condition": "and",
  5489.                                   "conditions": [
  5490.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  5491.                                     {
  5492.                                       "condition": "state",
  5493.                                       "entity_id": [],
  5494.                                       "state": "off"
  5495.                                     }
  5496.                                   ]
  5497.                                 },
  5498.                                 {
  5499.                                   "condition": "and",
  5500.                                   "conditions": [
  5501.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  5502.                                     {
  5503.                                       "condition": "state",
  5504.                                       "entity_id": [],
  5505.                                       "state": "off"
  5506.                                     }
  5507.                                   ]
  5508.                                 }
  5509.                               ]
  5510.                             }
  5511.                           ],
  5512.                           "sequence": [
  5513.                             {
  5514.                               "alias": "Wait the number of minutes set in the by-pass time delay",
  5515.                               "delay": {
  5516.                                 "minutes": 0
  5517.                               }
  5518.                             },
  5519.                             {
  5520.                               "choose": [
  5521.                                 {
  5522.                                   "alias": "If transition is selected",
  5523.                                   "conditions": [
  5524.                                     {
  5525.                                       "condition": "template",
  5526.                                       "value_template": "{{ 'use_transition' in include_light_control }}"
  5527.                                     }
  5528.                                   ],
  5529.                                   "sequence": [
  5530.                                     {
  5531.                                       "alias": "Turn off the lights",
  5532.                                       "service": "light.turn_off",
  5533.                                       "target": {
  5534.                                         "entity_id": "{{ light_entities }}"
  5535.                                       },
  5536.                                       "data": {
  5537.                                         "transition": "{{ transition_off_value }}"
  5538.                                       }
  5539.                                     },
  5540.                                     {
  5541.                                       "alias": "Turn off the scenes",
  5542.                                       "service": "scene.turn_on",
  5543.                                       "data": {
  5544.                                         "entity_id": "{{ end_scene_entities }}",
  5545.                                         "transition": "{{ transition_off_value }}"
  5546.                                       }
  5547.                                     }
  5548.                                   ]
  5549.                                 },
  5550.                                 {
  5551.                                   "alias": "If transition is not selected",
  5552.                                   "conditions": [
  5553.                                     {
  5554.                                       "condition": "template",
  5555.                                       "value_template": "{{ 'use_transition' not in include_light_control }}"
  5556.                                     }
  5557.                                   ],
  5558.                                   "sequence": [
  5559.                                     {
  5560.                                       "alias": "Turn off the lights",
  5561.                                       "service": "light.turn_off",
  5562.                                       "target": {
  5563.                                         "entity_id": "{{ light_entities }}"
  5564.                                       }
  5565.                                     },
  5566.                                     {
  5567.                                       "alias": "Turn off the scenes",
  5568.                                       "service": "scene.turn_on",
  5569.                                       "data": {
  5570.                                         "entity_id": "{{ end_scene_entities }}"
  5571.                                       }
  5572.                                     }
  5573.                                   ]
  5574.                                 }
  5575.                               ]
  5576.                             },
  5577.                             {
  5578.                               "alias": "Turn off the switches",
  5579.                               "service": "switch.turn_off",
  5580.                               "target": {
  5581.                                 "entity_id": "{{ switch_entities }}"
  5582.                               }
  5583.                             },
  5584.                             {
  5585.                               "alias": "Turn off the script",
  5586.                               "service": "script.turn_on",
  5587.                               "data": {
  5588.                                 "entity_id": "{{ end_script_entities }}"
  5589.                               }
  5590.                             },
  5591.                             {
  5592.                               "alias": "Turn off the boolean for scenes and scripts",
  5593.                               "service": "input_boolean.turn_off",
  5594.                               "data": {
  5595.                                 "entity_id": []
  5596.                               }
  5597.                             },
  5598.                             {
  5599.                               "alias": "Turn off the boolean for scenes and scripts",
  5600.                               "service": "input_boolean.turn_off",
  5601.                               "data": {
  5602.                                 "entity_id": []
  5603.                               }
  5604.                             },
  5605.                             {
  5606.                               "stop": "Stop the automation"
  5607.                             }
  5608.                           ]
  5609.                         },
  5610.                         {
  5611.                           "alias": "Motion trigger is off and check if any by-passes are on",
  5612.                           "conditions": [
  5613.                             {
  5614.                               "condition": "or",
  5615.                               "conditions": [
  5616.                                 {
  5617.                                   "condition": "and",
  5618.                                   "conditions": [
  5619.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  5620.                                     {
  5621.                                       "condition": "or",
  5622.                                       "conditions": [
  5623.                                         {
  5624.                                           "condition": "state",
  5625.                                           "entity_id": [],
  5626.                                           "match": "any",
  5627.                                           "state": "on"
  5628.                                         },
  5629.                                         {
  5630.                                           "condition": "state",
  5631.                                           "entity_id": [],
  5632.                                           "match": "any",
  5633.                                           "state": "on"
  5634.                                         },
  5635.                                         {
  5636.                                           "condition": "state",
  5637.                                           "entity_id": [],
  5638.                                           "match": "any",
  5639.                                           "state": "on"
  5640.                                         }
  5641.                                       ]
  5642.                                     }
  5643.                                   ]
  5644.                                 },
  5645.                                 {
  5646.                                   "condition": "and",
  5647.                                   "conditions": [
  5648.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  5649.                                     {
  5650.                                       "condition": "or",
  5651.                                       "conditions": [
  5652.                                         {
  5653.                                           "condition": "state",
  5654.                                           "entity_id": [],
  5655.                                           "match": "any",
  5656.                                           "state": "on"
  5657.                                         },
  5658.                                         {
  5659.                                           "condition": "state",
  5660.                                           "entity_id": [],
  5661.                                           "match": "any",
  5662.                                           "state": "on"
  5663.                                         }
  5664.                                       ]
  5665.                                     }
  5666.                                   ]
  5667.                                 },
  5668.                                 {
  5669.                                   "condition": "and",
  5670.                                   "conditions": [
  5671.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  5672.                                     {
  5673.                                       "condition": "or",
  5674.                                       "conditions": [
  5675.                                         {
  5676.                                           "condition": "state",
  5677.                                           "entity_id": [],
  5678.                                           "match": "any",
  5679.                                           "state": "on"
  5680.                                         },
  5681.                                         {
  5682.                                           "condition": "state",
  5683.                                           "entity_id": [],
  5684.                                           "match": "any",
  5685.                                           "state": "on"
  5686.                                         }
  5687.                                       ]
  5688.                                     }
  5689.                                   ]
  5690.                                 },
  5691.                                 {
  5692.                                   "condition": "and",
  5693.                                   "conditions": [
  5694.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  5695.                                     {
  5696.                                       "condition": "or",
  5697.                                       "conditions": [
  5698.                                         {
  5699.                                           "condition": "state",
  5700.                                           "entity_id": [],
  5701.                                           "match": "any",
  5702.                                           "state": "on"
  5703.                                         },
  5704.                                         {
  5705.                                           "condition": "state",
  5706.                                           "entity_id": [],
  5707.                                           "match": "any",
  5708.                                           "state": "on"
  5709.                                         }
  5710.                                       ]
  5711.                                     }
  5712.                                   ]
  5713.                                 },
  5714.                                 {
  5715.                                   "condition": "and",
  5716.                                   "conditions": [
  5717.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  5718.                                     {
  5719.                                       "condition": "state",
  5720.                                       "entity_id": [],
  5721.                                       "match": "any",
  5722.                                       "state": "on"
  5723.                                     }
  5724.                                   ]
  5725.                                 },
  5726.                                 {
  5727.                                   "condition": "and",
  5728.                                   "conditions": [
  5729.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  5730.                                     {
  5731.                                       "condition": "state",
  5732.                                       "entity_id": [],
  5733.                                       "match": "any",
  5734.                                       "state": "on"
  5735.                                     }
  5736.                                   ]
  5737.                                 },
  5738.                                 {
  5739.                                   "condition": "and",
  5740.                                   "conditions": [
  5741.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  5742.                                     {
  5743.                                       "condition": "state",
  5744.                                       "entity_id": [],
  5745.                                       "match": "any",
  5746.                                       "state": "on"
  5747.                                     }
  5748.                                   ]
  5749.                                 }
  5750.                               ]
  5751.                             }
  5752.                           ],
  5753.                           "sequence": [
  5754.                             {
  5755.                               "alias": "Check by-pass settings and preform the correct action",
  5756.                               "if": [
  5757.                                 {
  5758.                                   "alias": "Check if the by-pass auto off is enabled",
  5759.                                   "condition": "template",
  5760.                                   "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  5761.                                 }
  5762.                               ],
  5763.                               "then": [
  5764.                                 {
  5765.                                   "alias": "Wait the number of minutes set in the by-pass auto off time delay",
  5766.                                   "delay": {
  5767.                                     "minutes": 60
  5768.                                   }
  5769.                                 },
  5770.                                 {
  5771.                                   "alias": "Parallel Actions for the by-pass auto off",
  5772.                                   "parallel": [
  5773.                                     {
  5774.                                       "sequence": [
  5775.                                         {
  5776.                                           "choose": [
  5777.                                             {
  5778.                                               "conditions": [
  5779.                                                 {
  5780.                                                   "condition": "template",
  5781.                                                   "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}"
  5782.                                                 }
  5783.                                               ],
  5784.                                               "sequence": [
  5785.                                                 {
  5786.                                                   "alias": "Turn off the by-pass",
  5787.                                                   "service": "homeassistant.turn_off",
  5788.                                                   "entity_id": []
  5789.                                                 }
  5790.                                               ]
  5791.                                             }
  5792.                                           ]
  5793.                                         }
  5794.                                       ]
  5795.                                     },
  5796.                                     {
  5797.                                       "sequence": [
  5798.                                         {
  5799.                                           "choose": [
  5800.                                             {
  5801.                                               "conditions": [
  5802.                                                 {
  5803.                                                   "condition": "template",
  5804.                                                   "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}"
  5805.                                                 }
  5806.                                               ],
  5807.                                               "sequence": [
  5808.                                                 {
  5809.                                                   "alias": "Turn off the by-pass",
  5810.                                                   "service": "homeassistant.turn_off",
  5811.                                                   "entity_id": []
  5812.                                                 }
  5813.                                               ]
  5814.                                             }
  5815.                                           ]
  5816.                                         }
  5817.                                       ]
  5818.                                     },
  5819.                                     {
  5820.                                       "sequence": [
  5821.                                         {
  5822.                                           "choose": [
  5823.                                             {
  5824.                                               "conditions": [
  5825.                                                 {
  5826.                                                   "condition": "template",
  5827.                                                   "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  5828.                                                 }
  5829.                                               ],
  5830.                                               "sequence": [
  5831.                                                 {
  5832.                                                   "alias": "Turn off the by-pass",
  5833.                                                   "service": "homeassistant.turn_off",
  5834.                                                   "entity_id": []
  5835.                                                 }
  5836.                                               ]
  5837.                                             }
  5838.                                           ]
  5839.                                         }
  5840.                                       ]
  5841.                                     }
  5842.                                   ]
  5843.                                 }
  5844.                               ]
  5845.                             },
  5846.                             {
  5847.                               "stop": "Stop the automation"
  5848.                             }
  5849.                           ]
  5850.                         }
  5851.                       ]
  5852.                     }
  5853.                   ]
  5854.                 },
  5855.                 {
  5856.                   "alias": "By-pass is turned off & check if the motion trigger is on",
  5857.                   "conditions": [
  5858.                     {
  5859.                       "condition": "trigger",
  5860.                       "id": [
  5861.                         "t8_on",
  5862.                         "t8_off",
  5863.                         "t8_stop"
  5864.                       ]
  5865.                     },
  5866.                     {
  5867.                       "condition": "state",
  5868.                       "entity_id": [
  5869.                         "binary_sensor.hue_motion_sensor_1_motion"
  5870.                       ],
  5871.                       "match": "any",
  5872.                       "state": "on"
  5873.                     }
  5874.                   ],
  5875.                   "sequence": [
  5876.                     {
  5877.                       "choose": [
  5878.                         {
  5879.                           "alias": "Check all by-pass are off and check conditions if enabled ",
  5880.                           "conditions": [
  5881.                             {
  5882.                               "condition": "or",
  5883.                               "conditions": [
  5884.                                 {
  5885.                                   "condition": "and",
  5886.                                   "conditions": [
  5887.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  5888.                                     {
  5889.                                       "condition": "state",
  5890.                                       "entity_id": [],
  5891.                                       "state": "off"
  5892.                                     },
  5893.                                     {
  5894.                                       "condition": "state",
  5895.                                       "entity_id": [],
  5896.                                       "state": "off"
  5897.                                     },
  5898.                                     {
  5899.                                       "condition": "state",
  5900.                                       "entity_id": [],
  5901.                                       "state": "off"
  5902.                                     }
  5903.                                   ]
  5904.                                 },
  5905.                                 {
  5906.                                   "condition": "and",
  5907.                                   "conditions": [
  5908.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  5909.                                     {
  5910.                                       "condition": "state",
  5911.                                       "entity_id": [],
  5912.                                       "state": "off"
  5913.                                     },
  5914.                                     {
  5915.                                       "condition": "state",
  5916.                                       "entity_id": [],
  5917.                                       "state": "off"
  5918.                                     }
  5919.                                   ]
  5920.                                 },
  5921.                                 {
  5922.                                   "condition": "and",
  5923.                                   "conditions": [
  5924.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  5925.                                     {
  5926.                                       "condition": "state",
  5927.                                       "entity_id": [],
  5928.                                       "state": "off"
  5929.                                     },
  5930.                                     {
  5931.                                       "condition": "state",
  5932.                                       "entity_id": [],
  5933.                                       "state": "off"
  5934.                                     }
  5935.                                   ]
  5936.                                 },
  5937.                                 {
  5938.                                   "condition": "and",
  5939.                                   "conditions": [
  5940.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  5941.                                     {
  5942.                                       "condition": "state",
  5943.                                       "entity_id": [],
  5944.                                       "state": "off"
  5945.                                     },
  5946.                                     {
  5947.                                       "condition": "state",
  5948.                                       "entity_id": [],
  5949.                                       "state": "off"
  5950.                                     }
  5951.                                   ]
  5952.                                 },
  5953.                                 {
  5954.                                   "condition": "and",
  5955.                                   "conditions": [
  5956.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  5957.                                     {
  5958.                                       "condition": "state",
  5959.                                       "entity_id": [],
  5960.                                       "state": "off"
  5961.                                     }
  5962.                                   ]
  5963.                                 },
  5964.                                 {
  5965.                                   "condition": "and",
  5966.                                   "conditions": [
  5967.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  5968.                                     {
  5969.                                       "condition": "state",
  5970.                                       "entity_id": [],
  5971.                                       "state": "off"
  5972.                                     }
  5973.                                   ]
  5974.                                 },
  5975.                                 {
  5976.                                   "condition": "and",
  5977.                                   "conditions": [
  5978.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  5979.                                     {
  5980.                                       "condition": "state",
  5981.                                       "entity_id": [],
  5982.                                       "state": "off"
  5983.                                     }
  5984.                                   ]
  5985.                                 }
  5986.                               ]
  5987.                             },
  5988.                             {
  5989.                               "condition": "or",
  5990.                               "conditions": [
  5991.                                 "{{ (include_sun == 'sun_enabled') and (state_attr('sun.sun','elevation') >= sun_elevation | float(90)) }}",
  5992.                                 "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_disabled') and (states[ambient_light_sensor].state | int > ambient_light_value | int) }}",
  5993.                                 "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and (states[ambient_light_sensor].state | int > ambient_light_value | int) and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) }}",
  5994.                                 "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and (states[ambient_light_sensor].state | int > ambient_light_value | int) and (is_state(boolean_scenes_scripts, 'off')) }}",
  5995.                                 {
  5996.                                   "condition": "and",
  5997.                                   "conditions": [
  5998.                                     {
  5999.                                       "condition": "time",
  6000.                                       "after": "00:00:00",
  6001.                                       "before": "00:00:00"
  6002.                                     },
  6003.                                     "{{ include_time == 'time_enabled' }}"
  6004.                                   ]
  6005.                                 }
  6006.                               ]
  6007.                             }
  6008.                           ],
  6009.                           "sequence": [
  6010.                             {
  6011.                               "alias": "Wait the number of minutes set in the by-pass time delay",
  6012.                               "delay": {
  6013.                                 "minutes": 0
  6014.                               }
  6015.                             },
  6016.                             {
  6017.                               "choose": [
  6018.                                 {
  6019.                                   "alias": "If transition is selected",
  6020.                                   "conditions": [
  6021.                                     {
  6022.                                       "condition": "template",
  6023.                                       "value_template": "{{ 'use_transition' in include_light_control }}"
  6024.                                     }
  6025.                                   ],
  6026.                                   "sequence": [
  6027.                                     {
  6028.                                       "alias": "Turn off the lights",
  6029.                                       "service": "light.turn_off",
  6030.                                       "target": {
  6031.                                         "entity_id": "{{ light_entities }}"
  6032.                                       },
  6033.                                       "data": {
  6034.                                         "transition": "{{ transition_off_value }}"
  6035.                                       }
  6036.                                     },
  6037.                                     {
  6038.                                       "alias": "Turn off the scenes",
  6039.                                       "service": "scene.turn_on",
  6040.                                       "data": {
  6041.                                         "entity_id": "{{ end_scene_entities }}",
  6042.                                         "transition": "{{ transition_off_value }}"
  6043.                                       }
  6044.                                     }
  6045.                                   ]
  6046.                                 },
  6047.                                 {
  6048.                                   "alias": "If transition is not selected",
  6049.                                   "conditions": [
  6050.                                     {
  6051.                                       "condition": "template",
  6052.                                       "value_template": "{{ 'use_transition' not in include_light_control }}"
  6053.                                     }
  6054.                                   ],
  6055.                                   "sequence": [
  6056.                                     {
  6057.                                       "alias": "Turn off the lights",
  6058.                                       "service": "light.turn_off",
  6059.                                       "target": {
  6060.                                         "entity_id": "{{ light_entities }}"
  6061.                                       }
  6062.                                     },
  6063.                                     {
  6064.                                       "alias": "Turn off the scenes",
  6065.                                       "service": "scene.turn_on",
  6066.                                       "data": {
  6067.                                         "entity_id": "{{ end_scene_entities }}"
  6068.                                       }
  6069.                                     }
  6070.                                   ]
  6071.                                 }
  6072.                               ]
  6073.                             },
  6074.                             {
  6075.                               "alias": "Turn off the switches",
  6076.                               "service": "switch.turn_off",
  6077.                               "target": {
  6078.                                 "entity_id": "{{ switch_entities }}"
  6079.                               }
  6080.                             },
  6081.                             {
  6082.                               "alias": "Turn off the script",
  6083.                               "service": "script.turn_on",
  6084.                               "data": {
  6085.                                 "entity_id": "{{ end_script_entities }}"
  6086.                               }
  6087.                             },
  6088.                             {
  6089.                               "stop": "Stop the automation"
  6090.                             }
  6091.                           ]
  6092.                         },
  6093.                         {
  6094.                           "alias": "Motion trigger is on and check if any by-passes are on",
  6095.                           "conditions": [
  6096.                             {
  6097.                               "condition": "or",
  6098.                               "conditions": [
  6099.                                 {
  6100.                                   "condition": "and",
  6101.                                   "conditions": [
  6102.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  6103.                                     {
  6104.                                       "condition": "or",
  6105.                                       "conditions": [
  6106.                                         {
  6107.                                           "condition": "state",
  6108.                                           "entity_id": [],
  6109.                                           "match": "any",
  6110.                                           "state": "on"
  6111.                                         },
  6112.                                         {
  6113.                                           "condition": "state",
  6114.                                           "entity_id": [],
  6115.                                           "match": "any",
  6116.                                           "state": "on"
  6117.                                         },
  6118.                                         {
  6119.                                           "condition": "state",
  6120.                                           "entity_id": [],
  6121.                                           "match": "any",
  6122.                                           "state": "on"
  6123.                                         }
  6124.                                       ]
  6125.                                     }
  6126.                                   ]
  6127.                                 },
  6128.                                 {
  6129.                                   "condition": "and",
  6130.                                   "conditions": [
  6131.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  6132.                                     {
  6133.                                       "condition": "or",
  6134.                                       "conditions": [
  6135.                                         {
  6136.                                           "condition": "state",
  6137.                                           "entity_id": [],
  6138.                                           "match": "any",
  6139.                                           "state": "on"
  6140.                                         },
  6141.                                         {
  6142.                                           "condition": "state",
  6143.                                           "entity_id": [],
  6144.                                           "match": "any",
  6145.                                           "state": "on"
  6146.                                         }
  6147.                                       ]
  6148.                                     }
  6149.                                   ]
  6150.                                 },
  6151.                                 {
  6152.                                   "condition": "and",
  6153.                                   "conditions": [
  6154.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  6155.                                     {
  6156.                                       "condition": "or",
  6157.                                       "conditions": [
  6158.                                         {
  6159.                                           "condition": "state",
  6160.                                           "entity_id": [],
  6161.                                           "match": "any",
  6162.                                           "state": "on"
  6163.                                         },
  6164.                                         {
  6165.                                           "condition": "state",
  6166.                                           "entity_id": [],
  6167.                                           "match": "any",
  6168.                                           "state": "on"
  6169.                                         }
  6170.                                       ]
  6171.                                     }
  6172.                                   ]
  6173.                                 },
  6174.                                 {
  6175.                                   "condition": "and",
  6176.                                   "conditions": [
  6177.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  6178.                                     {
  6179.                                       "condition": "or",
  6180.                                       "conditions": [
  6181.                                         {
  6182.                                           "condition": "state",
  6183.                                           "entity_id": [],
  6184.                                           "match": "any",
  6185.                                           "state": "on"
  6186.                                         },
  6187.                                         {
  6188.                                           "condition": "state",
  6189.                                           "entity_id": [],
  6190.                                           "match": "any",
  6191.                                           "state": "on"
  6192.                                         }
  6193.                                       ]
  6194.                                     }
  6195.                                   ]
  6196.                                 },
  6197.                                 {
  6198.                                   "condition": "and",
  6199.                                   "conditions": [
  6200.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  6201.                                     {
  6202.                                       "condition": "state",
  6203.                                       "entity_id": [],
  6204.                                       "match": "any",
  6205.                                       "state": "on"
  6206.                                     }
  6207.                                   ]
  6208.                                 },
  6209.                                 {
  6210.                                   "condition": "and",
  6211.                                   "conditions": [
  6212.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  6213.                                     {
  6214.                                       "condition": "state",
  6215.                                       "entity_id": [],
  6216.                                       "match": "any",
  6217.                                       "state": "on"
  6218.                                     }
  6219.                                   ]
  6220.                                 },
  6221.                                 {
  6222.                                   "condition": "and",
  6223.                                   "conditions": [
  6224.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  6225.                                     {
  6226.                                       "condition": "state",
  6227.                                       "entity_id": [],
  6228.                                       "match": "any",
  6229.                                       "state": "on"
  6230.                                     }
  6231.                                   ]
  6232.                                 }
  6233.                               ]
  6234.                             }
  6235.                           ],
  6236.                           "sequence": [
  6237.                             {
  6238.                               "alias": "Check by-pass settings and preform the correct action",
  6239.                               "if": [
  6240.                                 {
  6241.                                   "alias": "Check if the by-pass auto off is enabled",
  6242.                                   "condition": "template",
  6243.                                   "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  6244.                                 }
  6245.                               ],
  6246.                               "then": [
  6247.                                 {
  6248.                                   "alias": "Wait the number of minutes set in the by-pass auto off time delay",
  6249.                                   "delay": {
  6250.                                     "minutes": 60
  6251.                                   }
  6252.                                 },
  6253.                                 {
  6254.                                   "alias": "Parallel Actions for the by-pass auto off",
  6255.                                   "parallel": [
  6256.                                     {
  6257.                                       "sequence": [
  6258.                                         {
  6259.                                           "choose": [
  6260.                                             {
  6261.                                               "conditions": [
  6262.                                                 {
  6263.                                                   "condition": "template",
  6264.                                                   "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}"
  6265.                                                 }
  6266.                                               ],
  6267.                                               "sequence": [
  6268.                                                 {
  6269.                                                   "alias": "Turn off the by-pass",
  6270.                                                   "service": "homeassistant.turn_off",
  6271.                                                   "entity_id": []
  6272.                                                 }
  6273.                                               ]
  6274.                                             }
  6275.                                           ]
  6276.                                         }
  6277.                                       ]
  6278.                                     },
  6279.                                     {
  6280.                                       "sequence": [
  6281.                                         {
  6282.                                           "choose": [
  6283.                                             {
  6284.                                               "conditions": [
  6285.                                                 {
  6286.                                                   "condition": "template",
  6287.                                                   "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}"
  6288.                                                 }
  6289.                                               ],
  6290.                                               "sequence": [
  6291.                                                 {
  6292.                                                   "alias": "Turn off the by-pass",
  6293.                                                   "service": "homeassistant.turn_off",
  6294.                                                   "entity_id": []
  6295.                                                 }
  6296.                                               ]
  6297.                                             }
  6298.                                           ]
  6299.                                         }
  6300.                                       ]
  6301.                                     },
  6302.                                     {
  6303.                                       "sequence": [
  6304.                                         {
  6305.                                           "choose": [
  6306.                                             {
  6307.                                               "conditions": [
  6308.                                                 {
  6309.                                                   "condition": "template",
  6310.                                                   "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  6311.                                                 }
  6312.                                               ],
  6313.                                               "sequence": [
  6314.                                                 {
  6315.                                                   "alias": "Turn off the by-pass",
  6316.                                                   "service": "homeassistant.turn_off",
  6317.                                                   "entity_id": []
  6318.                                                 }
  6319.                                               ]
  6320.                                             }
  6321.                                           ]
  6322.                                         }
  6323.                                       ]
  6324.                                     }
  6325.                                   ]
  6326.                                 }
  6327.                               ]
  6328.                             },
  6329.                             {
  6330.                               "stop": "Stop the automation"
  6331.                             }
  6332.                           ]
  6333.                         }
  6334.                       ]
  6335.                     }
  6336.                   ]
  6337.                 }
  6338.               ]
  6339.             },
  6340.             {
  6341.               "choose": [
  6342.                 {
  6343.                   "alias": "Sun, Ambient Light Sensor & time above setting to turn off",
  6344.                   "conditions": [
  6345.                     {
  6346.                       "condition": "trigger",
  6347.                       "id": [
  6348.                         "t9",
  6349.                         "t10",
  6350.                         "t11"
  6351.                       ]
  6352.                     }
  6353.                   ],
  6354.                   "sequence": [
  6355.                     {
  6356.                       "choose": [
  6357.                         {
  6358.                           "alias": "If transition is selected",
  6359.                           "conditions": [
  6360.                             {
  6361.                               "condition": "template",
  6362.                               "value_template": "{{ 'use_transition' in include_light_control }}"
  6363.                             }
  6364.                           ],
  6365.                           "sequence": [
  6366.                             {
  6367.                               "alias": "Turn off the lights",
  6368.                               "service": "light.turn_off",
  6369.                               "target": {
  6370.                                 "entity_id": "{{ light_entities }}"
  6371.                               },
  6372.                               "data": {
  6373.                                 "transition": "{{ transition_off_value }}"
  6374.                               }
  6375.                             },
  6376.                             {
  6377.                               "alias": "Turn off the scenes",
  6378.                               "service": "scene.turn_on",
  6379.                               "data": {
  6380.                                 "entity_id": "{{ end_scene_entities }}",
  6381.                                 "transition": "{{ transition_off_value }}"
  6382.                               }
  6383.                             }
  6384.                           ]
  6385.                         },
  6386.                         {
  6387.                           "alias": "If transition is not selected",
  6388.                           "conditions": [
  6389.                             {
  6390.                               "condition": "template",
  6391.                               "value_template": "{{ 'use_transition' not in include_light_control }}"
  6392.                             }
  6393.                           ],
  6394.                           "sequence": [
  6395.                             {
  6396.                               "alias": "Turn off the lights",
  6397.                               "service": "light.turn_off",
  6398.                               "target": {
  6399.                                 "entity_id": "{{ light_entities }}"
  6400.                               }
  6401.                             },
  6402.                             {
  6403.                               "alias": "Turn off the scenes",
  6404.                               "service": "scene.turn_on",
  6405.                               "data": {
  6406.                                 "entity_id": "{{ end_scene_entities }}"
  6407.                               }
  6408.                             }
  6409.                           ]
  6410.                         }
  6411.                       ]
  6412.                     },
  6413.                     {
  6414.                       "alias": "Turn off the switches",
  6415.                       "service": "switch.turn_off",
  6416.                       "target": {
  6417.                         "entity_id": "{{ switch_entities }}"
  6418.                       }
  6419.                     },
  6420.                     {
  6421.                       "alias": "Turn off the script",
  6422.                       "service": "script.turn_on",
  6423.                       "data": {
  6424.                         "entity_id": "{{ end_script_entities }}"
  6425.                       }
  6426.                     },
  6427.                     {
  6428.                       "alias": "Turn off the input boolean night lights",
  6429.                       "service": "input_boolean.turn_off",
  6430.                       "data": {
  6431.                         "entity_id": []
  6432.                       }
  6433.                     },
  6434.                     {
  6435.                       "stop": "Stop the automation"
  6436.                     }
  6437.                   ]
  6438.                 },
  6439.                 {
  6440.                   "alias": "Turn off night lights when trigger by end night lights conditions",
  6441.                   "conditions": [
  6442.                     {
  6443.                       "condition": "trigger",
  6444.                       "id": [
  6445.                         "t12",
  6446.                         "t13",
  6447.                         "t14"
  6448.                       ]
  6449.                     }
  6450.                   ],
  6451.                   "sequence": [
  6452.                     {
  6453.                       "choose": [
  6454.                         {
  6455.                           "alias": "If transition is selected",
  6456.                           "conditions": [
  6457.                             "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (is_state(night_boolean_scenes_scripts, 'on')) }}"
  6458.                           ],
  6459.                           "sequence": [
  6460.                             {
  6461.                               "choose": [
  6462.                                 {
  6463.                                   "alias": "If transition is selected",
  6464.                                   "conditions": [
  6465.                                     {
  6466.                                       "condition": "template",
  6467.                                       "value_template": "{{ 'use_transition' in include_night_light_control }}"
  6468.                                     }
  6469.                                   ],
  6470.                                   "sequence": [
  6471.                                     {
  6472.                                       "alias": "Turn off the lights",
  6473.                                       "service": "light.turn_off",
  6474.                                       "target": {
  6475.                                         "entity_id": "{{ crossover_night_lights_light }}"
  6476.                                       },
  6477.                                       "data": {
  6478.                                         "transition": "{{ night_transition_off_value }}"
  6479.                                       }
  6480.                                     }
  6481.                                   ]
  6482.                                 },
  6483.                                 {
  6484.                                   "alias": "If transition is not selected",
  6485.                                   "conditions": [
  6486.                                     {
  6487.                                       "condition": "template",
  6488.                                       "value_template": "{{ 'use_transition' not in include_night_light_control }}"
  6489.                                     }
  6490.                                   ],
  6491.                                   "sequence": [
  6492.                                     {
  6493.                                       "alias": "Turn off the lights",
  6494.                                       "service": "light.turn_off",
  6495.                                       "target": {
  6496.                                         "entity_id": "{{ crossover_night_lights_light }}"
  6497.                                       }
  6498.                                     }
  6499.                                   ]
  6500.                                 }
  6501.                               ]
  6502.                             },
  6503.                             {
  6504.                               "alias": "Turn off the switches",
  6505.                               "service": "switch.turn_off",
  6506.                               "target": {
  6507.                                 "entity_id": "{{ crossover_night_lights_switch }}"
  6508.                               }
  6509.                             },
  6510.                             {
  6511.                               "alias": "Turn off the script",
  6512.                               "service": "script.turn_on",
  6513.                               "data": {
  6514.                                 "entity_id": "{{ end_script_entities }}"
  6515.                               }
  6516.                             },
  6517.                             {
  6518.                               "choose": [
  6519.                                 {
  6520.                                   "alias": "If adjust light settings when crossing over if lights are ON is selected in night light control",
  6521.                                   "conditions": [
  6522.                                     {
  6523.                                       "condition": "template",
  6524.                                       "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}"
  6525.                                     }
  6526.                                   ],
  6527.                                   "sequence": [
  6528.                                     {
  6529.                                       "choose": [
  6530.                                         {
  6531.                                           "alias": "If transition is selected",
  6532.                                           "conditions": [
  6533.                                             {
  6534.                                               "condition": "template",
  6535.                                               "value_template": "{{ 'use_transition' in include_night_light_control }}"
  6536.                                             }
  6537.                                           ],
  6538.                                           "sequence": [
  6539.                                             {
  6540.                                               "alias": "Turn off the scenes",
  6541.                                               "service": "scene.turn_on",
  6542.                                               "data": {
  6543.                                                 "entity_id": "{{ end_scene_entities }}",
  6544.                                                 "transition": "{{ night_transition_off_value }}"
  6545.                                               }
  6546.                                             }
  6547.                                           ]
  6548.                                         },
  6549.                                         {
  6550.                                           "alias": "If transition is not selected",
  6551.                                           "conditions": [
  6552.                                             {
  6553.                                               "condition": "template",
  6554.                                               "value_template": "{{ 'use_transition' not in include_night_light_control }}"
  6555.                                             }
  6556.                                           ],
  6557.                                           "sequence": [
  6558.                                             {
  6559.                                               "alias": "Turn off the scenes",
  6560.                                               "service": "scene.turn_on",
  6561.                                               "data": {
  6562.                                                 "entity_id": "{{ end_scene_entities }}"
  6563.                                               }
  6564.                                             }
  6565.                                           ]
  6566.                                         }
  6567.                                       ]
  6568.                                     },
  6569.                                     {
  6570.                                       "alias": "Turn off the input boolean night lights",
  6571.                                       "service": "input_boolean.turn_off",
  6572.                                       "data": {
  6573.                                         "entity_id": []
  6574.                                       }
  6575.                                     },
  6576.                                     {
  6577.                                       "choose": [
  6578.                                         {
  6579.                                           "alias": "Set the transition and brightness for the normal lights switch",
  6580.                                           "conditions": [
  6581.                                             {
  6582.                                               "condition": "template",
  6583.                                               "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('enable_lux_controled_brightness' not in include_dynamic_lighting) and ('use_colour_temperature' not in include_light_control) }}"
  6584.                                             }
  6585.                                           ],
  6586.                                           "sequence": [
  6587.                                             {
  6588.                                               "service": "light.turn_on",
  6589.                                               "target": {
  6590.                                                 "entity_id": "{{ crossover_lights_light_on }}"
  6591.                                               },
  6592.                                               "data": {
  6593.                                                 "transition": "{{ transition_on_value }}",
  6594.                                                 "brightness_pct": "{{ brightness_value }}"
  6595.                                               }
  6596.                                             }
  6597.                                           ]
  6598.                                         },
  6599.                                         {
  6600.                                           "alias": "Set the transition and colour temperature for the normal lights switch",
  6601.                                           "conditions": [
  6602.                                             {
  6603.                                               "condition": "template",
  6604.                                               "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('enable_lux_controled_brightness' not in include_dynamic_lighting) and ('use_colour_temperature' in include_light_control) }}"
  6605.                                             }
  6606.                                           ],
  6607.                                           "sequence": [
  6608.                                             {
  6609.                                               "service": "light.turn_on",
  6610.                                               "target": {
  6611.                                                 "entity_id": "{{ crossover_lights_light_on }}"
  6612.                                               },
  6613.                                               "data": {
  6614.                                                 "transition": "{{ transition_on_value }}",
  6615.                                                 "kelvin": "{{temperature_value}}"
  6616.                                               }
  6617.                                             }
  6618.                                           ]
  6619.                                         },
  6620.                                         {
  6621.                                           "alias": "Set the transition, brightness and colour temperature for the normal lights switch",
  6622.                                           "conditions": [
  6623.                                             {
  6624.                                               "condition": "template",
  6625.                                               "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('enable_lux_controled_brightness' not in include_dynamic_lighting) and ('use_colour_temperature' in include_light_control) }}"
  6626.                                             }
  6627.                                           ],
  6628.                                           "sequence": [
  6629.                                             {
  6630.                                               "service": "light.turn_on",
  6631.                                               "target": {
  6632.                                                 "entity_id": "{{ crossover_lights_light_on }}"
  6633.                                               },
  6634.                                               "data": {
  6635.                                                 "transition": "{{ transition_on_value }}",
  6636.                                                 "brightness_pct": "{{ brightness_value }}",
  6637.                                                 "kelvin": "{{temperature_value}}"
  6638.                                               }
  6639.                                             }
  6640.                                           ]
  6641.                                         },
  6642.                                         {
  6643.                                           "alias": "Set the brightness for the normal lights switch",
  6644.                                           "conditions": [
  6645.                                             {
  6646.                                               "condition": "template",
  6647.                                               "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('enable_lux_controled_brightness' not in include_dynamic_lighting) and ('use_colour_temperature' not in include_light_control) }}"
  6648.                                             }
  6649.                                           ],
  6650.                                           "sequence": [
  6651.                                             {
  6652.                                               "service": "light.turn_on",
  6653.                                               "target": {
  6654.                                                 "entity_id": "{{ crossover_lights_light_on }}"
  6655.                                               },
  6656.                                               "data": {
  6657.                                                 "brightness_pct": "{{ brightness_value }}"
  6658.                                               }
  6659.                                             }
  6660.                                           ]
  6661.                                         },
  6662.                                         {
  6663.                                           "alias": "Set the colour temperature for the normal lights switch",
  6664.                                           "conditions": [
  6665.                                             {
  6666.                                               "condition": "template",
  6667.                                               "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('enable_lux_controled_brightness' not in include_dynamic_lighting) and ('use_colour_temperature' in include_light_control) }}"
  6668.                                             }
  6669.                                           ],
  6670.                                           "sequence": [
  6671.                                             {
  6672.                                               "service": "light.turn_on",
  6673.                                               "target": {
  6674.                                                 "entity_id": "{{ crossover_lights_light_on }}"
  6675.                                               },
  6676.                                               "data": {
  6677.                                                 "kelvin": "{{temperature_value}}"
  6678.                                               }
  6679.                                             }
  6680.                                           ]
  6681.                                         },
  6682.                                         {
  6683.                                           "alias": "Set the brightness and colour temperature for the normal lights switch",
  6684.                                           "conditions": [
  6685.                                             {
  6686.                                               "condition": "template",
  6687.                                               "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('enable_lux_controled_brightness' not in include_dynamic_lighting) and ('use_colour_temperature' in include_light_control) }}"
  6688.                                             }
  6689.                                           ],
  6690.                                           "sequence": [
  6691.                                             {
  6692.                                               "service": "light.turn_on",
  6693.                                               "target": {
  6694.                                                 "entity_id": "{{ crossover_lights_light_on }}"
  6695.                                               },
  6696.                                               "data": {
  6697.                                                 "brightness_pct": "{{ brightness_value }}",
  6698.                                                 "kelvin": "{{temperature_value}}"
  6699.                                               }
  6700.                                             }
  6701.                                           ]
  6702.                                         }
  6703.                                       ]
  6704.                                     }
  6705.                                   ]
  6706.                                 }
  6707.                               ]
  6708.                             }
  6709.                           ]
  6710.                         },
  6711.                         {
  6712.                           "alias": "If transition is selected",
  6713.                           "conditions": [
  6714.                             "{{ 'manage_scripts_crossing_over' in include_night_light_control }}",
  6715.                             "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(night_boolean_scenes_scripts, 'off')) }}"
  6716.                           ],
  6717.                           "sequence": [
  6718.                             {
  6719.                               "alias": "Turn off the script",
  6720.                               "service": "script.turn_on",
  6721.                               "data": {
  6722.                                 "entity_id": "{{ end_script_entities }}"
  6723.                               }
  6724.                             },
  6725.                             {
  6726.                               "stop": "Stop the automation"
  6727.                             }
  6728.                           ]
  6729.                         }
  6730.                       ]
  6731.                     }
  6732.                   ]
  6733.                 },
  6734.                 {
  6735.                   "alias": "Safe Guard when HA restarts",
  6736.                   "conditions": [
  6737.                     {
  6738.                       "condition": "trigger",
  6739.                       "id": "t15"
  6740.                     }
  6741.                   ],
  6742.                   "sequence": [
  6743.                     {
  6744.                       "choose": [
  6745.                         {
  6746.                           "alias": "Check all by-pass are off and check conditions if enabled ",
  6747.                           "conditions": [
  6748.                             {
  6749.                               "condition": "or",
  6750.                               "conditions": [
  6751.                                 {
  6752.                                   "condition": "and",
  6753.                                   "conditions": [
  6754.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  6755.                                     {
  6756.                                       "condition": "state",
  6757.                                       "entity_id": [],
  6758.                                       "state": "off"
  6759.                                     },
  6760.                                     {
  6761.                                       "condition": "state",
  6762.                                       "entity_id": [],
  6763.                                       "state": "off"
  6764.                                     },
  6765.                                     {
  6766.                                       "condition": "state",
  6767.                                       "entity_id": [],
  6768.                                       "state": "off"
  6769.                                     }
  6770.                                   ]
  6771.                                 },
  6772.                                 {
  6773.                                   "condition": "and",
  6774.                                   "conditions": [
  6775.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  6776.                                     {
  6777.                                       "condition": "state",
  6778.                                       "entity_id": [],
  6779.                                       "state": "off"
  6780.                                     },
  6781.                                     {
  6782.                                       "condition": "state",
  6783.                                       "entity_id": [],
  6784.                                       "state": "off"
  6785.                                     }
  6786.                                   ]
  6787.                                 },
  6788.                                 {
  6789.                                   "condition": "and",
  6790.                                   "conditions": [
  6791.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  6792.                                     {
  6793.                                       "condition": "state",
  6794.                                       "entity_id": [],
  6795.                                       "state": "off"
  6796.                                     },
  6797.                                     {
  6798.                                       "condition": "state",
  6799.                                       "entity_id": [],
  6800.                                       "state": "off"
  6801.                                     }
  6802.                                   ]
  6803.                                 },
  6804.                                 {
  6805.                                   "condition": "and",
  6806.                                   "conditions": [
  6807.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  6808.                                     {
  6809.                                       "condition": "state",
  6810.                                       "entity_id": [],
  6811.                                       "state": "off"
  6812.                                     },
  6813.                                     {
  6814.                                       "condition": "state",
  6815.                                       "entity_id": [],
  6816.                                       "state": "off"
  6817.                                     }
  6818.                                   ]
  6819.                                 },
  6820.                                 {
  6821.                                   "condition": "and",
  6822.                                   "conditions": [
  6823.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  6824.                                     {
  6825.                                       "condition": "state",
  6826.                                       "entity_id": [],
  6827.                                       "state": "off"
  6828.                                     }
  6829.                                   ]
  6830.                                 },
  6831.                                 {
  6832.                                   "condition": "and",
  6833.                                   "conditions": [
  6834.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  6835.                                     {
  6836.                                       "condition": "state",
  6837.                                       "entity_id": [],
  6838.                                       "state": "off"
  6839.                                     }
  6840.                                   ]
  6841.                                 },
  6842.                                 {
  6843.                                   "condition": "and",
  6844.                                   "conditions": [
  6845.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  6846.                                     {
  6847.                                       "condition": "state",
  6848.                                       "entity_id": [],
  6849.                                       "state": "off"
  6850.                                     }
  6851.                                   ]
  6852.                                 }
  6853.                               ]
  6854.                             }
  6855.                           ],
  6856.                           "sequence": [
  6857.                             {
  6858.                               "alias": "Small time delay required",
  6859.                               "delay": {
  6860.                                 "seconds": 1
  6861.                               }
  6862.                             }
  6863.                           ]
  6864.                         },
  6865.                         {
  6866.                           "alias": "Check if any by-passes are on",
  6867.                           "conditions": [
  6868.                             {
  6869.                               "condition": "or",
  6870.                               "conditions": [
  6871.                                 {
  6872.                                   "condition": "and",
  6873.                                   "conditions": [
  6874.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  6875.                                     {
  6876.                                       "condition": "or",
  6877.                                       "conditions": [
  6878.                                         {
  6879.                                           "condition": "state",
  6880.                                           "entity_id": [],
  6881.                                           "match": "any",
  6882.                                           "state": "on"
  6883.                                         },
  6884.                                         {
  6885.                                           "condition": "state",
  6886.                                           "entity_id": [],
  6887.                                           "match": "any",
  6888.                                           "state": "on"
  6889.                                         },
  6890.                                         {
  6891.                                           "condition": "state",
  6892.                                           "entity_id": [],
  6893.                                           "match": "any",
  6894.                                           "state": "on"
  6895.                                         }
  6896.                                       ]
  6897.                                     }
  6898.                                   ]
  6899.                                 },
  6900.                                 {
  6901.                                   "condition": "and",
  6902.                                   "conditions": [
  6903.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  6904.                                     {
  6905.                                       "condition": "or",
  6906.                                       "conditions": [
  6907.                                         {
  6908.                                           "condition": "state",
  6909.                                           "entity_id": [],
  6910.                                           "match": "any",
  6911.                                           "state": "on"
  6912.                                         },
  6913.                                         {
  6914.                                           "condition": "state",
  6915.                                           "entity_id": [],
  6916.                                           "match": "any",
  6917.                                           "state": "on"
  6918.                                         }
  6919.                                       ]
  6920.                                     }
  6921.                                   ]
  6922.                                 },
  6923.                                 {
  6924.                                   "condition": "and",
  6925.                                   "conditions": [
  6926.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  6927.                                     {
  6928.                                       "condition": "or",
  6929.                                       "conditions": [
  6930.                                         {
  6931.                                           "condition": "state",
  6932.                                           "entity_id": [],
  6933.                                           "match": "any",
  6934.                                           "state": "on"
  6935.                                         },
  6936.                                         {
  6937.                                           "condition": "state",
  6938.                                           "entity_id": [],
  6939.                                           "match": "any",
  6940.                                           "state": "on"
  6941.                                         }
  6942.                                       ]
  6943.                                     }
  6944.                                   ]
  6945.                                 },
  6946.                                 {
  6947.                                   "condition": "and",
  6948.                                   "conditions": [
  6949.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  6950.                                     {
  6951.                                       "condition": "or",
  6952.                                       "conditions": [
  6953.                                         {
  6954.                                           "condition": "state",
  6955.                                           "entity_id": [],
  6956.                                           "match": "any",
  6957.                                           "state": "on"
  6958.                                         },
  6959.                                         {
  6960.                                           "condition": "state",
  6961.                                           "entity_id": [],
  6962.                                           "match": "any",
  6963.                                           "state": "on"
  6964.                                         }
  6965.                                       ]
  6966.                                     }
  6967.                                   ]
  6968.                                 },
  6969.                                 {
  6970.                                   "condition": "and",
  6971.                                   "conditions": [
  6972.                                     "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  6973.                                     {
  6974.                                       "condition": "state",
  6975.                                       "entity_id": [],
  6976.                                       "match": "any",
  6977.                                       "state": "on"
  6978.                                     }
  6979.                                   ]
  6980.                                 },
  6981.                                 {
  6982.                                   "condition": "and",
  6983.                                   "conditions": [
  6984.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}",
  6985.                                     {
  6986.                                       "condition": "state",
  6987.                                       "entity_id": [],
  6988.                                       "match": "any",
  6989.                                       "state": "on"
  6990.                                     }
  6991.                                   ]
  6992.                                 },
  6993.                                 {
  6994.                                   "condition": "and",
  6995.                                   "conditions": [
  6996.                                     "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}",
  6997.                                     {
  6998.                                       "condition": "state",
  6999.                                       "entity_id": [],
  7000.                                       "match": "any",
  7001.                                       "state": "on"
  7002.                                     }
  7003.                                   ]
  7004.                                 }
  7005.                               ]
  7006.                             }
  7007.                           ],
  7008.                           "sequence": [
  7009.                             {
  7010.                               "alias": "Check by-pass auto off is enabled and preform the correct",
  7011.                               "if": [
  7012.                                 {
  7013.                                   "alias": "Check if the by-pass auto off is enabled",
  7014.                                   "condition": "template",
  7015.                                   "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  7016.                                 }
  7017.                               ],
  7018.                               "then": [
  7019.                                 {
  7020.                                   "alias": "Wait the number of minutes set in the by-pass auto off time delay",
  7021.                                   "delay": {
  7022.                                     "minutes": 60
  7023.                                   }
  7024.                                 },
  7025.                                 {
  7026.                                   "alias": "Parallel Actions for the by-pass auto off",
  7027.                                   "parallel": [
  7028.                                     {
  7029.                                       "sequence": [
  7030.                                         {
  7031.                                           "choose": [
  7032.                                             {
  7033.                                               "conditions": [
  7034.                                                 {
  7035.                                                   "condition": "template",
  7036.                                                   "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}"
  7037.                                                 }
  7038.                                               ],
  7039.                                               "sequence": [
  7040.                                                 {
  7041.                                                   "alias": "Turn off the by-pass",
  7042.                                                   "service": "homeassistant.turn_off",
  7043.                                                   "entity_id": []
  7044.                                                 }
  7045.                                               ]
  7046.                                             }
  7047.                                           ]
  7048.                                         }
  7049.                                       ]
  7050.                                     },
  7051.                                     {
  7052.                                       "sequence": [
  7053.                                         {
  7054.                                           "choose": [
  7055.                                             {
  7056.                                               "conditions": [
  7057.                                                 {
  7058.                                                   "condition": "template",
  7059.                                                   "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}"
  7060.                                                 }
  7061.                                               ],
  7062.                                               "sequence": [
  7063.                                                 {
  7064.                                                   "alias": "Turn off the by-pass",
  7065.                                                   "service": "homeassistant.turn_off",
  7066.                                                   "entity_id": []
  7067.                                                 }
  7068.                                               ]
  7069.                                             }
  7070.                                           ]
  7071.                                         }
  7072.                                       ]
  7073.                                     },
  7074.                                     {
  7075.                                       "sequence": [
  7076.                                         {
  7077.                                           "choose": [
  7078.                                             {
  7079.                                               "conditions": [
  7080.                                                 {
  7081.                                                   "condition": "template",
  7082.                                                   "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  7083.                                                 }
  7084.                                               ],
  7085.                                               "sequence": [
  7086.                                                 {
  7087.                                                   "alias": "Turn off the by-pass",
  7088.                                                   "service": "homeassistant.turn_off",
  7089.                                                   "entity_id": []
  7090.                                                 }
  7091.                                               ]
  7092.                                             }
  7093.                                           ]
  7094.                                         }
  7095.                                       ]
  7096.                                     }
  7097.                                   ]
  7098.                                 }
  7099.                               ]
  7100.                             },
  7101.                             {
  7102.                               "stop": "Stop the automation"
  7103.                             }
  7104.                           ]
  7105.                         }
  7106.                       ]
  7107.                     }
  7108.                   ]
  7109.                 }
  7110.               ]
  7111.             },
  7112.             {
  7113.               "alias": "Parallel Actions for dynamic lighting",
  7114.               "parallel": [
  7115.                 {
  7116.                   "sequence": [
  7117.                     {
  7118.                       "alias": "Check if the dynamic lighting is enabled",
  7119.                       "condition": "and",
  7120.                       "conditions": [
  7121.                         {
  7122.                           "condition": "template",
  7123.                           "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}"
  7124.                         }
  7125.                       ]
  7126.                     },
  7127.                     {
  7128.                       "choose": [
  7129.                         {
  7130.                           "alias": "Set the Dynamic Lux Controlled Brightness for the normal lights switch",
  7131.                           "conditions": [
  7132.                             {
  7133.                               "condition": "template",
  7134.                               "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness'}}"
  7135.                             }
  7136.                           ],
  7137.                           "sequence": [
  7138.                             {
  7139.                               "alias": "Dynamic Lighting Control",
  7140.                               "repeat": {
  7141.                                 "until": "{{ expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 }}",
  7142.                                 "sequence": [
  7143.                                   {
  7144.                                     "choose": [
  7145.                                       {
  7146.                                         "alias": "Set the transition and dynamic lighting brightness for the normal lights switch",
  7147.                                         "conditions": [
  7148.                                           {
  7149.                                             "condition": "template",
  7150.                                             "value_template": "{{ ('use_transition' in include_light_control) and (include_dynamic_lighting == 'enable_lux_controled_brightness') and ('use_colour_temperature' not in include_light_control) }}"
  7151.                                           }
  7152.                                         ],
  7153.                                         "sequence": [
  7154.                                           {
  7155.                                             "service": "light.turn_on",
  7156.                                             "target": {
  7157.                                               "entity_id": "{{ light_entities }}"
  7158.                                             },
  7159.                                             "data": {
  7160.                                               "transition": "{{ transition_on_value }}",
  7161.                                               "brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec %} {% if lux <= dynamic_lighting_min_lux %}\n  {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n  {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n  {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n  {% set bv = bv %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif (lp > bv) and  (lp - bv) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n  {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n  {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n"
  7162.                                             }
  7163.                                           },
  7164.                                           {
  7165.                                             "alias": "Dynamic lighting heartbeat",
  7166.                                             "delay": {
  7167.                                               "minutes": 1
  7168.                                             }
  7169.                                           }
  7170.                                         ]
  7171.                                       },
  7172.                                       {
  7173.                                         "alias": "Set the transition, dynamic lighting brightness and colour temperature for the normal lights switch",
  7174.                                         "conditions": [
  7175.                                           {
  7176.                                             "condition": "template",
  7177.                                             "value_template": "{{ ('use_transition' in include_light_control) and (include_dynamic_lighting == 'enable_lux_controled_brightness') and ('use_colour_temperature' in include_light_control) }}"
  7178.                                           }
  7179.                                         ],
  7180.                                         "sequence": [
  7181.                                           {
  7182.                                             "service": "light.turn_on",
  7183.                                             "target": {
  7184.                                               "entity_id": "{{ light_entities }}"
  7185.                                             },
  7186.                                             "data": {
  7187.                                               "transition": "{{ transition_on_value }}",
  7188.                                               "brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec %} {% if lux <= dynamic_lighting_min_lux %}\n  {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n  {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n  {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n  {% set bv = bv %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif (lp > bv) and  (lp - bv) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n  {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n  {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n",
  7189.                                               "kelvin": "{{temperature_value}}"
  7190.                                             }
  7191.                                           },
  7192.                                           {
  7193.                                             "alias": "Dynamic lighting heartbeat",
  7194.                                             "delay": {
  7195.                                               "minutes": 1
  7196.                                             }
  7197.                                           }
  7198.                                         ]
  7199.                                       },
  7200.                                       {
  7201.                                         "alias": "Set the dynamic lighting brightness for the normal lights switch",
  7202.                                         "conditions": [
  7203.                                           {
  7204.                                             "condition": "template",
  7205.                                             "value_template": "{{ ('use_transition' not in include_light_control) and (include_dynamic_lighting == 'enable_lux_controled_brightness') and ('use_colour_temperature' not in include_light_control) }}"
  7206.                                           }
  7207.                                         ],
  7208.                                         "sequence": [
  7209.                                           {
  7210.                                             "service": "light.turn_on",
  7211.                                             "target": {
  7212.                                               "entity_id": "{{ light_entities }}"
  7213.                                             },
  7214.                                             "data": {
  7215.                                               "brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec %} {% if lux <= dynamic_lighting_min_lux %}\n  {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n  {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n  {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n  {% set bv = bv %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif (lp > bv) and  (lp - bv) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n  {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n  {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n"
  7216.                                             }
  7217.                                           },
  7218.                                           {
  7219.                                             "alias": "Dynamic lighting heartbeat",
  7220.                                             "delay": {
  7221.                                               "minutes": 1
  7222.                                             }
  7223.                                           }
  7224.                                         ]
  7225.                                       },
  7226.                                       {
  7227.                                         "alias": "Set the dynamic lighting brightness and colour temperature for the normal lights switch",
  7228.                                         "conditions": [
  7229.                                           {
  7230.                                             "condition": "template",
  7231.                                             "value_template": "{{ ('use_transition' not in include_light_control) and (include_dynamic_lighting == 'enable_lux_controled_brightness') and ('use_colour_temperature' in include_light_control) }}"
  7232.                                           }
  7233.                                         ],
  7234.                                         "sequence": [
  7235.                                           {
  7236.                                             "service": "light.turn_on",
  7237.                                             "target": {
  7238.                                               "entity_id": "{{ light_entities }}"
  7239.                                             },
  7240.                                             "data": {
  7241.                                               "brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec %} {% if lux <= dynamic_lighting_min_lux %}\n  {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n  {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n  {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n  {% set bv = bv %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif (lp > bv) and  (lp - bv) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n  {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n  {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n",
  7242.                                               "kelvin": "{{temperature_value}}"
  7243.                                             }
  7244.                                           },
  7245.                                           {
  7246.                                             "alias": "Dynamic lighting heartbeat",
  7247.                                             "delay": {
  7248.                                               "minutes": 1
  7249.                                             }
  7250.                                           }
  7251.                                         ]
  7252.                                       }
  7253.                                     ]
  7254.                                   }
  7255.                                 ]
  7256.                               }
  7257.                             }
  7258.                           ]
  7259.                         }
  7260.                       ]
  7261.                     },
  7262.                     {
  7263.                       "choose": [
  7264.                         {
  7265.                           "alias": "Dynamic Lighting -  Lux Controlled Brightness - Inverted for the normal lights switch",
  7266.                           "conditions": [
  7267.                             {
  7268.                               "condition": "template",
  7269.                               "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness_inv'}}"
  7270.                             }
  7271.                           ],
  7272.                           "sequence": [
  7273.                             {
  7274.                               "alias": "Dynamic Lighting Control",
  7275.                               "repeat": {
  7276.                                 "until": "{{ expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 }}",
  7277.                                 "sequence": [
  7278.                                   {
  7279.                                     "choose": [
  7280.                                       {
  7281.                                         "alias": "Set the transition and dynamic lighting brightness for the normal lights switch",
  7282.                                         "conditions": [
  7283.                                           {
  7284.                                             "condition": "template",
  7285.                                             "value_template": "{{ ('use_transition' in include_light_control) and (include_dynamic_lighting == 'enable_lux_controled_brightness_inv') and ('use_colour_temperature' not in include_light_control) }}"
  7286.                                           }
  7287.                                         ],
  7288.                                         "sequence": [
  7289.                                           {
  7290.                                             "service": "light.turn_on",
  7291.                                             "target": {
  7292.                                               "entity_id": "{{ light_entities }}"
  7293.                                             },
  7294.                                             "data": {
  7295.                                               "transition": "{{ transition_on_value }}",
  7296.                                               "brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec %} {% if lux <= dynamic_lighting_min_lux %}\n  {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n  {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n  {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n  {% set bv = bv %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif (lp > bv) and  (lp - bv) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n  {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n  {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n"
  7297.                                             }
  7298.                                           },
  7299.                                           {
  7300.                                             "alias": "Dynamic lighting heartbeat",
  7301.                                             "delay": {
  7302.                                               "minutes": 1
  7303.                                             }
  7304.                                           }
  7305.                                         ]
  7306.                                       },
  7307.                                       {
  7308.                                         "alias": "Set the transition, dynamic lighting brightness and colour temperature for the normal lights switch",
  7309.                                         "conditions": [
  7310.                                           {
  7311.                                             "condition": "template",
  7312.                                             "value_template": "{{ ('use_transition' in include_light_control) and (include_dynamic_lighting == 'enable_lux_controled_brightness_inv') and ('use_colour_temperature' in include_light_control) }}"
  7313.                                           }
  7314.                                         ],
  7315.                                         "sequence": [
  7316.                                           {
  7317.                                             "service": "light.turn_on",
  7318.                                             "target": {
  7319.                                               "entity_id": "{{ light_entities }}"
  7320.                                             },
  7321.                                             "data": {
  7322.                                               "transition": "{{ transition_on_value }}",
  7323.                                               "brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec %} {% if lux <= dynamic_lighting_min_lux %}\n  {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n  {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n  {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n  {% set bv = bv %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif (lp > bv) and  (lp - bv) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n  {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n  {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n",
  7324.                                               "kelvin": "{{temperature_value}}"
  7325.                                             }
  7326.                                           },
  7327.                                           {
  7328.                                             "alias": "Dynamic lighting heartbeat",
  7329.                                             "delay": {
  7330.                                               "minutes": 1
  7331.                                             }
  7332.                                           }
  7333.                                         ]
  7334.                                       },
  7335.                                       {
  7336.                                         "alias": "Set the dynamic lighting brightness for the normal lights switch",
  7337.                                         "conditions": [
  7338.                                           {
  7339.                                             "condition": "template",
  7340.                                             "value_template": "{{ ('use_transition' not in include_light_control) and (include_dynamic_lighting == 'enable_lux_controled_brightness_inv') and ('use_colour_temperature' not in include_light_control) }}"
  7341.                                           }
  7342.                                         ],
  7343.                                         "sequence": [
  7344.                                           {
  7345.                                             "service": "light.turn_on",
  7346.                                             "target": {
  7347.                                               "entity_id": "{{ light_entities }}"
  7348.                                             },
  7349.                                             "data": {
  7350.                                               "brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec %} {% if lux <= dynamic_lighting_min_lux %}\n  {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n  {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n  {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n  {% set bv = bv %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif (lp > bv) and  (lp - bv) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n  {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n  {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n"
  7351.                                             }
  7352.                                           },
  7353.                                           {
  7354.                                             "alias": "Dynamic lighting heartbeat",
  7355.                                             "delay": {
  7356.                                               "minutes": 1
  7357.                                             }
  7358.                                           }
  7359.                                         ]
  7360.                                       },
  7361.                                       {
  7362.                                         "alias": "Set the dynamic lighting brightness and colour temperature for the normal lights switch",
  7363.                                         "conditions": [
  7364.                                           {
  7365.                                             "condition": "template",
  7366.                                             "value_template": "{{ ('use_transition' not in include_light_control) and (include_dynamic_lighting == 'enable_lux_controled_brightness_inv') and ('use_colour_temperature' in include_light_control) }}"
  7367.                                           }
  7368.                                         ],
  7369.                                         "sequence": [
  7370.                                           {
  7371.                                             "service": "light.turn_on",
  7372.                                             "target": {
  7373.                                               "entity_id": "{{ light_entities }}"
  7374.                                             },
  7375.                                             "data": {
  7376.                                               "brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec %} {% if lux <= dynamic_lighting_min_lux %}\n  {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n  {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n  {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n  {% set bv = bv %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif (lp > bv) and  (lp - bv) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n  {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n  {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n",
  7377.                                               "kelvin": "{{temperature_value}}"
  7378.                                             }
  7379.                                           },
  7380.                                           {
  7381.                                             "alias": "Dynamic lighting heartbeat",
  7382.                                             "delay": {
  7383.                                               "minutes": 1
  7384.                                             }
  7385.                                           }
  7386.                                         ]
  7387.                                       }
  7388.                                     ]
  7389.                                   }
  7390.                                 ]
  7391.                               }
  7392.                             }
  7393.                           ]
  7394.                         }
  7395.                       ]
  7396.                     },
  7397.                     {
  7398.                       "choose": [
  7399.                         {
  7400.                           "alias": "Dynamic Lighting - Sun Elevation Lighting - Colour Temp for the normal lights switch",
  7401.                           "conditions": [
  7402.                             {
  7403.                               "condition": "template",
  7404.                               "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour' }}"
  7405.                             }
  7406.                           ],
  7407.                           "sequence": [
  7408.                             {
  7409.                               "alias": "Dynamic Lighting Control",
  7410.                               "repeat": {
  7411.                                 "until": "{{ expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 }}",
  7412.                                 "sequence": [
  7413.                                   {
  7414.                                     "choose": [
  7415.                                       {
  7416.                                         "alias": "Set the transition and dynamic sun elevation colour temperature for the normal lights switch",
  7417.                                         "conditions": [
  7418.                                           {
  7419.                                             "condition": "template",
  7420.                                             "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and (include_dynamic_lighting == 'enable_sun_elevation_colour') }}"
  7421.                                           }
  7422.                                         ],
  7423.                                         "sequence": [
  7424.                                           {
  7425.                                             "service": "light.turn_on",
  7426.                                             "target": {
  7427.                                               "entity_id": "{{ light_entities }}"
  7428.                                             },
  7429.                                             "data": {
  7430.                                               "transition": "{{ transition_on_value }}",
  7431.                                               "kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% endif %}\n{% else %}\n  {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n"
  7432.                                             }
  7433.                                           },
  7434.                                           {
  7435.                                             "alias": "Dynamic lighting heartbeat",
  7436.                                             "delay": {
  7437.                                               "minutes": 1
  7438.                                             }
  7439.                                           }
  7440.                                         ]
  7441.                                       },
  7442.                                       {
  7443.                                         "alias": "Set the transition, lighting brightness and dynamic sun elevation colour temperature for the normal lights switch",
  7444.                                         "conditions": [
  7445.                                           {
  7446.                                             "condition": "template",
  7447.                                             "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and (include_dynamic_lighting == 'enable_sun_elevation_colour') }}"
  7448.                                           }
  7449.                                         ],
  7450.                                         "sequence": [
  7451.                                           {
  7452.                                             "service": "light.turn_on",
  7453.                                             "target": {
  7454.                                               "entity_id": "{{ light_entities }}"
  7455.                                             },
  7456.                                             "data": {
  7457.                                               "transition": "{{ transition_on_value }}",
  7458.                                               "brightness_pct": "{{ brightness_value }}",
  7459.                                               "kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% endif %}\n{% else %}\n  {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n"
  7460.                                             }
  7461.                                           },
  7462.                                           {
  7463.                                             "alias": "Dynamic lighting heartbeat",
  7464.                                             "delay": {
  7465.                                               "minutes": 1
  7466.                                             }
  7467.                                           }
  7468.                                         ]
  7469.                                       },
  7470.                                       {
  7471.                                         "alias": "Set the dynamic sun elevation colour temperature for the normal lights switch",
  7472.                                         "conditions": [
  7473.                                           {
  7474.                                             "condition": "template",
  7475.                                             "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and (include_dynamic_lighting == 'enable_sun_elevation_colour') }}"
  7476.                                           }
  7477.                                         ],
  7478.                                         "sequence": [
  7479.                                           {
  7480.                                             "service": "light.turn_on",
  7481.                                             "target": {
  7482.                                               "entity_id": "{{ light_entities }}"
  7483.                                             },
  7484.                                             "data": {
  7485.                                               "kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% endif %}\n{% else %}\n  {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n"
  7486.                                             }
  7487.                                           },
  7488.                                           {
  7489.                                             "alias": "Dynamic lighting heartbeat",
  7490.                                             "delay": {
  7491.                                               "minutes": 1
  7492.                                             }
  7493.                                           }
  7494.                                         ]
  7495.                                       },
  7496.                                       {
  7497.                                         "alias": "Set the lighting brightness and dynamic sun elevation colour temperature for the normal lights switch",
  7498.                                         "conditions": [
  7499.                                           {
  7500.                                             "condition": "template",
  7501.                                             "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and (include_dynamic_lighting == 'enable_sun_elevation_colour') }}"
  7502.                                           }
  7503.                                         ],
  7504.                                         "sequence": [
  7505.                                           {
  7506.                                             "service": "light.turn_on",
  7507.                                             "target": {
  7508.                                               "entity_id": "{{ light_entities }}"
  7509.                                             },
  7510.                                             "data": {
  7511.                                               "brightness_pct": "{{ brightness_value }}",
  7512.                                               "kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% endif %}\n{% else %}\n  {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n"
  7513.                                             }
  7514.                                           },
  7515.                                           {
  7516.                                             "alias": "Dynamic lighting heartbeat",
  7517.                                             "delay": {
  7518.                                               "minutes": 1
  7519.                                             }
  7520.                                           }
  7521.                                         ]
  7522.                                       }
  7523.                                     ]
  7524.                                   }
  7525.                                 ]
  7526.                               }
  7527.                             }
  7528.                           ]
  7529.                         }
  7530.                       ]
  7531.                     },
  7532.                     {
  7533.                       "choose": [
  7534.                         {
  7535.                           "alias": "Set the Sun Elevation Lighting - Brightness for the normal lights switch",
  7536.                           "conditions": [
  7537.                             {
  7538.                               "condition": "template",
  7539.                               "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness' }}"
  7540.                             }
  7541.                           ],
  7542.                           "sequence": [
  7543.                             {
  7544.                               "alias": "Dynamic Lighting Control",
  7545.                               "repeat": {
  7546.                                 "until": "{{ expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 }}",
  7547.                                 "sequence": [
  7548.                                   {
  7549.                                     "choose": [
  7550.                                       {
  7551.                                         "alias": "Set the transition and dynamic sun elevation lighting brightness for the normal lights switch",
  7552.                                         "conditions": [
  7553.                                           {
  7554.                                             "condition": "template",
  7555.                                             "value_template": "{{ ('use_transition' in include_light_control) and (include_dynamic_lighting == 'enable_sun_elevation_brightness') and ('use_colour_temperature' not in include_light_control) }}"
  7556.                                           }
  7557.                                         ],
  7558.                                         "sequence": [
  7559.                                           {
  7560.                                             "service": "light.turn_on",
  7561.                                             "target": {
  7562.                                               "entity_id": "{{ light_entities }}"
  7563.                                             },
  7564.                                             "data": {
  7565.                                               "transition": "{{ transition_on_value }}",
  7566.                                               "brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set brightness_value = dynamic_lighting_max_brightness %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set brightness_value = dynamic_lighting_min_brightness %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set brightness_value = dynamic_lighting_min_brightness %}\n  {% endif %}\n{% else %}\n  {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n"
  7567.                                             }
  7568.                                           },
  7569.                                           {
  7570.                                             "alias": "Dynamic lighting heartbeat",
  7571.                                             "delay": {
  7572.                                               "minutes": 1
  7573.                                             }
  7574.                                           }
  7575.                                         ]
  7576.                                       },
  7577.                                       {
  7578.                                         "alias": "Set the transition, dynamic sun elevation lighting brightness and colour temperature for the normal lights switch",
  7579.                                         "conditions": [
  7580.                                           {
  7581.                                             "condition": "template",
  7582.                                             "value_template": "{{ ('use_transition' in include_light_control) and (include_dynamic_lighting == 'enable_sun_elevation_brightness') and ('use_colour_temperature' in include_light_control) }}"
  7583.                                           }
  7584.                                         ],
  7585.                                         "sequence": [
  7586.                                           {
  7587.                                             "service": "light.turn_on",
  7588.                                             "target": {
  7589.                                               "entity_id": "{{ light_entities }}"
  7590.                                             },
  7591.                                             "data": {
  7592.                                               "transition": "{{ transition_on_value }}",
  7593.                                               "brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set brightness_value = dynamic_lighting_max_brightness %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set brightness_value = dynamic_lighting_min_brightness %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set brightness_value = dynamic_lighting_min_brightness %}\n  {% endif %}\n{% else %}\n  {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n",
  7594.                                               "kelvin": "{{temperature_value}}"
  7595.                                             }
  7596.                                           },
  7597.                                           {
  7598.                                             "alias": "Dynamic lighting heartbeat",
  7599.                                             "delay": {
  7600.                                               "minutes": 1
  7601.                                             }
  7602.                                           }
  7603.                                         ]
  7604.                                       },
  7605.                                       {
  7606.                                         "alias": "Set the dynamic sun elevation lighting brightness for the normal lights switch",
  7607.                                         "conditions": [
  7608.                                           {
  7609.                                             "condition": "template",
  7610.                                             "value_template": "{{ ('use_transition' not in include_light_control) and (include_dynamic_lighting == 'enable_sun_elevation_brightness') and ('use_colour_temperature' not in include_light_control) }}"
  7611.                                           }
  7612.                                         ],
  7613.                                         "sequence": [
  7614.                                           {
  7615.                                             "service": "light.turn_on",
  7616.                                             "target": {
  7617.                                               "entity_id": "{{ light_entities }}"
  7618.                                             },
  7619.                                             "data": {
  7620.                                               "brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set brightness_value = dynamic_lighting_max_brightness %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set brightness_value = dynamic_lighting_min_brightness %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set brightness_value = dynamic_lighting_min_brightness %}\n  {% endif %}\n{% else %}\n  {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n"
  7621.                                             }
  7622.                                           },
  7623.                                           {
  7624.                                             "alias": "Dynamic lighting heartbeat",
  7625.                                             "delay": {
  7626.                                               "minutes": 1
  7627.                                             }
  7628.                                           }
  7629.                                         ]
  7630.                                       },
  7631.                                       {
  7632.                                         "alias": "Set the dynamic sun elevation lighting brightness and colour temperature for the normal lights switch",
  7633.                                         "conditions": [
  7634.                                           {
  7635.                                             "condition": "template",
  7636.                                             "value_template": "{{ ('use_transition' not in include_light_control) and (include_dynamic_lighting == 'enable_sun_elevation_brightness') and ('use_colour_temperature' in include_light_control) }}"
  7637.                                           }
  7638.                                         ],
  7639.                                         "sequence": [
  7640.                                           {
  7641.                                             "service": "light.turn_on",
  7642.                                             "target": {
  7643.                                               "entity_id": "{{ light_entities }}"
  7644.                                             },
  7645.                                             "data": {
  7646.                                               "brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set brightness_value = dynamic_lighting_max_brightness %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set brightness_value = dynamic_lighting_min_brightness %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set brightness_value = dynamic_lighting_min_brightness %}\n  {% endif %}\n{% else %}\n  {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n",
  7647.                                               "kelvin": "{{temperature_value}}"
  7648.                                             }
  7649.                                           },
  7650.                                           {
  7651.                                             "alias": "Dynamic lighting heartbeat",
  7652.                                             "delay": {
  7653.                                               "minutes": 1
  7654.                                             }
  7655.                                           }
  7656.                                         ]
  7657.                                       }
  7658.                                     ]
  7659.                                   }
  7660.                                 ]
  7661.                               }
  7662.                             }
  7663.                           ]
  7664.                         }
  7665.                       ]
  7666.                     },
  7667.                     {
  7668.                       "choose": [
  7669.                         {
  7670.                           "alias": "Set the Sun Elevation Lighting - Colour Temp + Brightness for the normal lights switch",
  7671.                           "conditions": [
  7672.                             {
  7673.                               "condition": "template",
  7674.                               "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness' }}"
  7675.                             }
  7676.                           ],
  7677.                           "sequence": [
  7678.                             {
  7679.                               "alias": "Dynamic Lighting Control",
  7680.                               "repeat": {
  7681.                                 "until": "{{ expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 }}",
  7682.                                 "sequence": [
  7683.                                   {
  7684.                                     "choose": [
  7685.                                       {
  7686.                                         "alias": "Set the transition, dynamic sun elevation lighting brightness and dynamic sun elevation colour temperature for the normal lights switch",
  7687.                                         "conditions": [
  7688.                                           {
  7689.                                             "condition": "template",
  7690.                                             "value_template": "{{ ('use_transition' in include_light_control) and (include_dynamic_lighting == 'enable_sun_elevation_colour_brightness') }}"
  7691.                                           }
  7692.                                         ],
  7693.                                         "sequence": [
  7694.                                           {
  7695.                                             "service": "light.turn_on",
  7696.                                             "target": {
  7697.                                               "entity_id": "{{ light_entities }}"
  7698.                                             },
  7699.                                             "data": {
  7700.                                               "transition": "{{ transition_on_value }}",
  7701.                                               "brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set brightness_value = dynamic_lighting_max_brightness %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set brightness_value = dynamic_lighting_min_brightness %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set brightness_value = dynamic_lighting_min_brightness %}\n  {% endif %}\n{% else %}\n  {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n",
  7702.                                               "kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% endif %}\n{% else %}\n  {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n"
  7703.                                             }
  7704.                                           },
  7705.                                           {
  7706.                                             "alias": "Dynamic lighting heartbeat",
  7707.                                             "delay": {
  7708.                                               "minutes": 1
  7709.                                             }
  7710.                                           }
  7711.                                         ]
  7712.                                       },
  7713.                                       {
  7714.                                         "alias": "Set the dynamic sun elevation lighting brightness and dynamic sun elevation colour temperature for the normal lights switch",
  7715.                                         "conditions": [
  7716.                                           {
  7717.                                             "condition": "template",
  7718.                                             "value_template": "{{ ('use_transition' not in include_light_control) and (include_dynamic_lighting == 'enable_sun_elevation_colour_brightness') }}"
  7719.                                           }
  7720.                                         ],
  7721.                                         "sequence": [
  7722.                                           {
  7723.                                             "service": "light.turn_on",
  7724.                                             "target": {
  7725.                                               "entity_id": "{{ light_entities }}"
  7726.                                             },
  7727.                                             "data": {
  7728.                                               "brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set brightness_value = dynamic_lighting_max_brightness %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set brightness_value = dynamic_lighting_min_brightness %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set brightness_value = dynamic_lighting_min_brightness %}\n  {% endif %}\n{% else %}\n  {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n",
  7729.                                               "kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% endif %}\n{% else %}\n  {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n"
  7730.                                             }
  7731.                                           },
  7732.                                           {
  7733.                                             "alias": "Dynamic lighting heartbeat",
  7734.                                             "delay": {
  7735.                                               "minutes": 1
  7736.                                             }
  7737.                                           }
  7738.                                         ]
  7739.                                       }
  7740.                                     ]
  7741.                                   }
  7742.                                 ]
  7743.                               }
  7744.                             }
  7745.                           ]
  7746.                         }
  7747.                       ]
  7748.                     },
  7749.                     {
  7750.                       "choose": [
  7751.                         {
  7752.                           "alias": "Set the Sun Elevation Lighting - Colour Temp + LUX Controled Brightness for the normal lights switch",
  7753.                           "conditions": [
  7754.                             {
  7755.                               "condition": "template",
  7756.                               "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}"
  7757.                             }
  7758.                           ],
  7759.                           "sequence": [
  7760.                             {
  7761.                               "alias": "Dynamic Lighting Control",
  7762.                               "repeat": {
  7763.                                 "until": "{{ expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 }}",
  7764.                                 "sequence": [
  7765.                                   {
  7766.                                     "choose": [
  7767.                                       {
  7768.                                         "alias": "Set the transition, dynamic lighting lux brightness and dynamic sun elevation colour temperature for the normal lights switch",
  7769.                                         "conditions": [
  7770.                                           {
  7771.                                             "condition": "template",
  7772.                                             "value_template": "{{ ('use_transition' in include_light_control) and (include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness') }}"
  7773.                                           }
  7774.                                         ],
  7775.                                         "sequence": [
  7776.                                           {
  7777.                                             "service": "light.turn_on",
  7778.                                             "target": {
  7779.                                               "entity_id": "{{ light_entities }}"
  7780.                                             },
  7781.                                             "data": {
  7782.                                               "transition": "{{ transition_on_value }}",
  7783.                                               "brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec %} {% if lux <= dynamic_lighting_min_lux %}\n  {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n  {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n  {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n  {% set bv = bv %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif (lp > bv) and  (lp - bv) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n  {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n  {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n",
  7784.                                               "kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% endif %}\n{% else %}\n  {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n"
  7785.                                             }
  7786.                                           },
  7787.                                           {
  7788.                                             "alias": "Dynamic lighting heartbeat",
  7789.                                             "delay": {
  7790.                                               "minutes": 1
  7791.                                             }
  7792.                                           }
  7793.                                         ]
  7794.                                       },
  7795.                                       {
  7796.                                         "alias": "Set the dynamic lighting lux brightness and dynamic sun elevation colour temperature for the normal lights switch",
  7797.                                         "conditions": [
  7798.                                           {
  7799.                                             "condition": "template",
  7800.                                             "value_template": "{{ ('use_transition' not in include_light_control) and (include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness') }}"
  7801.                                           }
  7802.                                         ],
  7803.                                         "sequence": [
  7804.                                           {
  7805.                                             "service": "light.turn_on",
  7806.                                             "target": {
  7807.                                               "entity_id": "{{ light_entities }}"
  7808.                                             },
  7809.                                             "data": {
  7810.                                               "brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec %} {% if lux <= dynamic_lighting_min_lux %}\n  {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n  {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n  {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n  {% set bv = bv %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif (lp > bv) and  (lp - bv) <= dynamic_lighting_dead_zone %}\n  {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n  {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n  {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n",
  7811.                                               "kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n  {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n  {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling  %}\n    {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n    {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n  {% endif %}\n{% else %}\n  {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n"
  7812.                                             }
  7813.                                           },
  7814.                                           {
  7815.                                             "alias": "Dynamic lighting heartbeat",
  7816.                                             "delay": {
  7817.                                               "minutes": 1
  7818.                                             }
  7819.                                           }
  7820.                                         ]
  7821.                                       }
  7822.                                     ]
  7823.                                   }
  7824.                                 ]
  7825.                               }
  7826.                             }
  7827.                           ]
  7828.                         }
  7829.                       ]
  7830.                     },
  7831.                     {
  7832.                       "stop": "Stop the automation"
  7833.                     }
  7834.                   ]
  7835.                 },
  7836.                 {
  7837.                   "sequence": [
  7838.                     {
  7839.                       "choose": [
  7840.                         {
  7841.                           "alias": "Set the transition for the normal lights switch",
  7842.                           "conditions": [
  7843.                             {
  7844.                               "condition": "template",
  7845.                               "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and (include_dynamic_lighting == 'disable_dynamic_lighting') and ('use_colour_temperature' not in include_light_control) }}"
  7846.                             }
  7847.                           ],
  7848.                           "sequence": [
  7849.                             {
  7850.                               "service": "light.turn_on",
  7851.                               "target": {
  7852.                                 "entity_id": "{{ light_entities_off }}"
  7853.                               },
  7854.                               "data": {
  7855.                                 "transition": "{{ transition_on_value }}"
  7856.                               }
  7857.                             }
  7858.                           ]
  7859.                         },
  7860.                         {
  7861.                           "alias": "Set the transition and brightness for the normal lights switch",
  7862.                           "conditions": [
  7863.                             {
  7864.                               "condition": "template",
  7865.                               "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and (include_dynamic_lighting == 'disable_dynamic_lighting') and ('use_colour_temperature' not in include_light_control) }}"
  7866.                             }
  7867.                           ],
  7868.                           "sequence": [
  7869.                             {
  7870.                               "service": "light.turn_on",
  7871.                               "target": {
  7872.                                 "entity_id": "{{ light_entities_off }}"
  7873.                               },
  7874.                               "data": {
  7875.                                 "transition": "{{ transition_on_value }}",
  7876.                                 "brightness_pct": "{{ brightness_value }}"
  7877.                               }
  7878.                             }
  7879.                           ]
  7880.                         },
  7881.                         {
  7882.                           "alias": "Set the transition and colour temperature for the normal lights switch",
  7883.                           "conditions": [
  7884.                             {
  7885.                               "condition": "template",
  7886.                               "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and (include_dynamic_lighting == 'disable_dynamic_lighting') and ('use_colour_temperature' in include_light_control) }}"
  7887.                             }
  7888.                           ],
  7889.                           "sequence": [
  7890.                             {
  7891.                               "service": "light.turn_on",
  7892.                               "target": {
  7893.                                 "entity_id": "{{ light_entities_off }}"
  7894.                               },
  7895.                               "data": {
  7896.                                 "transition": "{{ transition_on_value }}",
  7897.                                 "kelvin": "{{temperature_value}}"
  7898.                               }
  7899.                             }
  7900.                           ]
  7901.                         },
  7902.                         {
  7903.                           "alias": "Set the transition, brightness and colour temperature for the normal lights switch",
  7904.                           "conditions": [
  7905.                             {
  7906.                               "condition": "template",
  7907.                               "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and (include_dynamic_lighting == 'disable_dynamic_lighting') and ('use_colour_temperature' in include_light_control) }}"
  7908.                             }
  7909.                           ],
  7910.                           "sequence": [
  7911.                             {
  7912.                               "service": "light.turn_on",
  7913.                               "target": {
  7914.                                 "entity_id": "{{ light_entities_off }}"
  7915.                               },
  7916.                               "data": {
  7917.                                 "transition": "{{ transition_on_value }}",
  7918.                                 "brightness_pct": "{{ brightness_value }}",
  7919.                                 "kelvin": "{{temperature_value}}"
  7920.                               }
  7921.                             }
  7922.                           ]
  7923.                         },
  7924.                         {
  7925.                           "alias": "Set the brightness for the normal lights switch",
  7926.                           "conditions": [
  7927.                             {
  7928.                               "condition": "template",
  7929.                               "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and (include_dynamic_lighting == 'disable_dynamic_lighting') and ('use_colour_temperature' not in include_light_control) }}"
  7930.                             }
  7931.                           ],
  7932.                           "sequence": [
  7933.                             {
  7934.                               "service": "light.turn_on",
  7935.                               "target": {
  7936.                                 "entity_id": "{{ light_entities_off }}"
  7937.                               },
  7938.                               "data": {
  7939.                                 "brightness_pct": "{{ brightness_value }}"
  7940.                               }
  7941.                             }
  7942.                           ]
  7943.                         },
  7944.                         {
  7945.                           "alias": "Set the colour temperature for the normal lights switch",
  7946.                           "conditions": [
  7947.                             {
  7948.                               "condition": "template",
  7949.                               "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and (include_dynamic_lighting == 'disable_dynamic_lighting') and ('use_colour_temperature' in include_light_control) }}"
  7950.                             }
  7951.                           ],
  7952.                           "sequence": [
  7953.                             {
  7954.                               "service": "light.turn_on",
  7955.                               "target": {
  7956.                                 "entity_id": "{{ light_entities_off }}"
  7957.                               },
  7958.                               "data": {
  7959.                                 "kelvin": "{{temperature_value}}"
  7960.                               }
  7961.                             }
  7962.                           ]
  7963.                         },
  7964.                         {
  7965.                           "alias": "Set the brightness and colour temperature for the normal lights switch",
  7966.                           "conditions": [
  7967.                             {
  7968.                               "condition": "template",
  7969.                               "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and (include_dynamic_lighting == 'disable_dynamic_lighting') and ('use_colour_temperature' in include_light_control) }}"
  7970.                             }
  7971.                           ],
  7972.                           "sequence": [
  7973.                             {
  7974.                               "service": "light.turn_on",
  7975.                               "target": {
  7976.                                 "entity_id": "{{ light_entities_off }}"
  7977.                               },
  7978.                               "data": {
  7979.                                 "brightness_pct": "{{ brightness_value }}",
  7980.                                 "kelvin": "{{temperature_value}}"
  7981.                               }
  7982.                             }
  7983.                           ]
  7984.                         },
  7985.                         {
  7986.                           "alias": "Set the default for the normal lights switch",
  7987.                           "conditions": [
  7988.                             {
  7989.                               "condition": "template",
  7990.                               "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and (include_dynamic_lighting == 'disable_dynamic_lighting') and ('use_colour_temperature' not in include_light_control) }}"
  7991.                             }
  7992.                           ],
  7993.                           "sequence": [
  7994.                             {
  7995.                               "service": "light.turn_on",
  7996.                               "target": {
  7997.                                 "entity_id": "{{ light_entities_off }}"
  7998.                               }
  7999.                             }
  8000.                           ]
  8001.                         }
  8002.                       ]
  8003.                     },
  8004.                     {
  8005.                       "choose": [
  8006.                         {
  8007.                           "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over",
  8008.                           "conditions": [
  8009.                             {
  8010.                               "condition": "template",
  8011.                               "value_template": "{% if night_boolean_scenes_scripts == [] %}\n  false\n{% elif is_state(night_boolean_scenes_scripts, 'on') %}\n  true\n{% else %}\n  false\n{% endif %}"
  8012.                             }
  8013.                           ],
  8014.                           "sequence": null
  8015.                         },
  8016.                         {
  8017.                           "alias": "If transition is selected",
  8018.                           "conditions": [
  8019.                             {
  8020.                               "condition": "template",
  8021.                               "value_template": "{{ 'use_transition' in include_light_control }}"
  8022.                             }
  8023.                           ],
  8024.                           "sequence": [
  8025.                             {
  8026.                               "alias": "Turn on the scenes",
  8027.                               "service": "scene.turn_on",
  8028.                               "target": {
  8029.                                 "entity_id": "{{ scene_entities }}"
  8030.                               },
  8031.                               "data": {
  8032.                                 "transition": "{{ transition_on_value }}"
  8033.                               }
  8034.                             },
  8035.                             {
  8036.                               "alias": "Turn on the boolean for scenes and scripts",
  8037.                               "service": "input_boolean.turn_on",
  8038.                               "data": {
  8039.                                 "entity_id": "{{ boolean_scenes_scripts_helper }}"
  8040.                               }
  8041.                             }
  8042.                           ]
  8043.                         },
  8044.                         {
  8045.                           "alias": "If transition is not selected",
  8046.                           "conditions": [
  8047.                             {
  8048.                               "condition": "template",
  8049.                               "value_template": "{{ 'use_transition' not in include_light_control }}"
  8050.                             }
  8051.                           ],
  8052.                           "sequence": [
  8053.                             {
  8054.                               "alias": "Turn on the scenes",
  8055.                               "service": "scene.turn_on",
  8056.                               "target": {
  8057.                                 "entity_id": "{{ scene_entities }}"
  8058.                               }
  8059.                             },
  8060.                             {
  8061.                               "alias": "Turn on the boolean for scenes and scripts",
  8062.                               "service": "input_boolean.turn_on",
  8063.                               "data": {
  8064.                                 "entity_id": "{{ boolean_scenes_scripts_helper }}"
  8065.                               }
  8066.                             }
  8067.                           ]
  8068.                         }
  8069.                       ]
  8070.                     },
  8071.                     {
  8072.                       "alias": "Turn on the switches",
  8073.                       "service": "switch.turn_on",
  8074.                       "target": {
  8075.                         "entity_id": "{{ switch_entities_off }}"
  8076.                       }
  8077.                     },
  8078.                     {
  8079.                       "alias": "Turn on the scripts",
  8080.                       "service": "script.turn_on",
  8081.                       "target": {
  8082.                         "entity_id": "{{ script_entities }}"
  8083.                       }
  8084.                     },
  8085.                     {
  8086.                       "choose": [
  8087.                         {
  8088.                           "alias": "By-pass is enabled & check by-pass option - turn lights on",
  8089.                           "conditions": [
  8090.                             {
  8091.                               "condition": "trigger",
  8092.                               "id": "t7_on"
  8093.                             }
  8094.                           ],
  8095.                           "sequence": [
  8096.                             {
  8097.                               "alias": "Check by-pass settings and preform the correct action",
  8098.                               "if": [
  8099.                                 {
  8100.                                   "alias": "Check if the by-pass auto off is enabled",
  8101.                                   "condition": "template",
  8102.                                   "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  8103.                                 }
  8104.                               ],
  8105.                               "then": [
  8106.                                 {
  8107.                                   "alias": "Wait the number of minutes set in the by-pass auto off time delay",
  8108.                                   "delay": {
  8109.                                     "minutes": 60
  8110.                                   }
  8111.                                 },
  8112.                                 {
  8113.                                   "alias": "Parallel Actions for the by-pass auto off",
  8114.                                   "parallel": [
  8115.                                     {
  8116.                                       "sequence": [
  8117.                                         {
  8118.                                           "choose": [
  8119.                                             {
  8120.                                               "conditions": [
  8121.                                                 {
  8122.                                                   "condition": "template",
  8123.                                                   "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}"
  8124.                                                 }
  8125.                                               ],
  8126.                                               "sequence": [
  8127.                                                 {
  8128.                                                   "alias": "Turn off the by-pass",
  8129.                                                   "service": "homeassistant.turn_off",
  8130.                                                   "entity_id": []
  8131.                                                 }
  8132.                                               ]
  8133.                                             }
  8134.                                           ]
  8135.                                         }
  8136.                                       ]
  8137.                                     },
  8138.                                     {
  8139.                                       "sequence": [
  8140.                                         {
  8141.                                           "choose": [
  8142.                                             {
  8143.                                               "conditions": [
  8144.                                                 {
  8145.                                                   "condition": "template",
  8146.                                                   "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}"
  8147.                                                 }
  8148.                                               ],
  8149.                                               "sequence": [
  8150.                                                 {
  8151.                                                   "alias": "Turn off the by-pass",
  8152.                                                   "service": "homeassistant.turn_off",
  8153.                                                   "entity_id": []
  8154.                                                 }
  8155.                                               ]
  8156.                                             }
  8157.                                           ]
  8158.                                         }
  8159.                                       ]
  8160.                                     },
  8161.                                     {
  8162.                                       "sequence": [
  8163.                                         {
  8164.                                           "choose": [
  8165.                                             {
  8166.                                               "conditions": [
  8167.                                                 {
  8168.                                                   "condition": "template",
  8169.                                                   "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}"
  8170.                                                 }
  8171.                                               ],
  8172.                                               "sequence": [
  8173.                                                 {
  8174.                                                   "alias": "Turn off the by-pass",
  8175.                                                   "service": "homeassistant.turn_off",
  8176.                                                   "entity_id": []
  8177.                                                 }
  8178.                                               ]
  8179.                                             }
  8180.                                           ]
  8181.                                         }
  8182.                                       ]
  8183.                                     }
  8184.                                   ]
  8185.                                 },
  8186.                                 {
  8187.                                   "stop": "Stop the automation"
  8188.                                 }
  8189.                               ],
  8190.                               "else": [
  8191.                                 {
  8192.                                   "stop": "Stop the automation"
  8193.                                 }
  8194.                               ]
  8195.                             }
  8196.                           ]
  8197.                         }
  8198.                       ]
  8199.                     },
  8200.                     {
  8201.                       "choose": [
  8202.                         {
  8203.                           "alias": "Check if the trigger is on and wait for it to go off",
  8204.                           "conditions": [
  8205.                             {
  8206.                               "condition": "state",
  8207.                               "entity_id": [
  8208.                                 "binary_sensor.hue_motion_sensor_1_motion"
  8209.                               ],
  8210.                               "state": "on",
  8211.                               "match": "any"
  8212.                             }
  8213.                           ],
  8214.                           "sequence": [
  8215.                             {
  8216.                               "alias": "Wait until motion sensor is off",
  8217.                               "wait_for_trigger": {
  8218.                                 "platform": "state",
  8219.                                 "entity_id": [
  8220.                                   "binary_sensor.hue_motion_sensor_1_motion"
  8221.                                 ],
  8222.                                 "from": "on",
  8223.                                 "to": "off"
  8224.                               }
  8225.                             }
  8226.                           ]
  8227.                         }
  8228.                       ]
  8229.                     },
  8230.                     {
  8231.                       "alias": "Wait the number of minutes set in the normal lights time delay",
  8232.                       "delay": {
  8233.                         "minutes": 2
  8234.                       }
  8235.                     },
  8236.                     {
  8237.                       "choose": [
  8238.                         {
  8239.                           "alias": "If transition is selected",
  8240.                           "conditions": [
  8241.                             {
  8242.                               "condition": "template",
  8243.                               "value_template": "{{ 'use_transition' in include_light_control }}"
  8244.                             }
  8245.                           ],
  8246.                           "sequence": [
  8247.                             {
  8248.                               "alias": "Turn off the lights",
  8249.                               "service": "light.turn_off",
  8250.                               "target": {
  8251.                                 "entity_id": "{{ light_entities }}"
  8252.                               },
  8253.                               "data": {
  8254.                                 "transition": "{{ transition_off_value }}"
  8255.                               }
  8256.                             },
  8257.                             {
  8258.                               "alias": "Turn off the scenes",
  8259.                               "service": "scene.turn_on",
  8260.                               "data": {
  8261.                                 "entity_id": "{{ end_scene_entities }}",
  8262.                                 "transition": "{{ transition_off_value }}"
  8263.                               }
  8264.                             }
  8265.                           ]
  8266.                         },
  8267.                         {
  8268.                           "alias": "If transition is not selected",
  8269.                           "conditions": [
  8270.                             {
  8271.                               "condition": "template",
  8272.                               "value_template": "{{ 'use_transition' not in include_light_control }}"
  8273.                             }
  8274.                           ],
  8275.                           "sequence": [
  8276.                             {
  8277.                               "alias": "Turn off the lights",
  8278.                               "service": "light.turn_off",
  8279.                               "target": {
  8280.                                 "entity_id": "{{ light_entities }}"
  8281.                               }
  8282.                             },
  8283.                             {
  8284.                               "alias": "Turn off the scenes",
  8285.                               "service": "scene.turn_on",
  8286.                               "data": {
  8287.                                 "entity_id": "{{ end_scene_entities }}"
  8288.                               }
  8289.                             }
  8290.                           ]
  8291.                         }
  8292.                       ]
  8293.                     },
  8294.                     {
  8295.                       "alias": "Turn off the switches",
  8296.                       "service": "switch.turn_off",
  8297.                       "target": {
  8298.                         "entity_id": "{{ switch_entities }}"
  8299.                       }
  8300.                     },
  8301.                     {
  8302.                       "alias": "Turn off the script",
  8303.                       "service": "script.turn_on",
  8304.                       "data": {
  8305.                         "entity_id": "{{ end_script_entities }}"
  8306.                       }
  8307.                     },
  8308.                     {
  8309.                       "alias": "Turn off the boolean for scenes and scripts",
  8310.                       "service": "input_boolean.turn_off",
  8311.                       "data": {
  8312.                         "entity_id": []
  8313.                       }
  8314.                     }
  8315.                   ]
  8316.                 }
  8317.               ]
  8318.             }
  8319.           ]
  8320.         }
  8321.       ],
  8322.       "id": "1696792357064",
  8323.       "alias": "Sensor Light Staircase FF",
  8324.       "description": ""
  8325.     },
  8326.     "blueprint_inputs": {
  8327.       "id": "1696792357064",
  8328.       "alias": "Sensor Light Staircase FF",
  8329.       "description": "",
  8330.       "use_blueprint": {
  8331.         "path": "Blackshome/sensor-light.yaml",
  8332.         "input": {
  8333.           "motion_trigger": [
  8334.             "binary_sensor.hue_motion_sensor_1_motion"
  8335.           ],
  8336.           "light_switch": {
  8337.             "entity_id": "scene.scene_staircase_ff_day"
  8338.           },
  8339.           "end_scenes": [
  8340.             "scene.scene_staircase_ff_off"
  8341.           ],
  8342.           "include_light_control": [
  8343.             "use_brightness",
  8344.             "use_transition"
  8345.           ],
  8346.           "light_transition_on": 5,
  8347.           "ambient_light_sensor": "sensor.hue_motion_sensor_1_illuminance",
  8348.           "ambient_light_value": 50,
  8349.           "include_device_tracker": "device_tracker_disabled",
  8350.           "zone": "zone.home",
  8351.           "people": [
  8352.             "person.chris_home"
  8353.           ],
  8354.           "include_night_lights": "night_lights_enabled",
  8355.           "include_night_light_control": [
  8356.             "use_transition",
  8357.             "use_brightness",
  8358.             "if_lights_are_on_adjust_when_crossing_over"
  8359.           ],
  8360.           "night_time_delay": 1,
  8361.           "night_light_brightness": 1,
  8362.           "night_light_transition_on": 5,
  8363.           "night_light_transition_off": 10,
  8364.           "night_lights_conditions": [
  8365.             "sun_enabled",
  8366.             "time_enabled"
  8367.           ],
  8368.           "night_lights_after_time": "21:30:00",
  8369.           "night_lights_before_time": "07:00:00",
  8370.           "time_delay": 2,
  8371.           "night_lights": {
  8372.             "entity_id": "scene.scene_staircase_ff_night"
  8373.           },
  8374.           "light_brightness": 80,
  8375.           "light_transition_off": 10,
  8376.           "ambient_light_options": "ambient_light_option_enabled",
  8377.           "include_dynamic_lighting": [],
  8378.           "dynamic_lighting_lux_sensor": "sensor.hue_motion_sensor_1_illuminance",
  8379.           "dynamic_lighting_max_lux": 400,
  8380.           "dynamic_lighting_min_lux": 40
  8381.         }
  8382.       }
  8383.     },
  8384.     "context": {
  8385.       "id": "01HVER2TGQBE0S018FQH70ZMDX",
  8386.       "parent_id": "01HVER2TGQS44JVM0ZNME0WYB2",
  8387.       "user_id": null
  8388.     }
  8389.   },
  8390.   "logbookEntries": [
  8391.     {
  8392.       "name": "Sensor Light Staircase FF",
  8393.       "message": "triggered by state of binary_sensor.hue_motion_sensor_1_motion",
  8394.       "source": "state of binary_sensor.hue_motion_sensor_1_motion",
  8395.       "entity_id": "automation.sensor_light_staircase_ff",
  8396.       "context_id": "01HVER2TGQBE0S018FQH70ZMDX",
  8397.       "when": 1713113229.8571088,
  8398.       "domain": "automation"
  8399.     },
  8400.     {
  8401.       "when": 1713113229.893378,
  8402.       "state": "2024-04-14T16:47:09.893323+00:00",
  8403.       "entity_id": "scene.scene_staircase_ff_day",
  8404.       "icon": "mdi:stairs-box",
  8405.       "context_event_type": "automation_triggered",
  8406.       "context_domain": "automation",
  8407.       "context_name": "Sensor Light Staircase FF",
  8408.       "context_message": "triggered by state of binary_sensor.hue_motion_sensor_1_motion",
  8409.       "context_source": "state of binary_sensor.hue_motion_sensor_1_motion",
  8410.       "context_entity_id": "automation.sensor_light_staircase_ff"
  8411.     },
  8412.     {
  8413.       "when": 1713113230.068244,
  8414.       "state": "on",
  8415.       "entity_id": "light.light_staircase_ff",
  8416.       "context_event_type": "automation_triggered",
  8417.       "context_domain": "automation",
  8418.       "context_name": "Sensor Light Staircase FF",
  8419.       "context_message": "triggered by state of binary_sensor.hue_motion_sensor_1_motion",
  8420.       "context_source": "state of binary_sensor.hue_motion_sensor_1_motion",
  8421.       "context_entity_id": "automation.sensor_light_staircase_ff"
  8422.     },
  8423.     {
  8424.       "when": 1713113363.980548,
  8425.       "state": "2024-04-14T16:49:23.980429+00:00",
  8426.       "entity_id": "scene.scene_staircase_ff_off",
  8427.       "icon": "mdi:stairs-box",
  8428.       "context_event_type": "automation_triggered",
  8429.       "context_domain": "automation",
  8430.       "context_name": "Sensor Light Staircase FF",
  8431.       "context_message": "triggered by state of binary_sensor.hue_motion_sensor_1_motion",
  8432.       "context_source": "state of binary_sensor.hue_motion_sensor_1_motion",
  8433.       "context_entity_id": "automation.sensor_light_staircase_ff"
  8434.     },
  8435.     {
  8436.       "when": 1713113364.103519,
  8437.       "state": "off",
  8438.       "entity_id": "light.light_staircase_ff",
  8439.       "context_event_type": "automation_triggered",
  8440.       "context_domain": "automation",
  8441.       "context_name": "Sensor Light Staircase FF",
  8442.       "context_message": "triggered by state of binary_sensor.hue_motion_sensor_1_motion",
  8443.       "context_source": "state of binary_sensor.hue_motion_sensor_1_motion",
  8444.       "context_entity_id": "automation.sensor_light_staircase_ff"
  8445.     }
  8446.   ]
  8447. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement