Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

IR lights switch not added with version 0.8 #91

Closed
badabing2005 opened this issue Dec 10, 2020 · 5 comments
Closed

IR lights switch not added with version 0.8 #91

badabing2005 opened this issue Dec 10, 2020 · 5 comments
Labels
bug Something isn't working NVR NVR related

Comments

@badabing2005
Copy link
Contributor

It looks like with version 0.8
The IR lights entity is not added.

The documentation says:

Depending on the camera, the following switches are created

So I suppose somehow it thinks that my NVR does not support IR lights, which it does.
It is: RLN8-410-E
Firmware: v2.0.0.271_20092801

@fwestenberg fwestenberg added NVR NVR related bug Something isn't working labels Dec 10, 2020
@fwestenberg
Copy link
Owner

Can it be, for switching the IR lights you need to use the service reolink_dev.set_daynight?

@badabing2005
Copy link
Contributor Author

Can it be, for switching the IR lights you need to use the service reolink_dev.set_daynight?

Indeed yes,
This switch package works

platform: template
switches:
  camera_frontdoor_ir_lights:
    #value_template: "{{ is_state_attr('camera.front_door', 'ir_lights_enabled', true) }}"
    turn_on:
      service: reolink_dev.set_daynight
      data:
        entity_id: camera.nvr
        mode: AUTO
    turn_off:
      service: reolink_dev.set_daynight
      data:
        entity_id: camera.nvr
        mode: COLOR

The only issue is without an attribute for the value, the startup state is nondeterministic.
Perhaps once you support NVR, you can have each Camera's ISP values as attributes, and the template can get the value from it.

@fwestenberg
Copy link
Owner

I can add the current state as an attribute indeed. 👍

@fwestenberg
Copy link
Owner

Attributes added, please update to v0.9.

@badabing2005
Copy link
Contributor Author

Awesome thanks, love it.
For anyone that wants to have a IR switch, here's my final switch package.

platform: template
switches:
  camera_frontdoor_ir_lights:
    # value_template: "{{ is_state_attr('camera.frontdoor', 'daynight_state', 'AUTO') }}"
    turn_on:
      service: reolink_dev.set_daynight
      data:
        entity_id: camera.frontdoor
        mode: AUTO
    turn_off:
      service: reolink_dev.set_daynight
      data:
        entity_id: camera.frontdoor
        mode: COLOR
    icon_template: >-
      {% if is_state_attr('camera.frontdoor', 'daynight_state', 'AUTO') %}
        mdi:flash-auto
      {% elif is_state_attr('camera.frontdoor', 'daynight_state', 'BLACKANDWHITE') %}
        mdi:flash
      {% elif is_state_attr('camera.frontdoor', 'daynight_state', 'COLOR') %}
        mdi:flash-off
      {% else %}
        mdi:flash-alert-outline
      {% endif %}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working NVR NVR related
Projects
None yet
Development

No branches or pull requests

2 participants