Copying from 2022.2: Let's start streamlining!:
personally, I really wish we had an option to allow new device_trackers to be enabled upon discovery. since https://github.com/home-assistant/core/pull/63328 newly discovered device_trackers are disabled,
and have no attributes in the entity_registry_updated
event_type resulting in:
using:
- 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:
data: >
{{trigger.event.data}}
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')}}
source: >
{{state_attr(entity,'source_type')}}
id: >
{{device_id(entity)}}
config: >
- entity: {{entity}},
- name: {{name}},
- host: {{host}},
- ip: {{ip}},
- mac: {{mac}},
- source_type: {{source_type}}
- id: {{id}}
time: >
{{now().timestamp()|timestamp_custom('%X')}}
title: >
{{time}} - New device registered: {{name}}
message_body: >
New device config: {{config}}
(devices that are enabled upon discovery according to the new device_tracker logic do show all/most of these fields populated.)
after enabling the tracker we can see all attributes are in fact there:
Please consider either adding a system option to enabled, or, if possible,provide details also on disabled device_trackers…