Closed wbx13 closed 1 month ago
Thanks for the report. I'll revisit all this stuff, I think there is a lot of things going on:
I'll try it on my set up here.
Hey @twrecked, thanks for all of your work on this, it's amazing! Are there any updates on Arlo functionality for Home Assistant?
This issue is stale because it has been open for 365 days with no activity. This issue will be automatically closed within 28 days if there is no further activity.
This issue was closed because it has been inactive for 28 days since being marked as stale.
Hi there,
I am a new user of hass-aarlo and I wasn't able to get the streaming working properly when not using direct streaming. The setup is as follow:
I am not used to post on Github, please be indulgent if this doesn't meet formatting, details, etc.
At first, I also couldn't find a way to get the direct streaming work properly so I tried to work around it. Now direct streaming works for me (see end of this post) but I still wanted to share what I found during my investigations with those who that might help.
On HA side, I had to set the backend as "sse" before getting the alarm state right but this is off-topic.
The issue I had first was that when trying to stream from the Lovelace UI, the UI was not able to access the master_playlist.m3u8 file (10s timeout => 499 error), unable to open it with VLC either.
I had a look to the logs and found that the stream was being destroyed before I could even access it. Here is the log section:
My interpretation was that hass-arlo asks pyaarlo to start the stream, pyaarlo starts it, but then hass-aarlo clears it out before it could event reach an active state. After digging a bit, I found that the update_state callback (camera.py line 326) was not checking if the value was in a temporary "startUserStream" state, so was clearing the stream in the else block. Not that pretty but I replaced the line 334:
elif value == "userStreamActive":
With:elif value == "userStreamActive" or value == "startUserStream":
It was better, the stream wasn't get cleared out and the master_playlist.m3u8 was accessible after a few seconds (readable with VLC).
BUT, this doesn't quite worked yet. When the UI tries to start streaming, the master_playlist.m3u8 is not yet ready to be served and results in a 404 error or 499 timeout when calling it too early. Introducing a delay before returning the url to the websocket might help. I have added a 2 seconds delay on the frontend side by modifying the lovelace-hass-aarlo card and it worked fine !
I know this is not the right place to write this might help some people facing the same issue. While writing this, I found that the lovelace-hass-aarlo card documentation was wrong. It says that the "direct" option should be put in the "image_view" settings but the code says it should be added to "image_click" (see hass-aarlo.js line 1215):
cc.directPlay = image_click.includes("direct") || _value( config.play_direct, false )
The "play_direct" option is not documented, but adding it at the root level of the card declaration just makes direct streaming work perfectly.
So at the end of the day, I'll just go with direct streaming without modifying any code.