|
| 1 | +################################################################ |
| 2 | +## Packages / Doorbell |
| 3 | +################################################################ |
| 4 | +homeassistant: |
| 5 | +automation: |
| 6 | + - alias: 'doorbell' |
| 7 | + initial_state: 'on' |
| 8 | + trigger: |
| 9 | + - platform: event |
| 10 | + event_type: zha_event |
| 11 | + event_data: |
| 12 | + unique_id: '0xf0c1:1:0x0006' |
| 13 | + device_ieee: '00:15:8d:00:03:26:94:9a' |
| 14 | + command: 'attribute_updated' |
| 15 | + action: |
| 16 | + - service: media_player.volume_set |
| 17 | + data_template: |
| 18 | + entity_id: media_player.google_home |
| 19 | + volume_level: > |
| 20 | + {% if is_state('input_boolean.finn_sleep', 'off') %} 1 |
| 21 | + {% elif is_state('input_boolean.finn_sleep', 'on') %} 0.40 |
| 22 | + {% endif %} |
| 23 | + - service: media_player.play_media |
| 24 | + data_template: |
| 25 | + entity_id: media_player.google_home |
| 26 | + media_content_id: > |
| 27 | + http://192.168.1.115/doorbell_tones/ |
| 28 | + {%- if is_state('input_select.theme', "New Year's Day") -%} new_years.mp3 |
| 29 | + {%- elif is_state('input_select.theme', "Groundhog Day") -%} groundhog_day.mp3 |
| 30 | + {%- elif is_state('input_select.theme', "Valentine's Day") -%} valentines_day.mp3 |
| 31 | + {%- elif is_state('input_select.theme', "St. Patrick's Day") -%} door_1.mp3 |
| 32 | + {%- elif is_state('input_select.theme', "Good Friday") -%} door_1.mp3 |
| 33 | + {%- elif is_state('input_select.theme', "Starwars Day") -%} R2D2.mp3 |
| 34 | + {%- elif is_state('input_select.theme', "Easter Sunday") -%} door_1.mp3 |
| 35 | + {%- elif is_state('input_select.theme', "Earth Day") -%} door_1.mp3 |
| 36 | + {%- elif is_state('input_select.theme', "Mother's Day") -%} door_1.mp3 |
| 37 | + {% elif is_state('input_select.theme', "Victoria Day") -%} door_1.mp3 |
| 38 | + {%- elif is_state('input_select.theme', "Father's Day") -%} get-to-the-choppa.mp3 |
| 39 | + {%- elif is_state('input_select.theme', "Canada Day") -%} door_1.mp3 |
| 40 | + {%- elif is_state('input_select.theme', "Labour Day") -%} door_1.mp3 |
| 41 | + {%- elif is_state('input_select.theme', "Thanksgiving Day") -%} door_1.mp3 |
| 42 | + {%- elif is_state('input_select.theme', "Halloween") -%} halloween.wav |
| 43 | + {%- elif is_state('input_select.theme', "Remembrance Day") -%} door_1.mp3 |
| 44 | + {%- elif is_state('input_select.theme', "Christmas Eve") -%} xmas.mp3 |
| 45 | + {%- elif is_state('input_select.theme', "Christmas Day") -%} xmas.mp3 |
| 46 | + {%- elif is_state('input_select.theme', "Boxing Day") -%} xmas.mp3 |
| 47 | + {%- elif is_state('input_select.theme', "New Year's Eve") -%} new_years.mp3 |
| 48 | + {%- else -%} door_1.mp3 |
| 49 | + {%- endif -%} |
| 50 | + media_content_type: 'audio/mp3' |
| 51 | + |
| 52 | +############## |
| 53 | + # - alias: 'guard dog' |
| 54 | + # initial_state: 'on' |
| 55 | + # trigger: |
| 56 | + # - platform: state |
| 57 | + # entity_id: binary_sensor.front_doorbell |
| 58 | + # from: 'off' |
| 59 | + # to: 'on' |
| 60 | + # condition: |
| 61 | + # condition: or |
| 62 | + # conditions: |
| 63 | + # - condition: state |
| 64 | + # entity_id: 'input_boolean.away' |
| 65 | + # state: 'on' |
| 66 | + # - condition: state |
| 67 | + # entity_id: 'input_boolean.vacation' |
| 68 | + # state: 'on' |
| 69 | + # action: |
| 70 | + # - service: media_player.volume_set |
| 71 | + # data: |
| 72 | + # entity_id: media_player.google_home |
| 73 | + # volume_level: 1.00 |
| 74 | + # - service: media_player.play_media |
| 75 | + # data_template: |
| 76 | + # entity_id: media_player.google_home |
| 77 | + # media_content_id: "http://192.168.1.115/misc_sound/dog-barking-2-bullmastiff.mp3" |
| 78 | + # media_content_type: 'audio/mp3' |
| 79 | + # - service: notify.html5 |
| 80 | + # data: |
| 81 | + # message: 'Someone is at the front door, Release the Hounds!' |
| 82 | + |
| 83 | +sensor: |
| 84 | + - platform: template |
| 85 | + sensors: |
| 86 | + theme_sound: |
| 87 | + friendly_name: 'Doorbell Sound' |
| 88 | + value_template: > |
| 89 | + {%- if is_state('input_select.theme', "New Year's Day") -%} new_years.mp3 |
| 90 | + {%- elif is_state('input_select.theme', "Groundhog Day") -%} groundhog_day.mp3 |
| 91 | + {%- elif is_state('input_select.theme', "Valentine's Day") -%} valentines_day.mp3 |
| 92 | + {%- elif is_state('input_select.theme', "St. Patrick's Day") -%} door_1.mp3 |
| 93 | + {%- elif is_state('input_select.theme', "Good Friday") -%} door_1.mp3 |
| 94 | + {%- elif is_state('input_select.theme', "Starwars Day") -%} R2D2.mp3 |
| 95 | + {%- elif is_state('input_select.theme', "Easter Sunday") -%} door_1.mp3 |
| 96 | + {%- elif is_state('input_select.theme', "Earth Day") -%} door_1.mp3 |
| 97 | + {%- elif is_state('input_select.theme', "Mother's Day") -%} door_1.mp3 |
| 98 | + {% elif is_state('input_select.theme', "Victoria Day") -%} door_1.mp3 |
| 99 | + {%- elif is_state('input_select.theme', "Father's Day") -%} get-to-the-choppa.mp3 |
| 100 | + {%- elif is_state('input_select.theme', "Canada Day") -%} door_1.mp3 |
| 101 | + {%- elif is_state('input_select.theme', "Labour Day") -%} door_1.mp3 |
| 102 | + {%- elif is_state('input_select.theme', "Thanksgiving Day") -%} door_1.mp3 |
| 103 | + {%- elif is_state('input_select.theme', "Halloween") -%} halloween.wav |
| 104 | + {%- elif is_state('input_select.theme', "Remembrance Day") -%} door_1.mp3 |
| 105 | + {%- elif is_state('input_select.theme', "Christmas Eve") -%} xmas.mp3 |
| 106 | + {%- elif is_state('input_select.theme', "Christmas Day") -%} xmas.mp3 |
| 107 | + {%- elif is_state('input_select.theme', "Boxing Day") -%} xmas.mp3 |
| 108 | + {%- elif is_state('input_select.theme', "New Year's Eve") -%} new_years.mp3 |
| 109 | + {%- else -%} door_1.mp3 |
| 110 | + {%- endif -%} |
| 111 | + icon_template: "{% if is_state('sun.sun', 'above_horizon') %}mdi:speaker-wireless{% else %}mdi:speaker{% endif %}" |
0 commit comments