Sonoff Garage open close status

As per the subject.
I’ve modified Sonoff Basic to be able to control Garage, and configured HA according to https://www.youtube.com/watch?v=QMepwpyjMCY

To make sure of the gate position I used magnetic contacts. However probably I did something wrong as icon shows wrong statuses.

  • when gate is closed, (magnetic sensor close each other) icon shows - garage is open
  • when gate is open/opening, (magentic sensor no connection) icon shows - garage is closed.

I’m still new in HA, thank you in advance for help

Open status
open

Closed status
closed

configuration.yaml

cover:
- platform: mqtt
  name: "test"
  state_topic: "cmnd/2/POWER2"
  command_topic: "cmnd/sonoffst/POWER"
  payload_open: "ON"
  payload_close: "ON"
  payload_stop: "ON"
  state_open: "ON"
  state_closed: "OFF"
  optomistic: false
  retain: false

automation.yaml

    - action:
  - delay: 00:00:01
  - data:
      payload: 'OFF'
      topic: cmnd/sonoffst/POWER
    service: mqtt.publish
  alias: Turn off Garage after 1 seconds
  condition: []
  id: '12345678901234'
  trigger:
  - payload: 'ON'
    platform: mqtt
    topic: cmnd/sonoffst/POWER

customize.yaml

cover.test:
    device_class: garage
    friendly_name: Garage

groups.yaml

garage_doors:
      name: Garage Doors
      view: no
      control: hidden
      icon: mdi:garage
      entities:
        - cover.test
1 Like

I’m not entirely sure if it will work but it looks like I would try to switch the “state_open” & State_closed" around and see if it works:

state_open: "OFF"
state_closed: "ON"

Hi, you should know which payload the Sonoff sends if it detects either the open or closed state since you probably configured it yourself.

Additional hints:

  • Typo: optomistic -> optimistic (but obsolete since you defined a state topic)
  • the payloads for your command topic are always “ON”, so you send “ON” to the Sonoff if you click the Open, close or Stop button

perfect, it’s working :slight_smile:

thank you so much

just wondering why I cannot control my garage door using HomeAssist android app via “group”

It’s working only when I select single garage door.

not working

working ok