# Presence detection via local network

**URL:** <https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131>\
**Category:** Demandes livrées\
**Tags:** capteur-présence, feature-integration\
**Created:** [February 24, 2021, 2:47pm UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131 "2021-02-24T14:47:54Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [January 8, 2023, 3:04pm UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/21 "2023-01-08T15:04:06Z")

</div>

Did you ask a generative AI? I’d really like to give it a try to see.

---

<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:** [January 8, 2023, 3:26pm UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/22 "2023-01-08T15:26:53Z")

</div>

No, I didn’t think of that at all, very good idea!

---

<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:** [January 8, 2023, 3:28pm UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/23 "2023-01-08T15:28:59Z")

</div>

I see what you mean, what I find difficult is illustrating:

- the presence of a human
- a local network

Without too many elements or text ^^

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [January 8, 2023, 4:49pm UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/24 "2023-01-08T16:49:40Z")

</div>

The text isn’t forbidden 😉

---

<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:** [January 8, 2023, 6:52pm UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/25 "2023-01-08T18:52:38Z")

</div>

Yes, yes, of course! But I think too much text kills the illustration.

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [January 15, 2023, 8:19am UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/26 "2023-01-15T08:19:27Z")

</div>

Hello,  
if some of you are motivated, I have a first version that seems functional and sufficient for detecting devices on the network.  
We’ll deal with the other features at a later time.

The docker image: `atrovato/gladys:lan-manager`

As a reminder, this is a test image and may therefore harm your «&nbsp;production&nbsp;» environment, so it is recommended to back up your data before using the image, or to test the image on another device, in order not to impact your «&nbsp;stable&nbsp;» installation.  
The feature is not available via Gladys Plus at the moment; it will be as soon as everything has been validated.

Thanks.

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [January 15, 2023, 9:33am UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/27 "2023-01-15T09:33:53Z")

</div>

Thanks @AlexTrovato!

Tested this morning:

- I don’t really like the logo colors, especially in the services list; it clashes too much with a «&nbsp;default Visio (Microsoft) colors&nbsp;» vibe. The same logo in a darker color would work better, I think (compare with the orange of the Zigbee2MQTT logo or even the illustration for Xiaomi)  

- During the scan there is a big CPU spike up to 168% but only for a few seconds. I’m on a mini PC, no issues. On an RPi you’d need to check the behavior, even if it means slowing the scan to save CPU

- I have at least x3 phones on a WiFi router + Freebox (WiFi disabled) and the scan only detected two MAC addresses. But since I have two routers that means I also have two IP allocations; I imagine the scan only works on the same network as Gladys. I’ll test with two other PCs turned on. In any case it would be good to remind users of the scan limitations when there are multiple networks.

- The scan results display the detected MAC addresses, without other indications. My Freebox for instance shows the name advertised by the device — do you think that’s achievable (in v2)? Otherwise, as a fallback, do a manufacturer lookup from the MAC addresses?

Thanks for developing this service — it’s going to be useful 😊

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [January 15, 2023, 9:42am UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/28 "2023-01-15T09:42:01Z")

</div>

And I would add that the interface is very simple to use and super clear.

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [January 15, 2023, 9:52am UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/29 "2023-01-15T09:52:53Z")

</div>

Thanks for taking the time.

> [@lmilcent](#):
>
> I don’t really like the colors of the logo

Me neither, I did that quickly, but I also asked for a bit of help to create a new one. I tested AI, but I have trouble getting my point across 😕

> [@lmilcent](#):
>
> During the scan, there’s a big CPU spike to 168%

Well, I tested on a real PC, not a Raspberry Pi, and I use a library that does the scan.  
I can always change it though.

> [@lmilcent](#):
>
> I imagine that the scan only works on the same network as Gladys

The scan runs on the networks where Gladys is present; all network interfaces are scanned (eth, wlan…).  
So if your devices aren’t on the same networks, indeed, I can’t do anything.

> [@lmilcent](#):
>
> the scan results display the detected MAC addresses

Strangely, I do get the device names (except for one).

> [@lmilcent](#):
>
> Otherwise, as a fallback, do a lookup of the manufacturers from the MAC addresses?

That’s doable 😃

Thanks again.

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [January 15, 2023, 10:11am UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/30 "2023-01-15T10:11:37Z")

</div>

> [@AlexTrovato](#):
>
> I tested AIs, but I’m having trouble making myself understood 😕

Just for my personal info, which AI did you use?

I’ll test as soon as I have 2 minutes 🙂

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [January 15, 2023, 10:13am UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/31 "2023-01-15T10:13:01Z")

</div>

StarryAI and DALL-E 😉

---

<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:** [January 15, 2023, 10:23am UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/32 "2023-01-15T10:23:20Z")

</div>

Hi!  
Tested and… When I click on ‹&nbsp;save&nbsp;› nothing happens, nothing is added to the ‹&nbsp;devices&nbsp;› list and nothing in the Gladys log…  
RPi2 32bit  
Sorry :⁠-⁠\  
Edit: I’m lying, there is this in the log : `2023-01-15T11:42:54+0100 \u003cinfo\u003e lan-manager.scan.js:20 (LANManager.scan) LANManager discovers 31 devices`  
But no matter what I try, it won’t save anything…

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [January 15, 2023, 10:48am UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/33 "2023-01-15T10:48:53Z")

</div>

Do you see any logs in the browser? (F12 for developer mode + «&nbsp;Console&nbsp;» tab)

---

<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:** [January 15, 2023, 11:41am UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/34 "2023-01-15T11:41:59Z")

</div>

I just tested (but from my phone, so no logs) and I can see my devices… But I can’t save them. The command returns nothing.

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [January 15, 2023, 3:17pm UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/35 "2023-01-15T15:17:48Z")

</div>

Okay, I’m reproducing the problem… a regression from my last change… I’ll let you know as soon as it’s fixed.

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [January 15, 2023, 3:45pm UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/36 "2023-01-15T15:45:07Z")

</div>

@AlexTrovato can you remind me of the docker run command to use please 🙂

---

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [January 15, 2023, 4:27pm UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/37 "2023-01-15T16:27:31Z")

</div>

That must be it :

> [@AlexTrovato](#):
>
> The Docker image: `atrovato/gladys:lan-manager`

---

<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:** [January 15, 2023, 5:11pm UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/38 "2023-01-15T17:11:59Z")

</div>

> [@spenceur](#):
>
> can you remind me of the docker run command to launch it please

Here it is:

```auto
docker run -d --log-driver json-file --log-opt max-size=10m --cgroupns=host --restart=always --privileged --network=host --name gladys -e 
NODE_ENV=production -e 
SERVER_PORT=80 -e 
TZ=Europe
```

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [January 15, 2023, 5:26pm UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/39 "2023-01-15T17:26:19Z")

</div>

Ok, the new fixed image is ready.  
Don’t forget to remove the old one before testing the new one:

```auto
docker stop gladys
docker rm gladys
docker rmi atrovato/gladys:lan-manager

```

Thanks again.

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [January 15, 2023, 6:40pm UTC](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131/40 "2023-01-15T18:40:17Z")

</div>

Thanks — access to the Gladys interface is on which port :)? 8420?

[Previous page](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131.md?page=1)

[Next page](https://community.gladysassistant.com/t/detection-de-presence-via-le-reseau-local/6131.md?page=3)
