Lovelace Windrose Card

Not quite working.

In the card edit view the background is visible but after saving it disappears. Also the title is not getting the font or padding applied:

Card edit preview:

Saved card:

How title font appears for other cards:

Screenshot 2023-02-01 at 09-37-50 Administration – Home Assistant

@tom_l did you already try to clear browser the browser cache? And refresh the dashboard with the 3 dots button in the top right corner?

This worked for Loroenzo, who had a similar problem with background colours.
If this doesn’t fix it, can you open an issue in GitHub?
https://github.com/aukedejong/lovelace-windrose-card/issues

@tom_l Something else I noticed. Looks like your windspeed sensor use knots. Currently this card only works correctly with m/s. I’m working on a version where the input and output unit can be configured.

1 Like

Yeah just testing it that way knowing the scale values are wrong.

Yep cleared cache, repeatedly, even tried in a private tab to make sure.

Just to double check, did you refreshed the dashboard with the 3 dots button in the top right corner within HA?

I looked at the code, but can’t find a reason why it shouldn’t work.
If you’re completely sure, then I have to try is with card_mod myself, I think.

There is no refresh option unless you are using YAML mode. I am not.

I think I found the problem. The card has the header in a shadow DOM. With card_mod you have to do specials stuff to get css working inside a shadow DOM.
Not all default cards in HA seam to work the same way. For example, the entities card doesn’t have the h1 header in a shadow DOM, in the history graph it is in a shadow DOM.

Can you check if your styling works with the history graph?

Finally had some time to reproduce the issue. Ignore my last post, it’s something else, but still no idea what.
For some reason the class is not applied to the ha-card element. It works for other custom cards. I compared code but did not find the issue.

I need help. Could somebody review my code?

1 Like

Release version 0.3.0
Added support for multiple input and output windspeed units.
Example:

See the readme for added configuration options.

Bugs, please create an issue in GitHub.

Thx, looks really great love this addon!

Edit:
After the installation of the latest version the Windrose won’t display anymore. I have cleared the cache in Chrome and also tried it in Safari with the same result.

Any idea what’s going wrong?

This is my yaml:

type: custom:windrose-card
title: laatste 4 uur
hours_to_show: 4
input_speed_unit: mps
output_speed_unit: bft
windspeed_bar_location: right
cardinal_direction_letters: NOZW
wind_direction_entity: sensor.dv_windrichting_graden
windspeed_entities:
  - entity: sensor.dv_windstoot_ms
    name: windstoot
  - entity: sensor.dv_windsnelheid_ms
    name: windsnelheid

Edit2:
The next day it just works again :grin:

Hi Mediacj, strange. If this happens again, maybe the browsers console log shows an error pointing to to the cause.

Released 0.3.1
Made it more robust, when a speed entity state is not a number, ignore it and don’t crash but log an error in the console log.

1 Like

I don’t seem to be able to update to this version. Anyone else having trouble?

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/hacs/repositories/base.py:630
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 05:40:17 (4 occurrences)
Last logged: 10:19:21

[140339878044112] Error handling message: Unknown error (unknown_error) from 127.0.0.1 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Home Assistant/2022.10.1 (io.robbie.HomeAssistant; build:2022.424; iPadOS 15.7.1) Mobile/HomeAssistant, like Safari)
[140340249973120] Error handling message: Unknown error (unknown_error) from 127.0.0.1 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Home Assistant/2022.10.1 (io.robbie.HomeAssistant; build:2022.424; iPadOS 15.7.1) Mobile/HomeAssistant, like Safari)
[140340209957904] Error handling message: Unknown error (unknown_error) from 127.0.0.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/config/custom_components/hacs/websocket/repository.py", line 216, in hacs_repository_download
    await repository.async_install()
  File "/config/custom_components/hacs/repositories/base.py", line 886, in async_install
    await self.async_install_repository()
  File "/config/custom_components/hacs/repositories/base.py", line 969, in async_install_repository
    await self.download_content()
  File "/config/custom_components/hacs/repositories/base.py", line 630, in download_content
    raise HacsException("No content to download")
custom_components.hacs.exceptions.HacsException: No content to download

Forgot to add the JS file to the release in Github. Sorry.
Reinstall in HACS should work now.

1 Like

I’ve tried v0.3.1 and got empty graph :confused:
I can see “No matching speed found for direction XXXX at timestamp YYYYY” in Developer Console on chrome:

My weather station is esphome based. Sensor values are reported at different intervals.

Hi Rufiik,
How the current version works. It gets al measurements for the given period. For every direction measurement it searches for a speed measurement at the same time or 1 second earlier or later.

I’m planning to make that 1 second configurable.
Do you think we can solve this in your case if we increase it to 5 seconds for example?
At what intervals do your sensors update?

Release v0.4.0
Added a configuration option to config the allowed time difference between a direction and speed measurement. Default is 1 second.

1 Like

@tom_l About the theming problem with card_mod. I openen an issue at https://github.com/thomasloven/lovelace-card-mod/issues/252 asking for help.

Well, the case is that my sensors have very different reporting intervals. Wind speed is 10 min (wind gusts, max from last 10min) and wind dir is 2 min. So they are totally different.
It looks like I have to sync them in order to use your card…

That’s right.
A windrose chart shows what speeds came from which direction. So when the card gets a speeds it needs to know at what direction it was measured.
You can try to set the direction_speed_time_diff property to 600 (10 min.), maybe it works.

Maybe I can make the matching logic smarter and make it work with your sensors. I need to think about this.

Yes, I fully understand it. Putting sensors in sync is the best way to make windrose working (at least with few seconds diff). It’s simple and it works, so no need to complicate it :grin:

I think there is one more “type” of windrose, only showing wind direction. Something like histogram chart but using windrose. It shows from which dir the wind v blows the most. Maybe you could implement it as well? :grin: