Help learning to write a variable


#1

I am still learning variables and have successfully used boolean and integer. I am now trying to learn device variables.

I want to group 2 motion sensors in a device variable but I’m not sure how to use it.

This is what I want
DEFINE: device: Kitchen_Motion_Sensors
IF variable Kitchen_Motion_Sensors changes to active
THEN with kitchen light turn on
IF variable Kitchen_Motion_Sensors changes to inactive
THEN with kitchen light turn off

I’m stuck at the IF parts. How do I write it?
My comparison options are physical device or expression

Any links to learn variables would be much appreciated!


#2

rather than using device variable as variables, you have to use them as a device in order to get the right comparison options. In you if, change to ‘device’ and scroll past all your devices and you will see the device variable. Select that as you device and then things should make sense.


#3

Thank you!