Dooya DT82tv Curtain Motors with Sonoff RF Bridge

I went through the BitBucketConverter.py thing just like you did. It sounds like I may be a bit more familiar with Python than you are (I use it at work day in and out), so it wasn’t too heavy a lift to get it done. Here are the codes I ended up with:

cover:
  - platform: mqtt
    name: "Master Bedroom Curtains"
    command_topic: "cmnd/sonoff-bridge/backlog"
    payload_open: "rfraw AA B0 35 05 04 12FC 05DC 02D0 0168 1EE6 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2B2B2A3B2B2B2 55;rfraw off"
    payload_close: "rfraw AA B0 35 05 04 12FC 05DC 02D0 0168 1EF0 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2B2A3A3B2B2A3 55;rfraw off"
    payload_stop: "rfraw AA B0 35 05 04 12FC 05DC 02C6 0168 1EE6 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2A3B2A3B2A3B2 55;rfraw off"
    set_position_template: "50"

They are similar up to a point. I didn’t actually try dropping your codes in my config file to see if they’d work. I would hope that each device they create has some unique address that keeps it from conflicting with other devices on the 433MHz bandwidth. I know that the moisture, door/window, and motion sensors I have are set up that way.

Any idea what that set_position_template: "50" does? I read through the mqtt cover component and still don’t really understand it.

Because there is no position feedback from the curtains this setting sets the position to the middle. If you don’t have it, when home assistant thinks that the windows are already open it Gray’s out the open button. You could have closed them with the remote or manually closed the curtain. So it would be out of sync and you couldn’t open them again

Thanks for the informative information, setting up python alone seemed to be the hardest part.

Did you happen to play around trying to store the raw B0 data on the Rfbridge for the use as a sensor by any chance? Hoping to intergrate a 443 remote to my home setup.

I am using my dooya with a broadlink rm pro. but it is only a transmitter, so if i use the dooya remote i won’t have feedback to home assistant. With sonoff rf bridge does it give feedback to home assistant? So if i open with manual remote the open button will be greyed out? Thank you

I have the same setup and actually worder about this as well. How to achieve this as sending and receiving are different codes.

I believe so, although I do not use it because it would easily get out of sync and there is no way of resynchronization apart from opening / closing the curtain.

When learning the codes you put the sonoff into read mode with rfraw 177. I believe that when it receives a RF signal it will send it out received B1 code over MQTT. I am currently renovating the room with the curtain so I don’t have it setup so can’t test it for you

I managed to get this done but I had to configure things slightly different. I use the stop position of the motors which means I had to use a template instead of MQTT cover because for the stop position you need to send the stop command 4 times (I use the cover motors not curtains motors but I assume it’s the same). As far as I know this is only possible using a script. I put the RF bridge in 166 mode to continuously listen to commands send by the wireless remote and input booleans to keep track of the status after a reboot.

I tried many different scenarios and it seems to work flawlessly. I can use the remote, HA front-end, automations, etc to control the blinds and HA always shows the actual position.

Hey i have been trying to get the B0 but every time the B1 code is different. here is a sample of the RfRaw Data that i got from the Sonoff RF Bridge.

