Add occupancy sensor capability

With the advent of new devices capable of detecting occupancy independently of movement, there would be a need for adding this capability as well as including it as available trigger in built-in app.

4 Likes

Think most of them just use the motion capability.

Exactly... they don't have a choice. The capability is missing.

2 Likes

What's the proposed value to having a new capability? I suppose using presence would probably be more appropriate.

Except presence looks weird. It's what the community Aqara FP1 driver does.

I'm not sure what that means.

Either way, presence is widely accepted to be used to determine whether or not someone is in their house...don't see why it wouldn't fit for a room.

As far as the way a capability is used in a device driver...that's easily modified to be whatever you want it to be.

As for the FP1, as far as I can tell, the implementation in @kkossev's driver seems to reflect presence in motion as well (that's actually what I'm using for all 7 of mine in Room Lighting).

In the FP1 driver 'presence' is actually a custom attribute, which reflects the FP1 sensor internal 'presence detected' state. The standard HE '"PresenceSensor" capability is not declared.

The 'presence' attribute comes from the same naming used in Aqara and HomeAsistant implementations... I realised that it may be confused with HE definition some time later, after the driver was published.

I was thinking about changing the custom attribute name to "presence_state" or something similar (like the other custom attribute in the driver - 'presence_type'). As I suppose that everyone is using the standard 'motion' attribute with FP1 devices, it is probably still not too late to make this change.

3 Likes

Separate to the Aqara FP1 considerations discussed already....
I wonder whether presence would be the right fit? I probably prefer the original phrasing in the Topic's title of occupancy, rather than presence. It's semantics, I know... And may not be materially relevant.

The way I interpret presence is that there is a concept of the location being managed by the hub as a whole, and each device that implements the presence capability is reporting their presence in that one location, i.e.

I feel like the requirement here is to know that there is activity in a Room, not so much the location of a specific device.

So I feel like some way of determining the occupancy of a room, whether that be through a driver or some platform indicator that can be referenced in rules and other apps, that seems like the way to go for me.

surely that's just a motion sensor or an zone aggregated motion sensor if your have multiple in a room?

I should have provided more examples... Because, yes, in many cases, both in my home and I expect others, motion and zone-based motion would be the way to determine occupancy.

But other situations or "sensors" may also be used to determine occupancy.... e.g.

  • Are you watching the TV (an Activity being ON for a Logitech Harmony or Chromecast being cast to)
  • Are you in bed (detected using pressure sensors or some other means)
  • Are you in "work-mode" in the Study, sitting at the desk, indicated through various means such as a virtual switch or something similar
2 Likes

Not sure if this helps, but I see presence is that I or my wife is home. Presence is that somebody is somewhere I am monitoring.

The full title of the section describing this categorization in the Developer Documentation is Device Capabilities. So given that, and after some consideration, I’m going to vote no on making it a capability as devices can’t be occupied. Does that mean I don’t believe that occupancy is a valid trait, also no, but, recalling Rooms are still a concept in transition, it should become a property of the Room class as it moves to becoming a finalized concept instead of bastardizing the Device class.

1 Like

Devices can't be occupied but they can report occupancy as devices can report motion or whatever. The point is some device reports both motion and occupancy independently. Without a seprate capability there is a confusion between one motion and the other witch could be motionless. Since presence is intended for a broader location there would be a need for a more specific "presence".

Also, from a point of view of automation, one might want to have a different take base on occupancy rather then motion.

Edit: probably the capability should be only "occupancy sensor" without the room part.

5 Likes

I updated the title to reflect more accurately the request

1 Like

With that small, but significant, change, a device capability would seem to be a reasonable request. :sunglasses:

4 Likes

Just trying to wrap my head around the semantics. Is the issue that, in your opinion "presence" would usually indicate a specific person occupying the location, whereas "occupancy" would merely indicate any person or animal?

Just asking as occupancy is usually synonymous with presence for most situations I can think of. Occupancy is when someone is present within a specified location within the specified boundaries. That can be a geolocation with a known radius (like individual presence sensors), or within a certain radius of my front door (I use presence as determined when my front door camera observes a face to alert for intrusions while I am away - this is coded as present/not present in the driver), or even within a location as determined by some pressure sensors, such as a previously mentioned bed. My sleep number bed marks me as "present" when there is enough weight noticed on my side of the bed. In those cases, my property is occupied, or my front porch is occupied, or my bed is occupied because someone is present.

I do get that only one of those involves knowing a specific person(or at least their sensor) is within a specified boundary. But, I am not sure that is enough of a difference to confuse people with a different definition for everything but devices specifically tied to one specific person (or their sensor).

Is there another difference I am missing? (Genuinely asking - not trying to challenge you at all. Just wondering what your specific thought process was on why presence doesn't work for you)

It can be argued that occupancy and presence are interchangeable and therefore would be redondant, but the concept of presence seems to be specifically related to the differenciation between people located at some premises while occupancy is more focus on a physical device sensor report of someone being in the close vicinity of that said device.

One may point out that broadening the concept of presence to include occupancy would dilute its purpose and perhaps add confusion. Hence that request.

6 Likes

That's the key difference for me.

Various use cases across presence and occupancy:

A specific known person is present.
Any or all known people are present.
A room or location is occupied by any person, whether they're known or not.

6 Likes

There's a related capability request to avoid the overuse of presence to mean a device is still online.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.