Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help Setup automation to display to Home Hub #1

Open
fabioteixei opened this issue Mar 31, 2024 · 3 comments
Open

Help Setup automation to display to Home Hub #1

fabioteixei opened this issue Mar 31, 2024 · 3 comments

Comments

@fabioteixei
Copy link

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.

@outadoc
Copy link
Owner

outadoc commented Apr 3, 2024

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:

  1. Install HACS on your Home Assistant, if you don't already have it;
  2. Add the outadoc/immich-home-assistant repository to HACS;
  3. Install the Immich integration with HACS;
  4. 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:

  1. Create a new dashboard on Home Assistant, with the Panel type (which only shows 1 full-screen card)
  2. On this dashboard, create a new card. I recommend using a picture-entity card, 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

@fabioteixei
Copy link
Author

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?

@outadoc
Copy link
Owner

outadoc commented Apr 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants