twrecked / hass-aarlo

Asynchronous Arlo Component for Home Assistant
GNU Lesser General Public License v3.0
399 stars 79 forks source link

Cannot start stream on Wireless Video Doorbell 2k #1014

Open Deltus7529 opened 6 days ago

Deltus7529 commented 6 days ago

Hello,

I've got the Wireless Video Doorbell 2k without a subscription. I tested it for 2 weeks and everything seems to be working fine but not the live stream view. I didn't find my device in the compatibility list, so I hope I can help you to support this new model.

I tried various configuration to start the stream on the glance card, but it never start. The card is able to get the lastIlmage if I start the stream from the Android or Web App. I don't have the paid subscription so I cannot test the recording or snapshots.

Home Assistant version

Arlo Model info :

Log

ERROR (stream_worker) [homeassistant.components.stream.stream.camera.aarlo_sonnette] Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input, rtsps://arlostreaming19879-z1-prod.wowza.arlo.com:443/vzmodulelive/AGG141BM00AC5_1732204683134?egressToken=8742ca04_109d_446f_94ea_7bf640e9ede6&userAgent=iOS&cameraId=AGG141BM00AC5_1732204683134&optimization=false&txnId=FE!f4d7fa32-265f-4654-8ab9-6d93bcce5e9e)

Reverse engeneering

I've found this endpoint when starting the stream from the webapp. I hidded things who looks linked to my account with [xxx]. If not sensitive and needed, tell me :)

Headers

Request URL: https://myapi.arlo.com/hmsweb/users/devices/sipInfo/v2?cameraId=AGG141BM00AC5&modelId=AVD4001A&uniqueId=[xxx]&eventId=FE!effab55f-3b7d-491d-a5fc-00320f01ba1f&time=1732207639600

Payload

cameraId=AGG141BM00AC5&modelId=AVD4001A&uniqueId=[xxx]&eventId=FE!effab55f-3b7d-491d-a5fc-00320f01ba1f&time=1732207639600

Preview

{ "data": { "from": "[xxx]_server", "to": "[xxx]", "action": "is", "resource": "sipDetails", "transId": "[xxx]", "sipCallInfo": { "id": "Conference_[xxx]", "calleeUri": "sip:AGG141BM00AC5_1732209201071_ee6cc1b8f77e48b3ad58e30c0c96f825D@livestream-z1-prod.arlo.com:443", "domain": "livestream-z1-prod.arlo.com", "port": 443, "conferenceId": null, "password": "[xxx]", "deviceId": "AGG141BM00AC5" }, "iceServers": { "uSessionId": "[xxx]", "data": [ { "port": "19302", "domain": "relay02-z1-prod.ar.arlo.com", "type": "stun" }, { "credential": "[xxx]", "port": "443", "domain": "relay02-z1-prod.ar.arlo.com", "transport": "tcp", "type": "turn", "username": "1732209211:[xxx]" }, { "credential": "[xxx]", "port": "443", "domain": "relay02-z1-prod.ar.arlo.com", "transport": "udp", "type": "turn", "username": "1732209211:[xxx]" } ] } }, "success": true }

rrowe629 commented 4 days ago

I'm seeing this same behavior with this device and version 0.8.1.9. Also saw it with the previous version. Model info, firmware, etc. same as above.

Updating this post to note that I can successfully play the last recorded event, just not the live view. Card configuration is simple:

twrecked commented 3 days ago

@Deltus7529 Firstly, thank you for posting a decent bug report, most of the ones I get are "it doesn't work" with no other information, so that makes a nice change.

Arlo does some weird things with the streams, it returns a rtsps URL but the underlying stream could be HLS or mpeg-dash. Start by changing your user_agent to one of the Apple or Linux specific ones.

You can see the details here:

https://github.com/twrecked/hass-aarlo/blob/master/README-advanced.md#user-agents

Deltus7529 commented 3 days ago

@twrecked Thanks for your help.

I tried different user_agent and config but I'm just able to get the lastImage and not the live-stream. Also, I don't know if that's interesting but when I start the stream, I don't necessarily got the error message that I posted on the log. For example here, the stream is started and it"s stuck on 'start_stream:' :

Logs

2024-11-24 18:13:12.035 DEBUG (ArloBackgroundWorker) [pyaarlo] AGG141BM00AC5: turning recent ON for Sonnette
2024-11-24 18:13:12.035 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.sensor] callback:Recent Activity Sonnette:recentActivity:True
2024-11-24 18:13:12.035 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.camera] callback:Sonnette:recentActivity:True
2024-11-24 18:13:12.036 DEBUG (ArloBackgroundWorker) [pyaarlo] AGG141BM00AC5: Sonnette DOORBELL got one mediaUploadNotification
2024-11-24 18:14:08.861 DEBUG (MainThread) [custom_components.aarlo.camera] library+99
2024-11-24 18:14:10.587 DEBUG (MainThread) [custom_components.aarlo.camera] stream_url for sonnette
2024-11-24 18:14:10.590 DEBUG (SyncWorker_2) [pyaarlo] AGG141BM00AC5: _start_stream::reqs='set()',local='{'streaming'}',remote='set()'

Then I click on stop :

2024-11-24 18:15:25.613 DEBUG (MainThread) [custom_components.aarlo.camera] stop_activity for sonnette
2024-11-24 18:15:25.709 DEBUG (SyncWorker_16) [pyaarlo] AGG141BM00AC5: got a stream/recording stop
2024-11-24 18:15:25.709 DEBUG (SyncWorker_16) [pyaarlo] AGG141BM00AC5: queueing update in 5
2024-11-24 18:15:25.709 DEBUG (SyncWorker_16) [pyaarlo] AGG141BM00AC5: queueing update in 15
2024-11-24 18:15:25.710 DEBUG (SyncWorker_16) [pyaarlo] AGG141BM00AC5: queueing update in 25
2024-11-24 18:15:25.710 DEBUG (SyncWorker_16) [pyaarlo] AGG141BM00AC5: turning recent ON for Sonnette
2024-11-24 18:15:25.710 DEBUG (SyncWorker_16) [custom_components.aarlo.sensor] callback:Recent Activity Sonnette:recentActivity:True
2024-11-24 18:15:25.713 DEBUG (SyncWorker_16) [custom_components.aarlo.camera] callback:Sonnette:recentActivity:True
2024-11-24 18:15:25.714 DEBUG (SyncWorker_16) [pyaarlo] AGG141BM00AC5: removing streaming activity state
2024-11-24 18:15:25.714 DEBUG (SyncWorker_16) [pyaarlo] AGG141BM00AC5: _event::idle::reqs='set()',local='set()',remote='set()'

And the lastImage get updated (but not always).

For the reference, here's my configuration.yaml. I forgot to post it. Maybe I screwed on something. Also, I'm running HomeAssistant on a Raspberry Pi 4 through Docker.

configuration.yaml

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
stream:
media_player:
browser_mod:
ffmpeg:
logger:
  default: info
  logs:
    pyaarlo: debug
    custom_components.aarlo: debug
aarlo:
    password: !secret "xxx"
    username: "xxx"
    user_agent: linux
    verbose_debug: true

And the card :

type: custom:aarlo-glance
entity: camera.aarlo_sonnette
name: Sonnette
image_top: name,status
image_bottom: stream,battery,signal
image_view: direct
image_click: stream

Tell me if you need different logs or testing. :)