/mqtt-door

Report the status of, and control the garage doors over MQTT

Primary LanguagePythonMIT LicenseMIT

mqtt-door

Use gpiozero to read the state of the magnetic reed sensors on the doors and control the doors via relays connected to GPIO pins

Use paho-mqtt to publish MQTT status messages and subscribe to command messages

The door contacts are GE Overhead Panel Door Magnetic Contact

The relay board is found on eBay. Search for 4-Channel Optic-Isolated Relay Module H/L Trigger 3.3V-5V Arduino / Raspberry PI

MQTT Status

topic = stat/garage/NAME
payload = {"state": "STATE"}

MQTT Command

topic = cmnd/garage/NAME 
payload = open or close

Home Assistant Sensor

sensor garage_north:
  - platform: mqtt
    name: "Garage North"
    state_topic: "stat/garage/north"
    value_template: "{{ value_json.state }}"

Home Assistant Cover

cover garage_north:
  - platform: mqtt
    name: "Garage North"
    device_class: garage
    state_topic: "stat/garage/north"
    command_topic: "cmnd/garage/north"
    payload_open: "OPEN"
    payload_close: "CLOSE"
    state_closed: '{"state": "closed"}'
    state_open: '{"state": "open"}'
    qos: 1
    retain: false