Added Small garage door back in #1138

This commit is contained in:
CCOSTAN 2024-05-03 21:13:52 +00:00
parent 957b74b126
commit 808f0dc5f1
2 changed files with 45 additions and 41 deletions

View File

@ -1 +1 @@
2024.4.3
2024.4.4

View File

@ -6,21 +6,9 @@
# Switch to Access_Tokens - https://www.vcloudinfo.com/2020/05/fixing-garadget-in-home-assistant.html
#-------------------------------------------
# cover:
# - platform: mqtt
# name: "Small Garage Door"
# device_class: 'garage'
# command_topic: "garadget/GSmall/command"
# state_topic: "garadget/GSmall/status"
# value_template: >-
# {% if value_json.status == 'closed' %}
# closed
# {% else %}
# open
# {% endif %}
# payload_open: "open"
# payload_close: "close"
# payload_stop: "stop"
cover:
- platform: mqtt
mqtt:
cover:
@ -38,6 +26,20 @@ mqtt:
payload_close: "close"
payload_stop: "stop"
- name: "Small Garage Door"
device_class: 'garage'
command_topic: "garadget/GSmall/command"
state_topic: "garadget/GSmall/status"
value_template: >-
{% if value_json.status == 'closed' %}
closed
{% else %}
open
{% endif %}
payload_open: "open"
payload_close: "close"
payload_stop: "stop"
sensor:
- name: "Large Garage Door Since"
state_topic: "garadget/GLarge/status"
@ -48,24 +50,21 @@ mqtt:
unit_of_measurement: '%'
value_template: '{{ value_json.bright }}'
- name: "Small Garage Door Since"
state_topic: "garadget/GSmall/status"
value_template: '{{ value_json.time }}'
# - platform: mqtt
# name: "Small Garage Door Since"
# state_topic: "garadget/GSmall/status"
# value_template: '{{ value_json.time }}'
# - platform: mqtt
# name: "Small Garage Door Brightness"
# state_topic: "garadget/GSmall/status"
# unit_of_measurement: '%'
# value_template: '{{ value_json.bright }}'
- name: "Small Garage Door Brightness"
state_topic: "garadget/GSmall/status"
unit_of_measurement: '%'
value_template: '{{ value_json.bright }}'
group:
garage_doors: # This group is used to check if doors are open or Closed.
name: Garage Doors
entities:
- cover.large_garage_door
# - cover.small_garage_door
- cover.small_garage_door
######################################################################
## Send a notification to anyone coming home asking if they want to open the garage door.
@ -87,8 +86,13 @@ automation:
entity_id: cover.large_garage_door
state: 'closed'
action:
- variables:
person_triggered: "{{ trigger.to_state.entity_id.split('.')[1] }}"
# - variables:
# person_triggered: "{{ trigger.to_state.entity_id.split('.')[1] }}"
- service: input_text.set_value
target:
entity_id: input_text.last_person_home
data:
value: "{{ trigger.to_state.entity_id.split('.')[1] }}"
- service: script.notify_engine_two_button
data:
title: 'Welcome Home!'
@ -101,7 +105,7 @@ automation:
action2: 'NO_OPEN_LARGE_GARAGE'
icon2: 'sfsymbols:house.circle'
destructive2: 'true'
who: "{{ person_triggered }}"
who: "{{ states('input_text.last_person_home') }}"
group: 'Welcome_Home'
- alias: 'Open Large Garage Door Action'
@ -111,7 +115,7 @@ automation:
event_type: mobile_app_notification_action
event_data:
action: OPEN_LARGE_GARAGE
conditions:
condition:
- condition: state
entity_id: cover.large_garage_door
state: 'closed'
@ -128,8 +132,8 @@ automation:
platform: event
event_type: mobile_app_notification_action
event_data:
action: 'NO_OPEN_LARGE_GARAGE'
conditions:
action: NO_OPEN_LARGE_GARAGE
condition:
- condition: state
entity_id: group.family
state: 'home'
@ -146,7 +150,7 @@ automation:
action2: 'KEEP_FRONT_DOOR_LOCKED'
icon2: 'sfsymbols:lock'
destructive2: 'true'
who: "{{ person_triggered }}"
who: "{{ states('input_text.last_person_home') }}"
group: 'Welcome_Home'
- alias: 'Unlock Front Door Action'
@ -155,7 +159,7 @@ automation:
platform: event
event_type: mobile_app_notification_action
event_data:
action: 'UNLOCK_FRONT_DOOR'
action: UNLOCK_FRONT_DOOR
action:
- service: lock.unlock
entity_id: lock.front_door
@ -171,10 +175,10 @@ automation:
- platform: time_pattern
minutes: '/1'
action:
# - service: mqtt.publish
# data:
# topic: "garadget/GSmall/command"
# payload: "get-status"
- service: mqtt.publish
data:
topic: "garadget/GSmall/command"
payload: "get-status"
- service: mqtt.publish
data:
@ -188,7 +192,7 @@ automation:
- platform: state
entity_id:
- cover.large_garage_door
# - cover.small_garage_door
- cover.small_garage_door
from: 'open'
to: 'closed'
for: '00:02:00'
@ -196,7 +200,7 @@ automation:
- platform: state
entity_id:
- cover.large_garage_door
# - cover.small_garage_door
- cover.small_garage_door
from: 'closed'
to: 'open'
for: '00:02:30'