Trouble making kapacitor deadman alert working

I need some help with setting up a deadman alert.

My goal is to fire an alert when some device stops sending any data due to some possible defect and send that alert on some rest endpoint.

In the format the alert is written now, it keeps hitting the endpoint even for some devices that keep pinging and in the body it says that the emitted value is above 0, usually 1 or 2.
Here is how the alert is written:

dbrp "example"."autogen"

var data = stream
    |eval(lambda: string("dev_addr"))
    |where(lambda: isPresent("measurement_type"))

    |deadman(0.0, 2m)
            .header('content-type', 'application/json; charset=UTF-8')

Not sure if the problem comes from the fact that the groupBy clause is by a field value. I found on github that you could do a groupBy when converting field to tag like i the code in there.