Skip to content
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

Fix notification delay with doorbell_graham_cracker #1280

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

townsen
Copy link

@townsen townsen commented Aug 2, 2023

The low cost wired Ring doorbell (aka 'Graham Cracker') cannot take snapshots whilst recording which leads to a ~15sec delay in the HomeKit notifications. This patch bypasses the snapshot load for these devices only. See issue #933.

* The low cost wired Ring doorbell cannot take snapshots whilst recording
  which leads to a ~15sec delay in the HomeKit notifications. This patch
  bypasses the snapshot load for these devices only.
  See issue dgreif#933.
@tsightler
Copy link
Collaborator

@dgreif What do you think? My gut says that, while this works, I'm not sure if this is the ideal place to fix this, for one camera model, OK, but my guess is there will be more.

I feel like a better approach is to impement some type of capability flag (not sure of the name, maybe hasSnapDuringRecord) in ring-client-api that can be checked here. This would cover any operatingOnBattery() mode and any camera models that don't have this capability could be explicitly added to the list, assuming we can't find a better way to identify them.

I do have a suspicion that any camera that can't do this will have a "run_mode" of "low_power", but I don't have access to enough models to prove that. Some cameras, mostly stickup cams I believe, but maybe spotlight cams too, support different run modes based on if their power source is battery, solar, or plug and based on settings in the app.

@townsen Any chance you could provide a data discovery of this camera to see what run mode it reports?

@townsen
Copy link
Author

townsen commented Aug 3, 2023

