I managed to get a doorbell read by the rtl_433 add-on. It sends a MQTT message whenever the button is pressed. I never worked manually with MQTT, but this is a screenshot from MQTT Explorer:
But this entity does not register anything when a message arrives on the MQTT server. I think I need more than this to later create an automation when the doorbell is ringing?
alias: Front Door Bell
description: ""
mode: single
triggers:
- topic: rtl_433/9b13b3f4-rtl433/devices/Generic-Remote/3745/tristate
payload: 001XXX0Z00XX
trigger: mqtt
conditions: []
actions:
- data:
message: TTS
data:
tts_text: Front door bell
media_stream: alarm_stream_max
tag: Alarm
priority: high
action: notify.mobile_app_sm_g981u1
You can just use an automation to alert you when doorbell rings without creating a sensor.
Still, this is not a really consistent solution (while it does the job!): I have to manually reset the switch after a second. A doorbell is a button, not a switch.
The HA documentation of MQTT events explicitly mentions “MQTT events are stateless. For example, a doorbell does not have a state like being “on” or “off” but instead is momentarily pressed.”
This would really make sense, but where is my implementation of the MQTT event (as tried above) wrong? It simply does not react when I press the doorbell, while the binary switch does.