Fixes and improvements for #83

State attributes added for cleanly listing which sensors are open/faulted
This commit is contained in:
2023-11-21 19:25:28 -05:00
parent 544d73812e
commit 131c6483c0
2 changed files with 141 additions and 29 deletions

View File

@ -1429,16 +1429,10 @@
data:
title: Lockdown Issue
notification_id: lockdown_issue
message: 'I fucked up this notification, will fix later, but you still gotta
issue, okbyeeeee {% set extdoors = expand(''binary_sensor.exterior_doors'')
| selectattr(''state'',''eq'',''on'') | map(attribute=''name'') | list | join('',
'') %} {% set windows = expand(''binary_sensor.windows'') | selectattr(''state'',''eq'',''on'')
| map(attribute=''name'') | list | join('', '') %} A lockdown issue has been
caused by the following sensors:
message: '{% set faults = state_attr(''sensor.total_faults'',''faulted'') |
join('', '') %} A lockdown issue has been caused by the following sensors:
Doors:{% if is_state(''binary_sensor.exterior_doors'',''on'') %} {{ extdoors
}} {% else %} None {% endif %} Windows:{% if is_state(''binary_sensor.windows'',''on'')
%} {{ windows }} {% else %} None {% endif %}'
{{ faults }}'
- service: script.text_notify
data:
type: critical
@ -1446,16 +1440,10 @@
%}\n tony\n{% else %}\n parents\n{% endif %}"
title: Security Not Armed!
tag: lockdown-issue
message: 'I fucked up this notification, will fix later, but you still gotta
issue, okbyeeeee {% set extdoors = expand(''binary_sensor.exterior_doors'')
| selectattr(''state'',''eq'',''on'') | map(attribute=''name'') | list | join('',
'') %} {% set windows = expand(''binary_sensor.windows'') | selectattr(''state'',''eq'',''on'')
| map(attribute=''name'') | list | join('', '') %} A lockdown issue has been
caused by the following sensors:
message: '{% set faults = state_attr(''sensor.total_faults'',''faulted'') |
join('', '') %} A lockdown issue has been caused by the following sensors:
Doors:{% if is_state(''binary_sensor.exterior_doors'',''on'') %} {{ extdoors
}} {% else %} None {% endif %} Windows:{% if is_state(''binary_sensor.windows'',''on'')
%} {{ windows }} {% else %} None {% endif %}'
{{ faults }}'
- if:
- condition: state
entity_id: binary_sensor.basement_occupied