-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opener - ring detect sensor not working #215
Comments
I have an idea what's going wrong, and it's most likely because you're using continuous mode instead of ring-to-open. The ring detection is unfortunately not documented. I had to take a guess and could observe that whenever a lock state update to "locked" is sent when it's already "locked", a ring is detected. Since you're using continuous mode, the lock state is never locked, and thus a ring can't be detected. I'd need to figure out how this is supposed to work when continuous mode is active. |
Thanks, I now read up across different forums on your previous endeavors to implement the ring detect sensor. It appears that Nuki chose to only make ring detection available via the HTTP Bridge API - too bad. I note that I get a sequence of at least two, sometimes three "ContinuousMode" messages within 10 to 12 seconds for each press of the doorbell button:
I am not sure why it is a sequence of messages - it may depend on the length of the press (which, however, was never more than 1.x seconds). So maybe you could try adapting your current detection mechanism (state "locked" updates to state "locked") to also pick up updates from "ContinuousMode" to "ContinuousMode" (and disregard any further "updates" happening within x seconds of the initial one). |
Yes makes sense they implemented it in a similar way, but those repeating messages are strange. The question is how long to ignore them. |
As a complication, might this also be affected by the ring tone suppression setting? |
I did some more test runs. Each doorbell button press triggers 2 or 3 (never only 1) "ContinuousMode" messages. The last message is logged within 2 to 14 seconds of the first. So a 20-second cool-off period counting from the first message would seem relatively safe. There are single message events, too, but they are never triggered by "manual" actions, only by "system" (nukihub) or "button" actions (or - strangely - are logged without any trigger and with no corresponding entry in the Nuki app log). |
I do not have ring tone suppression activated, neither globally nor in connection with Continuous mode. Should I test with active suppression? |
Yeah, I think that would be helpful. |
Ok, will do more tests tomorrow and report back. |
A few more observations:
In the meantime I have implemented a ring notification that works while continuous mode is active with the following automation in Home Assistant:
The timer.opener_trigger entity is a timer helper with a defined duration of 20 seconds. Its state is either "idle" or "active". When a message under the nukiopener/lock/state topic is received for the first time, the timer is started. While continuous mode is active, the message is always "ContinuousMode", so there is no need to filter for message content. It is, however, important to filter for the trigger sensor value being "manual" in order to catch only actual doorbell button presses and not other opening actions. When a second message within a 20 second period is received (i.e. while the timer is active), the timer is stopped and the notification action is executed. |
Interesting. So what messages are you getting under the nukiopener/lock/state topic? Must be "locked", because @technyon stated that is the only message the ring detection sensor listens for. Maybe the behavior is influenced by the Opener configuration. I only have a "dumb" buzzer (just a button, no intercom) and a independent doorbell, so my Opener configuration is simply "Brand: -", "Model: -" and "Doorbell cable connected: yes". |
Please don't forget that you are only monitoring the MQTT messages sent by Nuki Hub, not the actual BLE messages sent by the lock/opener. |
It's very annoying this isn't documented at all. My new guess would be that the opener sends the last status again - although I'm not sure why this would happen multiple times. |
Has there been any progress on this topic? I would love to have ring detection while "Continuous Mode" is On. |
Continuous mode is now a separate MQTT topic and should not be reflected in lockstate anymore since merging #296. So this problem should be fixed in the next release. |
Should be fixed in the current release |
Closing for now. @bklaesener Please recheck with release 8.33. If the problem is still there, we can reopen the issue. |
Unfortunately, neither the new binary sensor "ring_detect", nor the new event "ring" are triggered by door bell presses in my setup (continuous mode). What works now with 8.33 is to monitor the "nukiopener/lock/state" MQTT topic for the payload "open". But this does not seem to feed into either of the binary sensor or event in Home Assistant. |
ok, will reopen the issue. |
Seeing as the changes in 8.33 now allow the lock/state to become "open" while continuous mode is active this should be an easy fix. Looking at the Nuki Opener API a combination of the "Open" Lock State and "manual" Trigger should represent a ring (for both continuous mode and RTO?). @bklaesener: Can you confirm that trigger changes to I'll prepare a draft PR in the meantime |
With continuous mode activated, the trigger sensor does indeed change to The lock entity state is always So I am not sure your approach is going to work. As I wrote above, what works without fail (and also without false alarm) as a ring-to-open event indicator (in continuous mode) is checking for the payload |
The Home assistant lock entity is not changed by ring and should not / cannot be changed by it. The logic to signal a ring to the Home Assistant event / MQTT topics is part op the Nuki Hub code and PR #315 should make sure that a ring is published to MQTT / Home Assistant if the state of the Opener changes to You can download the build that is created by GitHub which includes these changes from https://github.com/technyon/nuki_hub/actions/runs/8145083443/artifacts/1295917525 Please try the binary in this build and report if these changes are succesfull. |
Ok, I guess I misunderstood! With the new firmware, ringing makes the |
Good to hear. Would be great if you can report in a couple of days if any false alarms are detected using this binary while your opener is in either continuous mode or RTO and if rings are always properly detected in both continuous mode and RTO. If no issues are found i'll change the PR from draft to ready for review so @technyon can review and hopefully merge it for the next release. |
Will do! |
I do have a follow up question (please bear with me, I don't own an Opener): Would it be usefull for the Home Assistant ring event sensor (added in #299) to have different events for:
@technyon: I don't like reflecting "ring" in the MQTT lock state as it isn't really a lock state (state remains locked in situation 1 and becomes open in situation 2, ring is not a (intermediate) state the opener can have). Seeing as ringing is now reflected in a seperate MQTT topic will you accept an update to this PR which will only reflect a doorbell ring in the Might be a breaking change for those that have the |
That does seem useful, especially because the the Please note, though, that the ring event sensor has not detected any ring event for me, yet. It has been triggered only by restarting the nuki hub. At all other times the state is |
@bklaesener: I've updated the PR to fix the event sensor. It should now detect a ring event with a type of "ring" when open and "ringlocked" when locked. Would you be willing to test the latest binary: https://github.com/technyon/nuki_hub/actions/runs/8162257175/artifacts/1299827462 |
Thank you, @iranl, tested and confirmed. Great job! |
@bklaesener: Any more insights after a couple of days use? No issues? False positives/negatives? If not I'll convert the PR to ready for review. |
No issues at all, go ahead! |
Hi, my "ring detect" sensor is always shown as "unknown" on the MQTT device page.
According to the MQTT debug log, the payload should be either "ring" or "locked" (see below).
Instead, each ring action returns a "continous mode" payload, which appears to match the "lock/state" state_topic but does not serve the purpose of the sensor:
Transmitted messages:
Downstairs Door ring detect (binary_sensor.downstairs_door_ring_detect)
MQTT discovery data:
Topic: homeassistant/binary_sensor/xxxxxxxx/ring/config
Payload
device:
identifiers:
- nuki_xxxxxxxx
manufacturer: Nuki
model: Opener
name: Downstairs Door
name: Downstairs Door ring detect
unique_id: xxxxxxxx_ring_detect
device_class: sound
state_topic: nukiopener/lock/state
payload_on: ring
payload_off: locked
platform: mqtt
Subscribed topics:
nukiopener/lock/state
10 most recently received message(s)
Received 10:56:23
QoS: 0
Payload: ContinuousMode
Received 16:33:50
QoS: 0
Payload: ContinuousMode
Received 16:34:07
QoS: 0
Payload: ContinuousMode
If this is due to a misconfiguaration on my part I would be grateful for a hint.
The text was updated successfully, but these errors were encountered: