Villhellm / lovelace-animated-background

Animated backgrounds for lovelace
195 stars 61 forks source link

Doesn't load on 2nd dashboard, unless page is refreshed #14

Closed Meelobee closed 4 years ago

Meelobee commented 4 years ago

Hey Villhellm, Thanks for the great addition to Home Assistant. I have a question about how it loads on different dashboards.

In my HA setup I have 2 Dashboards and I would like to add the animated backgrounds on the second dashboard only. Each dashboard uses its own Lovelace config file and I've added the config below to the 2nd dashboard only.

animated_background:
  views:
    - config:
        default_url: /local/backgrounds-animated/sunny.html
        entity: sun.sun
        state_url:
          above_horizon: /local/backgrounds-animated/sunny.html
          below_horizon: /local/backgrounds-animated/night.html
      path: /lovelace-rineke/temperatuur
    - config:
        default_url: /local/backgrounds-animated/sunny.html
        entity: sun.sun
        state_url:
          above_horizon: /local/backgrounds-animated/sunny.html
          below_horizon: /local/backgrounds-animated/night.html
      path: /lovelace-rineke/weer

But when I view the second dashboard, it opens with it's static background (in my case a custom image) The animated background only shows after I manually refesh the page. Is there any way to avoid that and have the animated background show right away when opening the second dashboard?

Home Assistant version: 0.108.9 Animated Background version: dd7563b Browser: Chrome (81.0.4044.129)

Thanks for your time :)

Villhellm commented 4 years ago

I haven't looked into multiple dashboards yet, I'll play with it to see if I can get it working

Meelobee commented 4 years ago

Thanks! Would be really great if it could be configured separately for each View on different Dashboards.

And sad news, it doesn't seem to work at all on the second dashboard with version dd7563b (I installed that right before making the first post, and I only realized it doesnt work anymore after I got the notification you replied and wanted to make a video of the issue.)

Villhellm commented 4 years ago

Okay, go ahead and give the latest update a try. Make sure your path: config does not include the dashboard, it just needs the relative path. So not /lovelace-rineke/weer, but rather just weer

Meelobee commented 4 years ago

It works as it should now and even opens without needing to refresh the page! Many thanks for the quick fix :)