Can sonoff RF bridge handle multiple MQTT messages published at the same time or in rapid succession?


#1

Hello,

I’m using Tasmota on a sonoff RF Bridge and I’ve hit a wall. If sent multiple MQTT messages (HA turning off all the lights for example) it would consume (read) all of them (all the MQTT messages) at the same time but it will process (convert to RF ) only the first message ignoring the others (it means it will turn on only once light). The only workaround Tasmota offers is to either do not publish many messages at the same time or add a delay (the clients that publish a message have to add a delay). I would expect instead, the RF consume 1 MQTT message, process it taking as much time as it needs and consume the next.

Does anybody know if OpenMQTTGateway has the same issue ?

Thanks


#2

Hello,

Could you indicate how many lights you have to turn off or on ?


#3

only 4. In Tasmota console I can see that the RF bridge “consumes” the 4 mqtt messages but only the first is converted to RF… and the bridge would restart… (one by one works well)…


#4

In my setup based on an arduino uno + ethernet shield the max devices that I switch on/off on the same time is 3/4 and it works. They are handle one by one.

Maybe the best way is to flash OMG, try it and give me your feedback.


#5

yes, I’ll try and let you know. In Flashing on an Tasmota device OTA? I’m invistigating how to flash it OTA on a Tasmota device. Thanks @1technophile


#6

installed. turning 1 light at the time it works well… Doing all at the same time I can see in mosquito:

home/OpenMQTTGateway/commands/MQTTtoSRFB {"value":7459748}
home/OpenMQTTGateway/commands/MQTTtoSRFB {"value":2975521}
home/OpenMQTTGateway/commands/MQTTtoSRFB {"value":2975524}
home/OpenMQTTGateway/commands/MQTTtoSRFB {"value":7459745}
home/OpenMQTTGateway/SRFBtoMQTT {"value":7459748}
home/OpenMQTTGateway/SRFBtoMQTT {"value":2975521}
home/OpenMQTTGateway/SRFBtoMQTT {"value":2975524}
home/OpenMQTTGateway/SRFBtoMQTT {"value":7459745}

but only the first one would be turned on (or off)…


Problem with sending fast on/off RF commands via OMG
#7

just tested Espurna and it works. It would read from MQTT, convert to RF and then repeat…


#8

interesting I will check why and try to correct this.


#9

How do you generate the “fire” of these commands?
Just try to reproduce your conditions


#10

here is the HA configuration for the three firmware I’ve tested (Tasmota, OMG and Espurna)

#   - &bridgeSwitch
#     platform: mqtt
#     command_topic: cmnd/bridge/rfcode
#     availability_topic: "tele/bridge/LWT"
#     payload_available: "Online"
#     payload_not_available: "Offline"
#     optimistic: true
#     retain: false
#     qos: 1
#     state_topic: "tele/bridge/RESULT"
#     state_value_template: '#{{value_json.RfReceived.Data}}'
#     name: "entrance"
#     payload_on: "#71D3A1"
#     payload_off: "#71D3A2"
#   - <<: *bridgeSwitch
#     name: "porch"
#     payload_on: "#71D3A4"
#     payload_off: "#71D3A8"
#   - <<: *bridgeSwitch
#     name: "kitchen window"
#     payload_on: "#2D6721"
#     payload_off: "#2D6722"
#   - <<: *bridgeSwitch
#     name: "kitchen mid"
#     payload_on: "#2D6724"
#     payload_off: "#2D6728"


#   - &omg
#     platform: mqtt
#     command_topic: "home/OpenMQTTGateway/commands/MQTTtoSRFB"
#     availability_topic: "home/OpenMQTTGateway/LWT"
#     payload_available: "online"
#     payload_not_available: "offline"
#     optimistic: true
#     retain: true
#     qos: 1
#     state_topic: "home/OpenMQTTGateway/SRFBtoMQTT"
#     state_value_template: '{"value":{{ value_json.value }}}'
#     name: "entrance"
#     payload_on: '{"value":7459745}' #"#71D3A1"
#     payload_off: '{"value":7459746}' #"#71D3A2"
#   - <<: *omg
#     name: "porch"
#     payload_on: '{"value":7459748}' #"#71D3A4"
#     payload_off: '{"value":7459752}' #"#71D3A8"
#   - <<: *omg
#     name: "kitchen window"
#     payload_on: '{"value":2975521}' #"#2D6721"
#     payload_off: '{"value":2975522}' #"#2D6722"
#   - <<: *omg
#     name: "kitchen mid"
#     payload_on: '{"value":2975524}' #"#2D6724"
#     payload_off: '{"value":2975528}' #"#2D6728"
#

- &esp
  platform: mqtt
  command_topic: "bridge/rfout/set"
  availability_topic: "bridge/status"
  payload_available: "1"
  payload_not_available: "0"
  optimistic: true
  retain: true
  qos: 1
  state_topic: "bridge/rfin"
  state_value_template: "{{ value  |regex_replace(find='^.{12}', replace='2BB6015E0442', ignorecase=False)}},1"
  name: "entrance"
  payload_on: '2BB6015E044271D3A1,1'
  payload_off: '2BB6015E044271D3A2,1'
- <<: *esp
  name: "porch"
  payload_on: '2BB6015E044271D3A4,1'
  payload_off: '2BB6015E044271D3A8,1'
- <<: *esp
  name: "kitchen window"
  payload_on: '2BB6015E04422D6721,1'
  payload_off: '2BB6015E04422D6722,1'
- <<: *esp
  name: "kitchen mid"
  payload_on: '2BB6015E04422D6724,1'
  payload_off: '2BB6015E04422D6728,1'