- id: '1654820574086'
  alias: 'Motions: Hall-based'
  description: ''
  trigger:
  - type: no_motion
    platform: device
    device_id: 6deb0a6fb7a4a849ba22afc166cf9919
    entity_id: binary_sensor.hall_motions_occupancy
    domain: binary_sensor
    for:
      hours: 0
      minutes: 0
      seconds: 10
    id: Short
  - type: no_motion
    platform: device
    device_id: 6deb0a6fb7a4a849ba22afc166cf9919
    entity_id: binary_sensor.hall_motions_occupancy
    domain: binary_sensor
    for:
      hours: 0
      minutes: 10
      seconds: 0
    id: Toilet
  - type: no_motion
    platform: device
    device_id: 6deb0a6fb7a4a849ba22afc166cf9919
    entity_id: binary_sensor.hall_motions_occupancy
    domain: binary_sensor
    for:
      hours: 0
      minutes: 40
      seconds: 0
    id: Long
  - type: no_motion
    platform: device
    device_id: 6deb0a6fb7a4a849ba22afc166cf9919
    entity_id: binary_sensor.hall_motions_occupancy
    domain: binary_sensor
    for:
      hours: 20
      minutes: 0
      seconds: 0
    id: Away
  condition:
  - condition: state
    entity_id: input_boolean.mode_hall_manual
    state: 'off'
  action:
  - choose:
    - conditions:
      - condition: trigger
        id: Short
      sequence:
      - type: turn_off
        device_id: 87071fc9d8fb9ebbccb145f5642c7404
        entity_id: light.aqara_hub_m1s_426c
        domain: light
      - type: turn_off
        device_id: 5c1c363a6825ad5a006f3bb84bb104ce
        entity_id: switch.hall_lights_left
        domain: switch
      - type: turn_off
        device_id: 07b7086cf34752386c82a5109311ac6e
        entity_id: switch.entrance_lights_center
        domain: switch
    - conditions:
      - condition: trigger
        id: Toilet
      - condition: state
        entity_id: binary_sensor.toilet_motions_occupancy
        state: 'off'
      sequence:
      - type: turn_off
        device_id: 07b7086cf34752386c82a5109311ac6e
        entity_id: switch.entrance_lights_left
        domain: switch
    - conditions:
      - condition: trigger
        id: Long
      sequence:
      - type: turn_off
        device_id: 04c6f563c006599ed7754aba652654ae
        entity_id: switch.bathroom_lights_left
        domain: switch
      - type: turn_off
        device_id: 04c6f563c006599ed7754aba652654ae
        entity_id: switch.bathroom_lights_center
        domain: switch
      - if:
        - condition: state
          entity_id: binary_sensor.motions_kitchen
          state: 'off'
        then:
        - type: turn_off
          device_id: 558ce3c924f9478aad68cb5b98f05ecc
          entity_id: switch.kitchen_lights_left
          domain: switch
        - type: turn_off
          device_id: dd315d1369ab360867d7daba78d2aebd
          entity_id: switch.kitchen_ledlights
          domain: switch
      - if:
        - condition: state
          entity_id: binary_sensor.guestroom_motions_occupancy
          state: 'off'
        - condition: state
          entity_id: input_boolean.mode_guests
          state: 'off'
        then:
        - type: turn_off
          device_id: e83c3f421447fac86b5089fbd286ed43
          entity_id: switch.guestroom_lights_left
          domain: switch
        - type: turn_off
          device_id: e83c3f421447fac86b5089fbd286ed43
          entity_id: switch.guestroom_lights_center
          domain: switch
    default: []
  mode: single
- id: '1654901560778'
  alias: 'Living: Office Light'
  description: ''
  use_blueprint:
    path: lights/light_switch.yaml
    input:
      switch: switch.living_lights_right
      light: light.yeelight_color_0x7caaf86
      dblclick:
      - parallel:
        - service: script.sleep_and_wake
          data:
            mode: hibernate
            target: office
        - service: switch.turn_off
          data: {}
          target:
            entity_id: switch.lights_living
- id: '1654986053564'
  alias: 'Hall: Kitchen LED'
  description: ''
  use_blueprint:
    path: lights/light_switch.yaml
    input:
      switch: switch.kitchen_lights_center
      light: switch.kitchen_ledlights
- id: '1654986378177'
  alias: 'Bedroom: Bulb'
  description: ''
  use_blueprint:
    path: lights/light_switch.yaml
    input:
      switch: switch.bedroom_lights_right
      light: light.smart_light
      dblclick:
      - service: script.turn_off_bedroom_lights
        data: {}
      - type: turn_off
        device_id: bf45f1d630db6e2aa1307866603f548a
        entity_id: light.smart_light
        domain: light
      - service: shell_command.sound_bedroom_off
        data: {}
      off_click:
      - type: turn_off
        device_id: 4ca2827c57a086e0da4d63756b15261b
        entity_id: switch.bedroom_tablelamp
        domain: switch
- id: '1654994043723'
  alias: Aqara Sounds
  description: ''
  trigger:
  - platform: state
    entity_id:
    - input_button.button_alert
    - input_button.button_confirm
    - input_button.button_ring
  condition: []
  action:
  - choose:
    - conditions:
      - condition: template
        value_template: '{{ trigger.entity_id == ''input_button.button_confirm'' }}'
      sequence:
      - service: alarm_control_panel.alarm_arm_night
        data: {}
        target:
          entity_id: alarm_control_panel.aqara_hub_m1s_426c
    - conditions:
      - condition: template
        value_template: '{{ trigger.entity_id == ''input_button.button_ring'' }}'
      sequence:
      - service: alarm_control_panel.alarm_arm_home
        data: {}
        target:
          entity_id: alarm_control_panel.aqara_hub_m1s_426c
      - delay:
          hours: 0
          minutes: 0
          seconds: 5
          milliseconds: 0
    - conditions:
      - condition: template
        value_template: '{{ trigger.entity_id == ''input_button.button_alert'' }}'
      sequence:
      - if:
        - condition: state
          entity_id: input_boolean.mode_production
          state: 'on'
        then:
        - service: alarm_control_panel.alarm_arm_away
          target:
            entity_id: alarm_control_panel.aqara_hub_m1s_426c
        - delay:
            hours: 0
            minutes: 0
            seconds: 15
            milliseconds: 0
        else:
        - service: alarm_control_panel.alarm_arm_home
          target:
            entity_id: alarm_control_panel.aqara_hub_m1s_426c
        - delay:
            hours: 0
            minutes: 0
            seconds: 5
            milliseconds: 0
    default: []
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: alarm_control_panel.alarm_disarm
    data: {}
    target:
      entity_id: alarm_control_panel.aqara_hub_m1s_426c
  mode: single
