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

Tizen browser on Samsung Family Hub show only config text #596

Closed
skydado opened this issue Nov 7, 2023 · 20 comments
Closed

Tizen browser on Samsung Family Hub show only config text #596

skydado opened this issue Nov 7, 2023 · 20 comments
Labels
bug Something isn't working

Comments

@skydado
Copy link

skydado commented Nov 7, 2023

Release with the issue: 3.0.0
Last working release: 2.1.1
Browser: Tizen on Samsung Family Hub

Description of the problem:
Since last update to 3.0.0, my dashboard shows me only the config text, not the graphical widget.
First line is: "Custom element doesn't exist: clock-weather-card."
Same dashboard works on other devices.
Tizen browser cannot be updated.

Rolled back to 2.1.1

As a note, this happened also on "clock-weather-card" when upgrading from 2.1.0 to any version > 2.1.1 (current latest is 2.1.3)
https://github.com/pkissling/clock-weather-card/issues/243

@skydado skydado added the bug Something isn't working label Nov 7, 2023
@maxwroc
Copy link
Owner

maxwroc commented Nov 7, 2023

I'm sorry to hear that. I'm not sure how we can solve this...

I assume there is an older version of the browser engine (javascript engine) and I have used somewhere some new JS construct/function. In fact it is possible that I have updated one of the dependencies and they use something new what is not supported in the old engines. It might be impossible to track it down.

If you are willing to test few bundles please let me know. I can try to build few card versions and you could test them (although you would need to update the card js file manually in your HA). Please let me know if you want to try

@maxwroc
Copy link
Owner

maxwroc commented Nov 7, 2023

Ok I think that I have found the culprit. If the below card code works for you then due to the same reason the clock-weather card stopped working

Please test: battery-state-card.zip

@maxwroc
Copy link
Owner

maxwroc commented Nov 7, 2023

I'm 99.9% sure that this is the culprit for both cards

@skydado
Copy link
Author

skydado commented Nov 7, 2023

Please test: battery-state-card.zip

Did it and it does not solve the issue. Don't know if I did the right steps because I have basic experience.

  1. upgraded again to 3.0.0
  2. replaced battery-state-card.js with your file in folder /config/www/community/battery-state-card/
  3. restarted HA (I have HASSIO)
  4. checked on Tizen: still showing the config test
  5. rolled back to 2.1.1 that works fine

Let me know if you want me to do other tests. Thanks!

@maxwroc
Copy link
Owner

maxwroc commented Nov 7, 2023

After overwriting the file can you please check on your PC/laptop what version of the card do you see in the DeveloperTools->Console

One more thing: can you please test my card on the page where you don't have clock-weather card? Cards shouldn't affect each other but I just wanted to double check.

BTW It is weird that you see the info about missing clock-weather-card but there is nothing for battery-state-card. Can you please try to use the simple/default config - basically just the card name without any additional config:

image

FYI You don't need to upgrade the version to v3 via HACS - you can just rename the existing file to save it for later (manual rollback)

@skydado
Copy link
Author

skydado commented Nov 7, 2023

After overwriting the file can you please check on your PC/laptop what version of the card do you see in the DeveloperTools->Console

Can't fine the Console. Any tip pls?

One more thing: can you please test my card on the page where you don't have clock-weather card? Cards shouldn't affect each other but I just wanted to double check.

Your card is already alone in a dedicated page.

BTW It is weird that you see the info about missing clock-weather-card but there is nothing for battery-state-card.

That's not true. I didn't attach any picture, but I see your card as the clock one.

battery-card

Can you please try to use the simple/default config - basically just the card name without any additional config:

done, see attached picture above

FYI You don't need to upgrade the version to v3 via HACS - you can just rename the existing file to save it for later (manual rollback)

With the 2.1.1 installed, I replaced original file with yours, restarted HA and it works.
With the 3.0.0 installed, I replaced original file with yours, restarted HA and it does not work.
I believe that it's not the battery-state-card.js that affect the behaviour.

@maxwroc
Copy link
Owner

maxwroc commented Nov 8, 2023

I'm not fully convinced that the files are not coming from the browser cache. So when you were testing it is possible that you were testing always the 2.X version.

Here you have two more cards which are printing the version in the card header section so it will be easy to tell whether the correct version is loaded:
dist.zip

If it is not a card JS file which is causing the issue there is just one more file which is downloaded (map file). It is an optional file which can help to debug JS in the browser - you can delete it. But I doubt that it is causing problems (no harm with deleting it)

@skydado
Copy link
Author

skydado commented Nov 9, 2023

With 2.1.1 installed:

  • replaced file with battery-state-card.211.js, renamed battery-state-card.js, restarted HA, tested: it works
  • replaced file with battery-state-card.300.js, renamed battery-state-card.js, restarted HA, tested: it works (but it seems version 2.1.1 because I still see time/date instead of "last_update" word, as it happens if I do not update card config when upgrading to 3.0.0)

Upgraded to 3.0.0:

  • replaced file with battery-state-card.211.js, renamed battery-state-card.js, restarted HA, tested: not working, can't see any version number printed on the card error shown.
  • replaced file with battery-state-card.300.js, renamed battery-state-card.js, restarted HA, tested: not working, can't see any version number printed on the card error shown.

Re-downloaded 3.0.0, removed map file, tested: not working

Re-downloaded 3.0.0, replaced map file with the 2.1.1 version map file: not working

