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

Commit

Permalink
Merge pull request #47 from MattiasC/Add-HACS-requirements
Browse files Browse the repository at this point in the history
Add hacs requirements
  • Loading branch information
fwestenberg authored Jul 4, 2020
2 parents 5762e31 + 95cee08 commit 6afbb39
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 91 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/hassfest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Validate with hassfest

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
validate:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- uses: home-assistant/actions/hassfest@master
231 changes: 141 additions & 90 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,120 +1,171 @@
# Reolink IP camera
Home Assistant Reolink addon
<h2 align="center">
<a href="https://reolink.com"><img src="./logo.png" alt="Reolink logotype" width="200"></a>
<br>
<i>Home Assistant Reolink addon</i>
<br>
</h2>

<p align="center">
<a href="https://github.com/custom-components/hacs"><img src="https://img.shields.io/badge/HACS-Custom-orange.svg"></a>
<img src="https://img.shields.io/github/v/release/fwestenberg/reolink" alt="Current version">
</p>

__Unsupported models__
- B800
- B400
- D400
- E1
- E1 Pro
- Battery-powered camera's
<p align="center">
<img src="./Lovelace%20Card.PNG?raw=true" alt="Example Lovelace card">
</p>

## Table of contents

- [Installation](#-installation)
- [Configuration](#-configuration)
- [Usage](#-usage)
- [Unsupported models](#-unsupported-models)
- [Troubleshooting](#-troubleshooting)

---


## Installation

### Manual install

```bash
# Download a copy of this repository
$ wget https://github.com/fwestenberg/reolink/archive/master.zip

# Unzip the archive
$ unzip master.zip

# Move the reolink_dev directory into your custom_components directory in your Home Assistant install
$ mv reolink-master/custom_components/reolink_dev <home-assistant-install-directory>/config/custom_components/
```


### HACS install

1. Click on HACS in the Home Assistant menu
2. Click on `Integrations`
3. Click the top right menu (the three dots)
4. Select `Custom repositories`
5. Paste the repository URL (`https://github.com/fwestenberg/reolink`) in the dialog box
6. Select category `Integration`
7. Click `Add`
8. Click `Install` on the Reolink IP camera box that has now appeared


__SETUP__
1. Clone this project into your config/custom_components directory
2. In your configuration.yaml add the following lines:
## Configuration

```text
1. Add the following to your `configuration.yaml`:
```yaml
camera:
- platform: reolink_dev
host: IP_ADDRESS
username: admin
password: YOUR_PASSWORD
name: camera (optional, default Reolink Camera)
name: frontdoor (optional, default Reolink Camera)
stream: main or sub (optional, default main)
protocol: rtmp or rtsp (optional, default rtmp)
channel: NVR camera channel (optional, default 0)
scan_interval: 5 (optional, default 30s)
```

3. Create a binary sensor for the motion detection, add this to your binary_sensors.yaml:

```text
platform: template
sensors:
motion_frontdoor:
friendly_name: Camera frontdoor
device_class: motion
entity_id: camera.frontdoor
value_template: "{{ is_state('camera.frontdoor', 'motion') }}"
delay_off:
seconds: 30
```

4. Create email, FTP upload and infrared light buttons:
```text
platform: template
switches:
camera_frontdoor_email:
value_template: "{{ is_state_attr('camera.frontdoor', 'email_enabled', true) }}"
turn_on:
service: camera.enable_email
data:
entity_id: camera.frontdoor
turn_off:
service: camera.disable_email
data:
entity_id: camera.frontdoor
icon_template: >-
{% if is_state_attr('camera.frontdoor', 'email_enabled', true) %}
mdi:email
{% else %}
mdi:email-outline
{% endif %}
camera_frontdoor_ftp:
value_template: "{{ is_state_attr('camera.frontdoor', 'ftp_enabled', true) }}"
turn_on:
service: camera.enable_ftp
data:
entity_id: camera.frontdoor
turn_off:
service: camera.disable_ftp
data:
entity_id: camera.frontdoor
icon_template: >-
{% if is_state_attr('camera.frontdoor', 'ftp_enabled', true) %}
mdi:filmstrip
{% else %}
mdi:filmstrip-off
{% endif %}
camera_frontdoor_ir_lights:
value_template: "{{ is_state_attr('camera.frontdoor', 'ir_lights_enabled', true) }}"
turn_on:
service: camera.enable_ir_lights
data:
entity_id: camera.frontdoor
turn_off:
service: camera.disable_ir_lights
data:
entity_id: camera.frontdoor
icon_template: >-
{% if is_state_attr('camera.frontdoor', 'ir_lights_enabled', true) %}
mdi:flashlight
{% else %}
mdi:flashlight-off
{% endif %}
binary_sensor:
platform: template
sensors:
motion_frontdoor:
friendly_name: Camera frontdoor
device_class: motion
entity_id: camera.frontdoor
value_template: "{{ is_state('camera.frontdoor', 'motion') }}"
delay_off:
seconds: 30

switch:
- platform: template
switches:
camera_frontdoor_email:
value_template: "{{ is_state_attr('camera.frontdoor', 'email_enabled', true) }}"
turn_on:
service: camera.enable_email
data:
entity_id: camera.frontdoor
turn_off:
service: camera.disable_email
data:
entity_id: camera.frontdoor
icon_template: >-
{% if is_state_attr('camera.frontdoor', 'email_enabled', true) %}
mdi:email
{% else %}
mdi:email-outline
{% endif %}
camera_frontdoor_ftp:
value_template: "{{ is_state_attr('camera.frontdoor', 'ftp_enabled', true) }}"
turn_on:
service: camera.enable_ftp
data:
entity_id: camera.frontdoor
turn_off:
service: camera.disable_ftp
data:
entity_id: camera.frontdoor
icon_template: >-
{% if is_state_attr('camera.frontdoor', 'ftp_enabled', true) %}
mdi:filmstrip
{% else %}
mdi:filmstrip-off
{% endif %}
camera_frontdoor_ir_lights:
value_template: "{{ is_state_attr('camera.frontdoor', 'ir_lights_enabled', true) }}"
turn_on:
service: camera.enable_ir_lights
data:
entity_id: camera.frontdoor
turn_off:
service: camera.disable_ir_lights
data:
entity_id: camera.frontdoor
icon_template: >-
{% if is_state_attr('camera.frontdoor', 'ir_lights_enabled', true) %}
mdi:flashlight
{% else %}
mdi:flashlight-off
{% endif %}
```
2. Restart Home Assistant.
5. Now restart Home Assistant.
__USAGE__
## Usage
In your Home Assistant Lovelace, add a new card with the following:
```text
```yaml
type: picture-glance
title: frontdoor
camera_image: camera.frontdoor
entities:
- switch.camera_frontdoor_ir_lights
- switch.camera_frontdoor_email
- switch.camera_frontdoor_ftp
- binary_sensor.motion_frontdoor
title: frontdoor
type: picture-glance
```
Now you will have card like this (notice the buttons and motion icon):
Now you will have a card the looks like this (notice the buttons and motion icon):
![Example Lovelace card](/Lovelace%20Card.PNG?raw=true)
## Unsupported models
- B800
- B400
- D400
- E1
- E1 Pro
- Battery-powered camera's
![alt text](https://github.com/fwestenberg/reolink/blob/master/Lovelace%20Card.PNG)
## Troubleshooting
- If the buttons are not working on the Lovelace card, make sure that the user that you configured in the Reolink camera is an **administrator**.
3 changes: 2 additions & 1 deletion custom_components/reolink_dev/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"domain": "reolink_dev",
"name": "Reolink IP camera",
"documentation": "https://www.example.com",
"documentation": "https://github.com/fwestenberg/reolink",
"issue_tracker": "https://github.com/fwestenberg/reolink/issues",
"dependencies": ["ffmpeg"],
"codeowners": ["@fwestenberg"]
}
5 changes: 5 additions & 0 deletions hacs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Reolink IP camera",
"domains": "camera",
"iot_class": "Local Push"
}
26 changes: 26 additions & 0 deletions info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
A Home Assistant integration for your Reolink security cameras which enables you to detect motion, control the IR lights, recording and the sending of emails.

*Configuration guide can be found [here](https://github.com/fwestenberg/reolink/blob/master/README.md).*


{% if installed %}

#### Changes from version {{ version_installed }}

{% if version_installed == version_available %}
*You already have the latest released version installed.*
{% endif %}

{% if version_installed.replace("v", "") | float < 0.3 %}
**Bugfix:** Change duplicate disable_ir_lights to disable_recording.
{% endif %}

{% if version_installed.replace("v", "") | float < 0.2 %}
**New feature:** Recording added.
{% endif %}

{% if version_installed.replace("v", "") | float < 0.1 %}
**Bugfix:** Async handling: aiohttp.
{% endif %}

{% endif %}
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6afbb39

Please sign in to comment.