input_boolean:
  domestina:
    name: Domestina time
    icon: mdi:broom

group:
  domestina_disabled_automations:
    - automation.presence_arrival_detection
    - automation.presence_coming_home
    - automation.routine_coming_home_left_work
    - automation.presence_leaving_home
    - automation.sleep_mode_enable
    - automation.sleep_mode_disable
    - automation.sleep_mode_toggle_on_bedside_switch_double_click
    - automation.music_play_pause_on_magic_cube_knock
    - automation.music_volume_down_on_magic_cube_rotate_left
    - automation.music_volume_up_on_magic_cube_rotate_right
    - automation.lighting_turn_on_all_lights_after_sunset
    - automation.lighting_turn_off_all_lights_after_sunrise
    - automation.lighting_living_room_turn_all_lights_on_on_magic_cube_flip_90
    - automation.lighting_living_room_turn_all_lights_off_on_magic_cube_flip_180
    - automation.routine_bedtime_toggle_on_bedside_switch_hold

automation:
  - alias: Domestina · Automate start
    trigger:
      platform: time
      at: "08:30:00"
    condition:
      - condition: time
        weekday: thu
    action:
      - service: input_boolean.turn_on
        entity_id: input_boolean.domestina

  - alias: Domestina · Start
    trigger:
      platform: state
      entity_id: input_boolean.domestina
      from: "off"
      to: "on"
    action:
      - service: input_boolean.turn_on
        entity_id: input_boolean.guest_mode
      - service: automation.turn_off
        entity_id: group.domestina_disabled_automations

  - alias: Domestina · Automate end
    trigger:
      platform: time
      at: "13:00:00"
    condition:
      - condition: time
        weekday: thu
    action:
      - service: input_boolean.turn_off
        entity_id: input_boolean.domestina

  - alias: Domestina · End
    trigger:
      platform: state
      entity_id: input_boolean.domestina
      from: "on"
      to: "off"
    action:
      - service: input_boolean.turn_off
        entity_id: input_boolean.guest_mode
      - service: automation.turn_on
        entity_id: group.domestina_disabled_automations