@tsightler I agree that a capability flag would be more elegant and generic, but I'm not sure how to check that. I've looked at the Data Discovery (I did one way back in #933, and repeated it today - see below) and I see nothing obvious, but I'm no expert. So although this is hardcode perhaps it's the only way. I do see an argument to move it further back into the ring-client-api as you suggest. Let's see what @dgreif thinks. I did this now as I'm off on vacation (which is what pushed me to make this fix!) so won't be able to refactor the PR until September.

@townsen
Copy link
Author

townsen commented Aug 3, 2023

Data Discovery taken today using NodeJS v18.16.0 and homebridge-ring v11.8.1 :
{"locations":[{"name":"Torquay","cameras":[{"kind":"doorbell_graham_cracker","description":"Front Door","is_sidewalk_gateway":false,"created_at":"2021-11-20T09:36:25Z","deactivated_at":null,"firmware_version":"Up to Date","owned":true,"stolen":false,"shared_at":null,"health":{"battery_percentage_category":"unknown","battery_voltage_category":"unknown","connected":true,"device_type":"doorbell_graham_cracker","external_connection":false,"firmware_version":"11.0.16","floodlight_on":false,"last_update_time":1691049200,"network_connection_value":"wifi","night_mode_on":false,"ota_status":"timeout","rss_connected":true,"rssi":-68,"rssi_category":"okay","second_battery_percentage_category":"unknown","second_battery_voltage_category":"unknown","sidewalk_connection":false,"transformer_voltage":19.386,"transformer_voltage_category":"good","white_led_on":false,"firmware_version_status":"Up to Date","packet_loss":0,"packet_loss_category":"good","hatch_open":false,"status_time":55412300169699,"vod_enabled":true,"firmware_avg_bitrate":"1309","stream_resolution":100,"video_packets_total":"2286","wifi_is_ring_network":false},"subscribed":false,"subscribed_motions":false,"battery_life":null,"external_connection":true,"active_schedule_uuid":null,"alerts":{"connection":"online","ota_status":"timeout"},"motion_snooze":null,"settings":{"motion_snooze_preset_profile":"low","motion_snooze_presets":["none","low","medium","high"],"live_view_preset_profile":"middle","live_view_presets":["low","middle","high","highest"],"doorbell_volume":8,"chime_settings":{"enable":true,"type":2,"duration":10},"advanced_motion_detection_enabled":true,"advanced_motion_detection_human_only_mode":false,"enable_audio_recording":true,"people_detection_eligible":false,"live_view_disabled":false,"ignore_zones":{"zone1":{"name":"undefined","state":0,"vertex1":{"x":0,"y":0},"vertex2":{"x":0,"y":0}},"zone2":{"name":"undefined","state":0,"vertex1":{"x":0,"y":0},"vertex2":{"x":0,"y":0}},"zone3":{"name":"undefined","state":0,"vertex1":{"x":0,"y":0},"vertex2":{"x":0,"y":0}},"zone4":{"name":"undefined","state":0,"vertex1":{"x":0,"y":0},"vertex2":{"x":0,"y":0}}},"enable_rich_notifications":true,"rich_notifications_billing_eligible":false,"loitering_threshold":10,"advanced_motion_detection_types":[],"motion_detection_enabled":true,"rich_notifications_scene_source":"cloud","offline_motion_event_settings":{"subscribed":false,"enabled":false,"max_upload_kb":5000,"resolution_p":360,"frequency_after_secs":2,"period_after_secs":30},"cv_settings":{"detection_types":{"human":{"enabled":false,"mode":"none","record":null,"notification":false},"loitering":{"enabled":false,"mode":"none","record":null,"notification":false},"motion":{"enabled":true,"mode":"edge","record":null,"notification":true},"moving_vehicle":{"enabled":false,"mode":"none","record":null,"notification":false},"other_motion":{"enabled":false,"mode":"none","record":null,"notification":false},"package_delivery":{"enabled":false,"mode":"none","record":null,"notification":false},"package_pickup":{"enabled":false,"mode":"none","record":null,"notification":false}},"threshold":{"loitering":10,"package_delivery":2},"triggers":[]},"concierge_settings":{"mode":"disabled"},"sheila_settings":{"cv_processing_enabled":false,"local_storage_enabled":false},"server_settings":{"ring_media_server_enabled":true,"ring_media_server_host":"rms-eu-west-1.rapi.us-east-1.prod.client.cap.ring.devices.a2z.com"},"cv_paid_features":{"human":false,"loitering":false,"motion":false,"other_motion":false,"package_delivery":false,"package_pickup":false,"cv_triggers":false},"other_paid_features":{"alexa_concierge":false,"sheila_cv":false,"sheila_recording":false},"zone_settings":{"motion":[{"name":"Default Zone","state":"enabled","properties":{"detection_types":["motion"]},"vertices":[{"x":0.156284,"y":0.672109},{"x":0.34318,"y":0.346498},{"x":0.677595,"y":0.291156},{"x":0.729759,"y":0.385409},{"x":0.682444,"y":1},{"x":0.584152,"y":1},{"x":0.333333,"y":1},{"x":0.021447,"y":0.995139}]}]},"stark_enrolled":null,"network_settings":{"mac_address_ble":null,"max_dynamic_listen_interval":null,"network_diagnosis":null,"multi_net_pref":3,"mac_address_wifi_24":null,"mac_address_wifi_5":null},"motion_zones":[0,0,0,0,0],"enable_vod":1,"exposure_control":2,"vod_suspended":0,"voice_volume":11,"video_settings":{"encryption_enabled":false,"encryption_method":1},"advanced_motion_zones":{"zone1":{"name":"Default Zone","state":2,"vertex1":{"x":0.156284,"y":0.672109},"vertex2":{"x":0.34318,"y":0.346498},"vertex3":{"x":0.677595,"y":0.291156},"vertex4":{"x":0.729759,"y":0.385409},"vertex5":{"x":0.682444,"y":1},"vertex6":{"x":0.584152,"y":1},"vertex7":{"x":0.333333,"y":1},"vertex8":{"x":0.021447,"y":0.995139}},"zone2":{"name":"Zone 2","state":0,"vertex1":{"x":0,"y":0},"vertex2":{"x":0,"y":0},"vertex3":{"x":0,"y":0},"vertex4":{"x":0,"y":0},"vertex5":{"x":0,"y":0},"vertex6":{"x":0,"y":0},"vertex7":{"x":0,"y":0},"vertex8":{"x":0,"y":0}},"zone3":{"name":"Zone 3","state":0,"vertex1":{"x":0,"y":0},"vertex2":{"x":0,"y":0},"vertex3":{"x":0,"y":0},"vertex4":{"x":0,"y":0},"vertex5":{"x":0,"y":0},"vertex6":{"x":0,"y":0},"vertex7":{"x":0,"y":0},"vertex8":{"x":0,"y":0}}},"advanced_motion_zones_enabled":true,"advanced_motion_zones_type":"8vertices","advanced_pir_motion_zones":{"zone1_sensitivity":5,"zone2_sensitivity":5,"zone3_sensitivity":5,"zone4_sensitivity":5,"zone5_sensitivity":5,"zone6_sensitivity":5},"motion_announcement":false,"motion_sensitivity_profile":1,"pir_sensitivity_1":5,"lite_24x7":{"subscribed":false,"enabled":true,"frequency_secs":180,"resolution_p":360},"rich_notifica-uuid":false},"features":{"cfes_eligible":true,"motion_zone_recommendation":false,"motions_enabled":true,"show_recordings":false,"show_vod_settings":true,"rich_notifications_eligible":true,"show_offline_motion_events":false,"sheila_camera_eligible":true,"sheila_camera_processing_eligible":true,"dynamic_network_switching_eligible":false,"motion_message_enabled":false,"show_24x7_lite":true},"ext_power_state":null}],"chimes":[],"intercoms":[],"devices":[]}],"amazonKeyLocks":[]}

@tsightler tsightler mentioned this pull request Nov 14, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants