Closed 64Spaces closed 2 months ago
Homebridge RPi already supports motion sensors. Afaik, HomeKit doesn’t treat occupancy sensors any differently, but Eve only supports history for motion sensors. Is there any reason you specifically need an occupancy sensor?
Thank you. Yes, I have the motion sensor set up and it works great.
I have an outdoor motion sensor to notify me when triggered. WIth RPi, I get the notification every 3 seconds in the Apple HomeKit App. The other developer had the occupancy sensor as an add-on option to the motion sensor that would show as an occupancy sensor in HomeKit. When it was triggered, I could set a period of 5 minutes in the Homebridge Config file and I would not get another notification for 5 minutes. Is there a setting I'm missing in RPI?
Thanks
Is there a setting I'm missing in RPI?
Hm, most motion sensors expose a Duration which defines how long the sensor continues to report motion detected after no longer detecting motion. Note that Apple's Home app doesn't support this, but Eve does (in the accessory settings) as do other decent HomeKit apps.
I haven't yet exposed this for Homebridge RPi, though.
Thanks. This particular motion sensor, connected to RPi, is a hardwired outdoor Optex brand. It doesn't support any "smart" settings. I looked in Eve at some of my other motion sensors (Hue, Aqara, and security hard wired) and Duration does not show on any of them. The Occupancy/Presence was a nice feature in the other platform I had, before transitioning to RPi. Hopefully, you can figure a way to add it. Thank you for taking a look at it.
@64Spaces I stumbled upon this thread, and see your use-case may apply to a plugin I use for my home. Have you considered homebridge-magic-occupancy?
You could try exposing a dummy Occupancy Sensor with that plugin and set it up with an automation to be triggered by your hardwired motion sensor. You are able to set a specified time for the sensor to remain occupied within the plugin settings, and then use that sensor to send you the notification instead of the motion sensor.
I looked in Eve at some of my other motion sensors (Hue, Aqara, and security hard wired) and Duration does not show on any of them.
Hue motion sensors support this, but the Hue bridge doesn’t. However, deCONZ and Homebridge deCONZ support this perfectly. I’m not sure about Aqara, they have many different models.
You could try exposing a dummy Occupancy Sensor
That makes sense particularly, when you have multiple motion sensors covering different angles of the same (large) room. For rooms with only a single motion sensor, it’s easier to set Duration, which I’ll add to Homebridge RPi’s motion sensor. I would use dummy motion sensors, to get Eve history on the dummy sensor as well. The Hue bridge and deCONZ support dummy sensors (CLIP sensors, see https://github.com/ebaauw/homebridge-hue/wiki/Getting-Started#24-clip-sensors) which Homebridge Hue and Homebridge deCONZ expose to HomeKit, so you don’t need an additional plugin. Also, you can then use rules on the Hue bridge or deCONZ gateway to update the dummy sensor, which are far more reliable and responsive than HomeKit automations.
Good thinking @ebaauw. That's actually how I have my home setup, and I use the duration option inside the HB Hue motion sensor. It works flawlessly!
However, correct me if I'm wrong, but I can't seem to find any indication in OP's request that this is related to HB Hue. My understanding is that there's a hardwired GPIO motion sensor connected to the Raspberry Pi in which they just need an extended duration for that motion/occupancy to stay triggered without excessive notifications being sent. I think if occupancy isn't specifically added to the RPi plugin, then simply adding a dummy occupancy sensor that's triggered by the hardwired motion sensor, and then relying on the occupancy sensor's notification instead would achieve the goal that OP is trying to achieve. Would you agree?
@ebaauw Additionally as a side inquiry; I would love to move a lot of my automations in HomeKit over to the Hue bridge directly, but no other HomeKit devices are visible/applicable as a condition or action when creating rules on the bridge other than hue devices or Friends of Hue devices connected to the bridge. Are you suggesting/aware of another way of creating this rule on the bridge directly and triggering a dummy switch/sensor that's not Hue related?
I can't seem to find any indication in OP's request that this is related to HB Hue
They mentioned not seeing Duration for Hue motion sensors. That's where Homebridge Hue overcomes the limitation of the Hue bridge.
they just need an extended duration for that motion/occupancy to stay triggered without excessive notifications being sent.
Indeed, but you don't need a dummy sensor for that. Homebridge RPi will provide Duration and handle Motion Detected as exposed to HomeKit accordingly. I'll just set a timer when the sensor reports motion is no longer detected. I'll delay setting Motion Detected off, until the timer expires. Of course, I'll cancel the timer if the sensor reports motion is (re-)detected before the duration is due.
Additionally as a side inquiry
That is off-topic, please move this to Homebridge Hue, maybe even to Discord. See the Wiki link above: you can use CLIP sensors to mimic the state of a non-Zigbee sensor and make these available to the Hue bridge / deCONZ gateway. Of course, you do need some script (see Wiki) or programme (see e.g. https://github.com/ebaauw/fp2-proxy) to monitor the real sensor's state and update the dummy sensor's state accordingly. Sometimes, do use HomeKit automations for this (e.g. to set a CLIPGenericFlag sensor when my Sony TV (that supports HomeKit) turns on, so I can dim the lights and close the blinds connected to deCONZ).
@ebaauw Ahh, yes I see now. If OP doesn't have HB Hue installed yet, I defffffinitely recommend it as well. I can't imagine my setup without it!
I also see your point about RPi's capabilities with GPIO sensors -- I just don't have any hooked up & hardwired that way so I'm unfamiliar with it but if getting the ability to customize that delay will be implemented the way you described, then I agree I think that should be all they need and can disregard the suggestion for the dummy sensor.
Also, thank you for your input with the off topic question! I was considering bringing it up on the other plugin's page, but since you mentioned it just thought I'd ask. I will dig into these suggestions you gave and head over to the HB Hue page/discord for any other questions. Thank you again for all your awesome plugins and support! Hope that solves OP's needs. 👌🏼
@ohhmyjawwsh, thank you for the suggestions. I have heard of magic-occupancy, but never explored it. It sounds like Erik is considering and working on this feature request. I will keep magic-occupancy in mind as a back up option. Thanks again.
In v1.8.22.
Thank you. I will set it up later today and report back.
I upgraded, set the duration in Eve. It works perfectly. Thanks so much for this enhancement.
Hello. I installed RPi this last weekend and it's working great. I replaced homebridge-gpio-device because it uses wiringPi, which is deprecated. However, it had a nice feature to add an occupancy/presence detector to a motion detector. Do you think this is possible with RPi? Screen shot below. Thanks so much.