Skip to content

Conversation

@grecine
Copy link

@grecine grecine commented Nov 10, 2025

Fix for #693 (duplicate of closed/stale #705 and solves the same problem as #713)

Problem

In v4.6.10, the Nest Protect occupancy sensor stopped updating correctly in HomeKit, causing automations to fail. The issue was introduced in commit 9795793 where .getValue() was replaced with .value in the characteristic update logic.

Root Cause

  • .getValue() triggers the characteristic's 'get' event handler, which calls the bound function (like getOccupancyDetected()) and updates the characteristic value properly
  • .value just accesses the property directly without triggering the 'get' event handler, so the characteristic value is never updated with the current device state

Fix

  • Reverted the change from .value back to .getValue() in the updateData method in lib/nest-device-accessory.js
  • Also fixed the same issue in index.js error handling section
  • This ensures characteristic updates trigger properly and HomeKit automations work as expected

Testing

  • ✅ Verified that the occupancy sensor now updates correctly
  • ✅ HomeKit automations based on occupancy should work again
  • ✅ No breaking changes introduced

Fixes #675 (the original HB2 compatibility issue that introduced this regression)

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant