I am wondering if anyone can help me.
I have a properly working LoraTap GDC311ZBQ1 (Tuya) garage door mechanism in HA with zigbee2mqtt. I have in customize.yaml (enabled in configuration.yaml) cover (cover.garaz_brama_trigger)
The LoraTap mechanism is equipped with a contact sensor (binary_sensor.garaz_brama_garage_door_contact) and it too reports the closed or open state correctly.
All of this is passed to HomeKit via a bridge (but that doesn’t matter in the problem) to be visible in CarPlay.
The gate opens or closes about 15 seconds - but the HA (and HK) basically show Open or Closed as soon as the button is pressed (where maybe for less than a second it blinks Opening / Closing).
Is there any way to add a time to open / close the gate and only then show that it is OPEN or CLOSE?
I use a triggered template to determine the state of the garage door
- trigger:
- entity_id: button.porte_garage
platform: state
id: trig_button
- entity_id: binary_sensor.tuya_contact_01_opening
platform: state
id: trig_state
- entity_id: sensor.garage_cover_state
platform: state
id: tm_opening
to: "opening"
for: 30
- entity_id: sensor.garage_cover_state
platform: state
id: tm_closing
to: "closing"
for: 60
- platform: event
event_type: event_template_reloaded
sensor:
- name: "Garage cover state"
unique_id: "garage_cover_state"
state: >
{% if trigger.id == "tm_opening" %}
open
{% elif trigger.id == "tm_closing" %}
open
{% elif trigger.id == "trig_state" and trigger.from_state.state == "off" %}
opening
{% elif trigger.id == "trig_button" and is_state("binary_sensor.tuya_contact_01_opening", "on") %}
closing
{% elif trigger.id == "trig_state" and trigger.to_state.state == "off" %}
closed
{% else %}
{{ "open" if is_state("binary_sensor.tuya_contact_01_opening", "on") else "closed" }}
{% endif %}
The door contact is binary_sensor.tuya_contact_01_opening and goes “on” as soon as I start opening the garage. I put the state on “opening”, then, and to “opened” after 30seconds. Similar when closing, based upon the closing button being pushed.