00:13:29 CMD: rfraw 177
00:13:29 MQT: stat/ESPChip/RESULT = {"RfRaw":"ON"}
00:13:29 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AAA055"}}
00:13:41 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 05 0A1E 12FC 04E2 0262 7E04 48080808080808092A3B2A2A2A2B3A3B2B3A3B2B3A2B3A3B3B3B2B3A3B3B2A3B2A3B3B3B2A3B2B3B3A2B3A3B3B2A3B3B2B 55"}}
00:13:58 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 04 04EC 026C 0A14 134C B0819080808091819190819091808191909191809181909191919191819091918190918091819091819A2A2A2A2A2A2A 55"}}
00:14:04 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 04 0546 02D0 0A14 1338 B0819080808091809191819091819081909191809181909191919191819091918190918091819091819A2A2A2A2A2A2A 55"}}
00:14:09 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 04 0500 028A 0A0A 134C B0819080808091809180809181909191919191809181909191919191819091918190918091819091819A2A2A2A2A2A2A 55"}}
00:14:10 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 06 04E2 026C 0B90 00AA 010E 1338 D0819080808091808081909181919191909191809182BCC1C0C19191819091918190918091819091819A2A2A2A2A2A2A 55"}}
00:14:14 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 05 04EC 026C 017C 0A0A 134C C081908080809180819191909181A190809191809181909191919191819091918190918091819091819B3B3B3B3B3B3B 55"}}
00:14:28 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 05 0A0A 12F2 04EC 0276 7E0E 48080808080808092A3B2A2A2A2B3A3B2A3B3B2B3A2B3B3A2B3B3B3B3B3A2B3B3B3A2B3A2B3B3B3B3A2B3B3B3B3A2B3B3A2B 55"}}
00:14:30 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 05 0A0A 12F2 04EC 026C 7E04 48080808080808092A3B2A2A2A2B3A3B3B2B3A2B3A2A3B2B3B3B3B3B3B3A2B3B3B3A2B3A2B3B3B3B3A2B3B3B3B3A2B3B3A2B 55"}}
00:14:33 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 03 0532 02A8 053C A80918 55"}}
00:14:33 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 05 0A0A 12FC 04EC 026C 7E04 48080808080808092A3B2A2A2A2B3A3B3B3B2A2B3A2A2B3B3B3B3B3B3B3A2B3B3B3A2B3A2B3B3B3B3A2B3B3B3B3A2B3B3A2B 55"}}
00:14:35 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 03 0212 049C 06A4 280808091809 55"}}
00:14:35 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 05 0A1E 12FC 04E2 026C 7E22 48080808080808092A3B2A2A2A2B3A3B3B3B3B3B2B3A2A2A2B3B3B3B3B3A2B3B3B3A2B3A2B3B3B3B3A2B3B3B3B3A2B3B3A2B 55"}}
00:14:37 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 05 0A0A 12F2 04EC 026C 7E0E 48080808080808092A3B2A2A2A2B3A2B3B3B3A2B3A3B2A2B3B3B3B3B3B3A2B3B3B3A2B3A2B3B3B3B3A2B3B3B3B3A2B3B3A2B 55"}}
00:14:41 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 05 0A14 12FC 04E2 0262 7E04 48080808080808092A3B2A2A2A2B3A2B3A3B3B2B3A3B2B3A2B3B3B3B3B3A2B3B3B3A2B3A2B3B3B3B3A2B3B3B3B3A2B3B3A2B 55"}}
00:14:42 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 05 0A14 1306 04EC 026C 7E04 48080808080808092A3B2A2A2A2B3A2A2B3A2B3A3B3B3B2B3B3B3B3B3B3A2B3B3B3A2B3A2B3B3B3B3A2B3B3B3B3A2B3B3A2B 55"}}
00:14:43 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 05 0A0A 12F2 04EC 026C 7E04 48080808080808092A3B2A2A2A2B3A2A2A3B2B3A3B3B3B3B2B3B3B3B3B3A2B3B3B3A2B3A2B3B3B3B3A2B3B3B3B3A2B3B3A2B 55"}}
00:14:45 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 05 0A1E 12FC 04E2 0262 7E22 48080808080808092A3B2A2A2A2B3A2A3B2A2B3A3B3B2B3B3B3B3B3B3B3A2B3B3B3A2B3A2B3B3B3B3A2B3B3B3B3A2B3B3A2B 55"}}
00:14:46 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 03 021C 04B0 06AE 280808091809 55"}}
00:14:47 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 05 0A1E 1306 04E2 026C 7E22 48080808080808092A3B2A2A2A2B3A2A3B3B3B2B3A3B3B2A2B3B3B3B3B3A2B3B3B3A2B3A2B3B3B3B3A2B3B3B3B3A2B3B3A2B 55"}}
00:14:48 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 03 0212 049C 0672 280809 55"}}
00:14:50 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 04 04EC 0280 0A0A 1342 B08190808080918190808091809191919191819091918091809191918091819190819091918091918A2A2A2A2A2A2A 55"}}
00:15:01 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 03 0212 0492 05B4 280809 55"}}
00:15:03 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 04 0532 02BC 0A14 140A B08190808080918190919180918091809191819091918091809191918091819190819091918091918A2A2A2A2A2A2A 55"}}
00:15:10 MQT: tele/ESPChip/RESULT = {"RfRaw":{"Data":"AA B1 03 0208 049C 0596 280809 55"}}