- id: '1654996443007'
  alias: 'Bedroom: BedSwitch'
  description: ''
  trigger:
  - platform: device
    domain: mqtt
    device_id: f7f321e14489d5f5ef9e332f06055769
    type: action
    subtype: single_left
    discovery_id: 0x54ef4410001b175a action_single_left
    id: left
  - platform: device
    domain: mqtt
    device_id: f7f321e14489d5f5ef9e332f06055769
    type: action
    subtype: single_right
    discovery_id: 0x54ef4410001b175a action_single_right
    id: right
  - platform: device
    domain: mqtt
    device_id: f7f321e14489d5f5ef9e332f06055769
    type: action
    subtype: double_right
    discovery_id: 0x54ef4410001b175a action_double_right
    id: right_dbl
  - platform: device
    domain: mqtt
    device_id: f7f321e14489d5f5ef9e332f06055769
    type: action
    subtype: double_left
    discovery_id: 0x54ef4410001b175a action_double_left
    id: left_dbl
  - platform: device
    domain: mqtt
    device_id: f7f321e14489d5f5ef9e332f06055769
    type: action
    subtype: hold_right
    discovery_id: 0x54ef4410001b175a action_hold_right
    id: right_hold
  - platform: device
    domain: mqtt
    device_id: f7f321e14489d5f5ef9e332f06055769
    type: action
    subtype: hold_left
    discovery_id: 0x54ef4410001b175a action_hold_left
    id: left_hold
  condition: []
  action:
  - choose:
    - conditions:
      - condition: trigger
        id: left
      sequence:
      - if:
        - condition: and
          conditions:
          - condition: state
            entity_id: switch.lights_bedroom
            state: 'off'
          - condition: numeric_state
            entity_id: sensor.bedroom_bedsidelampsocket_power
            below: '2'
        then:
        - parallel:
          - type: turn_on
            device_id: 4ca2827c57a086e0da4d63756b15261b
            entity_id: switch.bedroom_tablelamp
            domain: switch
        else:
        - parallel:
          - service: script.turn_off_bedroom_lights
            data: {}
    - conditions:
      - condition: trigger
        id: left_dbl
      sequence:
      - parallel:
        - service: switch.turn_off
          target:
            entity_id:
            - switch.lights_living
          data: {}
        - service: script.sleep_and_wake
          data:
            mode: hibernate
            target: office
        - if:
          - condition: state
            entity_id: input_boolean.mode_guests
            state: 'off'
          then:
          - service: switch.turn_off
            data: {}
            target:
              entity_id:
              - switch.lights_guest
              - switch.lights_temporary
        - service: input_button.press
          data: {}
          target:
            entity_id: input_button.button_confirm
    - conditions:
      - condition: trigger
        id: left_hold
      sequence:
      - service: script.bedroom_aircon
        data: {}
    - conditions:
      - condition: trigger
        id: right
      sequence:
      - service: shell_command.sound_bedroom_on
        data: {}
      - service: media_player.media_play_pause
        target:
          entity_id: media_player.smartpi
        data: {}
    - conditions:
      - condition: trigger
        id: right_dbl
      sequence:
      - service: script.play_playlist
        data:
          media_player: media_player.smartpi
          playlist: darksoft
    - conditions:
      - condition: trigger
        id: right_hold
      sequence:
      - service: input_button.press
        data: {}
        target:
          entity_id: input_button.button_ring
        enabled: false
      - service: media_player.play_media
        target:
          entity_id: media_player.smartpi
        data:
          media_content_id: media-source://dlna_dms/asgard/:64$0$5$1$0$0
          media_content_type: audio/mpeg
        metadata:
          title: Wish I Had An Angel
          thumbnail:
          media_class: music
          children_media_class:
          navigateIds:
          - {}
          - media_content_type: app
            media_content_id: media-source://dlna_dms
          - media_content_type: channel
            media_content_id: media-source://dlna_dms/asgard/:0
          - media_content_type: object.container.storageFolder
            media_content_id: media-source://dlna_dms/asgard/:64
          - media_content_type: object.container.storageFolder
            media_content_id: media-source://dlna_dms/asgard/:64$0
          - media_content_type: object.container.storageFolder
            media_content_id: media-source://dlna_dms/asgard/:64$0$5
          - media_content_type: object.container.storageFolder
            media_content_id: media-source://dlna_dms/asgard/:64$0$5$1
          - media_content_type: object.container.storageFolder
            media_content_id: media-source://dlna_dms/asgard/:64$0$5$1$0
    default:
    - service: input_button.press
      data: {}
      target:
        entity_id: input_button.button_confirm
  mode: restart
- id: '1655029337428'
  alias: 'Alarms: Safety'
  description: ''
  trigger:
  - type: moist
    platform: device
    device_id: 62b0726b0781074264bd1ba3a69de306
    entity_id: binary_sensor.bathroom_leak_water_leak
    domain: binary_sensor
  - platform: device
    type: turned_on
    device_id: d070cf57873fde4d4eeeed45e0e72f4a
    entity_id: switch.hall_smoke_alarm
    domain: switch
  - type: unsafe
    platform: device
    device_id: a40e83403ac69c75db53e21c88afd53b
    entity_id: binary_sensor.kitchen_gas
    domain: binary_sensor
  condition: []
  action:
  - service: input_button.press
    data: {}
    target:
      entity_id: input_button.button_alert
  - service: notify.mobile_app_lm_g810
    data:
      title: SmartPI Alarm
      message: Safety incidient
  - service: notify.smartpi
    data:
      message: Safety incidient
  mode: single
- id: '1655032416924'
  alias: 'Alarms: Wine Notification'
  description: ''
  trigger:
  - type: opened
    platform: device
    device_id: 1ac71f2a54426da15458e5b5090f7603
    entity_id: binary_sensor.kitchen_door_contact
    domain: binary_sensor
  condition: []
  action:
  - service: input_button.press
    data: {}
    target:
      entity_id: input_button.button_ring
  mode: single
- id: '1655037280868'
  alias: 'Alarms: Door-knock'
  description: ''
  trigger:
  - platform: device
    domain: mqtt
    device_id: 65b9dbde95854b17f5e0e31545962734
    type: action
    subtype: vibration
    discovery_id: 0x00158d0002b310d2 action_vibration
  condition:
  - type: is_no_motion
    condition: device
    device_id: 6deb0a6fb7a4a849ba22afc166cf9919
    entity_id: binary_sensor.hall_motions_occupancy
    domain: binary_sensor
  - type: is_not_open
    condition: device
    device_id: b45b5a514dd669f9f4bb8ebdaa396998
    entity_id: binary_sensor.entrance_door_contact
    domain: binary_sensor
  action:
  - service: input_button.press
    data: {}
    target:
      entity_id: input_button.button_ring
  mode: single
