51 Commits

Author SHA1 Message Date
Nick Berardi
ade34b7da6 fix(alexa): v3 API compliance, fan speed, security panel, and camera streaming improvements (#2083)
* fix(alexa): v3 API compliance fixes, fan speed, and security panel control

Bring the Alexa Smart Home integration in line with the current v3 API.

Tier 1 (malformed responses / missing handlers):
- BrightnessController: report brightness under the Alexa.BrightnessController
  namespace instead of Alexa.PowerController so Set/AdjustBrightness responses
  match the advertised capability.
- SmartVision ObjectDetection: flatten the doubly-nested payload.events array.
- SecurityPanelController: add Arm/Disarm directive handlers (previously
  advertised but unhandled, silently falling through to a fake success), wired
  to armSecuritySystem/disarmSecuritySystem. Enforce the spec rule rejecting a
  direct ARMED_AWAY -> other armed-state transition with AUTHORIZATION_REQUIRED.
  Drop the advertised FOUR_DIGIT_PIN authorization, which Scrypted cannot honor.
- Auth failures now return an Alexa INVALID_AUTHORIZATION_CREDENTIAL
  ErrorResponse instead of a bare HTTP 500 that Alexa retries and surfaces as a
  generic skill error.

API modernization:
- EndpointHealth: downgrade to the documented v3.1 / connectivity-only shape and
  stop emitting the undocumented battery property (and 3.2 version), which risks
  the whole capability being rejected.
- Fan: add Alexa.RangeController (Fan.Speed, 0-100%) for devices implementing the
  Fan interface, alongside the existing PowerController on/off.

Cleanups:
- addAccessToken: initialize event.endpoint as an object, not an array.
- Hoist getArmState to a shared export instead of duplicating it.

Bump version to 0.4.0.

* fix(alexa): improve camera stream quality and connectivity

Tune the WebRTC negotiation for Alexa camera sessions.

- Resolution: raise the proxied stream cap from 720p to 1080p. The previous
  1280x720 screen hint forced the transcoder into medium-resolution mode for
  every endpoint, so even an Echo Show 15 or Fire TV only received 720p. 1080p
  lets larger displays render sharply while the transcoder still clamps width
  and falls back to 720p when H.264 High can't be negotiated. We cap rather
  than send the uncapped source, since Alexa's directive carries no display
  hint and a 4K stream would waste bandwidth on smaller Echo devices.

- Two-way audio: only advertise isFullDuplexAudioSupported when the camera
  implements the Intercom interface. Advertising full duplex on a one-way
  camera makes Alexa set up a return mic path that goes nowhere.

- TURN: stop unconditionally disabling TURN, and expose a "Use TURN Servers"
  plugin setting (on by default). Alexa sessions are proxied and often cross
  NATs where a TURN relay is the only path that connects; combined with
  disabled trickle ICE (all candidates in the initial SDP), omitting the relay
  candidate left NAT-blocked sessions with no fallback. When enabled, TURN
  usage defers to the WebRTC plugin's own setting, matching the Google Home
  integration; disabling it force-disables TURN for Alexa sessions only.

Bump version to 0.5.0.
2026-06-29 19:47:34 -07:00
Koushik Dutta
1240f401d7 alexa: clean up removed devices 2025-03-21 08:08:27 -07:00
Koushik Dutta
2ceb2cd9c3 alexa: maybe fix alexa when no detection types are available 2025-02-05 12:49:04 -08:00
apocaliss92
29059691ce Alexa: add option to not auto enable devices (#1615)
Co-authored-by: Gianluca Ruocco <gianluca.ruocco@xarvio.com>
2024-10-19 16:10:42 -07:00
Koushik Dutta
b3087058a7 google-home/alexa: republish with new sdk for media converter 2024-09-02 08:40:03 -07:00
Koushik Dutta
2dd549c042 alexa: fix syncedDevices being undefined 2024-04-04 11:39:43 -07:00
Koushik Dutta
8fa5e23797 alexa/google-home: fix potential vulnerability. do not allow local network control using cloud tokens belonging to a different user. the plugins are now locked to a specific scrypted cloud account once paired. 2024-02-21 10:01:03 -08:00
Koushik Dutta
81b235c548 alexa/google-home: additional auth token checks to harden endpoints for cloud sharing 2024-02-20 21:42:40 -08:00
Nick Berardi
a62f402982 alexa: removed unneeded packages (#1319) 2024-02-14 14:14:29 -08:00
Nick Berardi
952b90fc98 alexa: added support for light, outlet, and fan device types (#1318) 2024-02-13 14:48:19 -08:00
Koushik Dutta
dab5be1103 alexa: fix potential response race 2023-11-27 19:42:11 -08:00
Koushik Dutta
b04aa75117 alexa: fix race condition in sendResponse 2023-11-22 21:23:01 -08:00
Nick Berardi
4ca63aadd5 alexa: display camera on doorbell press (#1066) 2023-09-08 13:56:49 -07:00
Nick Berardi
b9fc69347a alexa: added helpful error messages regarding token expiration (#1007) 2023-08-09 17:24:54 -07:00
Koushik Dutta
be888d215d alexa: fix doorbells 2023-06-25 10:28:46 -07:00
Koushik Dutta
0b55c777f8 alexa: publish w/ storage fix 2023-05-19 12:22:10 -07:00
Nick Berardi
a2121c0dc5 alexa: add setting to publish debug events to console (#685) 2023-04-03 08:24:31 -07:00
Koushik Dutta
7e5dcae64a webrtc/alexa: add option to disable TURN on peers that already have externally reachable addresses 2023-03-15 10:31:25 -07:00
Nick Berardi
ffbd25b13b alexa: set screen ratio to 720p (#625) 2023-03-14 18:40:47 -07:00
Nick Berardi
c85d45050f alexa: refactor code structure (#606) 2023-03-07 12:04:52 -08:00
Nick Berardi
4435fe1e0a alexa: ensure we are talking to the correct API endpoint (#580)
* alexa plugin: ensure we are talking to the right endpoint region for a customer

* added the api endpoint as a visible setting
2023-02-24 09:41:11 -08:00
Koushik Dutta
d7dab4bef3 alexa: provide hint that medium resolution is always used. 2023-01-13 11:05:06 -08:00
Koushik Dutta
f3c1b3cd16 various: minor cleanups 2023-01-04 13:56:42 -08:00
Nick Berardi
9c74175833 alexa: added logging around tokenInfo resets (#488) 2023-01-03 08:56:39 -08:00
Koushik Dutta
4ffbd16476 sdk: rename sdk.version to sdk.serverVersion 2023-01-02 20:01:13 -08:00
Koushik Dutta
53c9a60ab4 plugins: update tsconfig.json 2023-01-01 16:12:57 -08:00
Koushik Dutta
b2308a6666 alexa: publish beta 2022-12-30 14:28:02 -08:00
Koushik Dutta
c05da9d4a4 alexa: rethrow login failure error 2022-12-26 20:40:21 -08:00
Nick Berardi
e064685125 added support for type Garage and refactored the controller for future support (#479) 2022-12-26 20:29:55 -08:00
Nick Berardi
244db313f2 updated install instructions (#478) 2022-12-24 22:28:53 -08:00
Koushik Dutta
2bf0d0bcd9 webrtc/alexa: fix race condition with intercoms and track not received yet. 2022-11-27 00:16:46 -08:00
Koushik Dutta
6a96cdc1d9 alexa: close potential security hole if scrypted is exposed to the internet directly (ie, user is not using the cloud plugin against recommendations) 2022-10-06 20:10:20 -07:00
Koushik Dutta
43f0f98992 plugins: remove postinstall 2022-06-17 09:49:04 -07:00
Koushik Dutta
895509e4dd plugins: add tsconfig.json 2022-06-17 09:43:17 -07:00
Koushik Dutta
962168a285 alexa: doorbell motion sensor support 2022-06-12 10:11:08 -07:00
Koushik Dutta
2d92312f7e alexa: fix harmless crash in log 2022-06-11 15:58:07 -07:00
Koushik Dutta
7ffc23e3a5 alexa: fix empty endpoint list 2022-06-01 10:29:26 -07:00
Koushik Dutta
b4e9f20d5d all: prune package.json 2022-05-02 11:50:47 -07:00
Koushik Dutta
3a025652c9 alexa: fix doorbell syncing 2022-04-08 14:15:41 -07:00
Koushik Dutta
809804f960 alexa: publish 2022-04-05 17:54:52 -07:00
Koushik Dutta
7d6483fc8a alexa: 2 way audio 2022-04-03 20:19:42 -07:00
Koushik Dutta
fb620c0b41 alexa: 2 way audio 2022-04-03 20:19:42 -07:00
Koushik Dutta
6ab0fb001d alexa: motion events 2022-04-01 21:53:21 -07:00
Koushik Dutta
8d38a8fe1f webrtc: refactor 2022-03-28 18:33:04 -07:00
Koushik Dutta
cc9c4e130d alexa: use rtc signaling channel 2022-03-24 23:08:20 -07:00
Koushik Dutta
4d456b6050 alexa: publish 2022-03-24 11:33:59 -07:00
Koushik Dutta
65c87b02e6 alexa: doorbells 2022-03-23 22:38:36 -07:00
Koushik Dutta
18f982a8c3 alexa: sync devices properly 2022-03-23 13:19:19 -07:00
Koushik Dutta
f527a7e500 alexa: add camera/doorbell, fix webrtc to work with amazon reqs 2022-03-23 10:11:58 -07:00
Koushik Dutta
74628c98b0 alexa: initial pass with working cameras 2022-03-22 20:47:18 -07:00