Homey Community Forum

[APP] Ubiquiti UniFi Network

Hi, I got the test version connected now as well. Could someone please share an example of a flow that based on a mobile device connecting to the netwerk will trigger a subsequent process? I am struggling to understand how to use the card ‘apparaat verbonden met wifi’ as I would expect in the ‘and’ then to be able to use a validation like ‘apparaat verbonden has MAC --’ for example. But I do not seem to get parameters based on the first card.
Thanks in advance.

P.S. Running 6.2.25 on udmpro with 1.10.0-11

You already added your device as Homey device?
grafik

Then you can react on the “a device just connected” Flow card.
Use the Homey device name (the homey device has information about MAC from Unifi, so it’s not needed for flows) as conditon for the “Who” tag.

grafik

1 Like

You can also start with the device. If device connected or roams

1 Like

I’m wondering if that was already possible last year?
I migrated from SmartPresence to Unifi and used the same logic. Thanks for pointing at this possibility :slight_smile:

Thanks! I should have known. I was taken off guard due to the fact that without adding devices I see as options the rooms that I have created as zones. Anyways, ‘problem’ solved.

1 Like

Yes, this is the way i have been using it for a few years now. But with this many possibilities there is no way you can know everything :wink:

So, it should be so simply. I created this flow. The device itself shows correctly the connection status depending on switching on/off wifi. But the status of me being home or not is not changed. Am I missing something (again :blush:)?

Nah, it should work like this. i would however built a timer , sometimes it disconnects and does a reconnect when roaming from ap to ap.

What doesn’t work for you? Doesn’t set it you to away?

Indeed, it does not set me to ‘away’.

The Unifi device represents only the phone, not your person (Homey account). Just set you at home/away in the flow.
I use it rhis way to make all other home/away logics with the homey user state.
In addition I use a timer for away state to prevent a state change if teh phone is roaming between APs.

Unifi-Connect:
Set me at home and stop timer (if running).

Unifi-Disconnect:
Start timer (delay is taken from a logic variable):

Disconnect-Timer (delay) finished:
Set me away.

2 Likes

Great to see someone working on this app. It opens up a long list of possibilities.

Do you know if this presence flow also works with iPhones? They sometimes disconnect from wifi to save power.
What is the delay that you use on your timer?

I am not so worried by a delay in reporting “away”, but the presence should be set at “at-home” before I open my front door, or my alarm will trigger. Do you think that is possible?

1 Like

Thanks, I have a similar approach but took out the logic check in the AND card to rule out as much as possible. Indeed a connect or disconnect as flow trigger in combination with a Then card that sets the presence accordingly. I’ll do some testing tonight in order to narrow down possible reasons for this not functioning.

And your phone is disconnected from the WiFi and that status gets reflected by the device? Eg, there is no longer a escalation mark

Correct. I have the suspicious feeling roaming between the APs in combination with disconnecting trigger seems to be interfering. Not sure, will built in a timer or something like that (can you use a delay in combination with an AND card?) in combination with 2nd validation of disconnect prior to switching status.
Setup to test:

Just take my Screenshots as example (my last post).
Use Chronograph app for a timer.
You can’t work with timer in one flow. Xou have to start timernon disconnect and react on the timer event in a second flow. If you get reconnected while timer is running then stop the timer.
This way you get only set as away if you are offline tje whole delay (timer running).

I can’t get it to work with my USG-Pro and My cloud key Gen 2 (2.17) and Unifi 6.2.25.

trying Local super admin and cloud (main+owner )user. on port 443 and latesr experim=ental version 2.12

(I can’t add (or have) any devices(yet).

please help.

Can you send me screenshot from you app settings? by private message?

image6.png
Red Iphonitis rigorosa : level 11

Please check the UnifiOS option!

Ooops … Didn’t know that was an option to toggle. :pensive: :blush:

That with the “default” as site did the trick(with the local Super admin (“DoctorHomeyPro”) ! :upside_down_face:
(“Default” or my real sites name “BazingaHome” didn’t work.)

It’s connected now.

Thank you very much.

Wifi devices I could now add.

But LAN/Wired devices it gets an error in the adding screen. :confused: ->> Fixed! had to restart the app after adding the WiFi devices.