Beta 13 - Domoticz Camera feature causes crash

The new camera feature of Beta 13 for domoticz (eventhough very exciting to see) is causing issues. Ever since the update, the HomeHabit app would loose connection. I traced it down to the /json.htm?type=cameras HTTP request to the domoticz server. Per this issue on domoticz github https://github.com/domoticz/domoticz/issues/3059 the /json.htm?type=cameras call requires the user to have admin rights. My homehabit domoticz user does not have admin rights and I don’t want to grant it admin rights, so domoticz responds with 403 forbidden to this call, which causes homehabit to loose connection again.

Per the referenced issue above, latest domoticz Beta has a new JSON call /json.htm?type=cameras_user that can be accessed as a non-admin. I would think this would be the better JSON call to make.

Additionally, HomeHabit should probably not loose connection to the “normal” devices if the camera query gets a 403 Forbidden, and only not show any cameras.

Finally, I see that HomeHabit actually pulls in the source Snapshot URL out of domoticz, including camera credentials that maybe should not be visible to HomeHabit. Wouldn’t it make more sense to pull the snapshots out of Domoticz? HTTP call /camsnapshot.jpg?idx=1 provides the snapshot through Domoticz.

@lamptah Thank you for such detailed report! Let me check on it.

Thanks @igor.

One more comment: With the current way of pulling the actual camera snapshot URL plus credentials, HomeHabit should also honor the way Domoticz replaces credentials in the URL. My camera ImageURL as configured in Domoticz is cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=#USERNAME&pwd=#PASSWORD. When pulling the snapshot, Domoticz not only uses the configured user/pw for HTTP Basic Authentication but also replaces #USERNAME and #PASSWORD in the snapshot URL with the configured credentials. HomeHabit does not seem to honor this as of Beta 13 yet.

Anyway as mentioned before, calling the snapshots through Domoticz would be better in my opinion, but if there is a valid reason to keep pulling the actual camera URLs instead, the Auth should honor the user/pw in-URL replacements as well.

Thank you for this application. I really enjoy using it!

@lamptah The issue is fixed for Beta 14 release. We weren’t aware about new-ish non-privileged camera API, it is much better to use. The app will always request non-privileged cameras API from now on, and also use Domoticz proxy for snapshots.
Thanks again for a very detailed information!

Fix released in Beta 14

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.