Tasmota: RF bridge: Only first of multiple MQTT commands gets executed

Created on 27 Jun 2018  路  7Comments  路  Source: arendst/Tasmota

When receiving multiple MQTT commands at once, only first command seems to be executed.

I have a setup where I use a _Sonoff RF Bridge 433_ and use the Home Assistant MQTT light component along with some Elro 433MHz power outlets to control multiple lights around the apartment. Switching the individual lights on/off via Home Assistant / MQTT works just fine. The QoS of the messages is set to level 1 _(delivered at least once)_.

I have grouped three lights into a light group which causes them to be switched together. Using the Tasmota console, I can also see that all three commands have been received by the Tasmota / Sonoff Bridge:

00:28:33 MQT: tasmota/sonoff-rf-bridge/stat/RESULT = {"RfCode":"#401454"}
00:28:33 MQT: tasmota/sonoff-rf-bridge/stat/RESULT = {"RfCode":"#401514"}
00:28:33 MQT: tasmota/sonoff-rf-bridge/stat/RESULT = {"RfCode":"#501154"}

Yet, only the first socket is switched on/off.

I suppose this may be due to either of the two following issues:

  1. the three commands are being triggered too closely together and therefore not being interpreted as distinct commands by the individual sockets, or
  2. the bridge simply ignores the last two commands and only sends the first one.

When then manually triggering RfCode #401514 or RfCode #501154, e.g. via the console, the respective lights switch as expected.

Checklist

  • [x] Searched the problem in issues and in the wiki
    _(proved hard since I didn't quite know what to look for)_
  • [X] Hardware used: Sonoff Rf Bridge 433 (new version from 2018)
  • [X] Provide the output of command status 0 :
00:50:55 CMD: status 0
00:50:55 MQT: tasmota/sonoff-rf-bridge/stat/STATUS = {"Status":{"Module":25,"FriendlyName":["Sonoff"],"Topic":"sonoff-rf-bridge","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"SaveData":1,"SaveState":1,"ButtonRetain":0,"PowerRetain":0}}
00:50:55 MQT: tasmota/sonoff-rf-bridge/stat/STATUS1 = {"StatusPRM":{"Baudrate":19200,"GroupTopic":"sonoffs","OtaUrl":"http://sonoff.maddox.co.uk/tasmota/sonoff.ino.bin","RestartReason":"Power on","Uptime":"0T00:09:26","StartupUTC":"2018-06-26T23:41:29","Sleep":0,"BootCount":19,"SaveCount":54,"SaveAddress":"FA000"}}
00:50:55 MQT: tasmota/sonoff-rf-bridge/stat/STATUS2 = {"StatusFWR":{"Version":"5.13.1","BuildDateTime":"2018-05-10T01:59:37","Boot":31,"Core":"2_4_0","SDK":"2.1.0(deb1901)"}}
00:50:55 MQT: tasmota/sonoff-rf-bridge/stat/STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["Pica Pica Net",""],"TelePeriod":300,"SetOption":["00008009","55818000"]}}
00:50:55 MQT: tasmota/sonoff-rf-bridge/stat/STATUS4 = {"StatusMEM":{"ProgramSize":515,"Free":488,"Heap":17,"ProgramFlashSize":1024,"FlashSize":1024,"FlashMode":3}}
00:50:55 MQT: tasmota/sonoff-rf-bridge/stat/STATUS5 = {"StatusNET":{"Hostname":"sonoff-rf-bridge-4719","IPAddress":"192.168.2.126","Gateway":"192.168.2.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.2.1","Mac":"DC:4F:22:CB:32:6F","Webserver":2,"WifiConfig":3}}
00:50:55 MQT: tasmota/sonoff-rf-bridge/stat/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.2.128","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_CB326F","MqttUser":"mqtt","MqttType":1,"MAX_PACKET_SIZE":1000,"KEEPALIVE":15}}
00:50:55 MQT: tasmota/sonoff-rf-bridge/stat/STATUS7 = {"StatusTIM":{"UTC":"Tue Jun 26 23:50:55 2018","Local":"Wed Jun 27 00:50:55 2018","StartDST":"Sun Mar 25 02:00:00 2018","EndDST":"Sun Oct 28 03:00:00 2018","Timezone":1,"Sunrise":"05:19","Sunset":"20:28"}}
00:50:55 MQT: tasmota/sonoff-rf-bridge/stat/STATUS10 = {"StatusSNS":{"Time":"2018-06-27T00:50:55"}}
00:50:55 MQT: tasmota/sonoff-rf-bridge/stat/STATUS11 = {"StatusSTS":{"Time":"2018-06-27T00:50:55","Uptime":"0T00:09:26","Vcc":3.394,"Wifi":{"AP":1,"SSId":"Pica Pica Net","RSSI":100,"APMac":"70:3A:CB:9A:14:9C"}}}

To Reproduce

  1. Set up a Tasmota Sonoff Rf Bridge to control multiple 433MHz power outlets
  2. Using MQTT, send commands for multiple sockets _at the same time_ (e.g. using Home Assistant and a light group containing multiple MQTT lights)

Expected behavior
I would expect that every 433MHz switch reacts to the commands sent to them.

Actual behavior
Only the first command received by the bridge seems to have an effect.

Additional context
I have already tried using the delay command to set a delay between the subsequent commands, but to no avail.

From the wiki:

Management

Command | Payload | Description
------------------|------------|-------------------------------------------------------------------------------
Delay | | Reset backlog delay to 0.2 seconds
Delay | 2..3600 | Set delay between two backlog commands with 0.1 seconds increment

I'd appreciate any pointers towards what the issue might be and how it could be addressed.

Thank you :)

(Please, remember to close the issue when the problem has been addressed)

Most helpful comment

I had the same issue. worked around it using the suggestion above, but it's far from ideal.

It would be good to have a delay param, or setting.

your homeassistant switch config will look like:

- platform: mqtt
  name: some_switch
  command_topic: "cmnd/sonoff/Backlog"
  payload_on: "RfCode 1234; Delay 5;"
  payload_off: "RfCode 1235; Delay 5;"

All 7 comments

You are right, the commands need a delay beetween sending. RF Power Outlets are to slow....
Command delay is only used for command Backlog!
So i see two possibilitys:
Switch your group with Command Backlog with a Delay setting that works or
do the neccersary delay in HA

You could change your setup for the bridge as follow.
define the switch command ON / OFF always with the command backlog

Sniplet example (HA OpenHAB) needs adaption for HA:

{ mqtt=">[broker:cmnd/sonoff-bridge/Backlog:command:ON:Delay 2; RfSync 11320; RfLow 360; RfHigh 1090; RfCode #151514; Delay 20; Status7]" }

Sending RF timing commands and the RFCode fast in order change delay time to 20 and send dummy command after the needed wating time.

Thanks @Jason2866 for your quick reply! I will try to get this to work with Home Assistant :) Though I then probably won't be able to use the built-in MQTT light component.

If anyone has solved this with HA I'd be happy about pointers to how to best add the delay

Hi,

Could you manage to solve your issue?

I had the same issue. worked around it using the suggestion above, but it's far from ideal.

It would be good to have a delay param, or setting.

your homeassistant switch config will look like:

- platform: mqtt
  name: some_switch
  command_topic: "cmnd/sonoff/Backlog"
  payload_on: "RfCode 1234; Delay 5;"
  payload_off: "RfCode 1235; Delay 5;"

Hi,

@nicolas-fricke

Have you managed to solve your issue with the workaround explained by @vkhurana ?

Closing as there is no feedback. Solution explained above.

Was this page helpful?
0 / 5 - 0 ratings