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

Units don't follow setting in HA #140

Open
etxttul opened this issue Jul 8, 2022 · 2 comments
Open

Units don't follow setting in HA #140

etxttul opened this issue Jul 8, 2022 · 2 comments

Comments

@etxttul
Copy link

etxttul commented Jul 8, 2022

Hi,

In 2022.7 the functionality to set different units in the weather integration. For example the wind speed has always been km/h. But now you can set m/s (which is what we use in Sweden). I changed my values as soon as I saw this but in the weather card it still says km/h even after I changed. Please update the card so the units displayed correspond to the setting in HA,

Thanks
Tobe

@grassroot
Copy link

While waiting for official response from the author, here's an ugly hardcode hack to get the UI to show "m/s" for wind speed:

  1. Locate your weather-card.js file (for me with Yellow it is under /root/config/www/community/weather-card)
  2. Make a backup of both weather-card.js and weather-card.js.gz

cd /root/config/www/community/weather-card
cp weather-card.js weather-card.js.bak
cp weather-card.js.gz weather-card.js.gs.bak

  1. Open weather-card.js with your favourite editor and from function renderDetails locate row saying ${this.getUnit("length")}/h and change it simply to m/s.
    After the change it should look like this:
      ...
      ${stateObj.attributes.wind_speed}<span class="unit">
       m/s
     </span>
      ...
  1. Close editor and clear your browser cache.

Enjoy of new wind speed units :-)

@superpower10
Copy link

Temperature is the same. Europe uses a point to for thousand and a comma for the decimal point. This weather-card only shows US numbers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants