# \[Tutorial\] Detect the presence of a device/user with LANmanager

**URL:** <https://community.gladysassistant.com/t/tuto-detecter-la-presence-dun-appareil-utilisateur-avec-lanmanager/8487>\
**Category:** Tutoriels\
**Created:** [November 14, 2023, 9:06pm UTC](https://community.gladysassistant.com/t/tuto-detecter-la-presence-dun-appareil-utilisateur-avec-lanmanager/8487 "2023-11-14T21:06:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![GBoulvin](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gboulvin/32/10006_2.png) [@GBoulvin](https://community.gladysassistant.com/u/GBoulvin)\
**Post date:** [November 14, 2023, 9:06pm UTC](https://community.gladysassistant.com/t/tuto-detecter-la-presence-dun-appareil-utilisateur-avec-lanmanager/8487/1 "2023-11-14T21:06:01Z")

</div>

How to use the LANmanager integration to determine the presence of a device (and probably its owner) on the local network?

First of all, what’s it for?

Determining someone’s presence (an authorized person) in the house allows many scenarios to be activated such as heating control, lighting or home security.  
In Gladys Assistant, managing presence detection can be done, among other things, thanks to the devices associated with an inhabitant present on the network (a smartphone or a car on the WiFi network, a powered-on computer connected to the wired network…).

**1. Prerequisites**  
It’s preferable to know, at minimum, the MAC address of the device that must be detected. This address is UNIQUE and therefore corresponds to a single device.  
Finding this address depends on the device. I encourage you to look it up. For smartphones, it is often indicated on the box but can also be found in the device settings. For example, on Android, simply click on the WiFi network you are connected to:

 ![Screenshot_20231114_191043_com.android.settings](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/6/6ad5469e9aec72969c045f0ab33af9541b4c4e3e.jpeg)  
 ![Screenshot_20231114_191032_com.android.settings_edit_599796436781389](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/3/329bea33b01ccfbfd5a211feb28bf9c4cab5885d.jpeg)

If you can’t find your device’s MAC address, don’t worry!

**2. The integration**

Then go to the LANmanager integration

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/8/81c302c463ba619ff96df667c72ee4bc17cec3b3.png)  
Click on «&nbsp;Discovery&nbsp;»  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/3/33a74fca78c021251a23e101c79bcd6164b4bdae.png)  
Then on «&nbsp;Search on the network&nbsp;»  
When your device appears, give it a clear name then click «&nbsp;Save&nbsp;».  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/1/154fd190f4ebaef3785cc963d2b04293dcfede42.png)  
Do the same with the other devices you want to add then head to the «&nbsp;scenes&nbsp;» tab

Troubleshoot: Sometimes the device isn’t found on the first try. Check that it is connected to the same network (the same access point) and that this banner has not appeared:  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/9/9e6d516a5066b6d024ea003ee86f95335f71cabe.png)  
If so, click on «&nbsp;New devices available&nbsp;» to display them!

**3. The scenes**  
Yes, there are at least two to create to explain to Gladys Assistant what to do with the device detection (associate the presence of the device with that of a user)

_First scene to create:_  
Choose a clear name and a nice little icon. Then, in the triggers:

- Scheduled trigger: Interval 8 minutes (to be adjusted depending on the devices)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/a/a0686dc46c058349b1ca01a8319acb155aedcc8c.png)

Then, as the first step:

- Check user’s presence: choose the concerned user, the house and the device to associate and the time «&nbsp;device seen less than&nbsp;» 3 minutes (to be refined if needed)  

- Get the last state (of the device - the phone)  

- Continue only if phone = 1  

- User LEFT the house  

- Save your scene!

_Second scene:_  
Choose a nice name and a nice icon then, as trigger:

- Device state change: Phone (presence) «&nbsp;If the device is detected&nbsp;»  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/7/7fce6a9e120d8f6dfbde6af44859786e05567316.png)

And as the first action:

- User seen at home  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/e/e5d85084b8f0329b8ab2c53b7d408bd1c41b2bcd.png)

Don’t forget to save your scene!

And there you go!  
What to do with this? Turn the alarm on and turn off the heating when you leave and the opposite when you return, for example!

Troubleshoot2: Some devices have, for «&nbsp;security&nbsp;» reasons, a «&nbsp;Random MAC address&nbsp;» option. It goes without saying that this option must be disabled for detection to work!

---

<div class="post-metadata">

