Help Setup automation to display to Home Hub
Hi
That's not an issue but theres no discussion tab so i will post it here.
First of all, great work. Google is not helping you here because this does not shows up on google at all, i was lucky that i tryed to search this on bing and found your work.
Thanks for this great job and keep it up.
Now the hard pard. I'm good with IT stuff, moslty infra related (Kubernetes, Docker, Windows Linux and etc) but not that great with HASS automations.
Can you help me to setup the same automation that you did to display the photos on the google home hub? I did not understood your exemple. Sorry about my ignorance.
Thanks very much and again, great job.
Hi! First, thank you for the kind words :) Most of the info is technically in the README, but re-reading it I realize it's kind of a mess, sorry about that.
First you'll need to configure the integration:
- Install HACS on your Home Assistant, if you don't already have it;
- Add the
outadoc/immich-home-assistantrepository to HACS; - Install the Immich integration with HACS;
- Set up the Immich integration (like any other integration, via the web UI). You will need to provide your Immich instance's URL, and an API token, which you can generate from Immich.
Then, to show your photos on a dashboard that will be used by your Google Home:
- Create a new dashboard on Home Assistant, with the Panel type (which only shows 1 full-screen card)
- On this dashboard, create a new card. I recommend using a
picture-entitycard, which worked best for me:
- type: picture-entity
entity: image.immich_favorite_image
show_state: false
show_name: false
aspect_ratio: "16:9"
fit_mode: contain
Then, you'll want some kind of script or automation to cast your dashboard to your Nest Hub. I had trouble with casting the dashboard where it would sometimes be… casting, but not visible? So my script stops casting, then restarts it again after ~10 seconds. Not ideal but it seems to work fine.
So you can use this as a template to create a script entity:
alias: Display photo frame
sequence:
- service: media_player.turn_off
metadata: {}
data: {}
target:
entity_id: media_player.<your-device>
- service: cast.show_lovelace_view
metadata: {}
data:
entity_id: media_player.<your-device>
dashboard_path: lovelace
view_path: <path-to-your-dashboard>
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- service: cast.show_lovelace_view
data:
entity_id: media_player.<your-device>
dashboard_path: lovelace
view_path: <path-to-your-dashboard>
mode: single
icon: mdi:image-frame
In theory, this should be enough. In practice, I also have an automation that triggers this every few hours, because things can easily get messed up (either by Google Cast just failing, or someone else casting to the device, for example).
description: Reset the photo frame every few hours
mode: single
trigger:
- platform: time_pattern
hours: "3"
condition: []
action:
- service: script.turn_on
metadata: {}
data: {}
target:
entity_id: script.<id-of-your-script>
And you should be good to go!
I can't tell whether that's too much or not enough information, so if you have any points you need me to clarify or expand, don't hesitate :D
Thats great, i was able to get it working.
Quick question, is possible to change the default 5 minutes or even add an UI config on home assistant so we can manualy change that?
Not possible for now, and from what I understand it wouldn't be very easy to add it as an option, but I've thought about it and might get to it sometime.