My minor modifications:
I didn’t want the card header but when I set it to blank:
<ha-card header="">
the card padding was off, these changes seemed to help:
.card {
padding: 10px 25px 35px 25px;
Then there was an issue where the tooltip messed up the whole view. I deleted these under main and main div:
margin-top: -10px;
margin-top: -11px;
and then tooltip settings:
tooltips: {
mode: 'neareach',
For icon alignment I think this was all:
.attributes div {
text-align: left;
For the met.no icons I just hardcoded those initially just to see the result. You just need to find the ones you think match the description best.
this.weatherIcons = {
'clear-night': "https://api.met.no/weatherapi/weathericon/1.1/?symbol=1&is_night=1&content_type=image/svg%2Bxml",
'cloudy': "https://api.met.no/weatherapi/weathericon/1.1/?symbol=4&content_type=image/svg%2Bxml",
'fog': "https://api.met.no/weatherapi/weathericon/1.1/?symbol=14&content_type=image/svg%2Bxml",
'hail': "https://api.met.no/weatherapi/weathericon/1.1/?symbol=12&content_type=image/svg%2Bxml",
'lightning': "https://api.met.no/weatherapi/weathericon/1.1/?symbol=6&content_type=image/svg%2Bxml",
'lightning-rainy': "https://api.met.no/weatherapi/weathericon/1.1/?symbol=22&content_type=image/svg%2Bxml",
'partlycloudy': "https://api.met.no/weatherapi/weathericon/1.1/?symbol=3&content_type=image/svg%2Bxml",
'pouring': "https://api.met.no/weatherapi/weathericon/1.1/?symbol=10&content_type=image/svg%2Bxml",
'rainy': "https://api.met.no/weatherapi/weathericon/1.1/?symbol=9&content_type=image/svg%2Bxml",
'snowy': "https://api.met.no/weatherapi/weathericon/1.1/?symbol=13&content_type=image/svg%2Bxml",
'snowy-rainy': "https://api.met.no/weatherapi/weathericon/1.1/?symbol=12&content_type=image/svg%2Bxml",
'sunny': "https://api.met.no/weatherapi/weathericon/1.1/?symbol=1&content_type=image/svg%2Bxml",
'windy': 'hass:weather-windy',
'windy-variant': 'hass:weather-windy-variant'
and then change the html tag:
<img src=[[getWeatherIcon(weatherObj.state)]]>
and
<img src="[[getWeatherIcon(item.condition)]]" width=24px height=24px>
I also wanted the option for decimals in the temperature:
roundNumberD(number, decimals) {
var rounded = Number(Math.round(number+'e'+decimals)+'e-'+decimals);
return rounded;
}
roundNumber(number) {
var rounded = Math.round(number);
return rounded;
}
<div on-click="_tempAttr">[[roundNumberD(tempObj.state,1)]]<sup>[[getUnit('temperature')]]</sup></div>
</template>
<template is="dom-if" if="[[!tempObj]]">
<div on-click="_weatherAttr">[[roundNumberD(weatherObj.attributes.temperature,1)]]<sup>[[getUnit('temperature')]]</sup></div>
Finally I got the graph working with SMHI weather by overriding the time and set it to 12 in:
dateTime.push(new Date(d.datetime).setHours(12));
Probably could be nicer. I was mostly just fumbling my way through ^^