vasqued2 / ha-teamtracker-card

A Home Assistant frontend custom card that will display real-time updates for teams tracked with the ha-teamtracker integration. Has custom in-game layouts for football, baseball, basketball, hockey, soccer, golf, tennis, racing, and mma.
GNU General Public License v3.0
75 stars 16 forks source link

iPad App - Card rendering issue after updates to HA 2024.8.0 #95

Closed PRProd closed 1 month ago

PRProd commented 1 month ago

Greetings once again!

Just a heads up, Here are some screenshots of a new card rendering bug that is also affecting my HA-Firemote too. I wanted you to be aware of it, and have a reference to the issue that was opened with the iPad app folks https://github.com/home-assistant/iOS/issues/2908

Rendering of the Teamtracker card on the iPadOS app using HA 2024.8.0 image


Rendering of the same Teamtracker card everywhere else using HA 2024.8.0 image

vasqued2 commented 1 month ago

Thanks. Looks like multiple custom cards are impacted I’ll dig into it and keep an eye on what the others are doing as well.

Haven’t upgraded yet due to reports of long/failed upgrades with 8.0 so I’ll jump in and see what I can find.

vasqued2 commented 1 month ago

This is definitely the issue introduced in HA 2024.8.0 impacting some other custom cards in the Apple app as well. Waiting for direction from the HA team on if I need to make a change or if they will fix it on their side in an upcoming release.

PRProd commented 1 month ago

Thanks. I'm sincerely hoping that the answer doesn't come back as "don't use variables in your css" because that would be upsetting.

vasqued2 commented 1 month ago

@PRProd, it looks like we should have a reasonable chance of fixing it w/o a fix on the HA side. I use variables to render the IN, PRE, and POST cards. I've confirmed the IN and PRE cards work so there is something unique about the POST card. I won't have time to dig to see what is different until this evening or tomorrow. If you look for differences, it might give you a clue as to what to change in your card.

The files to look at would be render_in.js, render_pre.js, and render_post.js and see what's different w/ the POST file.

Ignore this. The cards appear to randomly work or not work. Going to take a lot more digging to figure out what is going on.

vasqued2 commented 1 month ago

This is not team or league related.

This broke in HA 2024.8,0 for specific devices. The most common devices impacted are iPads, but experiments with changing the user-agent in Chrome to other devices indicates it could impact others, although I don't have them to confirm. It impacts other cards besides Team Tracker and has been reported to the HA dev team. It was not fixed in the 2024.8.1 release.

It always impacts the first Team Tracker card on a refreshed dashboard tab. It also impacts all other cards on that that or other tabs with the same state. Cards with a state different than the first card render correctly.

This leads to a bizarre workaround that isn't pretty but it works. If the first Team Tracker card on a tab generates an error, all the regular cards will work.

The easiest way to do this is to create a new Team Tracker card on a tab but do not specify an entity. Place this card first on your tab. This will create an error card and all the other card types should display correctly.

Please post device and version information when reporting this problem, otherwise I will assume it is all related and not research your specific issue.

At this point, I am waiting on information from the HA dev team.

vasqued2 commented 1 month ago

Here is a workaround that works for me and I am curious if it works for others. If it consistently works, I expect it will help the HA devs find the root cause.

  1. Create a new Team Tracker card on the same dashboard tab that your other Team Tracker card/cards are on. If they are on multiple dashboard tabs, you must repeat this for each one. The new card should contain a single line of YAML type: custom:teamtracker-card

  2. This should create a text visual for the card that simply says "Unknown entity:"

  3. Move this new card so it is the first one on the dashboard.

  4. Refresh the dashboard on the device having problems so the "Unknown entity:" card displays as the first card.

  5. All the other cards should magically render correctly once refreshed.

  6. OPTIONAL: Once you have confirmed this corrected the problem, if you have card-mod installed, you can change the YAML of the first card to hide the card with "Unknown entity:" As long as this card is first on the dashboard tab, the other cards should render correctly even if nothing is displayed.

    type: custom:teamtracker-card
    card_mod:
    style: |
    ha-card {
     display: none;
    }

Let me know if this works for others or not. If it does not, please provide specifics on the version of HA you are using and what combo of device/brower/app you are having the problem on.

ChipChildress commented 1 month ago

I just had time to try this. It worked. I will install card-mod so I can turn off visibility.

imist commented 1 month ago

Empty card workaround fixes the issue on my iPad too.

piitaya commented 1 month ago

Some explanation about the issue here: https://github.com/mlamberts78/weather-chart-card/pull/223 Similar fix can be added to this repository to fix the issue.

vasqued2 commented 1 month ago

@piitaya Thanks. I will try to get the changes made this weekend. I'm not an HTML guy so I may have some questions after I dig in.

vasqued2 commented 1 month ago

I have release v0.14.2-beta1 to address this issue.

Please see discussion thread https://github.com/vasqued2/ha-teamtracker-card/discussions/97 for details and log any issues in that discussion thread or in this issue.

vasqued2 commented 1 month ago

This should be fixed in v0.14.2