- id: '1655084794489'
  alias: Telegram
  description: ''
  trigger:
  - platform: event
    event_type: telegram_command
  condition: []
  action:
  - choose:
    - conditions:
      - condition: template
        value_template: '{{ trigger.event.data.command == "/office_light" }} '
      sequence:
      - type: toggle
        device_id: 95931a9049849e575f2de543adf111eb
        entity_id: light.yeelight_color_0x7caaf86
        domain: light
    - conditions:
      - condition: template
        value_template: '{{ trigger.event.data.command == "/switch" }} '
      sequence:
      - if:
        - condition: template
          value_template: '{{ trigger.event.data.args|length == 1 }}'
        - condition: template
          value_template: '{{ states(trigger.event.data.args[0]) in ["on", "off",
            "true", "false" ] }}'
        then:
        - service: notify.smartpi
          data:
            message: Toggling entity {{ trigger.event.data.args[0] }} from the current
              state "{{ states(trigger.event.data.args[0]) }}"
        - service: homeassistant.toggle
          target:
            entity_id: '{{ trigger.event.data.args }}'
        else:
          choose:
          - conditions:
            - condition: template
              value_template: '{{ trigger.event.data.args|length != 1 }}'
            sequence:
            - service: notify.smartpi
              data:
                message: 'Wrong number of arguments for /switch command: {{ trigger.event.data.args
                  | length }}'
          - conditions:
            - condition: template
              value_template: '{{ states(trigger.event.data.args[0]) in ["unknown"]
                }}'
            sequence:
            - service: notify.smartpi
              data:
                message: 'Unknown entity: {{ trigger.event.data.args[0] }}'
          default:
          - service: notify.smartpi
            data:
              message: 'Entity {{ trigger.event.data.args[0] }} is in unsupported
                state: {{ states(trigger.event.data.args) }}'
    - conditions:
      - condition: template
        value_template: '{{ trigger.event.data.command == "/camera" }} '
      sequence:
      - choose:
        - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.args|length == 1 }}'
          - condition: template
            value_template: '{{ trigger.event.data.args[0] in ["hall", "aubergine",
              "aubergineview" ] }}'
          sequence:
          - service: telegram_bot.send_photo
            data:
              disable_notification: true
              caption: AubergineView
              url: http://smartpi:8123{{ state_attr("camera.192_168_50_51", "entity_picture")
                }}
        - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.args|length == 1 }}'
          - condition: template
            value_template: '{{ trigger.event.data.args[0] in ["door", "peep", "peepview"
              ] }}'
          sequence:
          - service: telegram_bot.send_photo
            data:
              disable_notification: true
              caption: PeepView
              url: http://smartpi:8123{{ state_attr("camera.192_168_50_132",  "entity_picture")
                }}
        - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.args|length == 1 }}'
          - condition: template
            value_template: '{{ trigger.event.data.args[0] in ["kitchen", "oven",
              "kitchenview", "ovenview" ] }}'
          sequence:
          - service: telegram_bot.send_photo
            data:
              disable_notification: true
              caption: OvenView
              url: http://smartpi:8123{{ state_attr("camera.ovenview", "entity_picture")
                }}
        - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.args|length == 0 }}'
          sequence:
          - service: telegram_bot.send_photo
            data:
              disable_notification: true
              caption: PeepView
              url: http://smartpi:8123{{ state_attr("camera.192_168_50_132",  "entity_picture")
                }}
          - service: telegram_bot.send_photo
            data:
              disable_notification: true
              caption: OvenView
              url: http://smartpi:8123{{ state_attr("camera.ovenview", "entity_picture")
                }}
          - service: telegram_bot.send_photo
            data:
              disable_notification: true
              caption: AubergineView
              url: http://smartpi:8123{{ state_attr("camera.192_168_50_51", "entity_picture")
                }}
        default:
        - service: notify.smartpi
          data:
            message: 'Unknown camera: {{ trigger.event.data.args[0] }}'
    - conditions:
      - condition: template
        value_template: '{{ trigger.event.data.command == "/open" }} '
      sequence:
      - choose:
        - conditions:
          - condition: or
            conditions:
            - condition: template
              value_template: '{{ trigger.event.data.args|length == 0 }}'
            - condition: and
              conditions:
              - condition: template
                value_template: '{{ trigger.event.data.args|length == 1 }}'
              - condition: template
                value_template: '{{ trigger.event.data.args[0] in ["h24", "halabyan24",
                  "building", "home" ] }}'
          sequence:
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.hall_speakerphone
          - service: notify.smartpi
            data:
              message: Openning Halabyan 24 building door
        default:
        - service: notify.smartpi
          data:
            message: 'Unknown lock: {{ trigger.event.data.args[0] }}'
    default:
    - service: notify.smartpi
      data:
        message: 'Unsupported command: {{ trigger.event.data.command }} with params:
          {{ trigger.event.data.args }}'
  mode: single
- id: '1672608894803'
  alias: 'Hall: Hall Camera Switch'
  description: ''
  use_blueprint:
    path: lights/light_switch.yaml
    input:
      switch: switch.hall_lights_center
      light: switch.hall_camera
- id: '1672624569107'
  alias: 'Hall: Entrance Combo'
  description: ''
  use_blueprint:
    path: lights/light_switch_combo.yaml
    input:
      switch: switch.entrance_lights_right
      master: switch.hall_lights_left
      on_click: []
      off_click: []
      dblclick:
      - service: switch.turn_on
        target:
          entity_id: switch.hall_lights_right
        data: {}
        enabled: false
      - service: script.sleep_and_wake
        data:
          mode: sleep
          target: house
      - if:
        - condition: state
          entity_id: binary_sensor.balcony_doors
          state: 'on'
        then:
        - service: light.turn_on
          target:
            entity_id: light.aqara_hub_m1s_426c
          data:
            brightness: 100
            rgb_color:
            - 255
            - 0
            - 0
        - service: input_button.press
          data: {}
          target:
            entity_id: input_button.button_confirm
        else:
        - service: light.turn_on
          target:
            entity_id: light.aqara_hub_m1s_426c
          data:
            brightness: 100
            rgb_color:
            - 0
            - 255
            - 0
      - delay:
          hours: 0
          minutes: 0
          seconds: 30
          milliseconds: 0
      - service: light.turn_off
        target:
          entity_id: light.aqara_hub_m1s_426c
- id: '1672627582279'
  alias: 'Hall: Kitchen Combo'
  description: ''
  use_blueprint:
    path: lights/light_switch_combo.yaml
    input:
      switch: switch.kitchen_lights_right
      master: switch.hall_lights_left
      on_click: []
      off_click:
      - service: switch.turn_off
        data: {}
        target:
          entity_id:
          - switch.entrance_lights_center
      dblclick:
      - service: switch.toggle
        target:
          entity_id:
          - switch.entrance_lights_center
        data: {}
- id: '1672629824242'
  alias: 'Hall: Hall Away/Security Mode Switch'
  description: ''
  use_blueprint:
    path: lights/light_switch.yaml
    input:
      switch: switch.hall_lights_right
      light: input_boolean.mode_away
      delay: 0
      on_click:
      - service: input_button.press
        data: {}
        target:
          entity_id: input_button.button_confirm
      post_action: []
