I have some questions about the new method being used for device_trackers. So it seems all “legacy” device trackers are being switched over to use the entity/device registry and known_devices.yaml has been deprecated… which I totally get.
I had an automation to let me know when new devices were detected on my network, but as the Integrations have been updated they stop using known_devices.yaml. The Netgear Integration seems to still use known devices but I’m sure that will be updated as well…
The old integrations seemed to use “device_tracker_new_device” which contained all relevant information needed.
device_tracker_new_device
{
"event_type": "device_tracker_new_device",
"data": {
"entity_id": "device_tracker.xa_x5_c9_x4_1d_28",
"host_name": "xA:x5:C9:x4:1D:28",
"mac": "xA:x5:C9:x4:1D:28"
},
"origin": "LOCAL",
"time_fired": "2021-03-06T20:41:05.229232+00:00",
"context": {
"id": "749767934c8884a3314c8911829c95ff",
"parent_id": null,
"user_id": null
}
}
So I was trying to use the events to get information when a new device_tracker entity was created but It seems that watching the events produces events that do not contain the host_name.
entity_registry_updated
{
"event_type": "entity_registry_updated",
"data": {
"action": "create",
"entity_id": "device_tracker.amys_ipad"
},
"origin": "LOCAL",
"time_fired": "2021-03-06T23:53:17.173668+00:00",
"context": {
"id": "2d7dcb9ef99cad949538d6eaa338001b",
"parent_id": null,
"user_id": null
}
}
device_registry_updated
{
"event_type": "device_registry_updated",
"data": {
"action": "update",
"device_id": "86a972a3e45bd9d5eca7a594553fef40"
},
"origin": "LOCAL",
"time_fired": "2021-03-06T23:55:48.616443+00:00",
"context": {
"id": "3f322e2f1098241c2fe1333763f944ae",
"parent_id": null,
"user_id": null
}
}
So after those events, there are entries in core.device_registry and entity_registry which contain all the needed information but it does not get passed in either of these events.
I am wondering if I am missing something here. Is it because I may have missed something in a registry entry and haven’t COMPLETELY removed all references to said devices when testing or does it not create that “device_tracker_new_device” event any longer? If it is not using that “device_tracker_new_device” does anyone know of a way to pull the host_name and/or mac_id which the new method of creating these entities?