Convert to B0 and try them out, then you’d know which one works.

@c_wolsey or @sjee

Have these curtain motors provided reliable in operation?

I am looking at replacing my standalone motor as the gears are stripping. It was only about £40 of ebay.

The living room died pretty soon as my window is 3.6M wide and the bedroom one is pretty much shot.

Does anyone happen to know how to convert these to the broadlink rm pro packet format? Or have them? … as I’m struggling with getting the codes from either broadlink.learn or the e-control dump method.

  • Open Curtains: RfRaw AA B0 35 05 04 12F2 05FA 02B2 0140 1EA0 2401233223322332232332232323322332232332323232232332323232323223322332323223323232 55
  • Close Curtains: RfRaw AA B0 35 05 04 1306 05D2 02DA 0168 1E96 2401233223322332232332232323322332232332323232232332323232323223322332322323323223 55
  • Stop Curtains: RfRaw AA B0 35 05 04 1310 05C8 02E4 015E 1E96 0123322332233223233223232332233223233232323223233232323232322332233223322332233224 55

HI Amazing description it saved me a lot of work when i was about to drop the issue.

thanks to your explanation i manged to install python etc etc on windows and i managed to make work few code however they only worked once.

this is the remote model

RE1011

This are BO that worked ONCE

light on:

rfraw AA B0 57 05 08 01C2 0136 0ECE 02D0 5CEE 4818181818181818080808080808080808080808080808283B08083B08380B08083B0808083B083B0838080B3808080808080B3808080808080B0838080B0808080808380B3B08083B0838 55;rfraw off

rfraw AA B0 54 05 08 01C2 0136 0EC4 02EE 5CE4 48181818181818180808080808080808080808080808082808380808080B3B380808080B083B3808080B3B083B3B380B083B3B380B0838080B3B380808080B080808380808080B38 55;rfraw off

close:

rfraw AA B0 55 05 08 01C2 012C 0ECE 02EE 5E60 4818181818080808080808080808080808080808080808280808080808083B08080808080838080B080808083B083B3B3B08083B3B3B08083B08083B380B3B3B08080808080808083B 55;rfraw off
rfraw AA B0 53 05 08 01D6 0118 0EC4 02EE 5CDA 481818181818181818181818181818080808080808180828183B080808380B3B0808083B380B080808380B08083B3B3B08083B3B3B080808083B083B380B08380B3B0808083808 55;rfraw off
rfraw AA B0 51 05 08 01C2 012C 0ECE 02EE 5CBC 481818181818180808080808080808080808080808080828083B08380B3B3B08380B08380B08380B3B0808380B380B0808380B380B0808083B3B3B380B08083B3B08380B38 55;rfraw off

Does anyone knows why ?

This has been probably the most helpful thread for me so far, once I got the Sonoff flashed anyhow. I’m trying to do the same thing, but for some reason when I try to send commands from HA, the Sonoff isn’t getting them, and I think it has to do with it not being subscribed to the MQTT channel. And I am having trouble figuring out how. When I click on the “down” command from the badge in HA, I can see that the broker is getting the message, using MQTT.fx. Here also is my HA configuration.yaml portion for this entity as well as my mqtt broker settings. Any guidance on how to make this last hurdle would be greatly appreciated.
If it matters, I’m running HA in docker on Ubuntu 18.04, but the MQTT broker(Mosquitto) is not dockerized, but is on the same device (same IP, that’s why the loopback address for broker IP)

Broker settings:

mqtt:
  broker: 127.0.0.1
  discovery: true
  discovery_prefix: RF_Bridge
  username: xxxx
  password: xxxx

Entity:

