MQTT Event: How to implement

Dear all,

I’m trying to make my doorbell smart. I got the bell signal tunneled to a Mosquitto-Server. I successfully started to use this information as a MQTT Binary Sensor, but this seems not to be the right approach for me, see my discussion here, as I manually have to reset the button. Not very elegant.

I searched a bit on the docs and I found the “MQTT Event” type: MQTT Event - Home Assistant The “MQTT Event” looks like the right approach, but I’m to inexperienced to implement it properly, I assume. While the button works, the event does not register anything.

Here is my code:

mqtt:
  - event:
      name: "Türklingel"
      state_topic: "rtl_433/9b13b3f4-rtl433-next/devices/Honeywell-ActivLink/Doorbell/476604/alert"
      event_types:
        - press
      device_class: "doorbell"
      unique_id: turklingel

Can you assist? I found no useful examples on the “MQTT Event” type.

Thanks a lot!

Looks like from your previous discussion you don’t want to reset after the momentary button press. Not sure why you don’t think it’s elegant as it’s a good approach if it works.

Maybe you want to reclassify it as a device trigger instead? Follow guide, remote button press is the same type as your doorbell.

@tylas13 Thank you. This looks like the right device, but the docs say:

“MQTT device triggers are only supported through MQTT discovery, manual setup through configuration.yaml is not supported. The discovery topic needs to be: <discovery_prefix>/device_automation/[<node_id>/]<object_id>/config . Note that only one trigger may be defined per unique discovery topic. Also note that the combination of type and subtype should be unique for a device.”

I have no idea if (and how) the rtl_433 add-on is able to provide the MQTT topic in this specific form. Looks like I have a problem here.

Honestly, I do not understand why the MQTT Event is not working properly…

@Tobster77 At least some Honeywell doorbells are supported by the autodiscovery script. I know mine is and here’s what gets posted to the configuration topic. I don’t think yours is based on the “alert” subtopic.

If you post this to the MQTT broker by hand, you can modify it to match your doorbell.

In homeassistant/device_automation/Honeywell-ActivLink-Doorbell-789047/Honeywell-ActivLink-Doorbell-789047-Knock/config I have:

{
  "automation_type": "trigger",
  "type": "button_short_release",
  "subtype": "button_1",
  "payload": 0,
  "topic": "rtl_433/local-rtl433/devices/Honeywell-ActivLink/Doorbell/789047/secret_knock",
  "platform": "mqtt",
  "device": {
    "identifiers": [
      "Honeywell-ActivLink-Doorbell-789047"
    ],
    "name": "Honeywell-ActivLink-Doorbell-789047",
    "model": "Honeywell-ActivLink",
    "manufacturer": "rtl_433"
  }
}