mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-10-09 07:37:48 +00:00
Add state trigger for garage doors and enhance notification message formatting
Implemented a new state trigger for the garage doors to notify when they are opened. Improved the notification message to dynamically reflect the status of both garage doors, providing clearer information on their state. This enhances user awareness and control over garage access.
This commit is contained in:
@@ -330,6 +330,11 @@ automation:
|
|||||||
trigger:
|
trigger:
|
||||||
- platform: time_pattern
|
- platform: time_pattern
|
||||||
minutes: '/45'
|
minutes: '/45'
|
||||||
|
- platform: state
|
||||||
|
entity_id:
|
||||||
|
- cover.large_garage_door
|
||||||
|
- cover.small_garage_door
|
||||||
|
to: 'open'
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: group.family
|
entity_id: group.family
|
||||||
to: not_home
|
to: not_home
|
||||||
@@ -370,8 +375,17 @@ automation:
|
|||||||
- service: script.notify_engine
|
- service: script.notify_engine
|
||||||
data:
|
data:
|
||||||
title: 'Check Garage Doors:'
|
title: 'Check Garage Doors:'
|
||||||
value1: "Small: {{ states('cover.small_garage_door')}}"
|
value1: >
|
||||||
value2: "Large: {{ states('cover.large_garage_door')}}"
|
{% set open = [] %}
|
||||||
|
{% if is_state('cover.small_garage_door','open') %}{% set _ = open.append('Small garage door') %}{% endif %}
|
||||||
|
{% if is_state('cover.large_garage_door','open') %}{% set _ = open.append('Large garage door') %}{% endif %}
|
||||||
|
{% if open|length == 0 %}
|
||||||
|
All garage doors are closed.
|
||||||
|
{% elif open|length == 1 %}
|
||||||
|
{{ open[0] }} is open.
|
||||||
|
{% else %}
|
||||||
|
{{ open|join(' and ') }} are open.
|
||||||
|
{% endif %}
|
||||||
who: "family"
|
who: "family"
|
||||||
camera_entity: "camera.garagecam"
|
camera_entity: "camera.garagecam"
|
||||||
group: 'information'
|
group: 'information'
|
||||||
|
Reference in New Issue
Block a user