Garage Door Template - Blocking Lovelace Icons

Hello,

I am using the garage door templates to control my two garage doors on an Insteon I/O link.
I have condition statements for both open and closed to check the sensors (sensors are OFF in the closed position and ON in any other position.)

I am trying to get the UI to block control of opening the door when it is open, and closing the door when it is close.

I would also like it to only allow the stop command within 10 seconds of either the open or closed commands.

The “script.large_garage_door_trigger” triggers the I/O link relay for 1 second and then turns it off.


  - platform: template
    covers:
      large_garage_door:
        device_class: garage
        unique_id: 'large_garage_door'
        friendly_name: "Large Garage Door"
        value_template: "{{is_state('binary_sensor.io_linc_sensor_lgdo','on')}}"
        open_cover:
          - condition: state
            entity_id: binary_sensor.io_linc_sensor_lgdo
            state: "off"
          - service: script.large_garage_door_trigger
        close_cover:
          - condition: state
            entity_id: binary_sensor.io_linc_sensor_lgdo
            state: "on"
          - service: script.large_garage_door_trigger
        stop_cover:
          service: script.large_garage_door_trigger
        icon_template: >-
          {% if is_state('binary_sensor.io_linc_sensor_lgdo','on') %}
            mdi:garage-open-variant
          {% else %}
            mdi:garage-variant
          {% endif %}

Screenshot 2023-07-04 154503

Is this not working? Not sure if you’re just stating this or whether there’s a problem.

Add a template condition to the stop action and check the last_updated property of the cover entity itself. If that doesn’t work, make an input_datetime helper to save the last opened or closed trigger and then check that in the template condition.

Is this not working? Not sure if you’re just stating this or whether there’s a problem.

It is not working, I was under the impression that the UI would automatically block based off of the position sensor, I am not sure If I have the sensor implemented correctly.

I don’t see anything wrong with your config.

My template covers correctly disables the right buttons depending on the state of the cover.

Does the value of binary_sensor.io_linc_sensor_lgdo change and persist when you open or close the garage door?

Are there any errors in your log?

I don’t think it will provide additional info that’s of value to debug this, but could you show the config for script.large_garage_door_trigger nonetheless?

binary_sensor.io_linc_sensor_lgdo Outputs Open or Closed in the corresponding states.

script.large_garage_door_trigger Is a simple script to trigger the relay for 1 second. I have a 14 second delay at the end to prevent it from being triggered multiple times by a bouncing finger.

small_garage_door_trigger:
  alias: Small Garage Door Trigger
  sequence:
  - service: switch.turn_on
    data: {}
    target:
      entity_id:
      - switch.io_linc_small_gdo_relay
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: switch.turn_off
    data: {}
    target:
      entity_id:
      - switch.io_linc_small_gdo_relay
  - delay:
      hours: 0
      minutes: 0
      seconds: 14
      milliseconds: 0
  mode: single
  icon: mdi:garage