Got this from another post on the forum. Can’t find the thread where from though.
- alias: Notify If New Devices
trigger:
- platform: event
event_type: device_tracker_new_device
action:
- service: notify.home_assistant
data_template:
message: >
New device:
{{trigger.event.data.host_name}}
({{trigger.event.data.entity_id}})
title: New device
That will send a notification with the MAC address of the device that just connected. It is pretty quick also.
I want to see if further data can be pulled to get the Vendor data that is put in the Knowndevices.yaml file. Its nice to know that a new device connected and its an apple product or dell computer etc.
I’m currently using the following which works like a charm:
- alias: New Device Detection
trigger:
platform: event
event_type: device_tracker_new_device
action:
- service: notify.telegram
data:
message: 'A new device just connected to your wifi.'
- service: ifttt.trigger
data:
event: wifi_connected
value1: NEW DEVICE!
PS: IFTTT action adds a entry to a logbook in Google Drive spreadsheet, the key is
“event_type: device_tracker_new_device”