Ok, so @chemelli and I have conjured up this automation:
- alias: New device registered config
id: New device registered config
mode: queued
trigger:
platform: event
event_type: entity_registry_updated
event_data:
action: create
condition: >
{{trigger.event.data.entity_id.startswith('device_tracker')}}
action:
- variables:
entity: >
{{trigger.event.data.entity_id}}
name: >
{{state_attr(entity,'friendly_name')}}
host: >
{{state_attr(entity,'host_name')}}
ip: >
{{state_attr(entity,'ip')}}
mac: >
{{state_attr(entity,'mac')}}
id: >
{{device_id(entity)}}
config: >
entity:{{entity}},
name:{{name}},
host:{{host}},
ip:{{ip}},
mac:{{mac}},
id:{{id}}
- service: system_log.write
data:
message: >
{{config}}
level: warning
logger: homeassistant.components.device_tracker
- service: persistent_notification.create
data:
title: >
New device registered: {{name}}
message: >
New device config: {{config}}
which works beautifully, and makes it very easy to check the new device and maybe edit it to suit your display needs in Lovelace.
We thought it would make a nice BP. However, since ive never used a BP before, and because of that have no real idea what we would need to change for it to become a BP, I am seeking some assistance from the community.
Which BP guru can help me out here? Any help is appreciated.
if remotely useful, for legacy device trackers one can still use:
- alias: New device tracked legacy
id: New device tracked legacy
trigger:
platform: event
event_type: device_tracker_new_device
action:
service: persistent_notification.create
data:
title: >
Newly tracked: {{trigger.event.data.entity_id}}
message: >
New device tracked: ({{trigger.event.data.entity_id}})
Host: {{trigger.event.data.host_name}}
Mac-address: {{trigger.event.data.mac}}
Data: {{trigger.event.data}}