Last active
January 17, 2019 17:54
-
-
Save dnuc/9816782b796c07e5139e95d39306006a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sleeping sensor automations | |
- alias: 'Starte Skript für Nachtruhe' | |
initial_state: True | |
hide_entity: true | |
trigger: | |
platform: event | |
event_type: xiaomi_aqara.movement | |
event_data: | |
entity_id: binary_sensor.vibration_158d0002b15f8d | |
movement_type: vibrate | |
condition: | |
- condition: time | |
after: '22:30:00' | |
before: '06:00:00' | |
- condition: state | |
entity_id: binary_sensor.is_anybody_home | |
state: 'on' | |
- condition: state | |
entity_id: input_boolean.sleeping | |
state: 'off' | |
- condition: state | |
entity_id: script.sleep_sensor_turn_on | |
state: 'off' | |
action: | |
- service: script.turn_on | |
entity_id: script.sleep_sensor_turn_on | |
- alias: 'Deaktiviere Skript für Nachtruhe' | |
initial_state: True | |
hide_entity: true | |
trigger: | |
platform: state | |
entity_id: group.motion_not_bedroom | |
to: 'on' | |
condition: | |
- condition: state | |
entity_id: script.sleep_sensor_turn_on | |
state: 'on' | |
- condition: state | |
entity_id: input_boolean.sleeping | |
state: 'off' | |
action: | |
- service: script.turn_off | |
entity_id: script.sleep_sensor_turn_on | |
- alias: 'Nachruhe Morgens aus' | |
initial_state: True | |
hide_entity: true | |
trigger: | |
platform: state | |
entity_id: group.motion_not_bedroom | |
to: 'on' | |
condition: | |
- condition: time | |
after: '06:00:00' | |
before: '22:30:00' | |
- condition: state | |
entity_id: input_boolean.sleeping | |
state: 'on' | |
action: | |
- service: input_boolean.turn_off | |
entity_id: input_boolean.sleeping | |
# SCRIPT | |
script: | |
sleep_sensor_turn_on: | |
alias: "Nachtruhe aktivieren" | |
sequence: | |
- delay: | |
minutes: 10 | |
- service: input_boolean.turn_on | |
entity_id: input_boolean.sleeping |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment