Détection de présence via le réseau local

@GBoulvin so I made the change to the device selection field on the presence box on the dashboard (I’m deliberately specifying that).

Let’s see with @pierre-gilles and the others if they find it acceptable; otherwise I’ll cancel.

The new image is available.

So, I’ve put the code in a PR, the LAN feature will be integrated in a future version of Gladys.

1 Like

I just tested it but I’m experiencing strange behavior!

First of all, registration now works but there is a mix-up of IP addresses
During the first scan I have my NAS at 192.168.0.16 but after a second scan the IP address changed and shows for my NAS the IP address of another.

Below I have 3 screenshots and the IP is not the same each time.



Below I have my NetAtmo on the right but on the left the device is also named NetAtmo even though there is no link.

Last point: all my devices appear twice!

You had deleted /var/lib/gladysassistant, right?

It’s fine for me!
One more thing though…
The first time — and only the first time — you scan, the logo spins in a loop, indefinitely.


You have to click elsewhere or on the ‹ refresh › button for the devices to appear.
If this behavior is normal, there should be a short explanatory sentence :wink:

Edit: a scan takes 14s for 35 devices with Gladys on my RPi2

Yes, I delete everything for each image so I start from scratch.

I had also forgotten the last point you mentioned about the logo that keeps looping.

Wow @_Will_71 indeed this behavior is strange… I feel like I’m going to struggle to figure out the how and why… but we can’t leave it like that.

Hello,

Second attempt and still nothing on my end…

When I start the search, it doesn’t seem like much happens…

Installed on Raspberry Pi via :

docker stop gladys
docker rm gladys
docker rmi atrovato/gladys:lan-manager
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/Paris -e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/gladysassistant:/var/lib/gladysassistant -v /dev:/dev -v /run/udev:/run/udev:ro atrovato/gladys:lan-manager

Nice work @AlexTrovato! :clap: I left a quick review on GitHub.

1 Like

I just merged the integration into master, it will be included in the next Gladys release!

Well done @AlexTrovato for the work, and thanks to everyone who tested :clap:

5 Likes

Hi everyone!

The integration was released this morning in Gladys Assistant 4.21 and will roll out to everyone within the next 24 hours :rocket: Big thanks again to @AlexTrovato for all the development :clap:

I realized there was no documentation on the site explaining how this integration works.

Would anyone like to take on writing documentation to explain how to set up detection via the local network? Following the same model as the Bluetooth integration documentation: Gérer la présence avec la détection Bluetooth | Gladys Assistant

Just make a PR on this repo: GitHub - GladysAssistant/v4-website: Gladys Assistant website

The integrations documentation is in this folder in English: v4-website/docs/integrations at master · GladysAssistant/v4-website · GitHub, and here in French: v4-website/i18n/fr/docusaurus-plugin-content-docs/current/integrations at master · GladysAssistant/v4-website · GitHub

Be sure to explain all the prerequisites (Is there anything to do on iOS/Android to be detectable?) and the common errors :slight_smile:

1 Like

Hello everyone !
I’m on 4.21 and I thought great I’ll be able to check my network, but I can’t find any devices on my network.

As a reminder my instance runs on a NAS via Docker, could that be the cause?

Are you by any chance trying to find devices from your Gladys Plus instance (remotely, that is)?
Because I was only able to discover devices on my Gladys locally :wink: I don’t know if that’s normal, though.

@AlexTrovato, I just tried the integration but I have a display issue on the dashboard

When you add, for example, several devices (in the image below 3 phones) it’s hard to tell which is which!
Would it be possible to edit this part or to display the name you give when adding?

2nd point regarding detection: my devices are correctly detected when I do a scan but afterwards the timing shown on the dashboard corresponds to when I added them in Gladys.
So if I disconnect them from the network or reconnect them there is no change in the timing, so we can’t use it in scenes!

EDIT
There was an update to the detection and it found it even though my phone is not on the network because I’m not at home.

Yep,

1 Like

Personally, it’s no better than during the dev tests.

Nothing happens, it detects nothing…

But I’ve never had any response to my messages :frowning:

1 Like

Good evening,

@spenceur, I have my production installation on a Synology, and indeed, no device was reported, or more precisely, the network discovery never finished.
In the « Configuration » tab of the LAN Manager, I then see no fewer than 8 network interfaces, on IPs in 192.168.x.x (my local network), but also on 172.x.x.x (Docker).
Disabling the Docker interfaces allowed discovery to work, with results in a few seconds.
After changing the configuration, if the button in the « Discovery » tab is red, I then advise you to restart Gladys.
If that works, we’ll make a change to disable the Docker interfaces by default (and stop the never-ending discovery).

@_Will_71 be careful with « smartphone » devices, they change their MAC address for security reasons, and the LAN Manager service relies on the MAC address to identify a device.
So it’s possible that the device changes identification, and therefore Gladys won’t find it.
For the « dashboard » area and the « Presence » display, indeed, it’s not great.
I think @pierre-gilles won’t mind if we change the display to show the device name rather than the feature name for presence features.

@Hizo sorry for not replying.
Maybe the answer given for @spenceur (1st paragraph) can help you.

I’m open to your feedback.
Thanks already for those :wink:

PS: I might have missed some information among all the messages.

Thanks for your feedback! For info the issue is only present on Gladys Plus but locally I scan correctly. Without disabling Docker’s network interface :wink:

However, it’s impossible to find an iPhone on the network with the service. Does anyone know how to do it?

Humm… that’s weird what you’re telling me!

On my side, it’s no better locally, because my problem is that it’s trying to scan the Docker networks (172.x.0.1/16), i.e. 65,536 IPs, across 5 Docker interfaces… 5 * 65000… anyway, it’s very, very, very long. I don’t even know if it will finish…

Do you also get an error message after the scan? Even if it worked?

I rechecked and on G+ I can see the devices showing now.
Is it because it was the first scan and therefore the slowness with the

1 Like

Thanks for your reply @AlexTrovato, the MAC address is fixed; I changed the setting on the smartphones.
But what’s strange is that the phone is being detected several times during the day even though I wasn’t at home!