Looking for way to monitor unifi controller

Does anyone have any ideas of how I could monitor a unifi controller and notify if it is down? I’m using the Unifi controller for presence detection and it’s working well. That is as long as the controller is running. Occasionally the controller crashes and I was trying to find a way for HA to notify me if it’s down.

You can use the nmap component for device tracker with custom scan options (port)

I tried nmap. Problem is devices showing away when they sleep. I adjusted the consider home part but then nmap takes too long to show when a device is away.

Unifi WAP seems to be the best for me as it can tell within a minute or two if I’m away and shows me home by the time I walk from the car to the front door. Plus it never shows me away when my device sleeps.

Unifi controllers never die :slight_smile:

Use a ping sensor.

Thought about ping but I need to monitor the unifi service, not the computer it runs on. The unifi controller service crashes, not the computer.

Thought maybe I could use the http sensor since I could use a port number. Think that would work?

I am not sure what you mean by this. My 2 unifi AP’s respond to ping.

I’m looking for a way to monitor the unifi controller, not the actual ap’s. I’m using the Unifi WAP, not Unifi direct AP.

The Unifi Controller occasional crashes which means the Unifi WAP device tracker doesn’t work. I’m looking for a way to get notified when the controller stops responding.

Hi, you can monitor the controller is up using a command line binary sensor. This is what I use to check mine:

Just make sure to change the IP to match your setup.

Best regards,

Susto

Thank you. I’ll give it a try. I appreciate it.

This works great. Thanks again. Question, I assume the check mark in the sensor means on which in turn means up and running. What does the sensor show when down or off?

I have some customizing for most sensors, including this one:

binary_sensor.unifi_controller_state:
friendly_name: Unifi State
icon: mdi:desktop-classic
templates:
icon: >
if (state === ‘on’) return ‘mdi:check’;
return ‘mdi:alert-octagon’;
icon_color: >
if (state === ‘on’) return ‘rgb(0, 171, 0)’;
return ‘rgb(255, 0, 0)’;
_stateDisplay: >
if (state === ‘on’) return ‘Up’;
return ‘Down’;

Afraid it’s in Spanish, what you are asking for is the second line “Estado del controlador”

Thanks Susto.