Doorbell video
This commit is contained in:
@@ -47,6 +47,7 @@ class Climate(hass.Hass):
|
|||||||
self.turn_off("switch.plug_158d00010dd98d")
|
self.turn_off("switch.plug_158d00010dd98d")
|
||||||
|
|
||||||
def split_on(self, mode, temp):
|
def split_on(self, mode, temp):
|
||||||
|
self.split_state = "on"
|
||||||
self.turn_on("switch.plug_158d00010dd98d")
|
self.turn_on("switch.plug_158d00010dd98d")
|
||||||
if (self.timer != None):
|
if (self.timer != None):
|
||||||
self.cancel_timer(self.timer)
|
self.cancel_timer(self.timer)
|
||||||
@@ -88,14 +89,12 @@ class Climate(hass.Hass):
|
|||||||
if nest_y1 == "on":
|
if nest_y1 == "on":
|
||||||
if self.check_door('FAN'):
|
if self.check_door('FAN'):
|
||||||
return
|
return
|
||||||
self.split_state = "on"
|
|
||||||
self.log("Turn on split for COOLING to {}.".format(nest_target_cool))
|
self.log("Turn on split for COOLING to {}.".format(nest_target_cool))
|
||||||
self.split_on("COOLING", 16)
|
self.split_on("COOLING", 16)
|
||||||
|
|
||||||
elif nest_w1 == "on":
|
elif nest_w1 == "on":
|
||||||
if self.check_door('OFF'):
|
if self.check_door('OFF'):
|
||||||
return
|
return
|
||||||
self.split_state = "on"
|
|
||||||
self.log("Turn on split for HEATING to {}".format(nest_target_hot))
|
self.log("Turn on split for HEATING to {}".format(nest_target_hot))
|
||||||
self.split_on("HEATING", 28)
|
self.split_on("HEATING", 28)
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ class Doorbell(hass.Hass):
|
|||||||
ringtone = 10
|
ringtone = 10
|
||||||
gw_mac = ''
|
gw_mac = ''
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
if "notify" not in self.args or "sensor" not in self.args:
|
if "notify" not in self.args or "sensor" not in self.args or "camera" not in self.args:
|
||||||
self.error("Please provide notify, sensor in config!")
|
self.error("Please provide notify, sensor, camera in config!")
|
||||||
return
|
return
|
||||||
if "gw_mac" in self.args:
|
if "gw_mac" in self.args:
|
||||||
self.gw_mac = self.args['gw_mac']
|
self.gw_mac = self.args['gw_mac']
|
||||||
@@ -36,12 +36,20 @@ class Doorbell(hass.Hass):
|
|||||||
self.log("doorbell call")
|
self.log("doorbell call")
|
||||||
self.call_service("xiaomi_aqara/play_ringtone", gw_mac=self.gw_mac, ringtone_id=self.ringtone, ringtone_vol=100)
|
self.call_service("xiaomi_aqara/play_ringtone", gw_mac=self.gw_mac, ringtone_id=self.ringtone, ringtone_vol=100)
|
||||||
self.notify("Звонок в дверь!!!", name = self.args['notify'])
|
self.notify("Звонок в дверь!!!", name = self.args['notify'])
|
||||||
for x in range(3):
|
# for x in range(3):
|
||||||
self.send_image()
|
self.send_image()
|
||||||
|
|
||||||
|
def send_video(self):
|
||||||
|
file = '/config/www/doorbell_video.mp4'
|
||||||
|
self.call_service("stream/record", stream_source=self.args['rtsp'], filename=file, duration=10)
|
||||||
|
self.timer = self.run_in(self.run_in_send_video, 12, file=file)
|
||||||
|
|
||||||
|
def run_in_send_video(self, args):
|
||||||
|
extra_data = {'video': {'file': args['file'], 'caption': 'Видео звонившего.'}}
|
||||||
|
self.notify("Видео звонившего", name = self.args['notify'], data=extra_data)
|
||||||
|
|
||||||
|
|
||||||
def send_image(self):
|
def send_image(self):
|
||||||
self.call_service("camera/snapshot", entity_id="camera.enterance", filename="/config/www/camera_image.jpg")
|
self.call_service("camera/snapshot", entity_id=self.args['camera'], filename="/config/www/camera_image.jpg")
|
||||||
extra_data = {'photo': {'file':'/config/www/camera_image.jpg', 'capture': 'Фото звонившего.'}}
|
extra_data = {'photo': {'file':'/config/www/camera_image.jpg', 'capture': 'Фото звонившего.'}}
|
||||||
self.notify("Фото звонившего", name = self.args['notify'], data=extra_data)
|
self.notify("Видео звонившего", name = self.args['notify'], data=extra_data)
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ doorbell:
|
|||||||
module: doorbell
|
module: doorbell
|
||||||
class: Doorbell
|
class: Doorbell
|
||||||
sensor: binary_sensor.door_window_sensor_158d0001f34374
|
sensor: binary_sensor.door_window_sensor_158d0001f34374
|
||||||
|
camera: camera.entrance
|
||||||
|
rtsp: !secret rtsp_entrance
|
||||||
notify: telegram
|
notify: telegram
|
||||||
gw_mac: !secret aqara1_mac
|
gw_mac: !secret aqara1_mac
|
||||||
global_dependencies:
|
global_dependencies:
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ homeassistant:
|
|||||||
|
|
||||||
logger:
|
logger:
|
||||||
default: info
|
default: info
|
||||||
# logs:
|
logs:
|
||||||
# custom_components.yandex_smart_home: debug
|
custom_components.yandex_smart_home: debug
|
||||||
|
|
||||||
api:
|
api:
|
||||||
|
|
||||||
@@ -33,6 +33,10 @@ config:
|
|||||||
discovery:
|
discovery:
|
||||||
system_health:
|
system_health:
|
||||||
|
|
||||||
|
#enables video recording
|
||||||
|
stream:
|
||||||
|
|
||||||
|
|
||||||
# Enables support for tracking state changes over time
|
# Enables support for tracking state changes over time
|
||||||
recorder: !include configuration/recorder.yaml
|
recorder: !include configuration/recorder.yaml
|
||||||
history:
|
history:
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ filter:
|
|||||||
exclude_entities:
|
exclude_entities:
|
||||||
- switch.plug_158d00020f3a29
|
- switch.plug_158d00020f3a29
|
||||||
- switch.plug_158d00026ea017
|
- switch.plug_158d00026ea017
|
||||||
|
- switch.plug_158d00010dd98d
|
||||||
- switch.xiaomi_miio_switch
|
- switch.xiaomi_miio_switch
|
||||||
- switch.domofon_mode
|
- switch.domofon_mode
|
||||||
- switch.domofon_open
|
- switch.domofon_open
|
||||||
|
|||||||
Submodule hass/settings/custom_components/yandex_smart_home updated: 7373db4978...19b012b1bb
@@ -95,6 +95,7 @@ work_longitude: 1.0
|
|||||||
syno_url: xxxxxxxxx
|
syno_url: xxxxxxxxx
|
||||||
syno_user: xxxxxxxxx
|
syno_user: xxxxxxxxx
|
||||||
syno_pass: xxxxxxxxx
|
syno_pass: xxxxxxxxx
|
||||||
|
rtsp_entrance: xxxxxxxxx
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
# MOSENERGO SETTINGS #
|
# MOSENERGO SETTINGS #
|
||||||
|
|||||||
@@ -159,9 +159,9 @@ views:
|
|||||||
icon: mdi:cctv
|
icon: mdi:cctv
|
||||||
cards:
|
cards:
|
||||||
- type: picture-entity
|
- type: picture-entity
|
||||||
title: enterance
|
title: entrance
|
||||||
entity: camera.enterance
|
entity: camera.entrance
|
||||||
camera_image: camera.enterance
|
camera_image: camera.entrance
|
||||||
show_info: true
|
show_info: true
|
||||||
tap_action: dialog
|
tap_action: dialog
|
||||||
- title: "Будильники"
|
- title: "Будильники"
|
||||||
|
|||||||
Reference in New Issue
Block a user