Skip to content
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

ASH26 Amcrest Security/Flood Light #113

Closed
itkfilelor opened this issue Nov 28, 2021 · 7 comments
Closed

ASH26 Amcrest Security/Flood Light #113

itkfilelor opened this issue Nov 28, 2021 · 7 comments

Comments

@itkfilelor
Copy link
Contributor

``Is your feature request related to a problem? Please describe.
'Illuminator' is not discovered on set up.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
Add a "advanced" mode to allow users to select their own lights as a catch-all for such circumstances.

Additional context
I already have this set up using shell commands, but for whatever reason they are not very reliable on my machine via HA.
For this particular camera/light the API does not return the white light correctly. See below.
For my unit:
Lighting_V2[0][0][1]
is the flood light controller
where as the api returns
Lighting_V2[0][2][1]
which does nothing (that i can see anyway)

Also the integration does not even pick anything up that is a light apart from the IR

Command:
http://floodlight.lan/cgi-bin/configManager.cgi?action=getConfig&name=Lighting_V2
Response:
table.Lighting_V2[0][0][0].Correction=50
table.Lighting_V2[0][0][0].LightSwitchDelay=0
table.Lighting_V2[0][0][0].LightType=InfraredLight
table.Lighting_V2[0][0][0].MiddleLight[0].Angle=50
table.Lighting_V2[0][0][0].MiddleLight[0].Light=50
table.Lighting_V2[0][0][0].Mode=Auto
table.Lighting_V2[0][0][0].Sensitive=3
table.Lighting_V2[0][0][1].Correction=50
table.Lighting_V2[0][0][1].LightSwitchDelay=0
table.Lighting_V2[0][0][1].LightType=WhiteLight
table.Lighting_V2[0][0][1].Mode=Off
table.Lighting_V2[0][0][1].NearLight[0].Angle=50
table.Lighting_V2[0][0][1].NearLight[0].Light=50
table.Lighting_V2[0][0][1].Sensitive=3
table.Lighting_V2[0][1][0].Correction=50
table.Lighting_V2[0][1][0].LightSwitchDelay=0
table.Lighting_V2[0][1][0].LightType=InfraredLight
table.Lighting_V2[0][1][0].MiddleLight[0].Angle=50
table.Lighting_V2[0][1][0].MiddleLight[0].Light=50
table.Lighting_V2[0][1][0].Mode=Auto
table.Lighting_V2[0][1][0].Sensitive=3
table.Lighting_V2[0][1][1].Correction=50
table.Lighting_V2[0][1][1].LightSwitchDelay=0
table.Lighting_V2[0][1][1].LightType=WhiteLight
table.Lighting_V2[0][1][1].Mode=Off
table.Lighting_V2[0][1][1].NearLight[0].Angle=50
table.Lighting_V2[0][1][1].NearLight[0].Light=50
table.Lighting_V2[0][1][1].Sensitive=3
table.Lighting_V2[0][2][0].Correction=50
table.Lighting_V2[0][2][0].LightSwitchDelay=0
table.Lighting_V2[0][2][0].LightType=InfraredLight
table.Lighting_V2[0][2][0].MiddleLight[0].Angle=50
table.Lighting_V2[0][2][0].MiddleLight[0].Light=50
table.Lighting_V2[0][2][0].Mode=Auto
table.Lighting_V2[0][2][0].Sensitive=3
table.Lighting_V2[0][2][1].Correction=50
table.Lighting_V2[0][2][1].LightSwitchDelay=0
table.Lighting_V2[0][2][1].LightType=WhiteLight
table.Lighting_V2[0][2][1].Mode=Off
table.Lighting_V2[0][2][1].NearLight[0].Angle=50
table.Lighting_V2[0][2][1].NearLight[0].Light=50
table.Lighting_V2[0][2][1].Sensitive=3

@itkfilelor
Copy link
Contributor Author

itkfilelor commented Dec 2, 2021

I found what appears to be the code block that is stopping the light from being discovered
custom_components/dahua/init.py Line 482

    def supports_illuminator(self) -> bool:
        """
        Returns true if this camera has an illuminator (white light for color cameras).  For example, the
        IPC-HDW3849HP-AS-PV does
        """
        return "table.Lighting_V2[{0}][0][0].Mode".format(self._channel) in self.data

This could also assist with this question from #52
I can try and stab at it myself, but I've never made an integration before and a lot of this code is bigger than anything I've ever made.
I'll see if I can through together a method similar to the doorbell check using the ASH model until something better can be put together by someone smarter.

@rroller
Copy link
Owner

rroller commented Dec 25, 2021

I've started to work on this. This is what it'll look like. The options will be: Off, On, Strobe.

This seem OK? I should have this done tomorrow.

Screen Shot 2021-12-24 at 11 09 04 PM

@rroller
Copy link
Owner

rroller commented Dec 25, 2021

The security light feature is released in https://github.com/rroller/dahua/releases/tag/0.9.28

@rroller
Copy link
Owner

rroller commented Dec 26, 2021

Resolving this issue now that the security light (illuminator) is now supported with this integration. Please reopen if you have any issues.

@rroller rroller closed this as completed Dec 26, 2021
@itkfilelor
Copy link
Contributor Author

WOW! great work! thank you!

@mpjanofsky
Copy link

Just set up my Amcrest floodlight using this integration and I’m not getting the Illuminator toggle. Is there any additional setup needed?

@itkfilelor
Copy link
Contributor Author

The main main integration currently does not support Amcrest Floodlights, try using PR 141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants