-
Notifications
You must be signed in to change notification settings - Fork 76
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
Control light on the ASH26-W? #161
Comments
I am looking to do this too myself, still have not cracked it. Does anyone know the command to control the light? |
Awesome! I'll have to try this out. Do you know of a way to get status too?
…On Sun, Nov 1, 2020, 7:10 PM DanPatten ***@***.***> wrote:
I figured it out:
http://IP/cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0][0][1].Mode=Manual
http://IP/cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0][0][1].Mode=Off
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#161 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2SYZ6ORMDUTI4L5MK4GNLSNX2IHANCNFSM4ROA4S7Q>
.
|
It looks like the config values do not sync with the smart home app but they do update when you query this point, I am unsure if this is right or not. http://IP/cgi-bin/configManager.cgi?action=getConfig&name=Lighting_V2 The value you are looking for is table.Lighting_V2[0][0][1].Mode= |
In my testing it seems that this only makes the light flash quickly, then turns off. Haven't been able to keep the lights on. |
I have my Floodlight setting set to manual, so maybe set that and try it? I am on the latest firmware too. |
I'm on the latest firmware too, and using this endpoint seemed to work to turn it on, but not off using Auto. I had to use the app to turn it off http://ip/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][0][0].Mode=Manual |
Use http://ip/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][0][0].Mode=Off to turn it off. Maybe your light index is different than mine but mine is [0][0][1] |
Now it's not working to turn it back on 😄 Neither the Lighting nor the Lighting_V2 endpoint. I wonder what's changed. I'll keep looking around. Where were you able to find the Lighting_V2 endpoint? Is there another one I wonder? |
I did some crazy stuff with RDP since amcrest cameras are basically dahua cameras at their base and dug around there. You can view the entire config to see everything http://IP/cgi-bin/configManager.cgi?action=getConfig&name=All |
Yeah not much else to see I guess. I tried a wireshark capture, and can see my phone viewing the stream from AWS, but when I press the light button it's not an HTTP command (looks like TCP?) and there's not much else I can gain from that. |
In the all config page, do you have this setting as false too?
|
That setting is true for me |
How did you set that to true? I wonder if that's why I'm not allowed to control the light? |
Take a look at the supporting doc: I can't remember exactly but its setConfig I think |
I was able to set it to true, but still can't get the light to turn on. Not sure what I'm missing. |
This is my Lighting V2 Config (light is off atm) table.Lighting_V2[0][0][0].Correction=50 Also have: For floodlight settings I have the light set to manual |
That did it. I had my floodlight setting in the app set to motion. Changing that to manual seems to have done it. Wish I could have motion controlled, and manual API override together |
For anyone that is searching for this too, here's an example I wrote for home assistant that might help: - platform: command_line
switches:
garage_floodlight:
command_on: '/usr/bin/curl -s --digest -u admin:password "http://IP/cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0][0][1].Mode=Manual" '
command_off: '/usr/bin/curl -s --digest -u admin:password "http://IP/cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0][0][1].Mode=Off" '
command_state: '/usr/bin/curl -s --digest -u admin:password "http://IP/cgi-bin/configManager.cgi?action=getConfig&name=Lighting_V2[0][0][1].Mode" | grep -oc "Manual" ||true'
value_template: '{{ value == "1" }}'
friendly_name: Garage Floodlight |
Thank you so much for posting this! I was searching to see if the light could be turned on / off locally before I pulled the trigger and ordered one of these to replace the floodlight in our garden. Looks like its a go! THANKS!!! |
Just a thought... Since you are looking to locally flip the light on / off I am going to assume you are feeding the video into your own NVR instead of using their cloud (yuck...) or the sd card (double yuck...)... Why not just have your NVR trigger on motion detect and flip the light accordingly. That is how I am planning on doing it anyways. |
Thankyou so much for posting this. One question - do I paste this into a light section of the configuration.yaml? |
It is a command line switch: https://www.home-assistant.io/integrations/switch.command_line/ |
Is this working reliably for you guys? I had mixed results and ended up not using it. Is there a new way now with these flood light cameras? |
That would be amazing :) I would actually use the flood light quite a lot as a regular light as it's in the perfect place for lighting while putting the bins out. |
I tried this on the command line and had to escape the square brackets, plus escape all the special characters in my password (note creds and IPs are not real here). Thanks all for your suggestions - this is now working. PASSWORD= password?yes
|
Does anyone have this working? I can change the settings and they sometimes turn the lights on for a second but then they turn off immediately. |
As long as motion detection is turned off on the camera then the script to turn on and off the light is working for me just fine |
Thanks for the quick response! That was it, need to turn off Flood Light motion detection and set the lights to manual in the Amcrest app. |
Seems like I can't use this light in automations? It needs an entity_id but I can't seem to configure one, says that's not a valid configuration? |
Can anyone confirm if this still works? Noticed this just this past week. |
Mine still works, and I update home assistant every morning via scheduled task |
Even after a factory reset and trying on a different VLAN I can not get it to work. Even http://IPADDRESS/cgi-bin/snapshot.cgi does not work. I'm considering buying another unit to test with at this point... |
Did you ever figure a way to toggle the flood light mode. Like you, I hope to control light locally, but also return it to automatic on when motion occurs. |
No. :-\ |
Comparing when the Motion Activated is selected. With the lights off. TO when its set to manual with the lights On C:>fc motion_activated_light_off.txt manual_light_on.txt ***** motion_activated_light_off.txt ***** motion_activated_light_off.txt ***** motion_activated_light_off.txt I Dont know why I dont see Lighting V2 when the lights is on? I can when I use the Dahua Integration to turn the light on. I believe the "AlarmLighting[0][0].Enable=false" Turns the Motion Activated to Manual mode. To then allow the Lights from Lighting V2 to stay On. I am unable to test if AlarmLighting00 changes to Manual mode or not BC i cannot get the curl to work |
In case this helps anyone else: I used @mcowger 's yaml to make a switch in HA (awesome of you btw). Worked great for a few months. Then it stopped. To fix it, in the Amcrest mobile app I did: This seemed to reset whatever was confused and now the HA switch controls the floodlights again. |
Yes, I was hoping to change to manual and increase timeout without the use of the amcrest app |
I made it less than 3 months before my ASH26 started not turning the light on again, but this time my above fiddling didnt work. I started cataloging each button in the mobile app and then discovered the "ForceOn" flag when setting NightVision to static ON. I tried setting Lighting_V2 to "ForceOn" instead of "Manual" and it actually returned OK. Expanding on that, the API documentation I can find only mentioned Lighting[][] where the first [] is for video channel (always 0) and the second is for "configNo" 0, 1, or 2 which sets "normal", "day", and "night". I figure this is the first two values of Lighting_V2[][][], the 3rd being [0] for InfraredLight and [1] for WhiteLight. I believe InfraredLight maps to "Night Vision On|Off" in the mobile app. On mine, this value seemed to force the WhiteLight aka floodlight on as well. So I started setting all of the V2[][][].Mode to ForcedOn or Off, which in turn seems to set all of the Lighting[][].Mode to ForceOn and Off with V2. I have updated mcowger's switch commands to set everything on or everything off in one swing just in case my issue is setting the default configNo but it somehow deciding to use another. (I still only query the one address, though) We will see if this method is more reliable. TL;DR I stopped messing with single values and just shotgun ForceOn and Off with the below commands in place of Manual in mcowger's code:
|
What is floodlight mode setting? I just turned mine to manual mode in the app. Then setup automations and use Dahua HA integration. But would try this if I could keep my setting to Motion Active and have the switch work. I prefer the near instant on when motion is detected from the camera. The HA automation has a very tiny delay. |
As for the cURL command did you try escaping the brackets? Also I am testing a way to toggle smart and manual. I never noticed the AlarmLighting table before, and I checked mine and it says
to
My app actually shows motion activated and the light sensor, which it did not before when only changing the settings in V2 |
I think this is the way. I know from the other post you’re testing it. But having this feature we be really nice. |
|
So when it’s by force it’s considered manual mode in the Amcrest app? anyway to add a switch within integration or a curl that I can use to test in ha? |
As for the LightCondition it just means when the light is motion activated, it will always come on regardless of light levels. the cURLs would be:
Always turn on:
state:
just swap Everything is case sensitive as well. |
I recently just got 2 of these floodlights and used this configuration on both, thank you btw! They seem to work fine in motion detected mode other than being unable to turn the light back off on their own, but I have yet to fully test it, I think the default was set to 5 minutes and I didn't wait that long. Could a command be added to switch it back to motion mode after it turns off manually? Or would it be better to just use the motion sensor entity in HA and configure it that way? |
I was also looking for the command that tingles that setting.
Right now I’m using manual mode and have the rule to turn when motion is
detected, then off.
Since the latest HomeKit updates it’s been acceptable bc it responds
quicker than it had say 6 months ago. But not as fast as motion mode.
…On Mon, Mar 6, 2023 at 8:47 AM d0u8l3m ***@***.***> wrote:
TL;DR
I stopped messing with single values and just shotgun ForceOn and Off with
the below commands in place of Manual in mcowger's code:
command_on: '/usr/bin/curl -s --digest -u admin:password "http://IP/cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0][0][0].Mode=ForceOn&Lighting_V2[0][0][1].Mode=ForceOn&Lighting_V2[0][1][0].Mode=ForceOn&Lighting_V2[0][1][1].Mode=ForceOn&Lighting_V2[0][2][0].Mode=ForceOn&Lighting_V2[0][2][1].Mode=ForceOn" '
command_off: '/usr/bin/curl -s --digest -u admin:password "http://IP/cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0][0][0].Mode=Off&Lighting_V2[0][0][1].Mode=Off&Lighting_V2[0][1][0].Mode=Off&Lighting_V2[0][1][1].Mode=Off&Lighting_V2[0][2][0].Mode=Off&Lighting_V2[0][2][1].Mode=Off" '
command_state: '/usr/bin/curl -s --digest -u admin:password "http://IP/cgi-bin/configManager.cgi?action=getConfig&name=Lighting_V2[0][0][1].Mode" | grep -oc "ForceOn" ||true'
I recently just got 2 of these floodlights and used this configuration on
both, thank you btw! They seem to work fine in motion detected mode other
than being unable to turn the light back off on their own, but I have yet
to fully test it, I think the default was set to 5 minutes and I didn't
wait that long.
Could a command be added to switch it back to motion mode after it turns
off manually? Or would it be better to just use the motion sensor entity in
HA and configure it that way?
—
Reply to this email directly, view it on GitHub
<#161 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2CAJZ42MNKYBYYMDIYXHXLW2XTFPANCNFSM4ROA4S7Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
From my experience in working with the ASH26, turning the light on manually definitely requires that motion detection for the floodlight be turned off first before trying to turn the light on. And, it seems those need to be done as separate sequential steps. I originally had the flashing light issue others have experienced...but this now works 100% of the time for me: Turn off motion detection for floodlight, turn light on: Turn Light Off, turn motion detection for floodlight back on (5 minutes): Works great for me, like I said the trick is to make each endpoint request separately as combining them doesn't work. I run a bash script with these calls being done via curl in home assistant as a command line switch. |
@drsweb Can you share config/code for this as I am struggling to get it working. Im trying to make a switch to turn it on and off but so for the switch is just stuck off. |
I have this at the end of my configuration.yaml (redacted user/ password) and IP. It doesn't go under any other yaml keys. (running latest version of homeassistant)
|
Here's what I use for my floodlight switches on Home Assistant, this runs on a Raspberry Pi with Raspian OS: At end of my HA configuration.yaml:
/config/scripts/floodon.sh:
/config/scripts/floodoff.sh:
|
So how do the scripts know which of the lights you are turning on and off if the one script runs for either camera? also when I copy your code I get an error end of the stream or a document separator is expected (165:1) |
The IP address of the camera is passed as a parameter to the scripts. For example in the HA config:
You would replace the
|
so in the end it should look like this ? I get were it is getting the IP address now just not sure were it gets the username and password from, or do you just use the same user name and password on both cameras? also when I copy your code I get an error end of the stream or a document separator is expected (165:1) |
Oh yes, sorry. My cameras have the same username/password. You could create more parameters to make that variable for each camera if you want/need to. I'm not sure, but it's possible you could be getting some sort of formatting code or something else if you are copy/pasting. Maybe look it over closely and if worse comes to worse maybe type things by hand to make sure that's not happening? The error does kind of make it sound like there is some sort formatting/characters that it's not expecting. |
Hello frens, me again. I just updated HA to 2024.1.2 (And I know I had this issue in Dec with one of the 2023.12.x builds) and my command line switch was throwing errors. They changed the way this was written in the configuration.yaml, as well as how the name and id function. For anyone having issues, the new way to write @mcowger's example commands is: command_line:
- switch:
name: Garage Floodlight
unique_id: garage_floodlight
command_on: "/usr/bin/curl --globoff -s --digest -u admin:pass 'http://<ip>/cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0][0][0].Mode=ForceOn&Lighting_V2[0][0][1].Mode=ForceOn&Lighting_V2[0][1][0].Mode=ForceOn&Lighting_V2[0][1][1].Mode=ForceOn&Lighting_V2[0][2][0].Mode=ForceOn&Lighting_V2[0][2][1].Mode=ForceOn'"
command_off: "/usr/bin/curl --globoff -s --digest -u admin:pass 'http://<ip>/cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0][0][0].Mode=Off&Lighting_V2[0][0][1].Mode=Off&Lighting_V2[0][1][0].Mode=Off&Lighting_V2[0][1][1].Mode=Off&Lighting_V2[0][2][0].Mode=Off&Lighting_V2[0][2][1].Mode=Off'"
command_state: "/usr/bin/curl --globoff -s --digest -u admin:pass 'http://<ip>/cgi-bin/configManager.cgi?action=getConfig&name=Lighting_V2[0][0][1].Mode' | grep -oc 'ForceOn' ||true"
value_template: "{{ value == '1' }}"
|
I was able to implement @drsweb bash scripts and HA config. Thanks! I ran into a few issues so I thought I would document it for others since it took me a while to find an answer:
|
This is a very curious observation that I have discovered....I have been using the "Manual/off" method for a couple years and it worked mostly fine. During the cold winter months though the light would turn on dimly or not turn on at all, but during the warm weather it worked fine. I figured it was just the hardware. This year, the light has been performing very poorly and wouldn't even turn on in 20F weather....but then I discovered that turning the light on/off via the app worked fine. The status of the light between HA and the amcrest app do not agree at all though, but for me that's fine, I never use the app. |
Is it possible to control the light on the new ASH26-W? That would be great if it could be added. Happy to help test anything, too
The text was updated successfully, but these errors were encountered: