Created
April 15, 2021 07:57
-
-
Save devbis/ebf8f2e973993c6b537fb2110ed83f71 to your computer and use it in GitHub Desktop.
Home assistant entrance trigger
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
alias: Turn on the light when enter home | |
description: '' | |
trigger: | |
- type: opened | |
platform: device | |
device_id: fa0f01d24dedc4bf42a6b72269616a2e | |
entity_id: binary_sensor.0x00158d000397557e_contact | |
domain: binary_sensor | |
condition: | |
- type: is_illuminance | |
condition: device | |
device_id: 800550e6f24418e3845d5099243b105d | |
entity_id: sensor.illuminance_0x58b3fca9d6b6 | |
domain: sensor | |
below: 400 | |
action: | |
- wait_for_trigger: | |
- type: motion | |
platform: device | |
device_id: 2e7e76b53c047777e98ffdd7e4e4f4ac | |
entity_id: binary_sensor.0x00158d0003cf8a0c_occupancy | |
domain: binary_sensor | |
for: | |
hours: 0 | |
minutes: 0 | |
seconds: 0 | |
milliseconds: 0 | |
timeout: '10' | |
continue_on_timeout: false | |
- service: switch.turn_on | |
data: {} | |
entity_id: switch.sonoff_1000da96d2 | |
- service: media_player.volume_set | |
entity_id: media_player.mpd | |
data: | |
volume_level: 0.5 | |
- service: tts.google_translate_say | |
data: | |
entity_id: media_player.mpd | |
message: >- | |
Добро пожаловать домой. Время сейчас {{ now().hour}}:{{ "%0.02d" | | |
format(now().strftime("%M") | int) }}. Температура в квартире {{ | |
states('sensor.temperature_usb_zytemp_1_40')|int|format(morph='градус') | |
}}, влажность {{ | |
states('sensor.humidity_582d3432e069')|int|format(morph='процент') }} | |
mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment