Homey Community Forum

Turn on lights when device is connected

Maybe its handled before but did not find what i’m looking for.

I’m testing a flow now in many different ways.

What I want is; When my iPhone is connected to the WiFi (UniFI) and time is later than for example 19:15 and the lights in the living room are off. Activate Flow “Sfeer aan”

I’ve now done this in many different ways, every time I test the flow it works. But when I set the trigger time 5 min later. And wait nothing happens.

I think the check for the time is not done every minut. And ofcourse my iPhone is allready connected.
This is logical because when i’m coming home at 17:00 for example its light enough to not have the lights on.
But around 19:15 for example I want them on. And ofcourse if this works i’ll want to tweak it for sundown etc.

Screenshot of what I have now (But that still does not work)

If someone knows what i’m doing wrong or what building blocks I need to add let me know.

I have the Homey Pro btw

I can’t see what is going wrong in your flow. But did you see there is an app for what you are trying to achieve? https://apps.athom.com/app/com.ubnt.unifi
Or use the location app.

The flow looks good to me. So you have to figure out what the problem is. I suggest to make a notification at the THEN part. That way you know what is happening. Try another WHEN part. You could for instance try a motion sensor as a trigger. That way you can find out if Unifi is the problem or the time is the problem or the light in the livingroom.

This flow will only run when the phone is connected while it was disconnected, when u come home. It will not fire at 19.51 or anywhere in between the hours stated in the flow. Just when u come home. When u come home at 1900 then the flow will trigger but not fire because of the conditions .

I all ready have the UniFi app installed that’s how i’m getting my “Connected” status.
But it seems like Homey does not run the flow every minut for example so that it will run the Flow “Sfeer TV” after 19:15 for example.

Ok, so how can I make it so it runs for example every minut. And checks if the Lights are on or not after 19:15 when my iPhone is connected.
But only run the Flow once when its activated. By this I mean. When I manually turn off the light but its for example 20:00 than i don’t want the lights to become on again.

I think i can do this by the Better Logic plugin by setting a variable for example like if the Flow has done its job after 19:15 than put the variable to executed and lets say around 01:00 i’ll run a flow to reset the variable to not_executed or something of 0 and 1 whatever :wink: You get the point.

That way the flow will only run once after 19:15 or what time I set (Can also be between 19:15 and 00:00)
And that when I turn off the lights to go to bed around 21:00 or whatever the lights wil not turn on again.

Hope you know what I want to accomplish here.

WHEN time is 1915 AND phone is connected AND de grote lamp is off THEN start sfeer tv AND disable this flow. WHEN time is 0700 THEN enable that flow.

1 Like

That was some fast responding.
Going to try that now!
I’ll test right away and let you know.

p.s. can I put all this in one Flow or do I need to make a separate flow to “Enable” the flow again.

2 flows yes

1 Like

Just one more, I don’t see the option when its later than 19:15 or between 19:15 and 00:00 in the When flow.

Will this work than?
With this i will run the Flow every 60 sec.

As long as Homey don’t shut the flow down for being fired too much that should work yes. Plz be aware that this flow will trigger 24/7. Maybe enable this flow at 2100 hours and disable it at 2300?

1 Like

It works like this, lights turned on, now I turned them off, lets see if they are on after 5 min or not :wink:

Yes, was also thinking about that, so that i’m not stressing it to much but, I have a Homey Pro… But its a good point.

Seems ok now. I’ll check tomorrow if everything works as expected when i’m coming home, and the lights turn on around 19:15.

If thats the case i’ll post a full solution with screenshots.

@Rocodamelshe Thanks for the help and fast responses.