**Author:** ![guim31](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/guim31/32/4840_2.png) [@guim31](https://community.gladysassistant.com/u/guim31)\
**Post date:** [November 15, 2023, 2:17pm UTC](https://community.gladysassistant.com/t/tuto-detecter-la-presence-dun-appareil-utilisateur-avec-lanmanager/8487/2 "2023-11-15T14:17:42Z")

</div>

It’s set up !!! Thanks @GBoulvin !!! 😉

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [November 16, 2023, 8:50am UTC](https://community.gladysassistant.com/t/tuto-detecter-la-presence-dun-appareil-utilisateur-avec-lanmanager/8487/3 "2023-11-16T08:50:36Z")

</div>

Thanks @GBoulvin, could we put this documentation on the Gladys site? We already have this doc for Bluetooth, but it was never made for the LAN Manager doc!

---

<div class="post-metadata">

**Author:** ![GBoulvin](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gboulvin/32/10006_2.png) [@GBoulvin](https://community.gladysassistant.com/u/GBoulvin)\
**Post date:** [November 16, 2023, 11:27am UTC](https://community.gladysassistant.com/t/tuto-detecter-la-presence-dun-appareil-utilisateur-avec-lanmanager/8487/4 "2023-11-16T11:27:10Z")

</div>

Of course! 😇

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [November 16, 2023, 12:56pm UTC](https://community.gladysassistant.com/t/tuto-detecter-la-presence-dun-appareil-utilisateur-avec-lanmanager/8487/5 "2023-11-16T12:56:31Z")

</div>

Can you make me a PR? 🙂

---

<div class="post-metadata">

**Author:** ![GBoulvin](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gboulvin/32/10006_2.png) [@GBoulvin](https://community.gladysassistant.com/u/GBoulvin)\
**Post date:** [November 16, 2023, 3:58pm UTC](https://community.gladysassistant.com/t/tuto-detecter-la-presence-dun-appareil-utilisateur-avec-lanmanager/8487/6 "2023-11-16T15:58:09Z")

</div>

Whoa… Uh…  
I can’t promise you anything because I’ve never done it, but why not 😉

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [November 16, 2023, 4:14pm UTC](https://community.gladysassistant.com/t/tuto-detecter-la-presence-dun-appareil-utilisateur-avec-lanmanager/8487/7 "2023-11-16T16:14:58Z")

</div>

> [@GBoulvin](#):
>
> I can’t promise you anything because I’ve never done it, but why not 😉

The hardest part is writing the content; if you can just create the article for me in Markdown (same format as the forum) + 2 folders with the images in FR and EN, I can take care of integrating that on the site! 😃

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [November 16, 2023, 4:58pm UTC](https://community.gladysassistant.com/t/tuto-detecter-la-presence-dun-appareil-utilisateur-avec-lanmanager/8487/8 "2023-11-16T16:58:27Z")

</div>

@GBoulvin I thought about the topic and set up something so you can help super easily!

> [@Gladys Assistant: Ecrivons plus de contenu ensemble!](https://community.gladysassistant.com/t/gladys-assistant-ecrivons-plus-de-contenu-ensemble/8492):
>
> Salut à tous slight_smile On en a parlé sur les dernières semaines, il manque clairement du contenu sur Gladys qui permettrait à de nouveaux utilisateurs de se projeter, et surtout d’attirer plus d’utilisateurs qui nous trouveraient via Google. J’ai commencé à recenser des sujets où il manque du contenu, et je pense qu’on pourrait se répartir les différents articles à écrire pour gagner du temps. En sachant que pour écrire du contenu, pas besoin de savoir coder, il faut juste savoir écrire …

---

<div class="post-metadata">

**Author:** ![Prof\_Techno](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prof_techno/32/19038_2.png) [@Prof\_Techno](https://community.gladysassistant.com/u/Prof_Techno)\
**Post date:** [September 26, 2024, 2:07pm UTC](https://community.gladysassistant.com/t/tuto-detecter-la-presence-dun-appareil-utilisateur-avec-lanmanager/8487/9 "2024-09-26T14:07:19Z")

</div>

Hello, I know the topic is a bit old but for me it works strangely I did everything exactly as written  
if I run the second scene from the tutorial it tells me that I am there, however the first tells me the opposite. I thought it was an error with == which should be different but nothing worked

I’m new to scenes, these are my first ones

Thank you for your help

---

<div class="post-metadata">

**Author:** ![Prof\_Techno](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prof_techno/32/19038_2.png) [@Prof\_Techno](https://community.gladysassistant.com/u/Prof_Techno)\
**Post date:** [September 28, 2024, 3:43pm UTC](https://community.gladysassistant.com/t/tuto-detecter-la-presence-dun-appareil-utilisateur-avec-lanmanager/8487/10 "2024-09-28T15:43:09Z")

</div>

So, I found the error: it’s not an equals but a «&nbsp;not equal to 1&nbsp;».

However, I sometimes have missed detections — I think it’s due to the detection timing. I’ll run tests in the next few days.
