I’m using Grafana 11.4. I have it connected to promethus, and have used a Unifi importer to provide several series in prometheus that tell me what wifi clients are connected. I’m trying to create a notification when a new client connects, or an old client that it hasn’t seen in at least 24 hours connects.
The prometheus series are like: unifi_client_uptime_seconds{mac="xx:xx:xx:xx:xx:xx"} or unifi_client_rssi_db{mac=...}. Note that due to way the unifi adapter works, all queries must be wrapped in sum by(mac) (unifi_client_uptime_seconds{}) or some variation thereof as unifi keeps 2.4G and 5G channels as separate labels
The former uptime_seconds:
The latter rssi_db:
My first thought was to trigger on unifi_client_rssi_db > 0, and fill in the missing values with zeros, however, I can’t seem to figure out how to keep the labels intact ({mac=...}). I’ve tried several variations of sum by(mac) (unifi_client_rssi_db{} or on(mac) vector(0)) or present_over_time(sum by(mac) (unifi_client_rssi_db{})[5m]) and nothing inserts zeros where Null values were. present_over_time converts null and non-null into null and 1, as far as I can tell.
I ended up creating an alert on sum by(mac) (unifi_client_uptime_seconds{}) < bool 60, which unfortunately does alert for every re-connection. I couldn’t figure out how to suppress the alerts where I reboot my phone or run away for just 5 minutes, instead of my desired 24hr.
How can I fill with zeros or otherwise alert on a reappearance after 24hrs?

