# Node-red / wifi

**URL:** <https://community.gladysassistant.com/t/node-red-wifi/6922>\
**Category:** Configuration\
**Created:** [February 10, 2022, 10:38am UTC](https://community.gladysassistant.com/t/node-red-wifi/6922 "2022-02-10T10:38:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [February 10, 2022, 10:38am UTC](https://community.gladysassistant.com/t/node-red-wifi/6922/1 "2022-02-10T10:38:22Z")

</div>

Hello,

I am currently setting up a lot of things on the node-red side. I wanted to add Wi-Fi detection via the smartphone. Has anyone already managed to set this up? The limitations are probably from Docker in my opinion. Any ideas?

(I tried with a Wi-Fi detection tool on node red but it tells me `no scanning utility found`)

---

<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:** [February 11, 2022, 7:26am UTC](https://community.gladysassistant.com/t/node-red-wifi/6922/2 "2022-02-11T07:26:59Z")

</div>

The Node-RED plugin must certainly have prerequisites with programs to install on the system.

Otherwise, the limitation is that recent iOS and Android devices regularly change their MAC address to avoid being too tracked.  
You may therefore not easily identify your phone unless you explicitly ask it not to change its MAC address.

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [February 11, 2022, 8:30am UTC](https://community.gladysassistant.com/t/node-red-wifi/6922/3 "2022-02-11T08:30:11Z")

</div>

Yes, I was wondering if anyone had these limitations, I’m going to dig into the code to see what it uses

Not sure about the Wi-Fi side, you need to be able to identify MAC addresses to be able to block (security in particular). So I think it doesn’t change.

---

<div class="post-metadata">

**Author:** ![PhilippeMA](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/p/b3f665/32.png) [@PhilippeMA](https://community.gladysassistant.com/u/PhilippeMA)\
**Post date:** [February 11, 2022, 8:46am UTC](https://community.gladysassistant.com/t/node-red-wifi/6922/4 "2022-02-11T08:46:48Z")

</div>

Hello,

On my installation, I detect the presence of users exclusively via Wi-Fi with a ping in Node-RED that returns to Gladys via MQTT when the ping has worked (palette: node-red-node-ping).

It works great.

Available for more details.

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [February 11, 2022, 8:47am UTC](https://community.gladysassistant.com/t/node-red-wifi/6922/5 "2022-02-11T08:47:54Z")

</div>

That’s clever! Especially if you block the IPs statically

Thanks, I’ll put that in place 🙂

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [February 11, 2022, 9:03am UTC](https://community.gladysassistant.com/t/node-red-wifi/6922/6 "2022-02-11T09:03:02Z")

</div>

However, I would like some information, how do you associate a user with a presence sensor in Gladys?

I have the impression that it doesn’t work as I wish, perhaps I am mistaken, but my MQTT sensor receives 0 = not present and 1 = present.

It tells me that it saw it a few seconds ago, but the user is no longer there. Is it me or is there a problem with the functioning of this feature?

---

<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:** [February 14, 2022, 8:27am UTC](https://community.gladysassistant.com/t/node-red-wifi/6922/7 "2022-02-14T08:27:18Z")

</div>

In my opinion, your scene is: «&nbsp;If presence = 1, the user is there&nbsp;», but since the sensor returns 0 after a few seconds (or its state is reset to 0 by Gladys, it’s the same), it quickly marks you as absent.

This is always a difficulty in relying solely on motion sensors to define a user’s presence. Gladys does not yet make this easy, in my opinion.

Here’s how I see things:

1. A scene that marks a person as present in case of movement from a sensor
2. A scene that marks a person as absent in case of no movement for 10 minutes

Where it gets stuck is scene 2, which will never wait **10 minutes after detecting** movement to mark you as absent. It will just run every 10 minutes, movement or not. So your presence detection will be terrible.  
I had this idea at the beginning, then I switched to an app that sends a signal to Gladys via Wi-Fi using MQTT. That way, when I’m on Wi-Fi, I’m detected, when I leave, I’m marked as absent.

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [February 14, 2022, 10:44am UTC](https://community.gladysassistant.com/t/node-red-wifi/6922/8 "2022-02-14T10:44:52Z")

</div>

Well, in that case I go through Node Red and it manages it like this:

- I find the phone =\> presence
- no phone =\> no presence

So in both cases it’s a real information.

But what I can’t do in Gladys is define a capture? or a state that says yes the user «&nbsp;Thibaut&nbsp;» is indeed present. And therefore that I send the info to node red?

Actually, the «&nbsp;presence&nbsp;» feature doesn’t work for my case (maybe in other cases I don’t know).

For me, presence is yes or no, here it’s seen there is X time

---

<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:** [February 14, 2022, 12:15pm UTC](https://community.gladysassistant.com/t/node-red-wifi/6922/9 "2022-02-14T12:15:58Z")

</div>

> [@damalgos](#):
>
> But what I can’t do in Gladys is define a capture? or a state that says yes the user «&nbsp;Thibaut&nbsp;» is indeed present. And then send the info to node red?

Yes, you create a «&nbsp;virtual&nbsp;» sensor in the MQTT integration, and then you create 2 scenes that will bridge this sensor and the native presence management:

```auto
IF sensor = 1 THEN user damalgos seen at home
IF sensor = 0 THEN user damalgos has left the house

```

You should see this virtual sensor as a kind of variable where you store a state.

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [February 14, 2022, 12:28pm UTC](https://community.gladysassistant.com/t/node-red-wifi/6922/10 "2022-02-14T12:28:55Z")

</div>

Ahhhhh thank you! Great, I hadn’t understood this particular case of setting the scene. Super thank you, that’s great

---

<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:** [February 14, 2022, 3:19pm UTC](https://community.gladysassistant.com/t/node-red-wifi/6922/11 "2022-02-14T15:19:15Z")

</div>

> [@pierre-gilles](#):
>
> You should see this virtual sensor as a kind of variable where you store a state.

I hadn’t understood the context, indeed it’s simpler like this in Gladys!
