Impossible MQTT config, Cover with Sonoff Dual (Tasmota´s StefanBode fork)

Hello

I´ve been trying to configure a roller blind with this very useful fork of the very famous Tasmota firmware. It allows to interlock two switches, set running times for intermediate positions and configure more than one shutter with one NodeMCU (as an example); I´m using a sonoff Dual R2, and the hardware is working very well (even using a normal roller blind switch attached to two GPIOs), but for the life of me, I can´t configure MQTT properly, the blinds just appear as unavailable to HA.

This is my current config:

  - platform: mqtt
    name: "Persiana Salon"
    availability_topic: "salon/persiana1/tele/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    position_topic: stat/salon/persiana1/SHUTTER1
    position_open: 100
    position_closed: 0
    set_position_topic: "salon/persiana1/cmnd/shutterposition"
    command_topic: "salon/persiana1/cmnd/backlog"
    payload_open: "SHUTTEROPEN"
    payload_close: "SHUTTERCLOSE"
    payload_stop: "SHUTTERSTOP"
    retain: false
    optimistic: false
    qos: 1

And tried publishing through another client on my broker with salon/persiana1/cmnd/backlog and it accepts SHUTTEROPEN and SHUTTERCLOSE and works properly, but I don´t know how to make the shutter available on HA (shows it as unavailable, but the topic salon/persiana1/LWT shows it as Online in the external client)

Could it be that there is another retained flag that is causing it to not show on HA? (unlikely, just changed the topic and full topic to salon/persianaa and it doesn’t work either)

I´m at a complete loss here…

Also, in case it helps, this is from the console:

00:20:31 MQT: salon/persiana1/SHUTTER1 = 100 (retained)
00:20:31 MQT: salon/persiana1/RESULT = {"POWER1":"OFF"}
00:20:31 MQT: salon/persiana1/POWER1 = OFF (retained)
00:20:31 MQT: salon/persiana1/RESULT = {"SHUTTER-1":{"position":100, "direction":0}}
00:21:21 MQT: salon/persiana1/STATE = {"Time":"2019-02-27T00:21:21","Uptime":"0T08:30:39","Vcc":3.444,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"Montes01","BSSId":"34:97:F6:61:67:C0","Channel":8,"RSSI":52},"DeepSleep":0,"Heap":22768}
00:21:21 MQT: salon/persiana1/SENSOR = {"Time":"2019-02-27T00:21:21","Switch1":"ON","Switch2":"ON","SHUTTER-1":{"position":100, "direction":0}}

Already tried to get help from the Discord channel, but it seems that my time zone is a little off for the US (GMT +1)

Thanks everyone

what is your topic in the Tasmota web interface?

Hello

Same as here (this is from the console web interface):

00:20:31 MQT: salon/persiana1/SHUTTER1 = 100 (retained)
00:20:31 MQT: salon/persiana1/RESULT = {"POWER1":"OFF"}
00:20:31 MQT: salon/persiana1/POWER1 = OFF (retained)
00:20:31 MQT: salon/persiana1/RESULT = {"SHUTTER-1":{"position":100, "direction":0}}
00:21:21 MQT: salon/persiana1/STATE = {"Time":"2019-02-27T00:21:21","Uptime":"0T08:30:39","Vcc":3.444,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"Montes01","BSSId":"34:97:F6:61:67:C0","Channel":8,"RSSI":52},"DeepSleep":0,"Heap":22768}
00:21:21 MQT: salon/persiana1/SENSOR = {"Time":"2019-02-27T00:21:21","Switch1":"ON","Switch2":"ON","SHUTTER-1":{"position":100, "direction":0}}

So full topic would be salon/persiana1

I added info from. The console since this fork creates some different states, like SHUTTER1

Thanks a lot

what MQTT device are you using from home assistant? component wise. I don’t see a state topic so thats probably why you’re not seeing it in the frontend.

Yes, that’s exactly it. HA doesn’t get the state of my cover (I think because the state topic is not correct).

I’ve named the entity cover.persiana_salon

FINALLY!

A few changes here and there, and voilá, working with a normal wall switch, slider updating positions and all.

This particular fork allows for setting the shutter´s position based on time, and also allows for corrections.

This is the current config, so it may help others:

  - platform: mqtt
    name: "Persiana Salon"
    availability_topic: "salon/persianaA/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    position_topic: salon/persianaA/SHUTTER1
    position_open: 100
    position_closed: 0
    set_position_topic: "salon/persianaA/cmnd/shutterposition"
    command_topic: "salon/persianaA/cmnd/backlog"
    payload_open: "SHUTTEROPEN"
    payload_close: "SHUTTERCLOSE"
    payload_stop: "SHUTTERSTOP"
    retain: false
    optimistic: false
    qos: 1

Cheers all

2 Likes

OK

I’m just writing to thank Mr @stefanbode for this great fork.

I just installed the aforementioned Dual R2 module on a big shutter, and it´s working flawlessly (compiled with core 2.3.0).

Anyone wanting to install it can ask.

Thanks again.

Buenas!!
I have followed this tutorial for installing sonoff dual into my roller shutters

https://domology.es/persianas-y-sonoff-dual/

It works in tasmota and connects to my mqtt. The problem is the cover, its like it doesn’t send any message to the sonoff when i press the cover’s buttons. This is my config:

- platform: mqtt
  name: "Persiana Salón"
  availability_topic: "persiana_salon/tele/LWT"
  payload_available: "Online"
  payload_not_available: "Offline"
  position_topic: stat/persiana_salon/SHUTTER1
  position_open: 100
  position_closed: 0
  set_position_topic: "cmnd/persiana_salon/shutterposition"
  value_template: "{{value_json.POWER1}}"
  command_topic: "cmnd/persiana_salon/backlog"
  payload_open: "SHUTTEROPEN"
  payload_close: "SHUTTERCLOSE"
  payload_stop: "SHUTTERSTOP"
  retain: false
  optimistic: false
  qos: 1

I also tryed yours with my topic but doesn’t works. Do u have any idea?

Hola

Your shutter won’t send any message by itself. The sonoff does, estimating the time passed since the roller’s activation, and thus, the position; so, you have to connect your physical switch to your sonoff dual.

Ty for answering. I didn’t referred to that, I mean that the buttons of the cover in HA doesn’t respond. The fork is working perfectly at tasmota ip adress device.

Then, check if you changed your full topic in Tasmota. It should be left as is (from flashing). The problem is the command topic, which is not being recognized in HA.
Also, check your capitals, MQTT is case sensitive.