Villhellm / lovelace-animated-background

Animated backgrounds for lovelace
195 stars 61 forks source link

Config not found and no animated background loaded #23

Closed SeLLeRoNe closed 4 years ago

SeLLeRoNe commented 4 years ago

Your Animated Background configuration

---
# This is actually just a bootstrap for my Lovelace configuration.
# It loads all resources for Lovelace dynamically from subfolders
# inside the `lovelace/resources` directory.
#
# Views are actually include one by one, this to guarentee the order of
# the tabs of the view in the UI.
#
title: Home Control Panel
preload_cards:
  - hui-element
  - markdown
  - conditional
preload_rows:
  - divider
custom_header:
  compact_mode: true
  footer_mode: false
  hide_header: false
  header_text: '{{ time }}' # See templates section for more on this.
  hide_config: true
  hide_raw: true
  hide_unused: true
  hide_help: true
#  button_icons:
#    menu: mdi:skull
#    voice: mdi:home
#    options: mdi:death-star-variant
#  hide_tabs:
#    - 5 to 9
#    - 0
#    - home
#  tab_icons:
#    0: mdi:skull
#    home: mdi:home
#    7: mdi:death-star-variant
  exceptions:
    - conditions:
        user: sonia
      config:
         hide_tabs:
           - 9 to 20
#        menu_dropdown: true
#    - conditions:
#        user: maykar, Bram Kragten, Ludeeus
#        user_agent: Mobile
#        media_query: "(max-width: 600px)"
#      config:
#        footer_mode: true
#        reverse_button_direction: true
#        reverse_tab_direction: true
#    - conditions:
#        query_string: kiosk
#      config:
#        kiosk_mode: true
  # Add the below to theme the header
  background: var(--app-header-background-color)
  elements_color: var(--app-header-text-color)
  active_tab_color: var(--state-icon-active-color)
  tab_indicator_color: var(--state-icon-active-color)
animated_background: !include lovelace/animated_backgrounds/default.yaml
decluttering_templates: !include_dir_merge_named lovelace/templates/
views:
  - !include lovelace/views/house.yaml
  - !include lovelace/views/living_room.yaml
  - !include lovelace/views/kitchen.yaml
  - !include lovelace/views/studio.yaml
  - !include lovelace/views/master_bedroom.yaml
  - !include lovelace/views/bedroom_luca.yaml
  - !include lovelace/views/bathroom.yaml
  - !include lovelace/views/laundry_room.yaml
  - !include lovelace/views/patio.yaml
  - !include lovelace/views/health.yaml
  - !include lovelace/views/weather.yaml

default.yaml

---
debug: true
included_devices:
  - windows
groups:
  - name: weather
    config:
      entity: "weather.dark_sky"
      state_url:
        'sunny': /local/animated_backgrounds/sunny.html
        'partlycloudy': /local/animated_backgrounds/cloudy.html
        'cloudy': /local/animated_backgrounds/cloudy.html
        'mostlycloudy': /local/animated_backgrounds/mostlycloudy.html
        'rainy': /local/animated_backgrounds/rainy.html
        'clear-night': /local/animated_backgrounds/night.html
        'fog': /local/animated_backgrounds/fog.html

Version of Home Assistant "Latest" is not a version number. Please provide the actual version number. 0.109.3

Describe the bug A clear and concise description of what the bug is. Animated background not loaded despite the config (somehow work on another dashboard, see other ticket)

Browser console log Post anything related to animated-background.js

Animated Background: Starting
animated-background.js:35 Animated Background DEBUG: Debug mode enabled
animated-background.js:37 {auth: u, connection: l, connected: true, states: {…}, config: {…}, …}
animated-background.js:35 Animated Background DEBUG: Not loaded, this is the currently found configuration

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen. Animated background to load :)

Desktop (please complete the following information):

Smartphone (please complete the following information):

Screenshots If applicable, add screenshots to help explain your problem. image

Additional context Add any other context about the problem here.

Villhellm commented 4 years ago

Can you also post the view configurations that you're having trouble with?

SeLLeRoNe commented 4 years ago

Do you need the entire thing or just the first few lines?

Villhellm commented 4 years ago

Just the first few lines as long as it includes any animated_background: configuration

SeLLeRoNe commented 4 years ago
title: Home
icon: mdi:home
panel: true
animated_background: weather
cards:
  - type: custom:layout-card
    layout: vertical
    cards:
      - type: custom:stack-in-card
        mode: vertical
        cards:
          - type: custom:decluttering-card
            template: title
            variables:
Villhellm commented 4 years ago

There should be a debug message right after Animated Background DEBUG: Not loaded, this is the currently found configuration that contains the group

Villhellm commented 4 years ago

Actually I was able to recreate it, it's not printing the other debug message