Let me know if you want me to do some more tests.

@maxwroc
Copy link
Owner

maxwroc commented Nov 9, 2023

Looks like you are replacing the file which is not in use or browser somehow caches and uses the old one.

Both JS files which I gave you are v3 of battery state card the only difference between them is the version of the Lit package which they use.

but it seems version 2.1.1

Exactly this is what I was suspecting. With the files I gave you you should see a big header on top of the card with the text: "Lit-v2.1.1" or "Lit-v3.0.0"

When you upgrade via HACS to v3 you have the same situation - the original released file is being used all the time (not the ones from here)

You can try do it in a slightly different way - to force browser to download the correct file:

  • Upload both battery js files I gave to /config/www/test
  • Replace the "hacsfiles" url address
    image
    with the following one
    /local/test/battery-state-card.211.js
  • Later test the same way the other file (just by changing the file name in the url)

As I have mentioned both files should print the card with big header like the following
image

@maxwroc
Copy link
Owner

maxwroc commented Nov 9, 2023

If you have a lovlace configured via yaml then these resources should be in the main configuration.yaml file.

If it's configured via UI then the list is in Settings > Dashboards > Resources (to see "Resources" option you need to click on 3 dots in the top-right corner)

If you have my-ha configured then the below link should take you to the proper page in your HA
https://my.home-assistant.io/redirect/lovelace_resources/

image

@skydado
Copy link
Author

skydado commented Nov 9, 2023

Thanks, newbie here, so not sure if my lovelace is configured via yalm or not. Maybe both?
In my configuration.yaml I have:
image
and in the ui_lovelace.yaml file:
image

On the other hand, in the UI Dashboard resources I have:
image

Should I need to delete the UI row?

@skydado
Copy link
Author

skydado commented Nov 9, 2023

Ok I discovered I had a mess, so I moved the few url from ui-lovelace to ui dashboard, and removed the "include ui.lovelace" from configuration.yaml.

So, I tested both the files and yes, the LIT-2.1.1 works and it is shown in the upper part of the card.
But the 3.0.0 file does not work and shows the config text, not the graphical widget.

So it has been a long journey (sorry for that and thanks for support) but you're right ... LIT 3 is not supported by Samsung Tizen Browser.
Unfortunatly there is no update for this app available and Tizen app store is locked. Do you thing there is any chance to bypass this lock and install an updated browser?

@maxwroc
Copy link
Owner

maxwroc commented Nov 9, 2023

Unfortunatly there is no update for this app available and Tizen app store is locked. Do you thing there is any chance to bypass this lock and install an updated browser?

Sorry I have no idea whether you can take off the lock and install the apps from the outside of official store. Try to search for some solutions in the internet.

I guess Samsung is not very eager to do the software updates as their main goal is to sell the device/appliance and later they don't care that much. But maybe if the same store and apps are being installed in their TVs you will get the update eventually.

I'm thinking now what to do in this case. I don't use any new features from lit-v3 so I don't really need to update this package. But v3 comes with quite significant perf improvements...

Even if I downgrade then you will probably end up with the same (or actually more significant) problem in the nearest future - when HA team decides to update Lit on their side (you won't be able to load HA dashboards at all)

Regarding your config. As long you don't have mode: yaml in the ui-lovelace.yaml file then I think the resources listed there are ignored and UI fully controls what is being referenced on the page/dashboard
image

@maxwroc
Copy link
Owner

maxwroc commented Nov 9, 2023

Here you have a card-v3 but with lit-v2 so for now you can use this one

battery-state-card.v3.lit-v2.zip

@skydado
Copy link
Author

skydado commented Nov 10, 2023

Thank you so much for the custom version with Lit v2 and the troubleshooting effort!

@skydado
Copy link
Author

skydado commented Nov 10, 2023

Can you please address me to a few public websites that are altready using Lit v3?
Or can you please give me some tips to google for them?

@maxwroc
Copy link
Owner

maxwroc commented Nov 10, 2023

Sorry I don't know any public websites which use lit >= 3.0.0. You can maybe try to take a look here: https://www.npmjs.com/package/lit?activeTab=dependents

The problem with tracking down websites which use lit is that lit has to be bundled (AFAIK at least - I'm not sure if it can be embedded via ES6 modules) so there is no separate reference to the lit js file (to some CDN)

When you see the lit package update in the below file you may start to be worried ;)
https://github.com/home-assistant/frontend/blob/d3f6ebd1d07940cc19d2e5ff4616786ff81dd790/package.json#L123

@maxwroc
Copy link
Owner

maxwroc commented Nov 10, 2023

I have just found PR with the lit package update in HA frontend. There is some discussion there which indicates that the upgrade to v3 won't happen soon as there are breaking changes which they need to address and there are other higher priority issues to solve.

home-assistant/frontend#18209

They have sent the other PR where they have pinned the current lit version which means even the minor updates will be ignored - I guess they have done it "just in case"

Eventually upgrade to v3 will happen but you can feel safe for a while ;)

@skydado
Copy link
Author

skydado commented Nov 10, 2023

Safe for a while and thanks for checking!
... but I want to start pushing Samsung, I need some public website to show them that their browser is limited.
I'll search for them ...

@maxwroc
Copy link
Owner

maxwroc commented Nov 14, 2023

I have released version (3.0.1) with downgraded Lit package - you can do the update from HACS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants