My smartapp is not picking up leak detection data

I am trying to retrieve data from a Water Sensor to send to an api. Here is the code:

section("Leak Sensor") {
    input "water", "capability.waterSensor", title: "Water", required: false, multiple: true
    input "battery", "capability.battery", title: "Battery", required: true, multiple: true
    input "temperature", "capability.temperatureMeasurement", title: "Temperature", required: false, multiple: true
}

def initialize() {
    subscribe(water, "water", evtHandler)
    subscribe(battery, "battery", evtHandler)
    subscribe(temperature, "temperature", evtHandler)
   }

The problem is, the only value thats being sent is the temperature value. The water and battery values are not being sent at all. Does anyone know why this is?

1 Like

I’m not sure about the battery, but after initially starting my apps with water, all I got was null until the first transition of the sensor. get it wet, see if that changes things.

1 Like

Ok, I am not at home right now but I will try that when I can. The simulator is showing the value “dry” though, so it should be sending that same value to my API should it not?

1 Like

You know I thought that too, and it really bugged me when I was playing with a water sensor. But maybe the sensor doesn’t actually send a dry message unless it’s been wet first. (or maybe it will once a day or something to save battery) …or maybe it only sends on transitions. I just know it confused me getting “null” back for a while from handle.currentValue(“water”) …until it actually triggered wet for the first time, after that it reported dry when it was dry.

Never trust the Simulator.

2 Likes

Oh ok, I’ll have to try getting it wet then. Thanks!

1 Like

Hello
Did you get the leaksmart to work ???