Ok, the new version requires you to either specify the camera entity_id or entity_id’s via the entity_id service parameter, or you need to specify entity_id: all. So to be compatible with the old method of selecting all cameras, you need to do this:
Is it possible to stream multicast content? It seems multicast would be the best solution for me, since I’ll have this content displayed in multiple places at one time. These cameras do not have the resources to handle 4-5 device streams at once.
I have no idea. Even though I’ve been putting in a lot of work on the amcrest integration, it mostly has to do with control – i.e., commands to changes settings, etc. I have very little video/streaming experience. That’s a question for someone else.
All previously submitted enhancements are now part of the standard component as of the 0.93.0 release. Support for the custom component has now “officially” ended. At some point I may remove it from my github repo.
I think I just need to learn how to read, I see the additions on there. Is this still applicable " Amcrest cameras with newer firmware no longer have the ability to stream high definition video with MJPEG encoding."?
No idea. I haven’t worked on that part. As I understand it, if you use the stream component, then it will get the RTSP URL from the amcrest component and then stream directly from the camera. Honestly, I’m not sure what the stream_source setting is for anymore.
I’ve been working on improving error handling in the amcrest component. Before I start working on a PR, would anyone be willing to test it out? You can find the changes here.
I haven’t worked on the doc side yet, but basically it should just “drop in.” But there are a couple of new, optional config variables:
max_errors – The maximum number of errors in a row that can occur while still considering the device available. If the next command results in error all the entities associated with the device will be made unavailable and error recovery will begin. The minimal value is 3 and the default is 5.
recheck_interval – When the device is considered unavailable it will be “pinged” periodically and once it responds properly all the entities associated with the device will become available again (and the recovery mode will end.) This variable controls the period of rechecking. The minimum value is 15 seconds, and the default is 15 minutes.
If anyone does try it out I’d appreciate any and all feedback. THANKS!!
Will this update help with errors? My log is filled with errors like:
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f48dfd8c710>, 'Connection to 10.0.0.184 timed out. (connect timeout=3.0)')': /cgi-bin/storageDevice.cgi?action=getDeviceAllInfo
Trying again due to error HTTPConnectionPool(host='10.0.0.184', port=80): Max retries exceeded with url: /cgi-bin/storageDevice.cgi?action=getDeviceAllInfo (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f48dfc562e8>, 'Connection to 10.0.0.184 timed out. (connect timeout=3.0)'))
Could not get image from Dining_Room_Camera camera due to error: Could not communicate with camera
Query failed due to error 401 Client Error: Unauthorized for url: http://10.0.0.179:80/cgi-bin/snapshot.cgi?channel=0
My username/password is correct and I’m able to stream my Amcrest camera RTSP feeds into Home Assistant, but I’m not getting preview images and a ton of errors.
OK, I’ve got it installed and had noticed a significant reduction in errors, but I forgot I had previously configured the logger to the “ERROR” level for homeassistant.component.amcrest, amcrest.http, and urrlib3.
I just restarted after removing them and using default logger settings now and will report back soon.
Note that before this update, I had captured the errors for the previous hour (using the production Amcrest component) and there were about 70 pairs of these 2 errors for 1 particular camera:
ERROR (SyncWorker_12) [amcrest.http] Query failed due to error 401 Client Error: Unauthorized for url: http://192.168.100.101:80/cgi-bin/snapshot.cgi?channel=1
ERROR (MainThread) [homeassistant.components.amcrest.camera] Could not get image from LakeCam_SD camera due to error: Could not communicate with camera
Can you tell me what HA version you’re using? And can you share your camera configuration? Is the camera controlled only by the HA amcrest (and stream) component, or is there anything else, in or out of HA, that is also communicating with the camera?
It may have some effect. Mainly it’s intended to handle the scenario when the camera is “off line” when HA starts, or goes off line during operation, or if there’s a LOT of errors. If there are intermittent warnings/errors, those probably won’t be minimized. But I’m just getting started. It’s kind of hard to handle all scenarios because I only have a few, relatively new models, and of course my network isn’t going to be similar to everyone’s. But I’ll do what I can.
One thing that can affect the ability to get a snapshot is the camera’s snapshot quality setting, and of course, the resolution. If it’s too high of a resolution, combined with too high of a quality setting, that can lead to snapshots never working. But I think the error would be different (although I don’t remember the details.)
Anyway, the more info I can get the better I can make the component.
Thanks for giving it a try. I’m definitely interested in hearing how it works for you!
Per my previous comment (and maybe you were involved in some of this discussion before), there are combinations of image resolution and snapshot quality settings that can cause the snapshot command to fail. I’ve even seen where it can be intermittent. I’m thinking about adding a feature to monitor for that and at least add a warning, but maybe even attempt to reduce the quality setting until the errors go away. Haven’t really done anything about that yet, though. It’s just on the list of ideas. Of course, not saying this is why you were seeing those errors.