mirror of
https://github.com/skalavala/mysmarthome.git
synced 2025-08-28 16:57:02 +00:00
added xiaomi switch for doorbell
This commit is contained in:
@@ -14,6 +14,38 @@ script:
|
||||
- service: input_boolean.toggle
|
||||
entity_id: input_boolean.do_not_disturb
|
||||
|
||||
play_ringtone:
|
||||
sequence:
|
||||
- service: xiaomi_aqara.play_ringtone
|
||||
data:
|
||||
gw_mac: !secret xiaomi_mac
|
||||
ringtone_id: 10
|
||||
ringtone_vol: 30
|
||||
|
||||
play_dog_sounds:
|
||||
sequence:
|
||||
- service: media_player.volume_set
|
||||
entity_id: media_player.living_room, media_player.upstairs
|
||||
data:
|
||||
volume_level: "1.0"
|
||||
- service: media_player.play_media
|
||||
data:
|
||||
entity_id: media_player.living_room, media_player.upstairs
|
||||
media_content_id: !secret dog_sound_url
|
||||
media_content_type: "music"
|
||||
- delay: "00:00:05"
|
||||
- service: media_player.play_media
|
||||
data:
|
||||
entity_id: media_player.living_room, media_player.upstairs
|
||||
media_content_id: !secret dog_sound_url
|
||||
media_content_type: "music"
|
||||
- delay: "00:00:05"
|
||||
- service: media_player.play_media
|
||||
data:
|
||||
entity_id: media_player.living_room, media_player.upstairs
|
||||
media_content_id: !secret dog_sound_url
|
||||
media_content_type: "music"
|
||||
|
||||
################################################################################
|
||||
# XIAOMI AQARA MAGIC CUBE AUTOMATIONS #
|
||||
# http://patorjk.com/software/taag/#p=display&h=2&v=2&f=Big&t=Test #
|
||||
@@ -341,3 +373,24 @@ automation:
|
||||
action_type: shake_air
|
||||
action:
|
||||
- service: script.toggle_do_not_disturb
|
||||
|
||||
################################################################################
|
||||
# Doorbell Automations -
|
||||
# When we are home, play the door bell
|
||||
# When we are not home, play dog sounds
|
||||
################################################################################
|
||||
- alias: Doorbell Single Press
|
||||
initial_state: true
|
||||
trigger:
|
||||
platform: event
|
||||
event_type: xiaomi_aqara.click
|
||||
event_data:
|
||||
entity_id: binary_sensor.wall_switch_158d00045622d9
|
||||
click_type: single
|
||||
action:
|
||||
- service_template: >
|
||||
{% if states('input_boolean.home_mode_away') == 'off' %}
|
||||
script.play_ringtone
|
||||
{% else %}
|
||||
script.play_dog_sounds
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user