Get HUE Light current state

I want to get the Nightlight ON if the Sun is set and the KuchenLicht is OFF.
How can I get the current state of the KuchenLicht?

rule:

rule "KucheNachtLicht"
when
    Channel 'astro:sun:home:rise#event' triggered START or
	Item KuchenLicht received OFF
then
    sendCommand(Gateway_LightSwitch, ON)
end

item:

Switch	KuchenLicht
        "Küchenlicht"
        { channel="hue:0100:1234567890:2:brightness" }

Not sure about the astro part of your clause but you can try:

when Channel ‘astro:sun:home:rise#event’ triggered START
then
if (KuchenLicht.state == OFF) {sendCommand(Gateway_LightSwitch, ON)}
end

1 Like