custom-cards / decluttering-card

🧹 Declutter your lovelace configuration with the help of this card
MIT License
384 stars 30 forks source link

decluttering-card references appear broken with Core 2023.4.0 #65

Closed Qoheleth closed 1 year ago

Qoheleth commented 1 year ago

Release with the issue: 2023.4.0 Last working release (if known): 2023.3.6 Browser and Operating System: Edge on Windows 11 also on Windows app and on Android App Description of problem: All previously working decluttering templates now display an error message like this: decluttering error Additional information: decluttering card template:

# card with automated light control
  auto-light-thing:
    card:
      type: 'custom:button-card'
      entity: '[[thing_entity]]'
      name: '[[thing_name]]'
      template: standard-button
      triggers_update: all
      aspect_ratio: '[[aspect_ratio]]'
      styles:
        grid:
          - position: relative
        custom_fields:
          lt:
            - position: absolute
            - right: 0%
            - top: 0%
            - height: 20px
            - width: 20px
      custom_fields:
        lt: |
          [[[
            var icon = "mdi:alpha-a-circle-outline";
            var color = "darkGrey";
            var status = states['[[light_entity]]'].state;
            if (status == 'on') {
              icon = "mdi:alpha-a-circle";
              color = "darkGreen";
            }
            return `<ha-icon icon="${icon}"
            style="width 18px; height: 18px; color: ${color};"></ha-icon>`
          ]]]
      hold_action:
        action: call-service
        service: homeassistant.toggle
        service_data:
          entity_id: '[[light_entity]]'
      state:
        - value: 'on'
          id: value_on
          icon: '[[thing_icon_on]]'
        - value: 'off'
          id: value_off
          icon: '[[thing_icon_off]]'

decluttering card use in ui-lovelace.yaml:

                - type: 'custom:decluttering-card'
                  template: auto-light-thing
                  variables:
                    - thing_entity: switch.grow_light_outlet
                    - thing_name: 'Grow Lt'
                    - light_entity: input_boolean.grow_light_automated
                    - thing_icon_on: 'mdi:lightbulb-on'
                    - thing_icon_off: 'mdi:lightbulb-outline'
                    - aspect_ratio: 1/1.1
miggi92 commented 1 year ago

I can confirm this issue on my instance.

kaizersoje commented 1 year ago

Same here.

ghost commented 1 year ago

I found the following fixed it for me:

kaizersoje commented 1 year ago

Clearing the cache and a hard reload fixes the problem.

Qoheleth commented 1 year ago

Tried removing cookies and re-logging in. Still the same issue.

cerebrate commented 1 year ago

Rather than deleting and reinstalling the app, Settings->Companion App->Debugging->Reset frontend cache does the necessary cache clearing no-muss, no-fuss.

kaizersoje commented 1 year ago

Rather than deleting and reinstalling the app, Settings->Companion App->Debugging->Reset frontend cache does the necessary cache clearing no-muss, no-fuss.

This is on iPhones.

For Android, go to Settings->Apps->Home Assistant->Storage and Cache->Clear Cache. (This was on a Pixel) I assume other Android phones will have similar option.

sreggy commented 1 year ago

Rather than deleting and reinstalling the app, Settings->Companion App->Debugging->Reset frontend cache does the necessary cache clearing no-muss, no-fuss.

I've tried on iPhone, clearing cache and reistalling app, but it doesn't work. I've also the same behaviour using a normal browser (i.e. Chrome).

Anyone can help ...

Regards Stefano

miggi92 commented 1 year ago

Rather than deleting and reinstalling the app, Settings->Companion App->Debugging->Reset frontend cache does the necessary cache clearing no-muss, no-fuss.

This is on iPhones.

For Android, go to Settings->Apps->Home Assistant->Storage and Cache->Clear Cache. (This was on a Pixel) I assume other Android phones will have similar option.

Thanks this worked for me.

roooodcastro commented 1 year ago

Just to add to the list of possible solutions in case someone else misses this like me, you need to update this custom card to the latest version as that contains a fix for 2023.4: https://github.com/custom-cards/decluttering-card/issues/63

eric1905 commented 1 year ago

And don't forget to change the version of the repository: /local/decluttering-card.js?v=1.0.0

sreggy commented 1 year ago

And don't forget to change the version of the repository: /local/decluttering-card.js?v=1.0.0

I've tryed downloading the last version and adding '?v=1.0.0' but it doesn't work ... the error still be present and doesn't work with 2023.4.0.

I'm using the container version.

Thanks for support Stefano