Help adding illuminance level

Hi all,

Can someone give me an example on how I would write an app to select devices with illuminance capability and then retrieve its current illuminance level? I have been reading for the past 2 days and I still do not understand what I am doing.

app input for lux sensors

        input(
        	name		: "luxSensor"
            ,title		: "Use this illuminance Sensor..."
            ,multiple	: false
            ,required	: true
            ,type		: "capability.illuminanceMeasurement"
        )

current value

def crntLux = luxSensor.currentValue("illuminance").toInteger()
1 Like

Hi,
Did you get anywhere with this?
Thanks.

Have a look at 'Weather Switch' (specifically the child app)

The code in there is easy to see and will show how I deal with illuminance

Andy