- id: '1672638756112'
  alias: 'Alarms: Intrusion'
  description: ''
  use_blueprint:
    path: camera/intrusion.yaml
    input:
      mode: input_boolean.mode_away
      arm_delay: 15
      disarm_delay: 5
      sensors:
      - binary_sensor.entrance_door_contact
      - binary_sensor.hall_motions_occupancy
      - switch.lights_bedroom
      - switch.lights_living
      camera_script:
      - service: script.1672637427937
        data: {}
      script:
      - parallel:
        - service: input_button.press
          data: {}
          target:
            entity_id: input_button.button_alert
        - service: notify.mobile_app_lm_g810
          data:
            title: SmartPI Alarm
            message: Intrusion detected
        - service: notify.smartpi
          data:
            message: Intrusion detected
- id: '1672677604586'
  alias: 'Guestroom: Mode switch'
  description: ''
  use_blueprint:
    path: lights/light_switch.yaml
    input:
      switch: switch.guestroom_lights_right
      light: input_boolean.mode_guests
      on_click:
      - service: input_button.press
        data: {}
        target:
          entity_id: input_button.button_confirm
- id: '1672972431474'
  alias: 'Office: Knob Office Bulb Control'
  description: ''
  use_blueprint:
    path: lights/knob-bulb-control.yaml
    input:
      light: light.yeelight_color_0x7caaf86
      knob: sensor.office_knob_action
      toggle:
      - if:
        - condition: state
          entity_id: switch.living_tablelampsocket
          state: 'on'
        then:
        - service: switch.turn_off
          data: {}
          target:
            entity_id: switch.lights_living_lustre
      - service: switch.toggle
        data: {}
        target:
          entity_id: switch.living_tablelampsocket
      brightness: input_number.knob_office_brightness0
      temperature: input_number.knob_office_temperature0
      hue: input_number.knob_office_hue0
      state: input_boolean.state_office_knob_pressed
- id: '1672979291802'
  alias: 'Office: Knob Multi-Bulb Control'
  description: ''
  use_blueprint:
    path: lights/knob-multi-bulb-control.yaml
    input:
      knob: sensor.office_knob_action
      lights:
      - light.yeelight_color_0x7caaf86
      - light.smart_light
- id: '1672987670623'
  alias: 'Office: Dimming Button'
  description: ''
  use_blueprint:
    path: lights/light_button.yaml
    input:
      button: sensor.office_button_action
      light: light.yeelight_color_0x7caaf86
      on_click:
      - service: homeassistant.turn_off
        data: {}
        target:
          entity_id: switch.lights_living_lustre
      dblclick:
      - if:
        - condition: state
          entity_id: switch.lights_living_lustre
          state: 'on'
        then:
        - service: switch.turn_off
          target:
            entity_id: switch.living_tablelampsocket
      - service: homeassistant.toggle
        data: {}
        target:
          entity_id: switch.lights_living_lustre
      hold_delay: 500
      state: input_boolean.state_office_button_pressed
      hold:
      - device_id: 95931a9049849e575f2de543adf111eb
        domain: light
        entity_id: light.yeelight_color_0x7caaf86
        type: brightness_decrease
- id: '1672989606410'
  alias: 'Office: Button'
  description: ''
  use_blueprint:
    path: lights/light_button.yaml
    input:
      button: sensor.office_button_action
      light: light.yeelight_color_0x7caaf86
      on_click:
      - if:
        - condition: state
          entity_id: switch.living_tablelampsocket
          state: 'on'
        then:
        - service: switch.turn_off
          data: {}
          target:
            entity_id: switch.living_tablelampsocket
        else:
        - if:
          - condition: state
            entity_id: switch.smart_power_strip_pro_socket_2
            state: 'off'
          then:
          - parallel:
            - service: script.sleep_and_wake
              data:
                mode: wake
                target: office
            - if:
              - condition: numeric_state
                entity_id: sun.sun
                attribute: elevation
                below: '5'
              then:
              - service: script.turn_on_office_lights
                data: {}
          else:
          - service: script.turn_on_office_lights
            data: {}
      off_click:
      - service: switch.turn_on
        data: {}
        target:
          entity_id: switch.living_tablelampsocket
      dblclick:
      - if:
        - condition: state
          entity_id: switch.lights_living_lustre
          state: 'on'
        then:
        - service: switch.turn_off
          target:
            entity_id: switch.living_tablelampsocket
      - service: homeassistant.toggle
        data: {}
        target:
          entity_id: switch.lights_living_lustre
      hold_delay: 500
      hold: []
      longclick:
      - if:
        - condition: state
          entity_id: switch.smart_power_strip_pro_socket_2
          state: 'off'
        then:
        - service: script.sleep_and_wake
          data:
            mode: wake
            target: office
        else:
        - parallel:
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.lights_temporary
          - if:
            - condition: state
              entity_id: input_boolean.mode_alone
              state: 'on'
            then:
            - service: script.turn_off_bedroom_lights
              data: {}
          - if:
            - condition: state
              entity_id: input_boolean.mode_guests
              state: 'off'
            then:
            - service: switch.turn_off
              data: {}
              target:
                entity_id: switch.lights_guest
        - service: input_button.press
          target:
            entity_id: input_button.button_confirm
          data: {}
      temperature: 4500
      on_light: 'no'
- id: '1672991247298'
  alias: 'Living: Light Sync'
  description: ''
  use_blueprint:
    path: lights/light_sync.yaml
    input:
      master: switch.living_lights_left
      slave: switch.living_lights_center
- id: '1672991298090'
  alias: 'Bedroom: Light Sync'
  description: ''
  use_blueprint:
    path: lights/light_sync.yaml
    input:
      master: switch.bedroom_lights_left
      slave: switch.bedroom_lights_center
- id: '1673021522642'
  alias: 'Motions: Kitchen'
  description: ''
  use_blueprint:
    path: motion/motion_switch.yaml
    input:
      light_target:
      - switch.kitchen_lights_left
      - switch.kitchen_ledlights
      motion_entity: binary_sensor.motions_kitchen
      illumination_test: sensor
      illuminance_entity: sensor.kitchen_motions_illuminance_lux
      lux_threshold: 60
