My smartapp is not picking up leak detection data

smartapp

#1

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?


(I got a hair cut from Alexa) #2

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.


#3

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?


(I got a hair cut from Alexa) #4

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.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #5

Never trust the Simulator.


#6

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


#7

Hello
Did you get the leaksmart to work ???