How to create several MQTT binary sensors

Hey folks,
I’m successfully using Sonoff RFBridge to Receive 433Mhz signals and send them to MQTT server topic.
First try: created one binary sensor in configuration.xml and it works like a charme.

mqtt:                                    
  binary_sensor:              
    unique_id: deckenfluter_0
    name: "Deckenfluter"            
    state_topic: "tele/tasmota_rfbridge/RESULT"
    value_template: "{{ value_json.RfReceived.Data }}"
    payload_on: "545533"            
    payload_off: "54553C"

for now I would like to create several MQTT binary sensors without success; HA is starting but only the last (!) entry in my list of ‘unique_ids’ is accepted; so what is the right syntax to get it working in configuration.yaml, please?

Kind Regards from Cologne

post your multiple sensor code
quite sure you added something in eccess (i.e. mqtt: :slight_smile: )

Can you please post your attempt to add more than one sensor and format it properly for the forum as per the instructions here: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

WOW! what a response time!

here’s what I tried in configuration.yaml to get more than one sensor working:

  mqtt:
    - binary_sensor:
        unique_id: deckenfluter_0
        name: "Deckenfluter"
        state_topic: "tele/tasmota_rfbridge/RESULT"
        value_template: "{{ value_json.RfReceived.Data }}"
        payload_on: "545533"
        payload_off: "54553C"
        qos: 1
    - binary_sensor:
        unique_id: kaminlampe_0
        name: "Kaminlampe"
        state_topic: "tele/tasmota_rfbridge/RESULT"
        value_template: "{{ value_json.RfReceived.Data }}"
        payload_on: "5455C3"
        payload_off: "5455CC"
        qos: 1
    - binary_sensor:
        unique_id: kugellampe_0
        name: "Kugellampe"
        state_topic: "tele/tasmota_rfbridge/RESULT"
        value_template: "{{ value_json.RfReceived.Data }}"
        payload_on: "501703"
        payload_off: "50170C"
        qos: 1
mqtt:
    binary_sensor:
      - unique_id: deckenfluter_0
        name: "Deckenfluter"
        state_topic: "tele/tasmota_rfbridge/RESULT"
        value_template: "{{ value_json.RfReceived.Data }}"
        payload_on: "545533"
        payload_off: "54553C"
        qos: 1

      - unique_id: kaminlampe_0
        name: "Kaminlampe"
        state_topic: "tele/tasmota_rfbridge/RESULT"
        value_template: "{{ value_json.RfReceived.Data }}"
        payload_on: "5455C3"
        payload_off: "5455CC"
        qos: 1

      - unique_id: kugellampe_0
        name: "Kugellampe"
        state_topic: "tele/tasmota_rfbridge/RESULT"
        value_template: "{{ value_json.RfReceived.Data }}"
        payload_on: "501703"
        payload_off: "50170C"
        qos: 1

More general:

mqtt:
    binary_sensor:
      - unique_id: ...
      - unique_id: ...
    sensor:
      - unique_id: ...
      - unique_id: ...
    number:
      - unique_id: ...
      - unique_id: ...

I’ve just realized that documentation for this is very hidden. Maybe the examples on the pages I’ve listed above should be updated. @Cybolord would you be willing to invest the work?

The part of documentation that explains my format can be found here: https://www.home-assistant.io/integrations/mqtt/#yaml-configuration-keyed-and-bundled-by-domain

Great stuff! Thank you very much, ThomDietrich!

It’s working like a charme - you saved me a lot of time :smiley: :+1: