Create your first logic device in under 5 minutes
In this guide, you'll create a simple motion-activated light that only works when it's dark outside.
IF (Motion Detected) AND (Dark Outside)
THEN Turn On Lights
๐ก Tip
Start with Logic Device if you're new to Boolean Toolbox. It has a visual pairing wizard that makes setup easier.
For our example, we need two inputs:
Input A: Motion Sensor
Browse to your motion sensor โ Select alarm_motion capability
Input B: Lux Sensor
Browse to your light sensor โ Select measure_luminance capability
๐ก Tip
Don't have a lux sensor? Use a virtual device or connect to weather data. You can also start with just motion detection!
Go to device settings and configure the formula:
[
{
"id": "motion_and_dark",
"name": "Motion & Dark",
"expression": "A AND B",
"enabled": true,
"timeout": 60,
"firstImpression": false
}
]
A AND B means both must be true)โก Quick Start
For motion only (without lux sensor), use: "expression": "A"
Use the Boolean Logic Emulator to verify your expression works correctly:
Now connect your logic device to actual actions:
WHEN
Formula [motion_and_dark] changed to TRUE
AND
(no conditions needed)
THEN
Turn on [Living Room Lights]
๐ก Pro Tip
Create a second flow that turns lights OFF when the formula changes to FALSE. This creates automatic lighting control!
"expression": "A"
Light turns on when motion detected
"expression": "A AND B"
Light only turns on when motion detected AND it's dark
"expression": "A OR B OR C"
Alert if ANY of multiple sensors trigger
"expression": "A AND NOT B"
Someone home (A) but NOT daytime (B) = Night mode
"expression": "(A OR B) AND C AND NOT D"
(Motion OR Door) AND Dark AND NOT Away Mode
| Operator | Alternative | Description | Example |
|---|---|---|---|
AND |
& |
Both must be true | A AND B |
OR |
| |
At least one must be true | A OR B |
XOR |
^ |
Exactly one must be true | A XOR B |
NOT |
! |
Inverts the value | NOT A |