Reolink cameras have added a feature to identify a baby crying. To leverage this, I wanted to add a custom icon to the camera stream (using webrtc-camera
for this purpose, as the shortcut example appears to align with my needs) and enable clicking on the icon to open the “more info” pop-up. I am already utilising the browser_mod
add-on for this. However, while the code successfully opens the pop-up when tested in the development tools, nothing happens with the camera feed itself.
Here is the relevant code:
type: custom:webrtc-camera
entity: camera.e1_zoom_onvif_profile000_mainstream
mode: webrtc,mse
media: video,audio
background: true
style: "video {transform: rotate(-90deg); aspect-ratio: 1}"
shortcuts:
- name: Baby crying
icon: >-
${ states['binary_sensor.e1_zoom_baby_crying'].state === 'on' ?
'mdi:emoticon-cry-outline':'mdi:sleep' }
service: browser_mod.more_info
service_data:
entity_id: binary_sensor.e1_zoom_baby_crying
ptz:
service: onvif.ptz
data_left:
entity_id: camera.e1_zoom_onvif_profile000_mainstream
pan: LEFT
move_mode: ContinuousMove
data_right:
entity_id: camera.e1_zoom_onvif_profile000_mainstream
pan: RIGHT
move_mode: ContinuousMove
data_up:
entity_id: camera.e1_zoom_onvif_profile000_mainstream
tilt: UP
move_mode: ContinuousMove
data_down:
entity_id: camera.e1_zoom_onvif_profile000_mainstream
tilt: DOWN
move_mode: ContinuousMove
data_zoom_in:
entity_id: camera.e1_zoom_onvif_profile000_mainstream
zoom: ZOOM_IN
move_mode: ContinuousMove
data_zoom_out:
entity_id: camera.e1_zoom_onvif_profile000_mainstream
zoom: ZOOM_OUT
move_mode: ContinuousMove
Also using the new action command instead of service:
type: custom:webrtc-camera
entity: camera.e1_zoom_onvif_profile000_mainstream
mode: webrtc,mse
media: video,audio
background: true
style: "video {transform: rotate(-90deg); aspect-ratio: 1}"
shortcuts:
- name: Baby crying
icon: >-
${ states['binary_sensor.e1_zoom_baby_crying'].state === 'on' ?
'mdi:emoticon-cry-outline':'mdi:sleep' }
action: browser_mod.more_info
data:
entity: binary_sensor.e1_zoom_baby_crying
ptz:
service: onvif.ptz
data_left:
entity_id: camera.e1_zoom_onvif_profile000_mainstream
pan: LEFT
move_mode: ContinuousMove
data_right:
entity_id: camera.e1_zoom_onvif_profile000_mainstream
pan: RIGHT
move_mode: ContinuousMove
data_up:
entity_id: camera.e1_zoom_onvif_profile000_mainstream
tilt: UP
move_mode: ContinuousMove
data_down:
entity_id: camera.e1_zoom_onvif_profile000_mainstream
tilt: DOWN
move_mode: ContinuousMove
data_zoom_in:
entity_id: camera.e1_zoom_onvif_profile000_mainstream
zoom: ZOOM_IN
move_mode: ContinuousMove
data_zoom_out:
entity_id: camera.e1_zoom_onvif_profile000_mainstream
zoom: ZOOM_OUT
move_mode: ContinuousMove