Villhellm commented 4 years ago

I added some debug messages so we know why the enabled() function returns false. Give it a try

SeLLeRoNe commented 4 years ago

So, now I see this:

Animated Background: Starting
animated-background.js:39 Animated Background DEBUG: Debug mode enabled
animated-background.js:39 Animated Background DEBUG: Debug mode enabled
animated-background.js:39 Animated Background DEBUG: Not loaded, this is the currently found configuration
utils.ts:2  BATTERY-STATE-CARD  1.2.0
hui-element.js:1 HUI-ELEMENT 1.0.0 IS INSTALLED 
3animated-background.js:39 Animated Background DEBUG: Debug mode enabled
2animated-background.js:39 Animated Background DEBUG: View switched, no configuration found

And a few lines down the console I got this again:

animated-background.js:39 Animated Background DEBUG: View switched, no configuration found
animated-background.js:39 Animated Background DEBUG: Debug mode enabled

Animated Background DEBUG: View switched, no configuration found

Animated Background DEBUG: Debug mode enabled

image image

Villhellm commented 4 years ago

I wonder why you're getting spammed with the debug mode message... it's only supposed to display on load or on dashboard switch. I'm thinking the culprit might be another plugin doing something

Villhellm commented 4 years ago

Which would explain why it works on one dashboard and not the other

SeLLeRoNe commented 4 years ago

That's odd, this view has been like this for a few months and before the "group" introduction (and the animated_background entry= it was actually working fine.

Oddly enough, if I add the default_url it works, meaning that it fall back to that, so it's not able to "read" the group for some reason it seems to me

Villhellm commented 4 years ago

Hmm. I'll add some debug messages for you specifically. Maybe something is happening with the lovelace object when it tries to find the animated_background entry in a view

Villhellm commented 4 years ago

Alright with the latest commit you'll see a message that says "Current loaded Lovelace config" followed by the lovelace object. Expand it so you can see config>views>and the first view then take a screenshot

SeLLeRoNe commented 4 years ago

image

SeLLeRoNe commented 4 years ago

Just a note, somehow it's going forever: image

Villhellm commented 4 years ago

Sorry, I meant the views on the lovelace object, not animated_background. I want to see if the views are fully loaded or not

Villhellm commented 4 years ago

If you use default_url do those messages repeat like that? Both of those things should only show up when something is being added to the lovelace panel, but that's not supposed to happen unless you change dashboards

SeLLeRoNe commented 4 years ago

Mmh, I think I lost you here, I have only that... image

SeLLeRoNe commented 4 years ago

I'll try to see with default_url

Villhellm commented 4 years ago

Yeah that's the info I needed, thanks

Villhellm commented 4 years ago

Oh jeez, I think I see the issue. It's due to no path: being defined, the groups statement was nested in a statement that required path to exist. I'll fix it

SeLLeRoNe commented 4 years ago

You know I thought about that? xD Stupid me not having that menthinooed.. I thought it was a stupid observation

SeLLeRoNe commented 4 years ago

Having the defaul_url still produces multiple lines, but way less (before were way more) image

Villhellm commented 4 years ago

To be fair it was a stupid mistake on my part. Still not sure why the messages are being spammed, but that's why it wasn't loading at all. I fixed the statement issue, but I still don't think it will fully work if the panel is constantly changing for some reason.

Give it a try though if you don't mind

SeLLeRoNe commented 4 years ago

Don't mind at all :) Give me 2 mins

SeLLeRoNe commented 4 years ago

It works, but now the "change view" issue seems to be back

SeLLeRoNe commented 4 years ago

Actually, even stranger. Now also on update with cache clenup load the animated background from a view without it

SeLLeRoNe commented 4 years ago

Console-wise, the amount of entries has decreased, but still multiples are fired image

Villhellm commented 4 years ago

We're gettin close! I didn't realize that up until now path: was a requirement. It's how I've been getting the current view configuration, but I'm working on a fix to make it optional

Villhellm commented 4 years ago

Potential fix just uploaded. I'm sure you're getting pretty burnt out on testing today. I know I am 😉

SeLLeRoNe commented 4 years ago

I actually went to sleep because I thought you did the same :D

Testing it now

SeLLeRoNe commented 4 years ago

PS. I don't mind testing, I do have to test many stuff in my job already, so I am quite used to it :D

SeLLeRoNe commented 4 years ago

Everything seems to be working fine! :)

SeLLeRoNe commented 4 years ago

Thanks a lot for your time. I am sorry I had to make you work that much :/

Villhellm commented 4 years ago

Oh no, I don’t mind at all! I’m just happy we’re getting to a more stable point. I am very thankful for the help

SeLLeRoNe commented 4 years ago

No worries at all, if you need just ping me on Discord. Very happy to help on things I know how to do :D