Multiple Sonoff RF receiving the same 433mhz command

Tags: #<Tag:0x00007f78064730d0>

Hello,

I have 3 sonoff RF bridges spread out in my home (flashed with Tasmota of course)

I have one 433mhz fire detector sending one single trigger command.

12:03:53 MQT: tele/sonoff_rf/RESULT = {"Time":"2020-02-13T12:03:53","RfReceived":{"Sync":12440,"Low":420,"High":1270,"Data":"9B1864","RfKey":"None"}}

Then in HA, I have a very simple automation

- alias: Feu chez moi !
  trigger:
    - platform: mqtt
      topic: "tele/sonoff_rf/RESULT"
  condition:
    - condition: template
      value_template: "{{ trigger.payload_json['RfReceived']['Data'] == '9B1864' }}"
[...]

My problem is when the fire detector fires up, 2 or 3 sonoff RF bridges receive the 433mhz signal and then the automation triggers 2 or 3 times in a row instead of once.

How can I avoid that ?

I have heard of Load Balancing With Shared Subscriptions in MQTT but I have yet to understand how to implement that. I am not even sure this applies to my present issue.

Any help would be greatly appreciated.

Thanks!

Set each RF bridge to post to a different mqtt topic?

Thanks for your reply.

I thought of that but then I would lose the opportunity to wander around my house with my Sonoff Remote and always have coverage with at least one of the sonoff RF bridges.

Also, Seting each RF bridge to post to a different mqtt topic would complexify the code.

I am sure there is a way on the MQTT broker to allow that, I just don’t know how to set this up.

I found a workable solution to the problem that is far from perfect but does the job. I set up a condition that checks the last time the automation was triggered and thus avoids multiple automation triggers to one 433mhz signal.

A 1-second interval seems enough.

'{{ as_timestamp(now()) - (as_timestamp(state_attr("automation.feu_chez_moi", "last_triggered")) or 0) > 1 }}'

The automation then looks as such:

- alias: Feu chez moi !
  trigger:
    - platform: mqtt
      topic: "tele/sonoff_rf/RESULT"
  condition:
    condition: and
    conditions:
    - condition: template
      value_template: '{{ as_timestamp(now()) - (as_timestamp(state_attr("automation.feu_chez_moi", "last_triggered")) or 0) > 1 }}'
    - condition: or
      conditions:
      - condition: template
        value_template: "{{ trigger.payload_json['RfReceived']['Data'] == '9B1864' }}"

A couple of thoughts

  1. When your automation triggers, you can turn off that automation as a step in the actions, add a delay (say 30 sec) and then have the automation turn itself back on - all in the same automation

  2. (optional) You could set up the mqtt topic sa an mqtt sensor (or mqtt binary sensor). This would mean you could see history on when the alarm fired etc … although you may need a way to “turn off” the alarm if the sonoff does not send an alarm off confirmation.

Hope this helps

Phil

That actually helped a LOT. Thanks for sharing a brilliant idea :slight_smile: