Looking for this automation... Security based

Hello,

I’m looking for an automation.
When some new device is connected to my network, then I would like to have a notification…

I know, for scanning it can use nmap and for notify, there also many options…
But how to put that together in one automation?

It will come handy, when someone will try to connect with wifi, break in, just as security, etc…

Thnx in advance :slight_smile:

You can use this trigger:

trigger:
    platform: event
    event_type: device_tracker_new_device

A device_tracker_new_device event is generated every time a new device is found.
How do you like to be notified? Email, on Hass interface, IFTTT, …?

1 Like

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.

1 Like

Here is the thread…

Thnx guys, for the fast reply. I appreciate it and I will test it out :slight_smile:

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”

1 Like