Please PM me the output of this URL from a PC on the same subnet as your Hubitat hub (replace each of the values with your actual values for username, etc).
I'm in to test this out. I have a lot of Dahua cams around the house. I have setup 1 as a test. Take works and I see the photo in the driver. Is there anyway to use that? Dashboard?
Those timeouts are expected if there are no events. Can you trigger a motion event and see if it comes through?
FYI, I am working on an updated version that does a sort of heartbeat to keep the timeouts to a minimum to avoid any side effects to the hub. I expect to post that soon once I can get some beta test coverage.
manually triggered motion event and I don't see anything new in the driver indicating motion
EDIT: Scratch that...I triggered motion in BlueIris...duh...let me trigger the cam
Nice! If you look at the device page, there are attributes that are populated. For example, crossLineDetected.
Look at the events history, and you should see "Rule1" when it became active and "waiting" when it became inactive again. You could use events on those attributes as triggers for your automations.
I just pushed v0.9.1 to GitHub and HPM, which has some improvements for connection reliability.
Only the "cameraDriver" file was updated. After you update the driver code, hit Initialize on your camera devices or just reboot Hubitat.
You will see some additional debug prints that include the term "heartbeat". I am still fine-tuning for performance, and there are some differences across the different camera systems that I have seen so far. I welcome any feedback or issues via PM (with verbose debug prints!).
Thanks again for working through these issues. It appears these last changes have had a positive effect on the issue I was seeing with free memory as well. Here's the stats on my hub after 14 hours of uptime.
Thank you creating this driver, and the Image Server app.
I am using:
Dahua camera discovery v0.9.1 (app)
Dahua/Amcrest Camera v0.9.1 (driver)
Image Server v0.9.0 (app)
I have the logical device working for an Amcrest IP3M-943W. (This model was discontinued ~3 years ago and firmware was not updated to what is currently on Amcrest cameras – just an fyi.) The camera’s image is displayed on the logical device page.
The Image Server app displays the generated URL. I created a Dashboard tile with the URL and receive log warnings from the Dashboard app:
app:392023-01-19 08:45:46.764 AMwarnExcluded attribute displayImage size of attribute > 1024 characters
app:392023-01-19 08:45:46.755 AMwarnExcluded attribute image size of attribute > 1024 characters
When I paste the URL into Firefox, I receive “pastedURL cannot be displayed as it contains errors.” I’m assuming I should be able to view the image in a browser.
The heartbeat is every 30 seconds. Will this be configurable in the future?
Is username/password sent to the camera in cleartext?
Sorry for the trouble; I introduced a bug with some last-minute cleanup. (Congratulations, you were evidently the first user of the new code ).
I checked in a fix, so please 'repair' in HPM or just grab the code again from GitHub if you installed manually. This only affected the Image Server app code.
Actually, that part of the code is going away all together. I worked out a better scheme for maintaining the connection.
Just to be clear, this is just about keeping the EventStream active, which is necessary because if it is dropping all the time you may miss events, and we also noticed that the Hubitat performance could be affected if the connection was closed and reopened repeatedly over time. The "heartbeat" behavior is not something that should be user-visible or particularly useful in general.
Is there something you were hoping to utilize it for, or could you explain more about why you wanted it to be configurable?
It is possible that the password is sent in cleartext at least once when connecting, as well as during the discovery process if you use the app. Is there an HTTPS option for your cameras? I could make that a configurable option.
Fixed. Thank you. (For testers, viewing in a browser is simply a check that the image file is accessible.)
If the heartbeat were configurable, it could be increased (more time between beats) to lessen the load on the hub. Currently I am not using motion settings on the camera, so the heartbeat could be burdensome. My plan was to create a rule and update the image periodically. If the heartbeat is removed then this issue is irrelevant.
I am unsure if there is an HTTPS option on my current camera, but at some point I will be upgrading. (My camera’s firmware requires a plugin (Amcrest/Dahua’s webplugin.exe) to view the live feed via a browser. Only Internet Explorer supports the plugin.) I assume a currently produced camera has an HTTPS option, so the option would be valuable.