-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ipcamera] Dahua / Amcrest floodlight cameras could have controls for the floodlight state #15118
Comments
What API call are you using that works with your camera? Does it match one of these already implemented ones? The channel Some cameras have IR lights, and others have Flood white lights and others will have a RELAY output for turning external lights on and off.
|
My camera has both IR and a flood light, the channel mentioned only controls the IR illuminator light. The dimmer values do increase / decrease the brightness of the IR LED next to the camera lens (verified visually by watching the soft red glow increase / decrease as I moved the slider) but do not affect the larger visible flood light. The API calls I'm using are the ones found here: tchellomello/python-amcrest#161 (comment) Looks like you are using the |
Is there any further comment on this request? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Sorry if this was awaiting my feedback I haven't seen anything since the question about the API endpoint I was using. If there isn't any interest in providing this functionality that's fine. A comment to that point would be helpful in that case. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@Skinah I'm assuming at this point that nothing will come of this request? I know it isn't a super exciting request but maybe I should share why I would like it. I have my floodlight camera on a switch right now, the switch has to always be on for the camera to work so I have to always have the floodlight set to motion enabled. However sometimes (like when I'm cooking on the grill) it would be nice to have the light on always. Right now I have to use the Amcrest app to do that but if I could control it with OpenHAB I could even use a z-wave scene controller to turn it on and off like a regular light while keeping the camera powered always. If this request isn't worth the time that's fine, I'll make do. But if there is any value found on your side in implementing this I would really appreciate it. |
Try the zipped jar that is here: http://pcmus.com/openhab/IpCameraBinding/ sourcecode changes are found here: |
The binding installs but displays this message:
Going back to the original version brings back the list of installable things. |
I just uploaded a new version I have spent the last hour testing here and fixed an issue. |
The thing types work now, I was able to configure the camera, and I see the white LED channels you added. The item type defaults to dimmer, but that does not work as the light doesn't support that. Changing it to switch works |
If I go into the Amcrest app and disable motion control the switch item works as expected. So the auto white LED item doesn't look like it's doing what it should. |
I can not test these commands as my camera replies with |
I’ll do some debugging tomorrow, it’s too late right now. I can likely
track down what’s wrong.
…On Wed, Dec 27, 2023 at 4:39 AM Matthew Skinner ***@***.***> wrote:
I can not test these commands as my camera replies with Bad Request! so I
need you to enable TRACE logs which will tell you exactly what the binding
is sending and what the camera replies with. Then let me know what needs to
change, please do not expect me to read 1,000+ words and guess when you
have a camera and can test it exactly.
—
Reply to this email directly, view it on GitHub
<#15118 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC5MJ46Z2N23E56CKUNBJUTYLQCHRAVCNFSM6AAAAAAZLR3IZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZQGIZDOMZRHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Make a call to this endpoint and note the settings that get reported. One of the settings that the camera may have is to turn the light back off after x seconds. LightDuration Also another reason is you may be changing the day profile setting when the camera is in night profile. Also this link has a lot of the possible urls listed:
|
"The item type defaults to dimmer, but that does not work as the light doesn't support that. Changing it to switch works" The binding should still work. Can you test it with a dimmer as a value of 0 or OFF should both turn the light off, this should work right now as both are handled the same way. Then any value should turn the light on if the camera does not support dimming. This may need a change to the URL called and it is possible the camera will not allow two commands to be sent in the one URL arguments which your thread linked did indicate for some cases this happens. Worth trying to achieve it first as older firmware may not have done it, but newer may. Both of these should be tested on your camera, as it is common for features to work even if your cameras UI is missing the control. That is why it is worth checking what your camera with this url: |
When the item type is set to dimmer, no value I assign to it will change the light state from OFF (0). Setting type to switch does toggle the light state.
As for the above commands, The output of
Here are the API calls I am currently using to change the light states using curl: Motion on:
Motion off:
Light on:
Light off:
The above calls are performed in the order The API calls you added in the code look correct for the light state, I am adding the Mode for the IR LED in my call (I think), but that can be controlled with the other channel so probably doesn't apply here. The call for enabling motion detection should probably be adjusted to use the |
New build for you to try named ipcamera-4.2.0-2023-12-29.zip same private server as before and I also pushed the source code changes to my git as before. I put the motion on and off in as you requested for this build, however I am not sure about this as it changes other settings that the user may not intend to change. I am guessing that this command will make the white led auto turn on for a set time when movement is detected? What happens if that call is left off, is there another way? I also used Lighting_V2[0][0][1].NearLight[0].Light from the dimmer, can you test it works as planned and yes I understand for your camera it may for the values 1-49 give no light. Please test 50 and above to see it turns the light from off to the desired state. Thanks. |
Sorry, just got time to dig into this and check, it works great, thanks! |
Sorry hit the close button mistakenly, I'll let the PR close the issue. |
Sorry I didn't address this question. The motion call doesn't need to be part of the light on-off call, it can, and probably should be a separate channel. I can use rules to modify the states when I press a button, no need to have the calls concatenated together. The only calls I have together are the ones that disable the IR led when the white light is on, but I don't really know if that's necessary (also can be addressed with rules on my side). The |
I do not mind grouping commands if they make sense for 99% of users. For example if the ir needs to be turned off when the white light turns on, then that can be added and then get put back to auto when the white light is turned off. The issue is if one user likes the white light on motion as it scares criminals away, whilst another does not like that as it triggers a dog to bark and wake the baby. So splitting the control up makes sense. What would the control get called and what is the description for your motion control? Does it need two controls so that the time the light stays on for can be adjusted? |
Is the Auto White LED channel something different from motion activation? And should the other parameters for motion detection be added as well (sensitivity, duration, zones, etc)? I don't think those should be in the scope of this request though, the current solution satisfies that. Improvements can be made later. |
One thing I just noticed with the way it currently is, turning the light off automatically re-enables motion detection, and I can see reasons why it shouldn't do that. For instance if you need to have motion detection turned off for some reason, or you are using a different method for that. So those API calls should be decoupled. |
Already done and a newer jar is on my server. I can not test any of this as I don't have a camera with these features so it is great your testing and understand that it needs to be in a way that most people will be happy with. |
Sorry, was super busy last week, but I did install the new jar and it's working for the light function. The "Auto White LED" channel isn't doing anything though. I assume that it is supposed to toggle the motion detection on and off, is that correct? Also, is there a way for the binding to poll the state of the light? The Amcrest app is able to do that, but I'm not sure what method it's using. It wouldn't be ideal if it were constantly hitting it with an api call for that but I don't see any way that the unit is pushing it out either. |
I have changed the api call for the auto white led channel, I think this will make you happy. We may change the time with another channel later if someone requests it, but lets leave it with the call you requested and have tested to work. Polling can be added, but I need a break from this and the PR is getting reviewed so would like to stop making changes mid review. Lets make that a new request and not do feature creep in this one. |
Your Environment
It doesn't appear that there are any channels configurable in the ipcamera binding for controlling the flood lights on the Amcrest ASH26 / Dahua IPC-L26N. The API endpoints are there, I have successfully used them in a script to toggle the light state.
It would be super nice if this was included in the binding so I could control the light state from openhab without resorting to using the http binding. There is a similar channel already that controls the IR light.
The text was updated successfully, but these errors were encountered: