My Lovelace Plugins

Hi,

I get this error in the log:

http://192.168.1.31:8123/local/lovelace-player.js:76:47 Uncaught TypeError: Cannot read property ‘attributes’ of undefined

which refers to this:
let attr = Object.assign(hass.states[p].attributes, {
volume_level: _audio.volume,
media_content_id: _audio.src,
device_id: _getDeviceId(),
});

1 Like

Did you install floorplan_speaker?
Did you set up the media_player and restart hass afterwards?
Can you see the media_player in /dev-state?

I’ll add some more safety checks… tomorrow.

Hi again, I can confirm all three questions. Is it because I try to call it from e.g. /dev-state, just to test it (example below) ?

Then the next thing to check is if you spelled the media player entity id right in lovelace-player-config.js.

Thank you. looks amazing.

This is my code - how can I integrate using your design? Can you give an example?

    cards:
  - type: "custom:content-card-ituran"
    entity: ituran.skodakodiak

so this is my lovelace:

title: Home
resources:
  - url: /local/tracker-card.js?v=0.1.5
    type: js
  - url: /local/custom-lovelace/upcoming-media-card/upcoming-media-card.js?v=0.1.9
    type: js
  - url: /local/custom_ui/dark-sky-weather-card.js?v=1
    type: js
  - url: /local/mini-media-player.js?ver=0.8.3
    type: module
  - url: /local/column-card.js?ver=0.0.1
    type: js

but I see an error:

https://domain.duckdns.org:xxxxx/local/column-card.js?ver=0.0.1:1:1 Uncaught SyntaxError: Identifier 'ColumnCard' has already been declared

I have this down further in lovelace file:

  - title: TV & Movies 2
    icon: mdi:kodi
    panel: true
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:column-card
            cards:
              - type: custom:upcoming-media-card
                service: removed
          - type: custom:column-card
            cards:
              - type: custom:upcoming-media-card
                service: removed
          - type: custom:column-card
            cards:
              - type: entities
                title: Newsgroups
                entities:
                  - sensor.bunch removed

and in a different part I have:

  - title: TV & Movies
    icon: mdi:kodi
    panel: true
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:upcoming-media-card
            service: removed
          - type: custom:upcoming-media-card
            service: removed
          - type: entities
            title: Newsgroups
            entities:
              - sensor.removed

This one displays properly but is hideous on a mobile! (splits screen into thirds)
So I’d like to use the column card so it would collapse to one column on a mobile.

If I do this:

  - title: TV & Movies 3
    icon: mdi:kodi
    panel: true
    cards:
      - type: custom:column-card
        cards:
          - type: custom:upcoming-media-card
            service: deleted
          - type: custom:upcoming-media-card
            service: deleted
          - type: entities
            title: Newsgroups
            entities:
              - sensor.deleted

Then I get 2 columns and if I change the width of the screen down I eventually get 1 column (which is great) But I’d like 3 columns instead of the first column containing the first 2 media cards and the third containing the entity card…

I hope I am making some sense

Also the custom card tracker is picking this card up but has a weird available version:
image
the version 7221e1 matches here https://github.com/custom-cards/information/blob/master/repos.json

2 Likes

That’s the same way it would be sorted in the default layout, because upcoming-media-card reports a static height of 3 - so it’s expected behavior.

If you wish to change it, you can change line 91 in the .js file so it reads

        if (columnEntityCount[i] < 3) {

Yeah. My cards get special treatment in the tracker because @ludeeus couldn’t wait for me to start using version numbers, so they use the git hash instead - which is much more convenient for me anyway.

You could either change ?ver=0.0.1 to ?ver=7221e1 in your resources section, or just run the updater and it should fix itself.

1 Like

in the custom_updater: section do we need to put addresses of each card?

No idea. I don’t use it myself. Ask @ludeeus (sorry for spamming you with mentions).

Sure, I hope you both sort this out. You are the God of Lovelace custom-cards, so many and so useful, but it helps users a lot an instrument like custom_updater, to keep so many custom card/components updated in an easy way

I tried to update but it wouldn’t update.

I assume if I change the column as you expect I will need to change the version number in the Lovelace file as well?

I mean you change this:

title: Home
resources:
  - url: /local/tracker-card.js?v=0.1.5
    type: js
  - url: /local/custom-lovelace/upcoming-media-card/upcoming-media-card.js?v=0.1.9
    type: js
  - url: /local/custom_ui/dark-sky-weather-card.js?v=1
    type: js
  - url: /local/mini-media-player.js?ver=0.8.3
    type: module
  - url: /local/column-card.js?ver=0.0.1
    type: js

To this:

title: Home
resources:
  - url: /local/tracker-card.js?v=0.1.5
    type: js
  - url: /local/custom-lovelace/upcoming-media-card/upcoming-media-card.js?v=0.1.9
    type: js
  - url: /local/custom_ui/dark-sky-weather-card.js?v=1
    type: js
  - url: /local/mini-media-player.js?ver=0.8.3
    type: module
  - url: /local/column-card.js?ver=7221e1
    type: js

But again. I don’t use the tracker component, so I’m not sure.

Did you try it?

I have tried:

         style:
           "--paper-card-background-color": "red"
           "--paper-item-icon-color": "white"
           "color": "black"
           image: /local/lovelace/automation/homeassistant.png
           height: 240px

Unfortunately it does not work.

Yeah I got that I needed to change that. Clicking on update in the custom tracker didn’t do anything. So I edited the JS and changed the 5 to 3 as you suggested and I edited the version in Lovelace yaml.

It is working fine now on my iPad - only showing 2 columns. I will know for sure tomorrow when I log in again on my PC.

Thanks for your help!

Just see now in chrome on my iPad it’s 3 columns, in the iOS app it’s 2 columns. On my phone both are 1 column.

Excellent! So much better than the way the panel was showing it. Thanks for this addon.

For @thomasloven 's cards, you do not need to do that.
I will not hijack this awesome thread, if there is a issue/question with the custom_updater, please open an issue at github for it.