Problem with door contact with RTL_433 protocol in lovelace

I am trying to set up a door contact with RTL_433 protocol in lovelace. Unfortunately that doesn’t work for me.
With Node-Red I can evaluate the state of the sensor. When receiving a signal I send an e-mail with the status of a door (open/closed)

I would also like to display the sensor on lovelace with the status of the door.

The sensor in question is:
Amazon door contact

I get the following messages about Mqqt events:

Nachricht 2728 empfangen auf rtl_433/Generic-Remote/54164/0/cmd um 11:19:
14

With mqtt-explorer:
Sensor_RTL_433_Mqtt_Mqtt-Explorer_Protokoll

My configuration currently looks like this:

/config/my_binary_sensor.yaml

- platform: mqtt
  state_topic: rtl_433/Generic-Remote/54164/0/cmd
  name: Haustuer
  unique_id: 54164
  device_class: door
  value_template: "{{ 'ON' if value_json.cmd == '14' else 'OFF' }}"
  payload_on: "14"
  payload_off: "10"

In lovelace it looks like this, the senor “Haustuer is unknown”:

I’ve played around with the code a lot, but I can’t get the sensor activated under lovelace. Can someone help me?

1 Like

Do you have a device/entity created for your sensor as MQTT integration? Does it update its state if changed?

Thanks for yout replay. Yes, I have.
In the meantime I have solved the problem. In the end it was easy.
I needed the correct path:
rtl_433/Generic-Remote/54164/0/cmd

and this code:

- platform: mqtt
  name: Garage
  state_topic: rtl_433/Generic-Remote/54164/0/cmd
  payload_off: "14"
  payload_on: "10"
  device_class: opening

Sensor_RTL_433_Tor geschlossen

Sensor_RTL_433_Tor offen