Homey Community Forum

Switching light ON & OFF in one single flow


I would like to use one single flow to switch [my office] light on AND off, using the body sensor as a trigger.
This is not really an absolute must; just going for effiency and trying to avoid a 2nd separate flow to switch the lights off again.

if the sensor goes on : lights on
if the sensor goes off : lights off

How do I go about? In the below flow, the trigger doesn’t work. I have tried several variants, using the same Tag in the “AND” conditions as well, but to no avail.


Body sensor? Do you mean a motion sensor such as from Neo coolcam or something similar? Why do you have a logic card as start and not the actual movement detected property of the device itself?

Well, Aqara calls them “body sensor”. Probably a poor translation from Chinese to English…
The sensor only has as triggers (amongst others):

  • movement detection on
  • movement detection off

… therefor, it will not suffice to turn the light on AND off using ONE trigger

I dont get the part in the “and” colum. You only want het lights goes on when there is a battery warning??

:slight_smile: True. that’s a mistake.
Should have been, of course, “when sensor is ON”.
Trust me, that isn’t the solution :slight_smile:

Isn’t there anyone out there who understands the request?
I’ll paste the flow in english tomorrow, after Homey’s midnight restart.

Install the timer app!
It works great:
Motion sensor trigers the flow that contains the timer in the “then”
The timer contains the lamp and a duration.
if the motion sensors triggers again during the duration the flow will run again and restart the timer.
If the motionsensor is not triggered the lamp will switch off at the end of the duration.

You can even set it to not trigger when the lamp is already on.

Example triggering multiple lamps
(My motion sensor triggers a virtual device that is in the “when”)

please take a look on the old forum

Your sensor is not a Variable but a Device.
You need to use
but this is not possible in 1 flow (as far as I can think of)

Good find. This is a typical thing that should have been implemented in Homey core.
To be able to trigger on changed tag (in your case a boolean tag) The annoying this is, is that is already a ‘known boolean’ in the Homey core system. (the brownish color is boolean, blue an integer, green is a text string)

Being able to do this would save a HUGE amount of flows to be created.