Subscribe MQTT message and display in notification

Hi, I have made a RFID reader and is able to send message to the topic “RFID”. For example, once I scan my card, it will send {“name”: “Michael”} to topic “RFID”.

I would like to display the name in hassio by using persistent notification, so I added below lines into automations.yaml, but it does not display the specific name as expect, instead it just exactly displays {{value_json.name}} in message field. Appreciate if anyone can point the right direction, thanks!

  • alias: RFID Notification
    trigger:
    platform: mqtt
    topic: RFID
    action:
    service: persistent_notification.create
    data:
    notification_id: ‘1’
    message: ‘{{value_json.name}}’
    title: ‘Hello’

%E6%8D%95%E8%8E%B7

Once you start adding json, you’re templating, so you need to change data: to data_template:

Also, when pasting code, use the preserve formatting tags </>. It makes your code much easier to read, and we can also help check for formatting issues :wink:

Hi all, I am trying to do the same (send persistent notifications via MQTT messages) with no luck. Can you explain what needs to be done on HA side to enable that (will appreciate a full example with all needed code) and what should I send over MQTT? Thanks a lot!