cover:
  - platform: mqtt
    name: "LR Blinds"
    command_topic: "cmnd/sonoffRFBridge/Backlog"
    payload_open: "rfraw AA B0 36 05 08 09A6 0668 0140 028A 15EA C092A3A3A3A3A3A3B2B2B2B2A3B2B2B2A3B2B2A3A3A3B2A3A3A3B2A3A3A3A3A3A3A3A3A3B2A3B2B2B2A3 55; rfraw off"
    payload_stop: "rfraw AA B0 36 05 08 09A6 0668 014A 028A 15EA C092A3A3A3A3A3A3B2B2B2B2A3B2B2B2A3B2B2A3A3A3B2A3B2A3B2A3A3A3A3A3A3A3A3A3B2A3B2B2A3A3 55; rfraw off"
    payload_close: "rfraw AA B0 36 05 08 09A6 065E 014A 028A 15EA C092A3A3A3A3A3A3B2B2B2B2A3B2B2B2A3B2B2A3A3A3A3A3B2B2B2A3A3A3A3A3A3A3A3A3B2A3A3A3B2B2 55; rfraw off"

mqtt-fx

EDIT:
I was able to get it working…by simply wiping the config of the Sonoff RF Bridge and putting back in the settings one at a time. Either something got corrupted or maybe I put in some setting that was screwing things up that I just didn’t see. Anyhow, this is a great thread for figuring out how to send commands to devices that don’t have “built in” rf codes and that have to be learned, converted, etc.
I do have another problem that isn’t related now…seems that HA Cloud is somehow relaying to Alexa that this device is a “door” and not a “cover”, so I am only getting a toggle option to control in creating a voice controlled routine. Gonna see if I can get some assistance from NabuCase on that one.

Anyone who is using this solution, I have a quick update. I was unable to use the position_template thing that c_wolsey was using to determine position/state and earlier I was looking for a way to retain the states of my door/window sensors when I found this thread.

The thread shows you how to set up automations for simple sensors that don’t have MQTT/Sonoff stored position data. That way, the automations can force retention of the sensor’s state by the MQTT broker. Anyway, I used that model to set up a way to store the state data for the curtain when I send a command from my remote or HA. This is what my automation looks like:

- id: publish_mqtt_from_master_bedroom_curtain_codes
  alias: Publish MQTT From Master Bedroom Curtain Codes
  trigger:
    - platform: mqtt
      topic: 'cmnd/sonoff-bridge/backlog'
  condition:
    - condition: template
      value_template: "{{ trigger.payload in ('rfraw AA B0 35 05 04 12FC 05DC 02D0 0168 1EE6 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2B2B2A3B2B2B2 55;rfraw off', 'rfraw AA B0 35 05 04 12FC 05DC 02D0 0168 1EF0 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2B2A3A3B2B2A3 55;rfraw off', 'rfraw AA B0 35 05 04 12FC 05DC 02C6 0168 1EE6 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2A3B2A3B2A3B2 55;rfraw off') }}"
  action:
    - service: mqtt.publish
      data_template:
        topic: "433/Master_Bedroom_Curtain"
        payload: >-
          {%- if trigger.payload == 'rfraw AA B0 35 05 04 12FC 05DC 02D0 0168 1EE6 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2B2B2A3B2B2B2 55;rfraw off' -%}
            ON
          {%- else -%}
            OFF
          {%- endif -%}
        retain: True

Now I have a state_topic in MQTT called 433/Master_Bedroom_Curtain and if I add to my curtain cover the state_topic, state_open and state_closed like this:

  - platform: mqtt
    device_class: curtain
    name: "Master Bedroom Curtains"
    command_topic: "cmnd/sonoff-bridge/backlog"
    payload_open: "rfraw AA B0 35 05 04 12FC 05DC 02D0 0168 1EE6 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2B2B2A3B2B2B2 55;rfraw off"
    payload_close: "rfraw AA B0 35 05 04 12FC 05DC 02D0 0168 1EF0 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2B2A3A3B2B2A3 55;rfraw off"
    payload_stop: "rfraw AA B0 35 05 04 12FC 05DC 02C6 0168 1EE6 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2A3B2A3B2A3B2 55;rfraw off"
    state_topic: "433/Master_Bedroom_Curtain"
    state_open: "ON"
    state_closed: "OFF"

