Get device's friend_name and entity_id from device_id

when new device add in my hass, I want to know.
I used automation to get device_id when new device access.

alias: event_test
description: ''
  - platform: event
    event_type: device_registry_updated
    context: {}
condition: []
  - service: mqtt.publish
      topic: /event/test
      payload_template: '{{|to_json(ensure_ascii=False) }}'
mode: parallel
max: 20

I want to konw this device’s friend_name and entities that belong to this device from device_id automatically?
I don’t know if this demand can be realized ,hahaha!
please help me ,thanks!

1 Like