This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from MattiasC/Add-HACS-requirements
Add hacs requirements
- Loading branch information
Showing
6 changed files
with
188 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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**. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Reolink IP camera", | ||
"domains": "camera", | ||
"iot_class": "Local Push" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %} |