Garage Cover Non-MQTT

I’m setting up a garage door opener relay, and DHT shield on a D1Mini and I cant for the life of me figure out a way to incorporate my binary-sensory to give Hassio the status of the door. All of the examples I seem to only find are using MQTT however I don’t want to go this route. This is my YAML

  • platform: template
    covers:
    garage_door:
    friendly_name: “Garage Door”
    value_template: “{{ states(‘binary_sensor.garage_status_2’)|float > OFF }}”
    open_cover:
    service: switch.turn_on
    data:
    entity_id: switch.garage_door_2
    close_cover:
    service: switch.turn_on
    data:
    entity_id: switch.garage_door_2
    stop_cover:
    service: switch.turn_on
    data:
    entity_id: switch.garage_door

why not use MQTT? It’s dead simple.

For testing applications with no mqtt

If no mqtt, how are you planing on connecting the D1Mini to home assistant ?

If you’re looking to reinvent the wheel you could create a completely unnecessary web server and send commands through http

Yeah. I’ll just use Mqtt. Thanks everyone

here is the non-mqtt cover I use for my garage door. It uses a zwave relay as the operator and a zwave tilt binary sensor as the position sensor.

  - platform: template
    covers:
      north_garage_door:
        friendly_name: 'North Garage Door'
        value_template: "{{ is_state('binary_sensor.garage_door_north_position_sensor', 'on') }}"
#        device_class: garage
        open_cover:
          service: script.turn_on
          entity_id: script.open_gdn
#          service: switch.turn_on
#          entity_id: switch.garage_door_north_operator_switch
        close_cover:
          service: script.turn_on
          entity_id: script.close_gdn
#          service: switch.turn_on
#          entity_id: switch.garage_door_north_operator_switch
        stop_cover:
          service: switch.turn_on
          entity_id: switch.garage_door_north_operator_switch
        icon_template: "{% if not is_state('binary_sensor.garage_door_north_position_sensor', 'off') %}mdi:garage-open{% else %}mdi:garage{% endif %}"

I use the scripts to check the current position of the door before I allow the door to be operated by voice command since Alexa doesn’t know what state the door is in and If I say to close the door and the door is already closed then the door would open instead. And that wouldn’t be good.

1 Like

Thanks Alot. I appreciate it.

Hi! Can you show a scripts???

  close_gdn:
    alias: Close the North Garage Door
    sequence:
      - condition: state
        entity_id: binary_sensor.garage_door_north_position_sensor
        state: 'on'
      - service: switch.turn_on
        entity_id: switch.garage_door_north_operator_switch
  
  open_gdn:
    alias: Open the North Garage Door
    sequence:
      - condition: state
        entity_id: binary_sensor.garage_door_north_position_sensor
        state: 'off'
      - service: switch.turn_on
        entity_id: switch.garage_door_north_operator_switch
1 Like