- id: '1736176173682' alias: Bedroom - Bed Controls - Aziz description: '' use_blueprint: path: local/ts004-wss.yaml input: switch: - sensor.wss04_action button_one_short_press: - action: cover.toggle metadata: {} data: {} target: area_id: bedroom button_one_double_press: - action: cover.set_cover_position metadata: {} data: position: 30 target: area_id: bedroom button_two_short_press: - if: - condition: or conditions: - condition: time before: '23:00:00' then: - action: light.toggle metadata: {} data: transition: 1 brightness_pct: 100 target: entity_id: light.esp01_bed_light else: - action: light.toggle metadata: {} data: transition: 1 brightness_pct: 30 target: entity_id: light.esp01_bed_light button_two_double_press: - action: light.toggle metadata: {} data: {} target: entity_id: light.zss02_l1 button_three_short_press: - if: - condition: state entity_id: switch.wss01_socket_1 state: 'on' then: - action: switch.turn_off entity_id: switch.wss01_socket_1 else: - action: switch.turn_on data: {} target: entity_id: switch.wss01_socket_1 button_three_double_press: - if: - condition: state entity_id: switch.wss01_socket_1 state: 'on' then: - action: switch.turn_off entity_id: switch.wss01_socket_1 else: - action: script.turn_on data: variables: heater: switch.wss01_socket_1 target: entity_id: script.control_bed_heater - id: '1736176998592' alias: Bedroom - Bed Controls - Nisrin description: '' use_blueprint: path: local/ts004-wss.yaml input: switch: - sensor.wss05_action button_one_short_press: - action: cover.toggle metadata: {} data: {} target: area_id: bedroom button_one_double_press: - action: cover.set_cover_position metadata: {} data: position: 30 target: area_id: bedroom button_two_short_press: - if: - condition: or conditions: - condition: time after: '23:00:00' then: - action: light.toggle metadata: {} data: transition: 1 brightness_pct: 30 target: entity_id: light.esp01_bed_light else: - action: light.toggle metadata: {} data: transition: 1 brightness_pct: 100 target: entity_id: light.esp01_bed_light button_two_double_press: - action: light.toggle metadata: {} data: {} target: entity_id: light.zss02_l1 button_four_short_press: [] button_four_double_press: [] - id: '1736361188282' alias: Bedroom - Lights - Night description: '' triggers: - trigger: numeric_state entity_id: - sensor.esp01_ultrasonic_right_sensor - sensor.esp01_ultrasonic_left_sensor below: 2 conditions: [] actions: - action: light.turn_on metadata: {} data: transition: 2 brightness_pct: 20 target: entity_id: light.esp01_bed_light - wait_for_trigger: - trigger: state entity_id: - binary_sensor.esp01_bed_right_occupancy - binary_sensor.esp01_bed_left_occupancy from: 'off' to: 'on' timeout: hours: 0 minutes: 5 seconds: 0 milliseconds: 0 - type: turn_off device_id: 2bc50fb9fb244a80baf0ec344bd83ef0 entity_id: ec0f3ac6e30c6a4234b532c0a52d1df1 domain: light mode: single - id: '1736361583980' alias: Reset Night Mode description: '' triggers: - trigger: sun event: sunrise offset: 0 conditions: [] actions: - action: input_boolean.turn_off metadata: {} data: {} target: label_id: flag_night_mode mode: single - id: '1736361791549' alias: Set - Bedroom - Night Mode description: '' triggers: - trigger: time at: '23:00:00' - trigger: state entity_id: - binary_sensor.esp01_bed_right_occupancy - binary_sensor.esp01_bed_left_occupancy from: 'off' to: 'on' for: hours: 0 minutes: 20 seconds: 0 conditions: - condition: time after: '21:00:00' - condition: state entity_id: binary_sensor.occupancy_bedroom state: 'on' actions: - action: input_boolean.turn_on metadata: {} data: {} target: entity_id: input_boolean.bedroom_night_mode mode: single - id: '1736423920854' alias: Mom's Room - Lights - Passage description: '' use_blueprint: path: local/occupancy-lights.yaml input: occupancy_entity: binary_sensor.ms08_occupancy light_target: - light.zss3g02_right no_occupancy_wait: 30 - id: '1736503798847' alias: Aquarium - Lights description: '' triggers: - trigger: time at: '13:00:00' id: time-on - trigger: time at: '19:00:00' id: time-off conditions: [] actions: - if: - condition: trigger id: - time-on then: - action: light.turn_on metadata: {} data: {} target: device_id: cdd8a4f42cf5052d2c020771d66c1959 else: - action: light.turn_off metadata: {} data: {} target: device_id: cdd8a4f42cf5052d2c020771d66c1959 mode: single - id: '1736688453558' alias: Tag Aquarium Light Heater is scanned description: '' triggers: - trigger: tag tag_id: e886a1ae-4a3f-4138-b862-7395f2c8eccb conditions: [] actions: - action: switch.toggle metadata: {} data: {} target: entity_id: - switch.sp23_aquarium_heater_socket_1 - switch.sp22_aquarium_filter_socket_1 mode: single - id: '1739712917701' alias: Tag Aquarium Light is scanned description: '' triggers: - trigger: tag tag_id: 270bd906-01e8-4d84-bf0f-bf42103e532a conditions: [] actions: - action: light.toggle metadata: {} data: {} target: device_id: cdd8a4f42cf5052d2c020771d66c1959 mode: single - id: '1740226912912' alias: Living Room - WSS description: '' use_blueprint: path: local/ts004-wss.yaml input: switch: - sensor.wss01_action button_one_short_press: [] button_one_double_press: [] button_two_short_press: - type: toggle device_id: ecd5da59723eab053cf22186ab31e5d0 entity_id: 3ab01da1e53eba62b7e1abae0920a44f domain: light button_three_short_press: - action: cover.toggle metadata: {} data: {} target: entity_id: cover.curtains_living_room_side button_three_double_press: - action: cover.set_cover_position metadata: {} data: position: 50 target: device_id: f7f43e4a623838e8bc0563300571e576 button_four_short_press: - action: light.toggle metadata: {} data: {} target: entity_id: light.living_room_grow_lights - id: '1740585724620' alias: Grow Lab - Fans description: '' triggers: - trigger: time_pattern minutes: '10' id: start - trigger: time_pattern minutes: '14' id: stop conditions: [] actions: - choose: - conditions: - condition: trigger id: - start sequence: - type: turn_on device_id: 3842f9da654631e6ee3802d56bb779c2 entity_id: 73f28fac90af8eeaafd08bf2bef49f2d domain: switch - conditions: - condition: trigger id: - stop sequence: - type: turn_off device_id: 3842f9da654631e6ee3802d56bb779c2 entity_id: 73f28fac90af8eeaafd08bf2bef49f2d domain: switch mode: single - id: '1740915184838' alias: Tag Living Room Plant Stand Lights is scanned description: '' triggers: - trigger: tag tag_id: 0d5f3fec-48f6-4590-bf3e-45df7f6f9882 conditions: [] actions: - action: light.toggle metadata: {} data: {} target: device_id: 5de341f4e01cd6ccd2af3946d4a95004 mode: single - id: '1741382226786' alias: Tag Living Room Corner Grow Light is scanned description: '' triggers: - trigger: tag tag_id: 32a181ed-0284-4efc-b3f0-f6b3e0fc94ff conditions: [] actions: - action: light.toggle metadata: {} data: {} target: entity_id: light.wss03_socket_1 mode: single - id: '1741383046471' alias: Tag Aquarium Corner Grow Light is scanned description: '' triggers: - trigger: tag tag_id: 438ab4d2-99ca-4d1d-a46f-8dae67ded75b conditions: [] actions: - action: light.toggle metadata: {} data: {} target: entity_id: light.sp10_living_room_plant_light_socket_1 mode: single - id: '1742032071122' alias: Bedroom - Night Mode Auto description: '' triggers: - trigger: time at: '21:00:00' id: night-start - trigger: time at: 08:00:00 id: night-end conditions: [] actions: - choose: - conditions: - condition: trigger id: - night-start sequence: - action: fan.set_preset_mode metadata: {} data: preset_mode: sleep target: device_id: 1bbb1dd386f9e9cf8913340e37688881 - conditions: - condition: trigger id: - night-end sequence: - action: fan.set_preset_mode metadata: {} data: preset_mode: auto target: device_id: 1bbb1dd386f9e9cf8913340e37688881 mode: single - id: '1742032398627' alias: Bedroom - Clean air when room empty description: '' triggers: - trigger: state entity_id: - binary_sensor.occupancy_bedroom from: 'on' to: 'off' for: hours: 0 minutes: 10 seconds: 0 id: room-empty conditions: - condition: template value_template: '{{ (as_timestamp(now()) - as_timestamp(this.attributes.last_triggered or 0)) > 10800 }} ' - condition: state entity_id: fan.master_bedroom_air_purifier attribute: preset_mode state: auto actions: - action: fan.set_percentage metadata: {} data: percentage: 100 target: device_id: 1bbb1dd386f9e9cf8913340e37688881 - wait_for_trigger: - trigger: state entity_id: - binary_sensor.occupancy_bedroom from: null to: 'on' timeout: hours: 0 minutes: 10 seconds: 0 milliseconds: 0 - action: fan.set_preset_mode metadata: {} data: preset_mode: auto target: device_id: 1bbb1dd386f9e9cf8913340e37688881 mode: single - id: '1736453280269' alias: Global - Bukhur - Magrib description: '' triggers: - trigger: sun event: sunset offset: 00:05:00 conditions: - condition: state entity_id: binary_sensor.occupancy_home state: 'on' actions: - action: script.turn_on metadata: {} data: {} target: entity_id: script.bukhur_quick mode: single - id: '1728813664008' alias: Bedroom - Curtains - Button use_blueprint: path: local/smart-scene-switch.yaml input: mode: restart switch: sensor.sss02_action button_short_press: - action: cover.toggle target: entity_id: cover.curtains_bedroom button_double_press: - action: cover.set_cover_position data: position: 30 target: entity_id: cover.curtains_bedroom button_long_press: - action: cover.set_cover_position data: position: 10 - id: '8196071004937' alias: Bedroom - Curtains - Fajr use_blueprint: path: local/peek-curtains.yaml input: occupancy_entity: binary_sensor.occupancy_bedroom cover_target: cover.curtains_bedroom trigger: - platform: sun event: sunrise offset: -00:15:00 - id: '6573097207207' alias: Bedroom - Curtains - Maghrib use_blueprint: path: local/peek-curtains.yaml input: occupancy_entity: binary_sensor.occupancy_bedroom cover_target: cover.curtains_bedroom trigger: - platform: sun event: sunset - id: '5219250874162' alias: Bedroom - Curtains - Wake Up trigger: - platform: time at: 09:00:00 action: - service: cover.set_cover_position target: entity_id: cover.curtains_bedroom data: position: 30 - id: '4448387364818' alias: Laundry - Lights description: '' mode: single triggers: - entity_id: - binary_sensor.ms03_occupancy from: 'off' to: 'on' for: hours: 0 minutes: 0 seconds: 0 id: motion-on trigger: state - entity_id: - binary_sensor.ms03_occupancy from: 'on' to: 'off' for: hours: 0 minutes: 0 seconds: 10 id: motion-of trigger: state - id: door-closed platform: state entity_id: binary_sensor.ds02_contact from: 'on' to: 'off' - id: door-open platform: state entity_id: binary_sensor.ds02_contact from: 'off' to: 'on' conditions: [] actions: - choose: - conditions: - condition: trigger id: - motion-on - door-open - condition: state entity_id: binary_sensor.ds02_contact state: 'on' sequence: - action: light.turn_on target: area_id: laundry - conditions: - condition: trigger id: - motion-of - door-closed sequence: - action: light.turn_off target: area_id: laundry - id: '1112311712098' alias: Bedroom - Lights - Maghrib use_blueprint: path: local/maghrib-lights.yaml input: occupancy_entity: binary_sensor.occupancy_bedroom light_target: - light.esp01_bed_light - light.zss02_l1 - id: '8513465843864' alias: Bedroom - Lights - Occupancy use_blueprint: path: local/occupancy-lights.yaml input: occupancy_entity: binary_sensor.occupancy_bedroom light_target: - light.esp01_bed_light - light.zss02_l1 - id: '8513465843844' alias: Bedroom - Lights - Fajr condition: - condition: state entity_id: binary_sensor.occupancy_bedroom state: 'on' triggers: - platform: sun event: sunrise offset: -00:30:00 action: - action: light.turn_on target: entity_id: light.esp01_bed_light data: transition: 1 brightness_pct: 50 - action: light.turn_off target: entity_id: light.esp01_bed_light data: transition: 1200 - id: '3395120795' alias: Global - Grow Lights mode: single variables: max_attempts: 5 trigger: - platform: sun event: sunrise offset: 01:00:00 id: turn_on - platform: sun event: sunset id: turn_off condition: [] action: - variables: labeled_devices: '{{ label_devices(''Grow Lights'') }}' device_light_entities: "{{ labeled_devices\n | map('device_entities')\n\ \ | sum(start=[])\n | map('expand')\n | sum(start=[])\n |\ \ selectattr('domain', 'eq', 'light')\n | map(attribute='entity_id')\n\ \ | list }}\n" labeled_entities: "{{ expand(label_entities('Grow Lights'))\n | selectattr('domain',\ \ 'eq', 'light')\n | map(attribute='entity_id')\n | list }}\n" grow_light_entities: '{{ (device_light_entities + labeled_entities) | unique }} ' - choose: - conditions: - condition: trigger id: turn_on sequence: - repeat: count: '{{ max_attempts }}' sequence: - service: light.turn_on target: entity_id: "{{ expand(grow_light_entities)\n | selectattr('state',\ \ 'eq', 'off')\n | map(attribute='entity_id')\n | list }}\n" - wait_template: "{{ expand(grow_light_entities)\n | selectattr('state',\ \ 'eq', 'on')\n | list | count == grow_light_entities | count }}\n" timeout: 0:00:10 continue_on_timeout: true - condition: template value_template: "{{ expand(grow_light_entities)\n | selectattr('state',\ \ 'eq', 'on')\n | list | count == grow_light_entities | count }}\n" - stop: All grow lights are on. - delay: 00:05:00 - conditions: - condition: trigger id: turn_off sequence: - repeat: count: '{{ max_attempts }}' sequence: - service: light.turn_off target: entity_id: "{{ expand(grow_light_entities)\n | selectattr('state',\ \ 'eq', 'on')\n | map(attribute='entity_id')\n | list }}\n" - wait_template: "{{ expand(grow_light_entities)\n | selectattr('state',\ \ 'eq', 'off')\n | list | count == grow_light_entities | count }}\n" timeout: 0:00:10 continue_on_timeout: true - condition: template value_template: "{{ expand(grow_light_entities)\n | selectattr('state',\ \ 'eq', 'off')\n | list | count == grow_light_entities | count }}\n" - stop: All grow lights are off. - delay: 00:05:00