hass-aarlo
hass-aarlo copied to clipboard
Streaming and Sensor Issues
Hi @twrecked!
Fantastic job with this integration. Thanks for all your work!
Over the last couple of days, I did a pretty deep dive into the resources available online for hass-aarlo, and I believe I've run out of options to get this working. I'm hoping it'll be useful to document my issues here.
System RPi 4 8gb
Home Assistant 2022.8.7 Supervisor 2022.08.3 Operating System 8.5 Frontend 20220802.0 - latest
HACS 1.26.2 Arlo Camera Support v0.7.2b8.3
Accessed through Firefox on MacOS
Arlo Wired Doorbell Firmware 1.14.0.0_1189_4e1d685
Sensors I have yet to get the motion and sound sensors working. The connectivity sensor seems to work. I haven't tested the ding sensor since it's not my biggest priority, and it calls my phone everytime it’s pushed.
I know Arlo is (was?) in the middle of changing their backend from sse to mqtt, but I've tried several combinations of config.yaml settings with both backends to no avail. The motion entity (binary_sensor.aarlo_motion_front_door) is recognized, but never triggers. Should I also have a sound entity? It doesn't appear in my entities list.
Adding the monitored_conditions: statment, and listing all of the binary sensors made each sensor visible, but unavailable in HA. Commenting out that entire clause under both binary sensor: and sensor: made the entities appear functional, although it seems only connectivity is actually reporting its state.
Streaming mpeg-dash streaming works on my laptop, but not on my iPhone. I understand this is expected since it's not a supported protocol on iOS.
Behavior with the image_view: direct (mpeg-dash) tag:
The first time I playback after a HA restart, the stream and status follow perfectly and immediately. On every consecutive playback, it works with a couple delays:
On stream start:
-Items in image_top disappear.
-Frame freezes for about five seconds.
-Frame goes black for about five seconds.
-Live stream appears.
On stream stop:
-Frame immediately reverts back to screencap of last recorded video.
-image_top reappears with camera status as "streaming" for about five seconds.
-Camera status returns to "Idle".
Note: If I watch the camera status on my phone while playing/stopping on the laptop, it correctly follows the streaming status on the FIRST playback after restart. Every consecutive playback, the status only changes to “streaming” for a few seconds when playback is stopped before reverting to “idle”.
Behavior without the image_view: direct tag defaulting to HLS:
The first time I playback after a HA restart, the stream and status follow perfectly after a short delay. On stop, the camera status changes to “unavailable” for about six seconds before reverting back to idle.
After the first playback, the camera status changes back and forth between “idle” and “unavailable” every ~30-45 seconds, indefinitely. If I try to playback while the camera is on “idle”, it immediately plays 1-2 seconds of video from the LAST stream. Then it freezes until I hit stop.
Watching my iPhone, the camera status never changes from idle.
This behavior is the same whether or not I have the ffmpeg_arguments in config.yaml, with the exception that when the ffmpeg arguments are present, the oscillation from unavailable to idle begins before I hit stop on the stream. Every time the status flips to idle, it repeats playback of the same 1-2 seconds from the last livestream.
In the system logs, I also get the following error:
Logger: homeassistant.components.stream.stream.camera.aarlo_front_door Source: components/stream/init.py:416 Integration: Stream (documentation, issues) First occurred: 11:45:02 AM (6 occurrences) Last logged: 11:50:03 AM • Error from stream worker: Stream ended; no additional packets • Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsps://arlostreaming3362-z2-prod.wowza.arlo.com:443/vzmodulelive/XXXXXXXXXXXXXXXXXX?egressToken=XXXXXXXXXXXXXXXXXX&userAgent=iOS&cameraId=XXXXXXXXXXXXXXXXXX&txnId=XXXXXXXXXXXXXXXXXX
I'm not sure if the sse/mqtt backend affects streaming, but I've verified the behaviors above to be the same under both variables.
Apologies for the long-winded report, and thank you again for all of your work on this integration!
Same issue here. Did you find a solution?
Not ignoring this, I will add something this... just out and about at the moment.
Sensors
Can you:
- try with the latest build
0.7.4.beta.6, when I was looking into the new location based APIs I noticed Arlo had changed how they get some data from the back end. I implemented those changes - double check you have provided
admin accessto the shared account, this is very important otherwise some updates won't come in, Arlo has been known to disable this so please check - try each of the back ends, I think the code might be too quick to choose
mqttif you don't specify one (Arlo seems like they don't want commit fully to one or the other, I have to manually flip mine about on occasion), I'm currently having success withsse - you need to make sure you have the entries in the
monitored conditionssection, you won't get them otherwise, my working config looks like this. Andsoundis camera dependant, I have it set but mostly use motion detection
# sensors.yaml
- platform: aarlo
monitored_conditions:
- captured_today
- last_capture
- total_cameras
- battery_level
- signal_strength
- recent_activity
# binary_sensors.yaml
- platform: aarlo
monitored_conditions:
- motion
- sound
- ding
- connectivity
- turn on some debug, it'll help work out what is happening
aarlo:
# you current config here...
verbose_debug: True
packet_dump: True
logger:
default: info
logs:
custom_components.aarlo: debug
pyaarlo: debug
Give both back ends a go, arm the system and try tripping the cameras. If it all goes well you'll see packets like this coming in:
{ "action": "is",
"from": "XXXXXXXXXXXXX",
"properties": {"motionDetected": "True"},
"resource": "cameras/XXXXXXXXXXXXX",
"transId": "XXXXXXXXXXXXX!c87fdfa6!1675735611287"}
If you don't see these then I can take a look at the logs. You can find a webpage here that will encrpyt the logs for you. Or you can run the following command on the raspberry pi to see do the same thing. Attach the file into this chat.
docker exec -it YOUR_DOCKER_NAME bash
cd /config/
cat home-assistant.log | curl -s -F 'plain_text_file=@-;filename=clear.txt' https://pyaarlo-tfa.appspot.com/encrypt > home-assistant.log.enc
exit
Streaming
Let me get back to you on that one. The whole rtsp/mpeg-dash/hls thing is annoying. It's all dependent on the user-agent type and I'm working on a version of the lovelace card that will be smart enough to switch types depending on the web client.
Having said that, I got the feeling that rtsp was removed by Arlo even though they return a URL to access it.
Streaming in general is a pain, the native web page doesn't work for me on Linux with 2K cameras and I know sometimes it wouldn't work on Apple devices as well, even without 2K.
Thanks so much for your work on this!!!
I likely won't have time to fully test this until next week. No rush, just glad to hear this is in the works :)
I'm having the same issues
Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsps://arlostreaming441-z1-prod.wo....
I use the sse backend
But when I open the Arlo app and view the stream, the snapshot is updated immediately, else it is not updated