added xiaomi switch for doorbell

This commit is contained in:
Mahasri Kalavala
2020-03-15 11:54:29 -04:00
parent d20c3d6356
commit c2adb8d055
8 changed files with 149 additions and 41 deletions

View File

@@ -114,8 +114,6 @@ automation:
- condition: template
value_template: "{{ states('input_boolean.working_in_office_room') == 'off' }}"
action:
- service: switch.turn_off
entity_id: switch.front_room
- service: homeassistant.turn_off
entity_id: switch.zwave_smart_switch_switch

View File

@@ -145,7 +145,6 @@ input_boolean:
led_alerts:
name: LED Messages
initial: on
icon: mdi:led-strip
movie_time:

View File

@@ -1,5 +1,8 @@
homeassistant:
customize:
binary_sensor.wall_switch_158d00045622d9:
friendly_name: Door Bell Button
binary_sensor.motion_sensor_158d0001a662fe:
friendly_name: Kitchen Motion Sensor (Xiaomi)
sensor.Illumination_158d0001a662fe:

View File

@@ -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 %}