- id: '1673037015865'
  alias: 'Motions: Night Light'
  description: ''
  use_blueprint:
    path: motion/motion_switch.yaml
    input:
      light_target: []
      motion_entity: binary_sensor.hall_motions_occupancy
      illumination_test: sun
      illuminance_entity: sensor.hall_motions_illuminance_lux
      lux_threshold: 30
      no_motion_wait: 5
      on_click:
      - if:
        - condition: state
          entity_id: input_boolean.mode_away
          state: 'off'
        - condition: state
          entity_id: input_boolean.mode_alone
          state: 'on'
        - condition: state
          entity_id: input_boolean.mode_bright
          state: 'on'
        then:
        - type: turn_on
          device_id: 5c1c363a6825ad5a006f3bb84bb104ce
          entity_id: switch.hall_lights_left
          domain: switch
        else:
        - type: turn_on
          device_id: 87071fc9d8fb9ebbccb145f5642c7404
          entity_id: light.aqara_hub_m1s_426c
          domain: light
          brightness_pct: 100
      off_click:
      - parallel:
        - if:
          - condition: state
            entity_id: input_boolean.mode_hall_manual
            state: 'off'
          then:
          - type: turn_off
            device_id: 5c1c363a6825ad5a006f3bb84bb104ce
            entity_id: switch.hall_lights_left
            domain: switch
        - type: turn_off
          device_id: 87071fc9d8fb9ebbccb145f5642c7404
          entity_id: light.aqara_hub_m1s_426c
          domain: light
      door_entity:
      - binary_sensor.entrance_door_contact
- id: '1673153262822'
  alias: 'Motions: Global v1'
  description: ''
  trigger:
  - platform: state
    id: home
    entity_id:
    - group.master_phones
    from: not_home
    to: home
    for:
      hours: 0
      minutes: 1
      seconds: 0
  - platform: state
    id: away
    entity_id:
    - group.master_phones
    from: home
    to: not_home
    for:
      hours: 1
      minutes: 0
      seconds: 0
  - type: no_motion
    platform: device
    device_id: 6deb0a6fb7a4a849ba22afc166cf9919
    entity_id: binary_sensor.hall_motions_occupancy
    domain: binary_sensor
    for:
      hours: 24
      minutes: 0
      seconds: 0
    id: empty_day
  - type: no_motion
    platform: device
    device_id: 6deb0a6fb7a4a849ba22afc166cf9919
    entity_id: binary_sensor.hall_motions_occupancy
    domain: binary_sensor
    for:
      hours: 120
      minutes: 0
      seconds: 0
    id: empty_week
  - type: motion
    platform: device
    device_id: 6deb0a6fb7a4a849ba22afc166cf9919
    entity_id: binary_sensor.hall_motions_occupancy
    domain: binary_sensor
    for:
      hours: 0
      minutes: 1
      seconds: 0
    id: motions
  - platform: state
    entity_id:
    - input_boolean.mode_away
    from: 'on'
    to: 'off'
    id: away_gone
  condition: []
  action:
  - choose:
    - conditions:
      - condition: state
        entity_id: input_boolean.mode_house_sleep
        state: 'off'
      - condition: or
        conditions:
        - condition: trigger
          id: empty_day
        - condition: and
          conditions:
          - condition: trigger
            id: away
          - condition: state
            entity_id: input_boolean.mode_alone
            state: 'on'
          - condition: state
            entity_id: binary_sensor.hall_motions_occupancy
            state: 'off'
            for:
              hours: 2
              minutes: 0
              seconds: 0
      sequence:
      - service: script.sleep_and_wake
        data:
          mode: sleep
          target: house
      - service: input_boolean.turn_on
        data: {}
        target:
          entity_id: input_boolean.mode_house_sleep
    - conditions:
      - condition: trigger
        id: empty_week
      - condition: state
        entity_id: input_boolean.mode_house_hibernate
        state: 'off'
      sequence:
      - service: script.sleep_and_wake
        data:
          mode: hibernate
          target: house
      - service: input_boolean.turn_on
        data: {}
        target:
          entity_id: input_boolean.mode_house_hibernate
    - conditions:
      - condition: trigger
        id: home
      sequence:
      - service: switch.turn_off
        data: {}
        target:
          entity_id: switch.hall_lights_right
    - conditions:
      - condition: or
        conditions:
        - condition: state
          entity_id: input_boolean.mode_house_sleep
          state: 'on'
        - condition: state
          entity_id: input_boolean.mode_house_hibernate
          state: 'on'
      - condition: or
        conditions:
        - condition: and
          conditions:
          - condition: trigger
            id: motions
          - condition: state
            entity_id: input_boolean.mode_away
            state: 'off'
        - condition: and
          conditions:
          - condition: trigger
            id: away_gone
          - type: is_motion
            condition: device
            device_id: 6deb0a6fb7a4a849ba22afc166cf9919
            entity_id: binary_sensor.hall_motions_occupancy
            domain: binary_sensor
      sequence:
      - if:
        - condition: state
          entity_id: input_boolean.mode_house_hibernate
          state: 'on'
        then:
        - service: script.sleep_and_wake
          data:
            mode: wake
            target: house
      - service: input_boolean.turn_off
        data: {}
        target:
          entity_id:
          - input_boolean.mode_house_sleep
          - input_boolean.mode_house_hibernate
    default: []
  mode: single
- id: '1673156009695'
  alias: 'Motions: Office'
  description: ''
  trigger:
  - type: no_motion
    platform: device
    device_id: 6deb0a6fb7a4a849ba22afc166cf9919
    entity_id: binary_sensor.hall_motions_occupancy
    domain: binary_sensor
    for:
      hours: 2
      minutes: 0
      seconds: 0
    id: sleep
  condition:
  - type: is_not_present
    condition: device
    device_id: 363c35226e1deea236d4a555c465522d
    entity_id: binary_sensor.presence_presence
    domain: binary_sensor
    for:
      hours: 0
      minutes: 5
      seconds: 0
  action:
  - choose:
    - conditions:
      - condition: trigger
        id: sleep
      - condition: state
        entity_id: switch.smart_power_strip_pro_socket_2
        state: 'on'
      sequence:
      - service: script.sleep_and_wake
        data:
          mode: sleep
          target: office
    default: []
  mode: single
- id: '1673156130994'
  alias: 'Hall: Kitchen Sync'
  description: ''
  trigger:
  - platform: device
    type: changed_states
    device_id: 558ce3c924f9478aad68cb5b98f05ecc
    entity_id: switch.kitchen_lights_left
    domain: switch
  condition: []
  action:
  - if:
    - condition: state
      entity_id: switch.kitchen_lights_left
      state: 'on'
    then:
    - type: turn_on
      device_id: dd315d1369ab360867d7daba78d2aebd
      entity_id: switch.kitchen_ledlights
      domain: switch
    else:
    - type: turn_off
      device_id: dd315d1369ab360867d7daba78d2aebd
      entity_id: switch.kitchen_ledlights
      domain: switch
  mode: single
- id: '1673212686198'
  alias: 'Office: Sven'
  description: ''
  trigger:
  - platform: state
    entity_id:
    - switch.smart_power_strip_pro_socket_4
    from: 'off'
    to: 'on'
    for:
      hours: 0
      minutes: 0
      seconds: 4
  condition: []
  action:
  - service: scene.turn_on
    data: {}
    target:
      entity_id: scene.sven_power_switch
  mode: single
