Skip to content

Fix Alexa PowerController bool payload mismatch on Homebridge 2.x#821

Draft
Copilot wants to merge 2 commits into
beta-0.10.0from
copilot/fix-alexa-device-unresponsive
Draft

Fix Alexa PowerController bool payload mismatch on Homebridge 2.x#821
Copilot wants to merge 2 commits into
beta-0.10.0from
copilot/fix-alexa-device-unresponsive

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

Homebridge 2.x/HAP-NodeJS 2.x strictly validates characteristic types. Alexa.PowerController commands were sending integer 1/0 from discovery cookies into bool characteristics, causing -70410 and Alexa “Device Unresponsive”.

  • Runtime compatibility guard (cached-cookie safe)

    • Updated alexaPowerController to coerce legacy cookie values at execution time:
      • 1 -> true
      • 0 -> false
      • all other values unchanged (no behavior change for non-bool paths)
  • Correct type at discovery source

    • Updated parse/Characteristic for On/Active actions to emit boolean cookie values directly:
      • TurnOn: true
      • TurnOff: false
  • Regression coverage

    • Added focused tests for:
      • coercion of legacy 1/0 cookies in alexaPowerController
      • passthrough of non-binary values
      • boolean cookie generation for On characteristics
    • Updated discovery snapshot fixtures to reflect boolean TurnOn/TurnOff values where applicable.
// alexaPowerController payload normalization
"value": (haAction.value === 1 ? true : (haAction.value === 0 ? false : haAction.value))

Copilot AI changed the title [WIP] Fix Alexa 'Device Unresponsive' issue with Homebridge 2.x Fix Alexa PowerController bool payload mismatch on Homebridge 2.x May 11, 2026
Copilot AI requested a review from NorthernMan54 May 11, 2026 14:10
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.

Alexa „Device Unresponsive" with Homebridge 2.x

2 participants