Pi.Alert: Device Monitoring/ IP address inventory tool

I would like to share a little gem I have recently discovered on GitHub. As soon as I started developing my own ESPHome devices, I realized that my IPv4 home range was getting messy, and keeping up with the changes was becoming challenging. Sadly, Home Assistant doesn’t have a built-in way of managing this. However, I have found a solution: Pi.Alert. It has been my best new friend lately.

You can find Pi.Alert on GitHub at the following link:

Pi.Alert

Pi.Alert scans the devices connected to your WiFi/LAN and alerts you to the connection of unknown devices. It also provides warnings when an “always connected” device disconnects. Additionally, Pi.Alert offers the ability to check the availability of web services.

The setup process is well explained on the website, so I won’t repeat it here.

Pi.Alert provides a very basic API, and the author explains how to integrate it with Home Assistant. You can find instructions on how to do this in the following link:

Pi.Alert API Usage with Home Assistant

I hope someone will find this little piece of software as useful as I did.

7 Likes

Looks to be very handy.

Nice one! :wink: Thanks for sharing!

Hello,
due the changes on 2023.6,

the way to define a command_lines sensor changed

This is the update sensor definition for PiAlert properties

command_line: 
  - sensor:
      name: "PiAlert - Last Scan"
      command: curl -k -X POST -F 'api-key=--todo-api-key-here--' -F 'get=system-status' http://[mypialerthost]/pialert/api/
      scan_interval: 200
      unique_id: pialert.status.lastscan
      value_template: '{{ value_json.Last_Scan }}'

  - sensor:
      name: "PiAlert - All Devices"
      command: curl -k -X POST -F 'api-key=--todo-api-key-here--' -F 'get=system-status' http://[mypialerthost]/pialert/api/
      scan_interval: 200
      unique_id: pialert.status.alldevices
      unit_of_measurement: ""
      value_template: '{{ value_json.All_Devices }}'

  - sensor:
      name: "PiAlert - Online Devices"
      command: curl -k -X POST -F 'api-key=--todo-api-key-here--' -F 'get=system-status' http://[mypialerthost]/pialert/api/
      scan_interval: 200
      unique_id: pialert.status.onlinedevices
      unit_of_measurement: ""
      value_template: '{{ value_json.Online_Devices }}'

  - sensor:
      name: "PiAlert - Offline Devices"
      command: curl -k -X POST -F 'api-key=--todo-api-key-here--' -F 'get=system-status' http://[mypialerthost]/pialert/api/
      scan_interval: 200
      unique_id: pialert.status.offlinedevices
      unit_of_measurement: ""
      value_template: '{{ value_json.Offline_Devices }}'

  - sensor:
      name: "PiAlert - Archived Devices"
      command: curl -k -X POST -F 'api-key=--todo-api-key-here--' -F 'get=system-status' http://[mypialerthost]/pialert/api/
      scan_interval: 200
      unique_id: pialert.status.archiveddevices
      unit_of_measurement: ""
      value_template: '{{ value_json.Archived_Devices }}'

  - sensor:
      name: "PiAlert - New Devices"
      command: curl -k -X POST -F 'api-key=--todo-api-key-here--' -F 'get=system-status' http://[mypialerthost]/pialert/api/
      scan_interval: 200
      unique_id: pialert.status.newdevices
      unit_of_measurement: ""
      value_template: '{{ value_json.New_Devices }}'

  - sensor:
      name: "PiAlert - Scanning"
      command: curl -k -X POST -F 'api-key=--todo-api-key-here--' -F 'get=system-status' http://[mypialerthost]/pialert/api/
      scan_interval: 120
      unique_id: pialert.status.scanning
      value_template: '{{ value_json.Scanning }}'

Also mind that in my case, I had to add an “/pialert/” to the url as the api are not served from the root but from this secondary path

Hello, implement what is described here in my system and it works correctly, but I have a question, would it be possible to have more detailed information on the new devices, directly on HA, or failing that, at least be able to have some information for when detects a new device make an automation, for a notice… THANK YOU!

You will need to go to github (link in the first post) and raise that as a feature request.

Hey :wave:

I had a few people coming to my fork from this thread so just FYI there are 2 apps, leiweibau’s (linked in the first post) and mine, which I renamed to NetAlertX to avoid confusion. If interested my fork comes with more detailed device sync into home assistant via MQTT:

I like the GUI. I set up my subnets and I configured the ARP settings. On my network it quickly located the router and itself. Nothing else was found. I discovered that I needed to enable the ARP scan and then save the settings and it scanned. Still no other systems were found. Great GUI on the program, but I already know about my router and the Pi.Alert. Seems like a work in progress.

Update: I updated to NetAlertX and it seems about the same. I carefully configured my interface and the ARP. Looks like the issue is it doesn’t like running in a container despite being on the main LAN.

FWIW I ran both in a Proxmox container without issue. Decided to keep pialert. I’m not running any firewalls on Proxmox, however. ARP scan picks up everything in my single subnet.

Hey,

make sure you have the correct network interface specified and the container is running in --network=host. More info here: