Найти в Дзене
Home Assistant

Делюсь автоматизацией к компоненту TvOverlay

В ответ на пост Делюсь автоматизацией к компоненту TvOverlay 🐱 Показ камеры на ТВ по движению, с мгновенным исчезновением по окончанию движения: alias: Показ камеры на ТВ по движению (с продлением) description: "" mode: restart # ← ключевой момент triggers: - trigger: state entity_id: binary_sensor.entrance_motion_2 to: "on" - trigger: state entity_id: binary_sensor.entrance_motion_2 to: "off" conditions: [] actions: - choose: # 🟢 Движение началось или продолжается - conditions: - condition: state entity_id: binary_sensor.entrance_motion_2 state: "on" sequence: - service: notify.tvoverlaynotify data: message: Камера у входа data: id: entrance_cam # важно — то же id seconds: 900 # 15 минут = 900 сек video: >- rtsp://User:Pass@192.168.1.25/axis-media/media.amp?videocodec=h264 #Пример для камер Axis # 🔴 Движение прекратилось - conditions: - condition: state entity_id: binary_sensor.entrance_motion_2 state: "off" sequence: - service: notify.tvoverlaynotify

В ответ на пост

Делюсь автоматизацией к компоненту TvOverlay 🐱

Показ камеры на ТВ по движению, с мгновенным исчезновением по окончанию движения:

alias: Показ камеры на ТВ по движению (с продлением)

description: ""

mode: restart # ← ключевой момент

triggers:

- trigger: state

entity_id: binary_sensor.entrance_motion_2

to: "on"

- trigger: state

entity_id: binary_sensor.entrance_motion_2

to: "off"

conditions: []

actions:

- choose:

# 🟢 Движение началось или продолжается

- conditions:

- condition: state

entity_id: binary_sensor.entrance_motion_2

state: "on"

sequence:

- service: notify.tvoverlaynotify

data:

message: Камера у входа

data:

id: entrance_cam # важно — то же id

seconds: 900 # 15 минут = 900 сек

video: >-

rtsp://User:Pass@192.168.1.25/axis-media/media.amp?videocodec=h264 #Пример для камер Axis

# 🔴 Движение прекратилось

- conditions:

- condition: state

entity_id: binary_sensor.entrance_motion_2

state: "off"

sequence:

- service: notify.tvoverlaynotify

data:

message: ""

data:

id: entrance_cam

seconds: 1

video: ""

notify:

- name: TvOverlayNotify

platform: rest

method: POST_JSON

resource: http://192.168.1.52:5001/notify #IP вашего Android

verify_ssl: false

title_param_name: title

data:

id: "{{ data.id | default(null) }}" # string | main text | default: null

appTitle: "{{ data.appTitle | default('Home Assistant') }}" # string | extra info text | default: null

color: "{{ data.color | default('#049cdb') }}" # string | color tint for smallIcon. accepts 6 or 8 digit color hex. the '#' is optional | default: null

image: "{{ data.image | default(null) }}" # string | accepts mdi icons, image urls and Bitmap encoded to Base64 | default: null

video: "{{ data.video | default(null) }}" # string | video url. supports rtps, hls, dash, smoothstreaming | default: null

smallIcon: "{{ data.smallIcon | default(null) }}" # string | accepts mdi icons, image urls and Bitmap encoded to Base64 | default: null

largeIcon: "{{ data.largeIcon | default(null) }}" # string | accepts mdi icons, image urls and Bitmap encoded to Base64 | default: null

corner: "{{ data.corner | default(null) }}" # string | position on the screen. accept values: bottom_start, bottom_end, top_start, top_end | default: null (uses hot corner)

seconds: "{{ data.seconds | default(null) }}" # int | duration that the notification will stay visible in seconds | default: null (uses duration setting)

#локально #безопасность #автоматизация #homeassistant 👍