- id: '1673329841884'
  alias: 'Motions: Toilet'
  description: ''
  use_blueprint:
    path: motion/occupancy_tracking.yaml
    input:
      occupancy: input_boolean.occupancy_toilet
      entrance: binary_sensor.toilet_door_contact
      inside: binary_sensor.toilet_motions_occupancy
      light: switch.entrance_lights_left
      on_action:
      - type: turn_on
        device_id: 07b7086cf34752386c82a5109311ac6e
        entity_id: switch.entrance_lights_left
        domain: switch
      reentry_wait: 10
      reentry_timeout: 45
- id: '1673331563280'
  alias: 'Motions: Bathroom'
  description: ''
  use_blueprint:
    path: motion/occupancy_tracking.yaml
    input:
      entrance: binary_sensor.bathroom_motions_occupancy
      inside: binary_sensor.bathroom_motions_occupancy
      light: switch.bathroom_lights_left
      occupancy: input_boolean.occupancy_bathroom
      on_action:
      - type: turn_on
        device_id: 04c6f563c006599ed7754aba652654ae
        entity_id: switch.bathroom_lights_left
        domain: switch
      reentry_wait: 5
      reentry_timeout: 45
- id: '1674140368136'
  alias: 'Office: Sven Scene Switch'
  description: ''
  use_blueprint:
    path: media/sven_scene_switch.yaml
    input:
      switch_action: sensor.living_scene_switch_action
      media_player: media_player.smartpi
      playlist_control: input_number.smartpi_playlist
      power_scene: scene.sven_power_switch
- id: '1674146213954'
  alias: 'Motions: Global v2'
  description: ''
  use_blueprint:
    path: motion/halabyan24.yaml
- id: '1674208339037'
  alias: 'Office: Knob Sound-Bulb Control'
  description: ''
  use_blueprint:
    path: lights/knob-sound-multi-bulb-control.yaml
    input:
      knob: sensor.office_knob_action
      lights:
      - light.yeelight_color_0x7caaf86
      media_player: media_player.smartpi
      toggle_actions:
      - choose:
        - conditions:
          - condition: template
            value_template: '{{ current_num == 0 }}'
          sequence:
          - if:
            - condition: state
              entity_id: switch.living_tablelampsocket
              state: 'on'
            then:
            - service: switch.turn_off
              data: {}
              target:
                entity_id: switch.lights_living_lustre
              enabled: false
          - service: switch.toggle
            target:
              entity_id: switch.living_tablelampsocket
            data: {}
        default: []
- id: '1674510035217'
  alias: 'Network: Backup'
  description: ''
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.network_route_vivacell
    to: 'on'
  condition: []
  action:
  - service: notify.notify
    data:
      message: Connected via Vivacell
  mode: single
- id: '1680824553612'
  alias: 'Motions: Bedroom'
  description: ''
  use_blueprint:
    path: motion/motion_switch.yaml
    input:
      light_target:
      - switch.bedroom_lights_left
      - switch.bedroom_lights_center
      motion_entity: binary_sensor.bedroom_motions_occupancy
      illumination_test: sun
      illuminance_entity: sensor.kitchen_motions_illuminance_lux
      lux_threshold: 60
      no_motion_wait: 60
      on_cond_should_be_off:
      - switch.lights_bedroom
      on_cond_should_be_on:
      - binary_sensor.hall_motions_occupancy
      off_cond_should_be_off:
      - switch.lights_bedroom
      on_click:
      - service: automation.turn_on
        data: {}
        target:
          entity_id: automation.motions_bedroom_from_hall
- id: '1680827972411'
  alias: 'Motions: Guestroom'
  description: ''
  use_blueprint:
    path: motion/motion_switch.yaml
    input:
      light_target:
      - switch.guestroom_lights_left
      - switch.guestroom_lights_center
      motion_entity: binary_sensor.guestroom_motions_occupancy
      illumination_test: sun
      illuminance_entity: sensor.kitchen_motions_illuminance_lux
      lux_threshold: 60
      no_motion_wait: 60
      on_cond_should_be_off:
      - switch.lights_guest
      off_cond_should_be_off:
      - input_boolean.mode_hall_manual
- id: '1680829267506'
  alias: 'Motions: Living'
  description: ''
  use_blueprint:
    path: motion/motion_switch.yaml
    input:
      light_target:
      - switch.living_lights_left
      - switch.living_lights_center
      motion_entity: binary_sensor.presence_presence
      illumination_test: sun
      illuminance_entity: sensor.kitchen_motions_illuminance_lux
      lux_threshold: 60
      no_motion_wait: 1200
      on_cond_should_be_off:
      - switch.lights_living
      on_cond_should_be_on:
      - binary_sensor.hall_motions_occupancy
- id: '1680830396231'
  alias: 'Motions: Living Office Wakeup'
  description: ''
  use_blueprint:
    path: motion/motion_switch.yaml
    input:
      light_target: []
      motion_entity: binary_sensor.presence_presence
      illumination_test: none
      illuminance_entity: sensor.presence_illuminance_lux
      lux_threshold: 60
      on_click:
      - parallel:
        - service: script.sleep_and_wake
          data:
            mode: wake
            target: office
        - service: media_player.media_play
          target:
            entity_id: media_player.smartpi
          data: {}
        - service: shell_command.sound_living
          data: {}
      off_click:
      - parallel:
        - service: script.sleep_and_wake
          data:
            mode: hibernate
            target: office
        - service: switch.turn_off
          data: {}
          target:
            entity_id: switch.lights_living
      no_motion_wait: 2400
      on_cond_should_be_on:
      - binary_sensor.hall_motions_occupancy
      - input_boolean.mode_office_sleep
      off_cond_should_be_off:
      - binary_sensor.hall_motions_occupancy
- id: '1680918876959'
  alias: Modes
  description: ''
  trigger:
  - platform: state
    entity_id:
    - input_boolean.mode_alone
    id: alone
  - platform: state
    entity_id:
    - input_boolean.mode_guests
    id: guests
  condition: []
  action:
  - choose:
    - conditions:
      - condition: trigger
        id: guests
      - condition: state
        entity_id: input_boolean.mode_guests
        state: 'on'
      sequence:
      - service: automation.turn_off
        data: {}
        target:
          entity_id: automation.motions_guestroom
    - conditions:
      - condition: trigger
        id: guests
      - condition: state
        entity_id: input_boolean.mode_guests
        state: 'off'
      sequence:
      - service: automation.turn_on
        data: {}
        target:
          entity_id: automation.motions_guestroom
    - conditions:
      - condition: trigger
        id: alone
      - condition: state
        entity_id: input_boolean.mode_alone
        state: 'on'
      sequence:
      - parallel:
        - service: automation.turn_on
          data: {}
          target:
            entity_id:
            - automation.motions_bedroom_v2
    - conditions:
      - condition: trigger
        id: alone
      - condition: state
        entity_id: input_boolean.mode_alone
        state: 'off'
      sequence:
      - parallel:
        - service: input_boolean.turn_on
          data: {}
          target:
            entity_id: input_boolean.mode_multiroom_manual
        - service: automation.turn_off
          data: {}
          target:
            entity_id:
            - automation.motions_bedroom_v2
