# https://www.home-assistant.io/integrations/amcrest
# amcrest:
#   - host: !secret amcrest_ip
#     username: !secret amcrest_username
#     password: !secret amcrest_password
#     resolution: low
#     binary_sensors:
#       - online

binary_sensor:
  - platform: template
    sensors:
      camera_state:
        friendly_name: Security camera
        device_class: safety
        value_template: >-
          {{ is_state('camera.mercury_amcrest_1', 'streaming') or is_state('camera.mercury_amcrest_1', 'recording') }}
        icon_template: >-
          {% if is_state('camera.mercury_amcrest_1', 'streaming') or is_state('camera.mercury_amcrest_1', 'recording') %}
            mdi:video
          {% else %}
            mdi:video-off
          {% endif %}
