Subscribe to contact sensor not working

Hello All,

I’m writing a smart app and have hit a wall.

input “rainSensor”, “capability.contactSensor”, title: “Sensor?”, required: true

No matter what I try the rainSensorHandler never gets called. I am still learning, any help would be appreciated.

Solved my own problem. Subscribe is looking for state changes when I needed current state. This works for me.

def rainState = rainSensor.currentValue(‘contact’)