- id: '1680923844207'
  alias: 'Motions: Bedroom from Hall'
  description: ''
  trigger:
  - type: no_motion
    platform: device
    device_id: 6deb0a6fb7a4a849ba22afc166cf9919
    entity_id: binary_sensor.hall_motions_occupancy
    domain: binary_sensor
    for:
      hours: 0
      minutes: 0
      seconds: 30
  condition:
  - condition: state
    entity_id: input_boolean.mode_alone
    state: 'on'
  - condition: state
    entity_id:
    - binary_sensor.bedroom_bedsidelamp
    - switch.bedroom_tablelamp
    - switch.bedroom_lights_right
    state: 'off'
  - condition: state
    entity_id:
    - binary_sensor.bedroom_motions_occupancy
    - binary_sensor.bedroom_presence_presence
    state: 'off'
    for:
      hours: 0
      minutes: 0
      seconds: 20
  action:
  - service: homeassistant.turn_off
    data: {}
    target:
      entity_id: switch.lights_bedroom
  - service: automation.turn_off
    data:
      stop_actions: false
    target:
      entity_id: automation.motions_bedroom_from_hall
  mode: single
- id: '1681005500468'
  alias: 'Bedroom: Switch3'
  description: ''
  trigger:
  - platform: device
    domain: mqtt
    device_id: dd15920a1e112dc1f45e5dd497aa3939
    type: action
    subtype: 1_single
    discovery_id: 0x70ac08fffe419fa1 action_1_single
    id: left1
  - platform: device
    domain: mqtt
    device_id: dd15920a1e112dc1f45e5dd497aa3939
    type: action
    subtype: 2_single
    discovery_id: 0x70ac08fffe419fa1 action_2_single
    id: center1
  - platform: device
    domain: mqtt
    device_id: dd15920a1e112dc1f45e5dd497aa3939
    type: action
    subtype: 3_single
    discovery_id: 0x70ac08fffe419fa1 action_3_single
    id: right1
  - platform: device
    domain: mqtt
    device_id: dd15920a1e112dc1f45e5dd497aa3939
    type: action
    subtype: 1_double
    discovery_id: 0x70ac08fffe419fa1 action_1_double
    id: left2
  - platform: device
    domain: mqtt
    device_id: dd15920a1e112dc1f45e5dd497aa3939
    type: action
    subtype: 2_double
    discovery_id: 0x70ac08fffe419fa1 action_2_double
    id: center2
  - platform: device
    domain: mqtt
    device_id: dd15920a1e112dc1f45e5dd497aa3939
    type: action
    subtype: 3_double
    discovery_id: 0x70ac08fffe419fa1 action_3_double
    id: right2
  - platform: device
    domain: mqtt
    device_id: dd15920a1e112dc1f45e5dd497aa3939
    type: action
    subtype: 1_hold
    discovery_id: 0x70ac08fffe419fa1 action_1_hold
    id: left3
  - platform: device
    domain: mqtt
    device_id: dd15920a1e112dc1f45e5dd497aa3939
    type: action
    subtype: 2_hold
    discovery_id: 0x70ac08fffe419fa1 action_2_hold
    id: center3
  - platform: device
    domain: mqtt
    device_id: dd15920a1e112dc1f45e5dd497aa3939
    type: action
    subtype: 3_hold
    discovery_id: 0x70ac08fffe419fa1 action_3_hold
    id: right3
  condition: []
  action:
  - choose:
    - conditions:
      - condition: trigger
        id: left1
      sequence:
      - service: homeassistant.toggle
        data: {}
        target:
          entity_id:
          - switch.bedroom_tablelamp
    - conditions:
      - condition: trigger
        id: left2
      sequence:
      - service: homeassistant.toggle
        data: {}
        target:
          entity_id:
          - switch.bedroom_lights_left
    - conditions:
      - condition: trigger
        id: left3
      sequence:
      - service: homeassistant.toggle
        data: {}
        target:
          entity_id:
          - light.smart_light
    - conditions:
      - condition: trigger
        id: center1
      sequence:
      - if:
        - condition: device
          device_id: 8ea1ddea398d0a1bcbef996a9fdc06c5
          domain: media_player
          entity_id: media_player.smartpi
          type: is_playing
        then:
        - service: shell_command.sound_bedroom_off
          data: {}
        else:
        - service: shell_command.sound_bedroom_on
          data: {}
      - service: media_player.media_play_pause
        target:
          entity_id: media_player.smartpi
        data: {}
    - conditions:
      - condition: trigger
        id: center2
      sequence:
      - service: media_player.media_next_track
        data: {}
        target:
          entity_id: media_player.smartpi
    - conditions:
      - condition: trigger
        id: center3
      sequence:
      - service: script.play_playlist
        data:
          media_player: media_player.smartpi
          playlist: darksoft
    default:
    - service: input_button.press
      data: {}
      target:
        entity_id: input_button.button_confirm
  mode: single
- id: '1686356828884'
  alias: 'Motions: Kitchen Music'
  description: ''
  trigger:
  - type: motion
    platform: device
    device_id: c021c60965f213e2de888cadc3c48a8a
    entity_id: binary_sensor.kitchen_motions_occupancy
    domain: binary_sensor
    id: 'on'
  - type: no_motion
    platform: device
    device_id: c021c60965f213e2de888cadc3c48a8a
    entity_id: binary_sensor.kitchen_motions_occupancy
    domain: binary_sensor
    for:
      hours: 0
      minutes: 4
      seconds: 0
    id: 'off'
  - type: not_present
    platform: device
    device_id: f669195bbff38ba24c6cbe552fc9f180
    entity_id: binary_sensor.bedroom_presence_presence
    domain: binary_sensor
    for:
      hours: 0
      minutes: 2
      seconds: 0
    id: bedroom
  condition:
  - condition: state
    entity_id: input_boolean.mode_multiroom_manual
    state: 'off'
  action:
  - choose:
    - conditions:
      - condition: trigger
        id: 'on'
      sequence:
        service: shell_command.sound_kitchen_on
        data: {}
    - conditions:
      - condition: trigger
        id: 'off'
      sequence:
      - if:
        - condition: state
          entity_id: binary_sensor.presence_multiroom_sound
          state: 'off'
        then:
        - service: shell_command.sound_kitchen_off
          data: {}
    - conditions:
      - condition: trigger
        id: bedroom
      sequence:
      - if:
        - condition: state
          entity_id: binary_sensor.presence_multiroom_sound
          state: 'off'
        then:
        - service: shell_command.sound_bedroom_off
          data: {}
  mode: single
