User presence at home

Manage the presence of one or multiple users

Hello, do we have an idea of how to proceed?

  • The most used in v3 was the presence via Bluetooth (via a scenario « When this device is detected via Bluetooth, then I am at home Â». « When this device is no longer detected for more than X minutes, then I am no longer at home Â»)

  • Next, perhaps the « estimated Â» presence via Owntracks (via 2 scenes, like « when I enter this geographical perimeter, then I am at home Â», « when I leave this perimeter, I am out of the house Â»

  • Finally, there is the presence via Wi-Fi network detection, which makes less and less sense now that iOS and Android rotate their MAC address to avoid this kind of tracking on public networks

Should we do as in v3, linking a device to a user? (not a fan)
Or do this through a scene? Or create a new dedicated UI service?
Or is the topic still up for discussion?

Why not with a facial recognition camera like Netatmo’s Welcome?
Or a button on the Gladys dashboard that triggers a scene (but this solution also requires clicking the button again when you leave).

Some leads found on the Net:
http://sarakha63-domotique.fr/presence-dans-la-domotique-les-solutions/

IFTTT seems to be the most suitable, but it has become paid, except for very limited use.

I found this.

But this solution seems to partially replace Gladys.

No, absolutely not, I agree! It was horrible to understand and not logical at all.

I think either in a scene, or in a dedicated service, to be seen what makes the most sense.

After thinking about it, I think a scene is the most flexible and works for the most people because everyone can add the conditions they want.

So, in my opinion, we need to create the necessary triggers/actions.

In the case of Bluetooth, we need to find a way to do this:

in a scene.

  • So an action « change user presence Â» in the scenes allows to switch a user to « at home Â» or « no longer at home Â»
  • Make sure that the scan of Bluetooth devices properly triggers an event when a Bluetooth device is seen after not having been seen for a while, and see the most logical way to catch this event in the scenes (via the trigger « device state changed Â»? Or a new trigger?)
  • Make sure there is an action in the scenes that allows to retrieve the last detection date of a device. In my opinion, the « retrieve last state Â» box already does the job, we just need to make sure that this box stores the datetime of the last event in the scene variables, and that we are then able to compare this date in the action « continue only if Â».

With this action, the user can create a scene that runs every 10 minutes, and checks « has device XXX been seen less than 10 minutes ago? Â». If yes, continue only if, and perform the action block « change user presence Â» to « out of the house Â».

What do you think @AlexTrovato?

Thanks @gaetanb76 for your research!

I agree, we’ll see how to « store / retrieve the last detection date of a device Â» (add a « last_seen_date Â» column on device?).

Then, we’ll also need to identify from the scene the devices that can be used as presence detection, in order to correctly implement the search on the service side (add a « user_presence Â» column on device? and the appropriate function on the service side « lookForDevice Â»?).

The problem with that is that we don’t have the history. Couldn’t it be a device_feature that would therefore have states?

I don’t think there necessarily needs to be any adaptation, it could just be a device_feature specific to home detection

Indeed, device_feature may do the trick.

For info, my nut mini keychain is detected :smiling_face: in the Bluetooth devices.

Think about adding it to the list of devices managed by Gladys.

It should only be added if it is managed for its function, presence management, which is not the case here.

Note, the list of devices that Gladys manages is a list that records devices « really managed and tested by a user Â», not devices that Gladys « sees Â» but does not really manage.

Indeed, that’s exactly what I was thinking and wanted to comment on yesterday before being offline (15,000 households due to an excavator).

My nut is only recognized. I can’t do anything with it for the moment.

It’s also the case for my Qubino and Fibaro Z-wave modules which are only On/Off. No position setting for my roller shutters, no different modes for my heating (comfort, eco, frost protection), no feedback.

That’s why I didn’t put them on the list.

This was the second requested feature after Bluetooth, and I’m working on it today :slight_smile:

I’ve merged the first feature, the ability to perform an action in scenes that says « the user is at home Â» or « the user is no longer at home Â».

@AlexTrovato Next step: How could we create a trigger in the « Device Seen Â» scenes? (which could work with potentially Bluetooth, Wi-Fi, or other technology)

The goal is to be able to create a scene:

  • WHEN « a device is seen: Nut Bluetooth Â»
  • THEN « User â€č john â€ș seen at home â€č my home â€ș Â»

Potentially, this could just be a « device.state-changed Â» trigger but with a special « detection Â» deviceFeature? What do you think?

I think the « detection Â» or « human Â» or « presence Â» feature is the simplest way to manage this, and it also implies that it’s a special feature. For Bluetooth, we can perform regular scans, and if we detect the presence of the device, we update this feature.
We just need to try not to spam events but to properly filter devices with this feature.
However, it won’t be the Bluetooth service that can say that the Nut device is a presence device, but the Nut service that can create a device with this feature.
Or alternatively, allow this feature on all devices, with an option when creating it.

I would go for « detection Â» or « presence Â».

That might be the most practical, but it’s just one brand among hundreds of others. If we have to make a service per brand, we won’t get far ^^

In any case, it’s just a checkbox to add in the Bluetooth device creation form, which will add the feature, and then the user can create their scene « when device XXX is seen Â» THEN « mark XXX at home XXX Â».

What do you think?

I’ll buy it!
I’m more for « presence Â», « detection Â» makes me think of « motion Â».
However, I think we already have a « presence Â» feature (from memory).
I’ll check if it’s not used for something else.
Otherwise, I’ll schedule it for Bluetooth :wink:
Added to the TODO list :wink: