Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 77 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,101 +1,109 @@
# 使用说明
1、将下载的插件中两个文件夹复制到custom_components目录下<br/>
2、key和secret请在萤石开发网站获取,具体可详见https://bbs.hassbian.com/thread-7062-1-1.html<br/>
3、在configuration.yaml文件中添加以下内容启用插件<br/>

~~~
ezvizctrl:
deviceSerial: ****设备序列号
appKey: ****api接口里面的appkey
appSecret: ****api接口里面的appsecret
1. 将下载的插件中的`ezviz`文件夹复制到`custom_components`目录下
2. `key`和`secret`请在[萤石开发网站](https://bbs.hassbian.com/thread-7062-1-1.html)获取
3. 在`configuration.yaml`文件中添加以下内容启用插件

```yaml
sensor:
- platform: ezviz
appKey: ****
appSecret: ****
deviceSerial: ***
scan_interval: 30
options:
- sceneStatus
- privacyStatus
- AlarmStatus
- pirStatus
- alarmSoundMode
~~~
4、在configuration.yaml添加两个开关,用于修改移动侦测和遮蔽状态
~~~
- defenceStatus
- onlineStatus
- motionStatus
```

4. 在`configuration.yaml`添加两个开关,用于修改移动侦测和遮蔽状态
```yaml
switch:
- platform: template
switches:
privacy:
sence:
friendly_name: 镜头遮蔽
value_template: "{{ is_state('sensor.ezviz_privacystatus', '启用遮蔽') }}"
value_template: "{{ is_state('sensor.ezviz_sceneStatus', '启用遮蔽') }}"
turn_on:
service: ezvizctrl.enable_privacy
service: ezviz.enable_sence
turn_off:
service: ezvizctrl.disable_privacy
service: ezviz.disable_sence
icon_template: >-
{% if is_state('sensor.ezviz_privacystatus', '启用遮蔽') %}
{% if is_state('sensor.ezviz_sceneStatus', '启用遮蔽') %}
mdi:eye-off
{% else %}
mdi:eye
{% endif %}
- platform: template
switches:
alarm:
friendly_name: 移动侦测
value_template: "{{ is_state('sensor.ezviz_alarmstatus', '布防') }}"
defence:
friendly_name: 布防状态(活动检测)
value_template: "{{ is_state('sensor.ezviz_defenceStatus', '布防') }}"
turn_on:
service: ezvizctrl.enable_alarm
service: ezviz.enable_defence
turn_off:
service: ezvizctrl.disable_alarm
service: ezviz.disable_defence
icon_template: >-
{% if is_state('sensor.ezviz_alarmstatus', '布防') %}
{% if is_state('sensor.ezviz_defenceStatus', '布防') %}
mdi:shield-home
{% else %}
mdi:shield-off
{% endif %}
~~~
5、在lovelace上面添加控制界面
首先安装 radial-menu 插件,https://github.com/custom-cards/radial-menu
将如下代码,通过原始编辑器,在合适的位置添加进去
~~~
- cards:
- entities:
- switch.privacy
- switch.alarm
- sensor.ezviz_alarmsoundmode
show_header_toggle: false
title: 摄像机状态
type: entities
- default_dismiss: false
default_open: true
icon: 'mdi:webcam'
items:
- entity: null
icon: 'mdi:arrow-up-thick'
name: 上
tap_action:
action: call-service
service: ezvizctrl.up
- entity: null
icon: 'mdi:arrow-right-thick'
name: 右
tap_action:
action: call-service
service: ezvizctrl.right
- entity: null
icon: 'mdi:arrow-down-thick'
name: 下
tap_action:
action: call-service
service: ezvizctrl.down
- entity: null
icon: 'mdi:arrow-left-thick'
name: 左
tap_action:
action: call-service
service: ezvizctrl.left
name: 家
type: 'custom:radial-menu'
type: vertical-stack
~~~
6、enjoyit
```
5. 安装 [radial-menu](https://github.com/custom-cards/radial-menu) 插件
6. 将如下代码,通过原始编辑器,在合适的位置添加进去
```yaml
cards:
- type: entities
entities:
- entity: switch.sence
- entity: switch.defence
- entity: sensor.ezviz_alarmsoundmode
name: 告警声音模式
- entity: sensor.ezviz_onlinestatus
name: 在线状态
- entity: sensor.ezviz_privacystatus
name: 隐私状态
- entity: sensor.ezviz_motionstatus
name: 人体感应告警
show_header_toggle: false
title: 摄像机状态
- default_dismiss: false
default_open: true
icon: 'mdi:webcam'
items:
- entity: null
icon: 'mdi:arrow-up-thick'
name: 上
tap_action:
action: call-service
service: ezviz.up
- entity: null
icon: 'mdi:arrow-right-thick'
name: 右
tap_action:
action: call-service
service: ezviz.right
- entity: null
icon: 'mdi:arrow-down-thick'
name: 下
tap_action:
action: call-service
service: ezviz.down
- entity: null
icon: 'mdi:arrow-left-thick'
name: 左
tap_action:
action: call-service
service: ezviz.left
name: 家
type: 'custom:radial-menu'

```
7. enjoyit

1 change: 1 addition & 0 deletions ezviz/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions ezviz/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"domain": "ezviz",
"name": "ezviz",
"documentation": "https://www.example.com",
"version":"0.0.1",
"dependencies": [],
"codeowners": [],
"requirements": []
Expand Down
Loading