So I was able to successfully setup an automation where in if a button press happens on my Unifi G4 Doorbell, it will then stream to my Nest Hub(s) / Android TV(s).
The “issue” I have is, I only want it to stream on those devices for 30 seconds and then automatically stop.
Here is the YAML for what I currently have setup:
alias: Doorbell Ring
description: ""
trigger:
- type: occupied
platform: device
domain: binary_sensor
condition: []
action:
- service: media_player.play_media
target:
entity_id: media_player.kitchen_display
data:
media_content_id: media-source://camera/camera.g4_doorbell_high
media_content_type: application/vnd.apple.mpegurl
metadata:
title: G4 Doorbell High
thumbnail: /api/camera_proxy/camera.g4_doorbell_high
media_class: video
children_media_class: null
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://camera
- service: media_player.play_media
target:
entity_id: media_player.shield
data:
media_content_id: media-source://camera/camera.g4_doorbell_high
media_content_type: application/vnd.apple.mpegurl
metadata:
title: G4 Doorbell High
thumbnail: /api/camera_proxy/camera.g4_doorbell_high
media_class: video
children_media_class: null
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://camera
mode: single