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

view specific backgrounds broken? #13

Closed
Fredfishface opened this issue Apr 30, 2020 · 18 comments
Closed

view specific backgrounds broken? #13

Fredfishface opened this issue Apr 30, 2020 · 18 comments

Comments

@Fredfishface
Copy link

Hi, Great addon. Your default example (animated backgrounds for all views) works. If I add a view option for a specific path I get the same background for all views. If I add two view specific options, I don't get anything.

Windows 10, chrome, latest version of home assistant.

Doesn't Work:
animated_background:
views:
- config:
default_url: >-
/community_plugin/lovelace-animated-background/background-animations/night.html
entity: sun.sun
path: new
- config:
default_url: >-
/community_plugin/lovelace-animated-background/backgound-animations/fog.html
path: blank

Works:
animated_background:
default_url: /local/animated-background/background-animations/sunny.html
included_users:
- Villhellm
entity: "weather.dark_sky"
state_url:
'sunny': /local/animated-background/background-animations/sunny.html
'partlycloudy': /local/animated-background/background-animations/cloudy.html
'cloudy': /local/animated-background/background-animations/cloudy.html
'mostlycloudy': /local/animated-background/background-animations/mostlycloudy.html
'clear-night': /local/animated-background/background-animations/night.html
'fog': /local/animated-background/background-animations/fog.html

Doesn't Work:
animated_background:
default_url: /community_plugin/lovelace-animated-background/background-animations/sunny.html
included_users:
- Villhellm
entity: "weather.dark_sky"
state_url:
'sunny': /community_plugin/lovelace-animated-background/background-animations/sunny.html
'partlycloudy': /community_plugin/lovelace-animated-background/background-animations/cloudy.html
'cloudy': /community_plugin/lovelace-animated-background/background-animations/cloudy.html
'mostlycloudy': /community_plugin/lovelace-animated-background/background-animations/mostlycloudy.html
'clear-night': /community_plugin/lovelace-animated-background/background-animations/night.html
'fog': /community_plugin/lovelace-animated-background/background-animations/fog.html
views:
- path: gaming
config:
default_url: /community_plugin/lovelace-animated-background/background-animations/sunny.html
entity: "light.game_room"
state_url:
'on': /community_plugin/lovelace-animated-background/background-animations/sunny.html
'off': /community_plugin/lovelace-animated-background/background-animations/night.html

@Villhellm
Copy link
Owner

That is not valid YAML. Please post your configs in code blocks with proper formatting. Also if you have the lines

included_users:
  - Villhellm

the config shouldn't work unless the home assistant user you are logged in as is Villhellm.

@Fredfishface
Copy link
Author

Leaving in Villhellm would have been a total doofus move :-).
Home Assistant 0.108.6
Frontend version: 20200407.2 - latest

Doesn't work (no backgrounds for any paths):

animated_background:
views:
- path: alarm
config:
default_url: /community_plugin/lovelace-animated-background/background-animations/fog.html

Works (all path backgrounds are sunny):

animated_background:
default_url: /community_plugin/lovelace-animated-background/background-animations/sunny.html

Doesn't Work (all backgrounds are sunny, view path is also sunny - not fog - can be any existing path):

animated_background:
default_url: /community_plugin/lovelace-animated-background/background-animations/sunny.html
views:
- path: alarm
config:
default_url: /community_plugin/lovelace-animated-background/background-animations/fog.html

@Fredfishface
Copy link
Author

When I submit, the yaml collapses. All of it is correctly formatted. If there is a trick to entering it here, please let me know.

@Villhellm
Copy link
Owner

You need to put code in code blocks. Surround the yaml with ``` on the line above and bellow
Ex:
```
animated_config:
default_url: /test
```
becomes

animated_config:
  default_url: /test

@Villhellm
Copy link
Owner

0.108.6 is not the latest, by the way. Remember it is important to always give actual version numbers as "latest" changes regularly.

@Fredfishface
Copy link
Author

Thank you.

Home Assistant 0.109.2
Frontend version: 20200427.1 - latest

Does not work:

animated_background:
views:
- path: alarm
config:
default_url: /community_plugin/lovelace-animated-background/background-animations/fog.html

Does Work:

animated_background:
default_url: /community_plugin/lovelace-animated-background/background-animations/sunny.html

Does not Work:

animated_background:
default_url: /community_plugin/lovelace-animated-background/background-animations/sunny.html
views:
- path: alarm
config:
default_url: /community_plugin/lovelace-animated-background/background-animations/fog.html

@Fredfishface
Copy link
Author

I placed the yaml within ```. I'll find another background solution.

@Villhellm
Copy link
Owner

This is not me being pedantic, spaces are critical in yaml. If I can't see an accurate config I can't accurately tell you what's wrong.

Are you seeing any errors in the browser console?

@Fredfishface
Copy link
Author

I didn't believe you were.

No, the console log shows that the default animated background is loaded (which it is).

@Villhellm
Copy link
Owner

The only other thing I could think to check without more information is make sure that your path is an exact match.

@Fredfishface
Copy link
Author

kk. I'll put some debug lines in the js and see where I end up. Thanks.

@Villhellm
Copy link
Owner

You can also set breakpoints in Chrome and follow it through each step

@Villhellm
Copy link
Owner

When I test your two "Does not work" configs and properly format the yaml it works on my machine. Be sure to update the plugin as well, I fixed a bug recently that may have been affecting one of those configs.

@Fredfishface
Copy link
Author

Fredfishface commented May 1, 2020 via email

@Villhellm
Copy link
Owner

Can you try to post your config one more time? Maybe a screenshot if you can't get the formatting to work?

@Fredfishface
Copy link
Author

Hi, I believe I managed to post the correctly formated yaml from the raw config editor for the dashboard in https://community.home-assistant.io/t/lovelace-animated-background-based-on-entity-state/132208/36
Apologize for the delay. Work beckoned.

@Villhellm
Copy link
Owner

Your path: line is not properly indented. It needs to be on the same level as config:

@Fredfishface
Copy link
Author

Fredfishface commented May 3, 2020

Call me doofus. I'd love to tell you that it still doesn't work but it is fixed :-). Many thanks. In addition I now know how to make custom cards.

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