Homey Community Forum

How to tell Homey i used the app for switch on or off

This category is created to show, and explain the working of specific Flows in homey.I have a magnetic contact on my back door and for the outdoor lighting I use a Fibaro 2 X 1500, FGS 222.
Now I want when I open my back door that the lights go on and when the door closes the lights go out after 1 minute. This works well with countdown function and hourglass.
But the problem is that if I have turned on the light with the wall switch, I open the door and close it again, the lamp also goes out. It should stay on. I also hope to solve this when I involve the switch S1 from the Fibaro. I use for now Light on is Boolean: True, Light off is Boolean: False.
Tested this with 2 separate magnetic contacts and that works too.
But if I turn on or of the light via the app, it won’t work again.

How can I make it clear to Homey that I am switching on or off via the app?
So enable via the app = Boolean: True. Disable = Boolean: False.
So click on the icon in the app.

When I had just written this message I realized that this could perhaps be done with a virtual switch.
Is that going to work? And can I also choose a toggle switch that changes color when switching on or off in the app?
Which one should that be?
Thanks in advance.

Edit: It looks like that the S1 idea also is not working. I have a normal switch and turn on with the switch and off in the app and everything is going wrong…

I try to explane it in english (my english is verry bad)

Make a couple of flows. One main flow with the IF cart “this flow is started”, in that flow you turn on the lights and you can use the AND cart to check the amount of light so that te lights not go on in the middle of the day

Flow 2: IF the door is opend AND the lights are off THEN start the main flow

Flow 3: IF the switch is turned on THEN start the main flow

Flow 4: IF the door is closed AND the switch is off THEN start a timer of 60 seconds

Flow 5: IF the timer is emty AND switch is off THEN turn off the lights

Flow 6: IF switch is turned off THEN turn off the lights and stop timer

A lot of flows, i know. But i work a lot this way and the big bennefit of this workarount is that you can fine tune every part verry easy with more ore less AND casrts.

@Jan_Willem_Visser Thank you for explaining this flows. I will try to do it this evening.
(My English is from Google Translate) :grinning: -

Hi @Mike1233,
I do have a similiar setup. Not for the garden but for every room. And I too had the problem. I want the lights to stay on if I turned them on manually, regardless which way I did that.
In my case I did this with Homey’s own mechanics only.
So what did I do to get this working.
I created a boolean logic variable for each Homey zone/room. That variable stores whether the light was turned on automatically.
Then I used Homey’s action cards for “Zone active” and “Zone became inactive for x minutes” to control the automatic lighting. However, you could as well use the sensors trigger events as well. In my case I just wanted to be device independend as a room might actually become active for more than just one reason/sensor.

Activate flow)
WHEN Zone became active (typically caused by a motion or contact sensor yielding their standard event)
AND
One of the lights is off == true
THEN
Set logic vairable “was automatic light on” to true
Turn on light devices in zone/room

Deactivate flow)
WHEN Zone became inactive for x minutes
AND
Logic variable “was automatic light on” == true
THEN
Turn of lights in zone/room
Set logic variable “was automatic light on” to false

This way I achieved the following:

  • Lights turn on off automatically
  • Lights stay on if turned on manually, regardless if by Homey app, by native app or by wallswitch
  • The flows are mostly device independed, so easy to maintain or replace sensors and lights in a zone/room
  • No need for any additional apps

In addition I also have a lux check in those flows, so lights will not turn on automatically if it is bright there already. But for simplicity I left this out here.

Maybe you find this apporach useful.

@Shakesbeard Thanks. I will try this also. I looks like exact what I want. But the other answer could also work.
The weekends are to short if you own a Homey. :grinning:

1 Like

Same question answer here with examples :


I have a similar needs as you and with almost the same hardware. But my flow setup uses tags and segregation of flows but I hope this can give you the idea on how to do what you want -

Easy enough so far, when the garage is active turn everything on and start a timer for 10 minutes.

When the timer runs out - turn very thing off.

When I press the garage button - reset the timer which turns everything off to start counting down from 1 hour.

I also have a flow for when the switch is pressed twice - completely disable the timer. So the garage light doesn’t automatically turn off. This is similar to what you want to do.

But just in case I forget to turn it off - at 2am turn it off for me.

Rather then disable the timer I have been meaning to instead disable the flow if I double tap, and then reenable each night at 2am when it does the sanity check.

I have tested it only the problem is that i do not have a pulse wall switch, only a toggle switch.
Double press doesn’t work with a toggle switch. I think.
Thanks.

It should work with a toggle, my Garage uses the toggle.

The Flow is called Pressed/Switched 2x

But let me know how you go

Ok thanks.
I will try it this weekend. I let you know.

Edit:
When i press the app or a timer starts the light then the zone is also active? Or do i not understand that correctly?

Where can i see if a zone is active?
I did not have the time to try it.

It shows in the devices overview where the Zone name is shown. But only if you view all devices.

Thank you.