I’m having some difficulty with casting local images from my HA Server to either a Chromecast or Home Hub.
I’m trying to set it so when the doorbell is rang, a snapshot is taken and then this image should be cast. The images is also sent to my phone via Telegram and this works perfectly.
I previously had live video footage of the camera cast, however there is a lot of buffering so figured a snapshot may work better.
Running in to issues with actually casting the images. No problem connecting to the cast devices, however the image will not display.
I can however call the media_player.play_media service and cast web hosted images, just not local images.
The Doorbell Automation is as below:
# Door Bell
- alias: Doorbell
trigger:
platform: event
event_type: xiaomi_aqara.click
event_data:
entity_id: binary_sensor.switch_158d0002134e55
click_type: single
action:
- service: camera.snapshot
data:
entity_id: camera.porch_ffmpeg
filename: "/tmp/porch.jpg"
- service: notify.notify
data:
message: "The doorbell was rang at {{now().strftime('%H:%M %d-%m-%Y')}}."
data:
photo:
- file: /tmp/porch.jpg
caption: The doorbell was rang at {{now().strftime('%H:%M %d-%m-%Y')}}.
- service: notify.bridget
data:
message: "The doorbell was rang at {{now().strftime('%H:%M %d-%m-%Y')}}."
data:
photo:
- file: /tmp/porch.jpg
caption: The doorbell was rang at {{now().strftime('%H:%M %d-%m-%Y')}}.
- service: xiaomi_aqara.play_ringtone
data:
gw_mac: 78:11:DC:B1:EF:85
ringtone_id: 10
ringtone_vol: 25
- service: media_player.turn_on
entity_id:
- media_player.kitchen_display
- media_player.lounge_max
- media_player.lenovosmartdisplay89835
- media_player.living_room_speaker
- delay:
seconds: 3
- service: tts.google_say
entity_id:
- media_player.kitchen_display
- media_player.lounge_max
- media_player.lenovosmartdisplay89835
- media_player.living_room_speaker
data:
message: 'Somebody is at the Front Door.'
# - service: media_player.play_media
# entity_id:
# - media_player.kitchen_display
# - media_player.chromecast1880
# - media_player.lenovosmartdisplay89835
# data:
# media_content_id: "/tmp/porch.jpg"
# media_content_type: "image/jpg"
# - delay:
# seconds: 30
# - service: media_player.turn_off
# entity_id:
# - media_player.kitchen_display
# - media_player.chromecast1880
# - media_player.lenovosmartdisplay89835
# - media_player.lounge_max
# - media_player.living_room_speaker
# - service: media_player.turn_on
# entity_id: media_player.kitchen_display
# - delay:
# seconds: 3
# - service: camera.play_stream
# data:
# entity_id: camera.porch_ffmpeg
# media_player: media_player.kitchen_display
# - delay:
# seconds: 60
# - service: media_player.turn_off
# entity_id: media_player.kitchen_display
I’ve also whitelisted the required directory
homeassistant:
whitelist_external_dirs:
- /tmp
As an aside, where actually is this /tmp folder stored on Hassio?
I’ve found multiple /tmp folders on my server, but never been able to find a snapshot.
Thanks,