#First YAML and need help please

1 messages · Page 1 of 1 (latest)

gleaming ember
#

I'm trying to make an automation so that the door bell video will be played on a TV once the person is sensed at the door. I got the following code from AI:
alias: Show Doorbell Feed
trigger:

  • platform: state
    entity_id: binary_sensor.reolink_video_doorbell_poe_visitor
    to: 'on'
    action:
  • service: media_player.play_media
    target:
    entity_id: media_player.your_chromecast
    data:
    media_content_id: media-source://camera/camera.doorbell_fluent
    media_content_type: application/vnd.apple.mpegurl

This what I have currently:
alias: Door Bell Video to TV
triggers:

  • entity_id:
    • binary_sensor.reolink_doorbell_front_porch_visitor
      to:
    • "on"
      trigger: state
      actions:
  • target:
    entity_id: media_player.lg_webos_tv_oled55c4pua
    data:
    media:
    media_content_type: application/vnd.apple.mpegurl
    metadata:
    camera.reolink_doorbell_front_porch_fluent: null
    action: media_player.play_media

I think the Trigger area is ok but the Action area, I don't have a clue how use the door bell video source:
camera.reolink_doorbell_front_porch_fluent

Also I'm not sure the following declaration is correct either:
media_content_type: application/vnd.apple.mpegurl

Any help would be appreciated.
Thanks

hard flare
#

Please format the code properly

misty quiverBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

tough patio
gleaming ember
#

I have switched back and forth to better understand both aspects.

tough patio