Skip to content
/ hass Public
forked from tiejiang29/hass

homeassistant 萤石状态&云台操作接口

Notifications You must be signed in to change notification settings

chliny/hass

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 

Repository files navigation

使用说明

  1. 将下载的插件中的ezviz文件夹复制到custom_components目录下
  2. keysecret请在萤石开发网站获取
  3. configuration.yaml文件中添加以下内容启用插件
sensor:
  - platform: ezviz
    appKey: ****
    appSecret: ****
    deviceSerial: ***
    scan_interval: 30
    options: 
      - sceneStatus
      - privacyStatus
      - pirStatus
      - alarmSoundMode
      - defenceStatus
      - onlineStatus
      - motionStatus
  1. configuration.yaml添加两个开关,用于修改移动侦测和遮蔽状态
switch:
  - platform: template
    switches:
      sence:
        friendly_name: 镜头遮蔽
        value_template: "{{ is_state('sensor.ezviz_sceneStatus', '启用遮蔽') }}"
        turn_on:
          service: ezviz.enable_sence
        turn_off:
          service: ezviz.disable_sence
        icon_template: >-
          {% if is_state('sensor.ezviz_sceneStatus', '启用遮蔽') %}
            mdi:eye-off
          {% else %}
            mdi:eye
          {% endif %}
  - platform: template
    switches:
      defence:
        friendly_name: 布防状态(活动检测)
        value_template: "{{ is_state('sensor.ezviz_defenceStatus', '布防') }}"
        turn_on:
          service: ezviz.enable_defence
        turn_off:
          service: ezviz.disable_defence
        icon_template: >-
          {% if is_state('sensor.ezviz_defenceStatus', '布防') %}
            mdi:shield-home
          {% else %}
            mdi:shield-off
          {% endif %}
  1. 安装 radial-menu 插件
  2. 将如下代码,通过原始编辑器,在合适的位置添加进去
    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'
  1. enjoyit

About

homeassistant 萤石状态&云台操作接口

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%