It will set the state when I click a button. Click ‘open’ and the icon changes to opened, click ‘close’ and the icon changes to closed. Obviously, this isn’t ideal/perfect because there is a delay on the curtain to open/close but it works very well since we don’t have a native position value from the unit. You’ll notice that if I hit the ‘stop’ button it’ll act like the curtain is closed – not sure what to do with that… :slight_smile:

==EDIT==

So I’ve been messing with this thing a little more and I found that I can setup and if, elif, else integrating the stop button and taking advantage of the position_topic instead of the state_topic. It works even better!

configuration.yaml:

cover:
  - platform: mqtt
    device_class: curtain
    name: "Master Bedroom Curtains"
    command_topic: "cmnd/sonoff-bridge/backlog"
    payload_open: "rfraw AA B0 35 05 04 12FC 05DC 02D0 0168 1EE6 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2B2B2A3B2B2B2 55;rfraw off"
    payload_close: "rfraw AA B0 35 05 04 12FC 05DC 02D0 0168 1EF0 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2B2A3A3B2B2A3 55;rfraw off"
    payload_stop: "rfraw AA B0 35 05 04 12FC 05DC 02C6 0168 1EE6 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2A3B2A3B2A3B2 55;rfraw off"
    position_topic: "433/Master_Bedroom_Curtain"

automation.yaml:

automation:
- id: publish_mqtt_from_master_bedroom_curtain_codes
  alias: Publish MQTT From Master Bedroom Curtain Codes
  trigger:
    - platform: mqtt
      topic: 'cmnd/sonoff-bridge/backlog'
  condition:
    - condition: template
      value_template: "{{ trigger.payload in ('rfraw AA B0 35 05 04 12FC 05DC 02D0 0168 1EE6 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2B2B2A3B2B2B2 55;rfraw off', 'rfraw AA B0 35 05 04 12FC 05DC 02D0 0168 1EF0 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2B2A3A3B2B2A3 55;rfraw off', 'rfraw AA B0 35 05 04 12FC 05DC 02C6 0168 1EE6 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2A3B2A3B2A3B2 55;rfraw off') }}"
  action:
    - service: mqtt.publish
      data_template:
        topic: "433/Master_Bedroom_Curtain"
        payload: >-
          {%- if trigger.payload == 'rfraw AA B0 35 05 04 12FC 05DC 02D0 0168 1EE6 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2B2B2A3B2B2B2 55;rfraw off' -%}
            100
          {%- elif trigger.payload == 'rfraw AA B0 35 05 04 12FC 05DC 02D0 0168 1EF0 A481A3A3B2B2B2A3A3A3B2A3A3A3B2B2A3A3A3A3A3A3B2A3B2B2B2B2B2B2B2A3B2A3B2B2A3A3B2B2A3 55;rfraw off' -%}
            0
          {%- else -%}
            50
          {%- endif -%}
        retain: True

Anyway, thought I’d share.
-Greg

1 Like

Hi All,

Does anybody has any idea or can address me to the possible solution?

Anyone have a Dooya DD2700H remote? Seems potentially different from the above, as I can’t get the B1 codes sniffed for it.

I am using a Sonoff 433 RF Bridge running the latest Tasmota+Portisch firmware in bridg (25) mode, and when I run rfraw 177, nothing shows up. I can get codes when testing with another MinkaAire RF remote so I know the portisch firmware is otherwise working.

@steveholix did you ever get th dd2700h to work? I am experiencing the exact same thing.

HI appreciate any advice as to where i’m going wrong. I have an RF Bridge flashed with Portische, I have some lights working and have used https://bbconv.hrbl.pl/ (online bitbucket converter). However I have tried for the DCV2700 Remote and I get no success - I dont like the idea of doing Python install (had nightmares with it before).
My question is - Is there any difference between installing the python as suggested above and using the online converter?
Thanks

Hi. Sorry for resurrecting an old thread. I got everything to work but I can’t get position state to work. It always shows “unavailable”. I stumbled on your post. Care to enlighten how you did this? Thanks!