sleep_and_wake: alias: "Sleep and Wake" description: "Sleep, Hibernate, and Wake actions for Office and Complete House" fields: mode: name: Mode description: "Operation mode: Sleep is non-intrusive action while Hibernate aimed on maximum power-savings and security" required: true selector: select: options: - hibernate - sleep - wake target: name: Target description: "Area: Office or complete House (more areas might be added in future)" required: true selector: select: options: - office - house mode: single sequence: - choose: - conditions: - condition: template value_template: '{{ target == "office" }}' sequence: - choose: - conditions: - condition: template value_template: '{{ mode == "sleep" }}' sequence: - parallel: - service: scene.turn_on target: entity_id: scene.lg_aircon_power_off - service: switch.turn_off target: entity_id: switch.smart_power_strip_pro_socket_2 - service: switch.turn_off target: entity_id: switch.living_lights_right - service: input_boolean.turn_on target: entity_id: input_boolean.mode_office_sleep - conditions: - condition: template value_template: '{{ mode == "hibernate" }}' sequence: - parallel: - service: media_player.media_pause target: entity_id: media_player.smartpi # Wait until we fix both sleep and WOL on laptop # - service: switch.turn_off # target: # entity_id: switch.plugs_office - service: scene.turn_on target: entity_id: scene.lg_aircon_power_off - service: switch.turn_off target: entity_id: switch.smart_power_strip_pro_socket_2 - service: switch.turn_off target: entity_id: switch.living_lights_right - service: input_boolean.turn_on target: entity_id: - input_boolean.mode_office_sleep - input_boolean.mode_office_hibernate - conditions: - condition: template value_template: '{{ mode == "wake" }}' sequence: - parallel: - service: switch.turn_on target: entity_id: - switch.plugs_office - switch.smart_power_strip_pro_socket_2 - service: wake_on_lan.send_magic_packet data: mac: "e8:6a:64:7b:5d:0a" - delay: seconds: 2 - service: wake_on_lan.send_magic_packet data: mac: "e8:6a:64:7b:5d:0a" - service: input_boolean.turn_off target: entity_id: - input_boolean.mode_office_sleep - input_boolean.mode_office_hibernate - conditions: - condition: template value_template: '{{ target == "house" }}' sequence: - choose: - conditions: - condition: template value_template: '{{ mode == "sleep" }}' sequence: - parallel: - service: script.bedroom_aircon_off # - service: scene.turn_on # target: # entity_id: scene.hyundai_aircon2_off - service: scene.turn_on target: entity_id: scene.lg_aircon_power_off # Wait until we fix both sleep and WOL on laptop # - service: switch.turn_off # target: # entity_id: switch.plugs_office - service: media_player.media_pause target: entity_id: media_player.smartpi - service: switch.turn_off target: entity_id: switch.smart_power_strip_pro_socket_2 - service: switch.turn_off target: entity_id: switch.lights_all # Don't do it here, but rather separately when leaving extended home zone # - service: switch.turn_on # target: # entity_id: switch.hall_lights_right - service: input_boolean.turn_on target: entity_id: - input_boolean.mode_house_sleep - input_boolean.mode_office_sleep - input_boolean.mode_office_hibernate - conditions: - condition: template value_template: '{{ mode == "hibernate" }}' sequence: - service: switch.turn_off target: entity_id: - switch.lights_all - switch.plugs_manual - switch.plugs_controlled # Thats a better way to allow some time for leaving - service: switch.turn_on target: entity_id: switch.hall_lights_right - service: input_boolean.turn_on target: entity_id: - input_boolean.mode_office_sleep - input_boolean.mode_office_hibernate - input_boolean.mode_house_sleep - input_boolean.mode_house_hibernate - conditions: - condition: template value_template: '{{ mode == "wake" }}' sequence: - service: switch.turn_on target: entity_id: - switch.plugs_kitchen - switch.bedroom_bedsidelampsocket - service: input_boolean.turn_off target: entity_id: - input_boolean.mode_house_sleep - input_boolean.mode_house_hibernate