From c2adb8d055eff3cb4400cc24ae90c1784ea5bb0a Mon Sep 17 00:00:00 2001 From: Mahasri Kalavala Date: Sun, 15 Mar 2020 11:54:29 -0400 Subject: [PATCH] added xiaomi switch for doorbell --- lovelace/00_myhome_view.yaml | 19 ++++++++ lovelace/14_rooms.yaml | 36 ++++++++++++++++ packages/motion_timers.yaml | 2 - packages/settings.yaml | 1 - packages/xiaomi_aqara.yaml | 3 ++ packages/xiaomi_magic_cubes.yaml | 53 +++++++++++++++++++++++ ui-lovelace.yaml | 2 +- zwcfg_0xd89c4f0c.xml | 74 ++++++++++++++++---------------- 8 files changed, 149 insertions(+), 41 deletions(-) create mode 100644 lovelace/14_rooms.yaml diff --git a/lovelace/00_myhome_view.yaml b/lovelace/00_myhome_view.yaml index 515769d..2f52015 100644 --- a/lovelace/00_myhome_view.yaml +++ b/lovelace/00_myhome_view.yaml @@ -106,6 +106,25 @@ cards: icon: "mdi:emoticon-dead-outline" name: Deaths + - type: glance + show_icon: true + show_name: true + show_state: true + title: Fitness + entities: + - entity: sensor.suresh_steps + icon: "mdi:run" + name: Suresh Steps + - entity: sensor.suresh_floors_ascended + icon: "mdi:run" + name: Suresh Floors Ascended + - entity: sensor.mallika_steps + icon: "mdi:run" + name: Mallika Steps + - entity: sensor.mallika_floors_ascended + icon: "mdi:run" + name: Mallika Floors Ascended + - type: entity-filter title: For Your Information show_empty: false diff --git a/lovelace/14_rooms.yaml b/lovelace/14_rooms.yaml new file mode 100644 index 0000000..839f922 --- /dev/null +++ b/lovelace/14_rooms.yaml @@ -0,0 +1,36 @@ +title: Rooms +icon: mdi:home +cards: + - type: entities + title: Home + show_header_toggle: false + entities: + - input_boolean.home_mode_away + + - type: entities + title: Kitchen + show_header_toggle: false + entities: + - switch.kitchen + - sensor.kitchen_motion_sensor_battery_level + - binary_sensor.kitchen_motion_sensor_sensor + - binary_sensor.kitchen_camera_motion + - binary_sensor.motion_sensor_158d0001a662fe + - sensor.illumination_158d0001a662fe + - input_label.motion_sensor_158d0001a662fe + + - type: entities + title: Family Room + show_header_toggle: false + entities: + - input_boolean.sharp_tv + - light.family_room + - media_player.living_room + - switch.downstairs_fragrance + - sensor.downstairs_multi_sensor_temperature + - sensor.downstairs_multi_sensor_relative_humidity + - sensor.downstairs_multi_sensor_luminance + - sensor.downstairs_multi_sensor_battery_level + - input_label.downstairs_multi_sensor_sensor + - input_label.downstairs_multi_sensor + - binary_sensor.downstairs_multi_sensor_sensor diff --git a/packages/motion_timers.yaml b/packages/motion_timers.yaml index 8b87369..1dcfc01 100644 --- a/packages/motion_timers.yaml +++ b/packages/motion_timers.yaml @@ -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 diff --git a/packages/settings.yaml b/packages/settings.yaml index ec86752..bc43f6c 100644 --- a/packages/settings.yaml +++ b/packages/settings.yaml @@ -145,7 +145,6 @@ input_boolean: led_alerts: name: LED Messages - initial: on icon: mdi:led-strip movie_time: diff --git a/packages/xiaomi_aqara.yaml b/packages/xiaomi_aqara.yaml index 616d46c..ef5bb66 100644 --- a/packages/xiaomi_aqara.yaml +++ b/packages/xiaomi_aqara.yaml @@ -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: diff --git a/packages/xiaomi_magic_cubes.yaml b/packages/xiaomi_magic_cubes.yaml index ce68b3d..4825a0b 100644 --- a/packages/xiaomi_magic_cubes.yaml +++ b/packages/xiaomi_magic_cubes.yaml @@ -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 %} diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index 2262ec8..e165676 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -1,4 +1,3 @@ - # This code is auto-generated using my Jinja lovelace migration script # visit: https://github.com/skalavala/mysmarthome/blob/master/jinja_helpers/jinja_lovelace.md # Or visit https://sharethelove.io/tools/jinja-magic-scripts @@ -25,3 +24,4 @@ views: - !include lovelace/11_scripts_view.yaml - !include lovelace/12_automations_view.yaml - !include lovelace/13_qnap_view.yaml + - !include lovelace/14_rooms.yaml diff --git a/zwcfg_0xd89c4f0c.xml b/zwcfg_0xd89c4f0c.xml index 4cf7ec0..24620f7 100644 --- a/zwcfg_0xd89c4f0c.xml +++ b/zwcfg_0xd89c4f0c.xml @@ -34,10 +34,10 @@ - - + + - + @@ -168,7 +168,7 @@ - + @@ -208,7 +208,7 @@ - + @@ -216,9 +216,9 @@ - - - + + + @@ -379,7 +379,7 @@ - + @@ -490,7 +490,7 @@ - + @@ -601,7 +601,7 @@ - + @@ -710,7 +710,7 @@ - + @@ -720,7 +720,7 @@ - + @@ -728,9 +728,9 @@ - - - + + + @@ -902,7 +902,7 @@ - + @@ -1006,18 +1006,18 @@ - - - + + + - - + + - + @@ -1181,7 +1181,7 @@ - + @@ -1190,8 +1190,8 @@ - - + + @@ -1328,7 +1328,7 @@ - + @@ -1339,7 +1339,7 @@ - + @@ -1369,7 +1369,7 @@ - + @@ -1416,7 +1416,7 @@ - + @@ -1703,7 +1703,7 @@ - + @@ -2023,7 +2023,7 @@ - + @@ -2038,7 +2038,7 @@ - + @@ -2132,7 +2132,7 @@ - + @@ -2262,9 +2262,9 @@ - - - + + +