Sonoff Sv Garage Door status issue

Hi, I’m new in HA, I just setup everthing via DrZz’s guide on youtube.
I’ve flash sonoff sv to latest tasmota firmware 8.3.1, then set GPIO14 to switch2(10),GPIO 4 to Relay2 (22) and put following commands in tamota console:

I can see the status changes of reed switch in console

18:12:11 MQT: cmnd/garagestate/POWER2 = ON (retained)
18:12:13 MQT: cmnd/garagestate/POWER2 = OFF (retained)

But the two arrows do not turn to grey when I test the reed switch, they are always black
I do not know where I’m wrong, could anyone help me? please.


It works when I click any arrows, just can not see the status
My configuaration in HA

cover:
  - platform: mqtt
    name: garage
    state_topic: cmnd/garagestate/POWER2
    command_topic: cmnd/sonoff/POWER
    payload_open: ON
    payload_close: ON
    payload_stop: ON
    state_open: ON
    state_closed: OFF
    optimistic: false

Anyone help me? I’m getting stuck here.

off top of head think you have you state_topic: wrong

try

state_topic: stat/garagestate/POWER2 or with out the 2

think of it this way

state_topic: get the state of it

command_topic: send this command

you could go into the console and have a look at what its sending

at work having smoko cant test

Here is what I use with my sonoffsv and a reed switch.

  - platform: mqtt
    name: Garage Door
    state_topic: "tele/garagestate/SENSOR"
    value_template: '{{ value_json.Switch2  }}'
    command_topic: "cmnd/sonoff/POWER1"
    availability_topic: "tele/sonoff/LWT"
    payload_open: "1"
    payload_close: "1"
    payload_stop: "1"
    qos: 1
    state_open: "ON"
    state_closed: "OFF"
    retain: false
    payload_available: "Online"
    payload_not_available: "Offline"

Hi, Myle
Thanks for replying. I’ve tried the code start from stat and without 2 as well.

Unfortunately, still not work.

Thanks, HickHackerz

I’ve copied yours to my configuaration.yaml, but the result is the same, two arrows are always black, never turn to grey. but I click any arrows, they work.

oddly, I do not know where I’m wrong.

any wrong setting in my tasmota console?

You can check Tasmota console, you are wanting to see what your topic is for the Switch2 status.
Something like

08:28:15 MQT: tele/sonoffsv/SENSOR = {"Time":"2020-05-22T08:28:15","Switch2":"OFF"}

Change the state_topic: “tele/garagestate/SENSOR” and value_template: ‘{{ value_json.Switch2 }}’ then accordingly.
Also you will want to change the logging interval to be shorter. Telemetry period is default 300 seconds but 30 seconds works for me.

Which version of HA are you using? I think there was a bug with this card between 0.109 and 0.109.3
Probably not the case I but thought I should mention it

Thanks for that.

I’ve check the topic you mentioned, look like this

04:34:06 MQT: tele/sonoff/SENSOR = {"Time":"2020-05-23T04:34:06","Switch2":"OFF"}

So I’ve changed the code to

  - platform: mqtt
    name: Garage Door
    state_topic: "tele/sonoff/SENSOR"
    value_template: '{{ value_json.Switch2  }}'
    command_topic: "cmnd/sonoff/POWER1"
    availability_topic: "tele/sonoff/LWT"
    payload_open: "1"
    payload_close: "1"
    payload_stop: "1"
    qos: 1
    state_open: "ON"
    state_closed: "OFF"
    retain: false
    payload_available: "Online"
    payload_not_available: "Offline"

then set the Telemetry period to 30

when I restart HA, the down arrow turn to grey, but the problem is that no matter how I change the state of the magnet, the state in HA will not change, and the downward arrow is always grey.

Thanks for reminder
But I’m using the latest version Home Assistant 0.110.1

I checked and I have my switch set at switchmode 2 1

I’ve done it, they are all solid black now.

I found a issue in tasmota is that the toggle 2 is always off even if I put the magnet on or away. does it matter?

the toggle 2 will turn to ON when I put the magnet on before I setup MQTT, after I done the MQTT setting, the state of toggle 2 won’t work at all.

Im not using a Sonoff Sv but i have the same configuration on tasmota and this configuration is working for me:

Switchretain
stat/garage/RESULT = {“SwitchRetain”:“ON”}
Powerretain
stat/garage/RESULT = {“PowerRetain”:“OFF”}
switchtopic2
stat/garage/RESULT = {“SwitchTopic”:“SENSOR”}
switchmode1
stat/garage/RESULT = {“SwitchMode1”:0}
switchmode2
stat/garage/RESULT = {“SwitchMode2”:2}

  cover:
  - platform: mqtt
    state_topic: "cmnd/SENSOR/POWER2"              #SwitchTopic Enabled
    command_topic: "cmnd/garage/POWER1"
    availability_topic: "tele/garage/LWT"  
    name: "Garage Door"
    qos: 0
    retain: false
    payload_open: "ON"
    payload_close: "ON"
    payload_stop: "ON"
    state_open: "ON"
    state_closed: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"  

Make sure that your reed switch is connected properly.

OMG
Your setting works to me!
finally works!

Thank you so much!!!