- id: '1686359598932'
  alias: 'Hall: Kitchen Music'
  description: ''
  use_blueprint:
    path: lights/light_switch.yaml
    input:
      switch: switch.kitchen_lights_center
      light: switch.lights_dummy
      on_click:
      - service: shell_command.sound_kitchen_on
        data: {}
      off_click:
      - service: shell_command.sound_kitchen_off
        data: {}
      dblclick:
      - service: input_boolean.turn_on
        data: {}
        target:
          entity_id: input_boolean.mode_multiroom_manual
- id: '1686693695647'
  alias: 'Motions: Bedroom v2'
  description: ''
  use_blueprint:
    path: motion/presence_switch.yaml
    input:
      light_target:
      - switch.bedroom_lights_left
      - switch.bedroom_lights_center
      motion_entity: binary_sensor.bedroom_motions_occupancy
      presence_entity: binary_sensor.bedroom_presence_presence
      illumination_test: sun
      illuminance_entity: sensor.kitchen_motions_illuminance_lux
      lux_threshold: 60
      no_motion_wait: 300
      on_cond_should_be_off:
      - switch.lights_bedroom
      on_cond_should_be_on:
      - binary_sensor.hall_motions_occupancy
      off_cond_should_be_off: []
      on_click:
      - service: automation.turn_on
        data: {}
        target:
          entity_id: automation.motions_bedroom_from_hall
      off_click:
      - service: script.turn_off_bedroom_lights
        data: {}
      off_cond_should_be_on:
      - switch.lights_bedroom
      - switch.lights_bedroom_manual
- id: '1686879286738'
  alias: Time
  description: ''
  trigger:
  - platform: time
    at: '11:00:00'
    id: morning
  - platform: time
    at: '21:00:00'
    id: evening
  condition: []
  action:
  - choose:
    - conditions:
      - condition: trigger
        id: morning
      sequence:
      - parallel:
        - if:
          - condition: state
            entity_id: input_boolean.mode_alone
            state: 'on'
          then:
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id: input_boolean.mode_multiroom_manual
    - conditions:
      - condition: trigger
        id: evening
      sequence:
      - parallel:
        - service: input_boolean.turn_on
          data: {}
          target:
            entity_id: input_boolean.mode_multiroom_manual
  mode: single
- id: '1687120402112'
  alias: 'Hall: Hall Manual Mode'
  description: ''
  use_blueprint:
    path: lights/light_switch.yaml
    input:
      switch: switch.hall_lights_center
      light: input_boolean.mode_hall_manual
      delay: 0
      on_click:
      - service: switch.turn_on
        data: {}
        target:
          entity_id:
          - switch.entrance_lights_center
          - switch.hall_lights_left
      post_action: []
- id: '1687206114066'
  alias: Speakerphone
  description: ''
  trigger:
  - platform: device
    type: turned_on
    device_id: 529c8fc6c1f99633f26bb254c97f2ab7
    entity_id: switch.hall_speakerphone
    domain: switch
    for:
      hours: 0
      minutes: 0
      seconds: 40
  condition: []
  action:
  - type: turn_off
    device_id: 529c8fc6c1f99633f26bb254c97f2ab7
    entity_id: switch.hall_speakerphone
    domain: switch
  mode: single
- id: '1687208079529'
  alias: 'Motions: Bedroom AirCon'
  description: ''
  trigger:
  - type: not_present
    platform: device
    device_id: f669195bbff38ba24c6cbe552fc9f180
    entity_id: binary_sensor.bedroom_presence_presence
    domain: binary_sensor
    for:
      hours: 0
      minutes: 30
      seconds: 0
  condition: []
  action:
  - service: scene.turn_on
    target:
      entity_id: scene.hyundai_aircon2_off
    metadata: {}
  mode: single
- id: '1687227285061'
  alias: 'Hall: Hall Camera '
  description: ''
  trigger:
  - platform: state
    entity_id:
    - input_boolean.mode_away
  condition: []
  action:
  - choose:
    - conditions:
      - condition: state
        entity_id: input_boolean.mode_away
        state: 'on'
      sequence:
      - parallel:
        - type: turn_on
          device_id: 26d4f61d01f392350cd4375fcc3dbf50
          entity_id: switch.hall_camera
          domain: switch
    - conditions:
      - condition: state
        entity_id: input_boolean.mode_away
        state: 'off'
      sequence:
      - parallel:
        - type: turn_off
          device_id: 26d4f61d01f392350cd4375fcc3dbf50
          entity_id: switch.hall_camera
          domain: switch
  mode: single
- id: '1687256985181'
  alias: Power Outtage
  description: ''
  trigger:
  - platform: state
    entity_id:
    - switch.hall_camera
    from: unavailable
    id: hall_camera
    for:
      hours: 0
      minutes: 2
      seconds: 0
  - platform: state
    entity_id:
    - light.yeelight_color_0x7caaf86
    from: unavailable
    id: office_bulb
    for:
      hours: 0
      minutes: 2
      seconds: 0
  condition: []
  action:
  - choose:
    - conditions:
      - condition: or
        conditions:
        - condition: trigger
          id: hall_camera
        - condition: trigger
          id: office_bulb
      sequence:
      - service: homeassistant.turn_on
        data: {}
        target:
          entity_id: switch.plugs_infrastructure
      - type: turn_off
        device_id: 95931a9049849e575f2de543adf111eb
        entity_id: light.yeelight_color_0x7caaf86
        domain: light
      - type: turn_off
        device_id: bf45f1d630db6e2aa1307866603f548a
        entity_id: light.smart_light
        domain: light
      - if:
        - condition: state
          entity_id: input_boolean.mode_away
          state: 'on'
        then:
        - type: turn_on
          device_id: 26d4f61d01f392350cd4375fcc3dbf50
          entity_id: switch.hall_camera
          domain: switch
        else:
        - type: turn_off
          device_id: 26d4f61d01f392350cd4375fcc3dbf50
          entity_id: switch.hall_camera
          domain: switch
    default: []
  mode: single
- id: '1687314395271'
  alias: 'Motions: Bathroom v2'
  description: ''
  use_blueprint:
    path: motion/occupancy_tracking_restart.yaml
    input:
      entrance: binary_sensor.bathroom_motions_occupancy
      inside: binary_sensor.bathroom_motions2_occupancy
      light: switch.bathroom_lights_left
      occupancy: input_boolean.occupancy_bathroom
      on_action:
      - service: switch.turn_on
        data: {}
        target:
          entity_id: switch.bathroom_lights_left
      reentry_wait: 10
      reentry_timeout: 90
- id: '1687317165822'
  alias: Infrastructure
  description: ''
  trigger:
  - platform: state
    entity_id:
    - switch.plugs_infrastructure
    to: 'off'
    id: 'off'
    for:
      hours: 0
      minutes: 5
      seconds: 0
  condition: []
  action:
  - choose:
    - conditions:
      - condition: trigger
        id: 'off'
      sequence:
      - service: homeassistant.turn_on
        data: {}
        target:
          entity_id: switch.plugs_infrastructure
    default: []
  mode: single