Noob sonoff sv garage door opener help

hi:)

new user that wants to start using HA, i’m running it on a RPI3b and up to now have x2 tp link smart plugs & x1 sonoff s26 tasmota smart plug set up in HA.

Next thing i’d like to get going is being able to open/close the garage door via HA on my phone.

so i’ve attempted to follow DrZz’s guide on youtube.

I’ve flashed a sonoff sv and can control/access the device via the browser and have set everything else as below. It shows up in the HA overview but i cannot control it via HA.

i’ve inputted the settings below in the sonoff console:

Switchretain 1
Powerretain 1
switchtopic2 garagestate
switchmode1 0
switchmode2 2

and set the GPIO’s to:

GPIO 14 to 10 Switch2

GPIO 4 to 22 Relay2

i’m running the mosquito hassio addon and have added the details to the sonoff, where i can see it is connecting in the console

00:00:00 Project sonoff Sonoff Version 6.4.1(sonoff)-2_4_2
00:00:00 WIF: Connecting to AP1 ########## in mode 11N as cmnd/sonoffsv01/POWER-2653...
00:00:04 WIF: Connected
00:00:04 DNS: Initialized
00:00:04 HTP: Web server active on cmnd/sonoffsv01/POWER-2653.local with IP address 192.168.1.82
12:39:12 MQT: Attempting connection...
12:39:13 MQT: Connected
12:39:13 MQT: tele/cmnd/sonoffsv01/POWER/LWT = Online (retained)
12:39:13 MQT: cmnd/cmnd/sonoffsv01/POWER/POWER = 
12:39:13 MQT: tele/cmnd/sonoffsv01/POWER/INFO1 = {"Module":"Sonoff SV","Version":"6.4.1(sonoff)","FallbackTopic":"cmnd/DVES_684A5D_fb/","GroupTopic":"sonoffs"}
12:39:13 MQT: tele/cmnd/sonoffsv01/POWER/INFO2 = {"WebServerMode":"Admin","Hostname":"cmnd/sonoffsv01/POWER-2653","IPAddress":"192.168.1.82"}
12:39:13 MQT: tele/cmnd/sonoffsv01/POWER/INFO3 = {"RestartReason":"Power on"}
12:39:13 MQT: stat/cmnd/sonoffsv01/POWER/RESULT = {"POWER":"ON"}
12:39:13 MQT: stat/cmnd/sonoffsv01/POWER/POWER = ON (retained)
12:39:21 MQT: tele/cmnd/sonoffsv01/POWER/STATE = {"Time":"2019-02-23T12:39:21","Uptime":"0T00:00:15","Vcc":3.370,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"ON","Wifi":{"AP":1,"SSId":"##########","BSSId":"##########","Channel":11,"RSSI":70}:

configuration.yaml

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
panel_iframe:
  configurator:
    title: Configurator
    icon: mdi:wrench
    url: http://192.168.1.32:3218
   
 
switch:
  - platform: tplink
    name: Bedroom Tv
    host: 192.168.1.170
  - platform: tplink
    name: Kids heater
    host: 192.168.1.171
  - platform: mqtt
    name: "sonoff1"
    state_topic: "stat/sonoff1/POWER"
    command_topic: "cmnd/sonoff1/POWER"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    retain: true

cover:

  - platform: mqtt
    name: "Sonoff SV Garage"
    state_topic: "cmnd/garagestate/POWER2"
    command_topic: "cmnd/sonoffsv01/POWER"
    payload_open: "ON"
    payload_close: "ON"
    payload_stop: "ON"
    state_open: "ON"
    state_closed: "OFF"
    optimistic: false

automations.yaml

 id: '1550871957892'
  alias: Garage Door
  trigger:
  - payload: 'ON'
    platform: mqtt
    topic: cmnd/sonoffsv01/POWER
  condition: []
  action:
  - data:
      payload: 'OFF'
      topic: cmnd/sonoffsv01/POWER
    service: mqtt.publish
  - delay: 00:00:01

customize.yaml

cover.Sonoff_SV_Garage:
 device_class: garage
 friendly_name: Garage 

groups.yaml

Garage Door:
 name: Garage Door
 view: no
 control: hidden
 icon: mdi:garage
 entities:
 - cover.Sonoff_SV_Garage

can anyone give me a shove in the right direction please? im beginning to think that all this is beyond me tbh:(

I think the problem is your mqtt topics and maybe even the payloads:

    state_topic: "cmnd/garagestate/POWER2"
    command_topic: "cmnd/sonoffsv01/POWER"
    payload_open: "ON"
    payload_close: "ON"
    payload_stop: "ON"
    state_open: "ON"
    state_closed: "OFF"

are you sure that those are the right topics? im pretty sure the state topic doesn’t start with cmnd. it should start with stat. and why are the sub-topics different? typically those are both the same when you flash a sonoff with tasmota.

so i think they should be something like “stat/sonoffsv01/POWER” and “cmnd/sonoffsv01/POWER”. you can run a mqtt sniffer to monitor the mqtt traffic and see if you can find the correct topics to use. if you trigger the sonoff with th tasmota web interface then you should see the command sent and the state returned.

also you need to verify the payloads. they are case sensitive.

1 Like

no i’m not sure they’re the right topics, i’ve pretty much just cut n pasted them and adjusted where i thought it was needed.

many thanks for the advice i’ll go have a further read up

edit: i removed the cmnd from the sonoff mqtt parameters so it now reads “sonoffsv01/POWER”, i can now control the from HA but it does not give me any indication or whether the door is open or closed etc.

Hi, I got the same issue as you, have you solved it? I gwt stuck with it now.