fwestenberg / reolink_dev

Home Assistant Reolink addon
MIT License
550 stars 102 forks source link

Reolink RLC-811A Spotlight #528

Open EmanueleGuidetti opened 2 years ago

EmanueleGuidetti commented 2 years ago

Describe the bug (I think it's a bug)

I want to control spotlight from HA so I disable "spotlight" from Advanced configuration in the Reolink App. In HA Reolink_dev integration I've "Spotlight switch" and I can control spotlight On/Off from my HA! The problem: when I use this swith to turn on and off the spotlight the camera configuration is set to use "Spotlight - Auto" so camera can light on the spotlight without my control.

To Reproduce follow the previous steps.

Expected behavior: I would like that the use of the "Spolight switch" don't change the camera settings.

Environment:

Thanks

KubaDavid commented 2 years ago

I have the exact same issue.

dkggpeters commented 2 years ago

I believe we want the Night Mode switch.

I want to have the spotlight only come on between certain times when advanced motion is detected. In the interim, I can write and automation to accomplish this. ie - I only what the spotlight light to come on if a person is detected after Midnight.

AKHwyJunkie commented 2 years ago

I solved this limitation by basically programming the logic into HA. These are the automations I used:

I use Blue Iris and have Deepstack AI integrated with HA through binary sensors & MQTT, but you can also read the motion detection (people, animals) from the camera itself with this integration. The specific offsets for sunrise/sunset times can vary based on camera placement. They can be customized with a lot of separate automations or just find a good average to use. Also, it's important to let your cameras continue to use auto mode for color/B&W so it'll respond appropriately to the lighting conditions.

EmanueleGuidetti commented 2 years ago
  • If motion not detected for 2 minutes, turn off spot light, turn on IR lights. Condition of sometime after sunset, sometime before sunrise.

Hi, Thanks for replay. You have the same logic I want use but: When you turn off spot light camera setting is "off" or "auto"?

AKHwyJunkie commented 2 years ago

When you turn off spot light camera setting is "off" or "auto"?

I have the camera spot light LED setting set to "off" in my case, so the camera doesn't override my automations. This integration overrides the configured camera setting by flipping the "virtual switches" in the camera itself. Also, as you might imagine, with HA you can do all sorts of adjustments to the behavior such as dusk to dawn, longer on times, conditions based on other sensors, home/away differences, etc.

klona commented 2 years ago

Got the same trouble. If using HA switch, camera come back to spotlight auto, what I don't want and I need to manually set it to Off using web page or reolink application. It would be really nice if HA integration got a feature to set off, auto or schedule for spotlight. Or at least it keeps existing configuration when you toggle in HA.

Thks, Klona

AKHwyJunkie commented 2 years ago

It would be really nice if HA integration got a feature to set off, auto or schedule for spotlight.

@klona

I'm not the plugin author, but I don't think this is within the capabilities of the plugin. There are two elements involved. First, an on/off switch for the actual spotlight that turns the light on and off. Then, there's the Reolink software that affects the behavior of that spotlight switch. This plugin only operates at the light switch level.

If you use the automations I recommended above, you can replicate the "auto" behavior of the camera identically to how the camera itself does it. Additionally, you can also replicate "off" and "schedule" (and many other things Reolink doesn't give you) through additional HA automations. Making the plugin interoperate at the Reolink software level would add complexity and would provide no additional functionality than all ready exists with the appropriate HA automations. The whole benefit of this plugin is that it lets you override the Reolink software settings, otherwise just use the Reolink software. (Which is hot garbage and insufficient for many users.)

jraydoran commented 2 years ago

Must the HA User on the Reolink Camera need to be an admin for this to work?

EmanueleGuidetti commented 2 years ago

If you use the automations I recommended above, you can replicate the "auto" behavior of the camera identically to how the camera itself does it. Additionally, you can also replicate "off" and "schedule" (and many other things Reolink doesn't give you) through additional HA automations.

Sorry, I haven't understood: how I can replicate light "off" (on camera) from HA?

AKHwyJunkie commented 2 years ago

Sorry, I haven't understood: how I can replicate light "off" (on camera) from HA?

They can be automated with the "Switch: Turn On", "Switch: Turn Off" and "Switch: Toggle" call service functions. You will find both the IR light and spotlight switch enumerated with this plugin. (Also the siren and a few others.) Here's mine in YAML, this is for three different RLC-811a's. My trigger is sunrise and I use a similar automation around sunset to turn the IR lights on.

alias: 'Outdoor Camera Lighting:  All Lights Off At Sunrise'
trigger:
  - platform: sun
    event: sunrise
    offset: '01:00:00'
condition: []
action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id:
        - switch.driveway_spotlight
        - switch.driveway_ir_lights
        - switch.driveway_zoom_spotlight
        - switch.driveway_zoom_ir_lights
        - switch.tent_spotlight
        - switch.tent_ir_lights
mode: single
cypherbits commented 1 year ago

Same happening to me on Duo 2 model.

setomerza commented 1 year ago

Also having this issue on the RLC-811A and Duo 2. I'm able to use the plugin to turn the spotlight on but the plugin is unable to turn the spotlight off afterwards. After the spotlight is turned on by the plugin, the Reolink NVR camera spotlight setting changes to "On as scheduled" and must manually be turned off via the Reolink web app.

Environment: