Created
January 30, 2023 00:53
-
-
Save sshimko/f2a064d4d28e7234363d327cb915a572 to your computer and use it in GitHub Desktop.
Home Assistant Script: Check for faulted Ring contact sensors and identify them through a media player
This file contains hidden or 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: Speak Faulted Alarm Sensors Script | |
description: "" | |
sequence: | |
- service: tts.cloud_say | |
data: | |
entity_id: media_player.office_sonos | |
message: > | |
{% set lst = states.binary_sensor | | |
rejectattr('attributes.device_class', 'undefined') | | |
selectattr('entity_id', 'in', integration_entities('mqtt')) | | |
selectattr('state', 'eq', 'on') | selectattr('attributes.device_class', | |
'search', 'window|door') | map(attribute="name") | unique | join(" and | |
") | regex_replace(find='Sensor', replace='', ignorecase=True) %} | |
{% if lst %} | |
The following windows or doors are open | |
{{ lst }} | |
{% else %} | |
All windows and doors are secure | |
{% endif %} | |
mode: single | |
icon: mdi:home-group |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment