GithubHelp home page GithubHelp logo

aukedejong / lovelace-windrose-card Goto Github PK

View Code? Open in Web Editor NEW
55.0 55.0 1.0 1.18 MB

Home Assistant Lovelace Windrose Card

JavaScript 0.78% TypeScript 99.22%
home-assistant home-assistant-custom lovelace lovelace-ui weather-dashboard windrose

lovelace-windrose-card's People

Contributors

aukedejong avatar natekspencer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

natekspencer

lovelace-windrose-card's Issues

Input speed kph, output mps gives blank display

I am sure I'm doing something wrong, please let me know. This is my config:

type: custom:windrose-card
hours_to_show: 4
max_width: 400
refresh_interval: 300
windspeed_bar_location: right
windspeed_bar_full: false
wind_direction_entity: sensor.ws3500_wind_direction
windspeed_entities:
  - entity: sensor.ws3500_wind_speed
    name: ''
wind_direction_unit: degrees
input_speed_unit: kph
output_speed_unit: mps
direction_compensation: 0
windrose_draw_north_offset: 0
cardinal_direction_letters: NESW
matching_strategy: direction-first
direction_speed_time_diff: 1

This gives:
image

kph / kph gives:
image

Version 0.11.0 on HA 2023.4.6

Error after update 6/9/2023

This wonderful weather tool created an error after the latest update. The rose does not appear and the error is: WindRoseCard: No wind_direction_entity.entity configured. I am using a Tempest weather sensor. I have the entity sensor.weatherflow_wind_direction in my entity list and can display it using the native Home Assistant card.

i want fix the legend range in rose plot

i want fix the range of the lengend

my code is here

from windrose import WindroseAxes
from matplotlib import pyplot as plt
import matplotlib.cm as cm
from numpy.random import random
from numpy import arange
import pandas as pd
MON=pd.read_csv(r'data.csv')
ws = MON["Ws"].values
wd = MON["Wd"].values
ax = WindroseAxes.from_ax()
ax.set_ylim(0,50)
ax.bar(wd, ws, normed=True, opening=0.8, edgecolor='white')
ax.set_title('plot2')
ax.set_legend()

the plots different legend please check the plots that i have attached
plot1
plot2

Blank card

I've updated to the newest release and replaced with the new card definition. After doing so, the card refuses to render anything other than a blank box. I've tried the webapp, mobile app, and an incognito window to rule out a cache problem. Any thoughts as what the issue could be?

There are some frontend errors in the logs after a clean restart of home assistant.

2023-06-09 16:08:04.291 ERROR (MainThread) [frontend.js.latest.202306080] :0:0 ResizeObserver loop completed with undelivered notifications.
2023-06-09 16:08:04.302 ERROR (MainThread) [frontend.js.latest.202306080] :0:0 ResizeObserver loop completed with undelivered notifications.
2023-06-09 16:08:13.620 ERROR (MainThread) [frontend.js.latest.202306080] :0:0 ResizeObserver loop completed with undelivered notifications.
2023-06-09 16:08:24.218 ERROR (MainThread) [frontend.js.latest.202306080] :0:0 ResizeObserver loop completed with undelivered notifications.
2023-06-09 16:08:26.285 ERROR (MainThread) [frontend.js.latest.202306080] :0:0 ResizeObserver loop completed with undelivered notifications.

I'm running home assistant core version 2023.6.1 with the following config for the windrose card:

type: custom:windrose-card
hours_to_show: 24
max_width: 400
refresh_interval: 300
windspeed_bar_location: bottom
windspeed_bar_full: false
wind_direction_entity:
  entity: sensor.weather_station_wind_direction_degrees
  direction_unit: degrees
  use_statistics: false
  direction_compensation: 0
windspeed_entities:
  - entity: sensor.weather_station_wind_speed
    name: 'Average windspeed'
    speed_unit: mph
    use_statistics: false
output_speed_unit: mph
speed_range_beaufort: true
speed_range_step: 5
speed_range_max: 30
windrose_draw_north_offset: 17
cardinal_direction_letters: NESW
matching_strategy: direction-first
center_calm_percentage: true

Allow changing wind speed unit

Hey, so I noticed that you implemented the beaufort scale based on the assumption that the value is in m/s

However some sensors may provide that in a different unit. It would be awesome if this was configurable.
I think these units should be supported:

  • m/s (current unit)
  • kmh (km/h)
  • mph (mi/h)
  • knots (kn)
  • ft/s

Only gettin NaN as values

Hi Auke,

I use Buienradar as base for the information, and that is working here for years already so in meteo info I see the windspeed and direction. But when I put them into the set-up from the card only NaN gets displayed no values are getting used?

[Feature request] card working with attribues

Please consider making this nice card work with attributes and not only entities like:

  wind_direction_entity: 
    - entity: weather.home
    - attribute: wind_bearing

or
entity: '{{ state_attr("weather.home", "wind_bearing") }}'

Creating new sensors from entities, for making this work, creates just more sensors to maintain....

russian translation

Can you give some strings to translate on russian? I will do.
and one thing, cant understand, mps - meter per second or mile?

[Feature request] card using a background image

This great card could be enhanced by enabling the selection of an image as a background to the windrose display. An example would be to have the windrose overlay an image of the house (plan view) at the location.
Cheers

Blank card. Error: Could not convert direction unknown to degrees

When restarting Home Assistant, my sensors have an unknown state for a short period of time.
It seems like it's not a major problem for the speed entity, but it is for the direction entity (which is in letters for me), so there's no rendering of the card until time passes and I no longer have any unknown state in the timeframe specified with hours_to_show .

Would it be possible to ignore any value that have an unknown state? I don't restart often so not a big deal for me, but it might prevent strange issues down the road. Also, should it include unavailable and None states?

This is what I get in Chrome console:
unknown

Unable to find file?

Please note I have Home Assistant Supervised, and there is no specific config/www directory, but I do have:

homeassistant/www

so, note these are the results from the command line (the wget line is cut and pasted from the instructions so that I can make sure there were no spelling mistakes:

`
pi@kruse-pi:/usr/share/hassio/homeassistant/www$
pi@kruse-pi:/usr/share/hassio/homeassistant/www$ sudo wget https://github.com/aukedejong/lovelace-windrose-card/releases/download/latest/windrose-card.js
--2023-04-24 08:34:35-- https://github.com/aukedejong/lovelace-windrose-card/releases/download/latest/windrose-card.js
Resolving github.com (github.com)... 140.82.114.4
Connecting to github.com (github.com)|140.82.114.4|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2023-04-24 08:34:35 ERROR 404: Not Found.
pi@kruse-pi:/usr/share/hassio/homeassistant/www
pi@kruse-pi:/usr/share/hassio/homeassistant/www$ wget https://github.com/aukedejong/lovelace-windrose-card/releases/download/latest/windrose-card.js
--2023-04-24 08:35:07-- https://github.com/aukedejong/lovelace-windrose-card/releases/download/latest/windrose-card.js
Resolving github.com (github.com)... 140.82.114.4
Connecting to github.com (github.com)|140.82.114.4|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2023-04-24 08:35:08 ERROR 404: Not Found.

`

Make the units less strict?

Had an idea to use this card for the lightning tracker and it kinda works using the azimuth and distance (in place of speed).

Only issue is "auto" for unit's does not work, and when forcing it the only option is km/h. Would be nice if I could use km instead. (I'm near the head of the arrow on the lightning map for reference)

image


      - type: custom:windrose-card
        title: Lightning
        data_period:
          hours_to_show: 3
        max_width: 400
        refresh_interval: 300
        windspeed_bar_location: bottom
        windspeed_bar_full: false
        wind_direction_entity:
          entity: sensor.blitzortung_lightning_azimuth
          direction_unit: degrees
          use_statistics: false
          direction_compensation: 0
        windspeed_entities:
          - entity: sensor.blitzortung_lightning_distance
            name: Distance
            speed_unit: kph
            use_statistics: false
        output_speed_unit: kph
        speed_range_beaufort: false
        windrose_draw_north_offset: 0
        cardinal_direction_letters: NESW
        matching_strategy: direction-first
        center_calm_percentage: true
        wind_direction_count: 16
        speed_range_step: 10
        speed_range_max: 100

Card blank wth DWD Gernan weather service.

Hi. I wonder if the card requires the entities to be logged to the logbook. My entities are recorded and stored in my DB. The also have a history. However, I excluded them from the logbook since my logbook is spammed by the very frequent changes of the wind speed and wind directions. Since I excluded them the card remains blank.

Windspeed bar range

It would be great to have possibility to define max value for windspeed bar. It looks like 90 km/h is hardcoded maximum with step=10. My max reading value is about 50 km/h, so half of the scale is not use at all. So setting up max to 50 would be best for me (step is 5 then).

wind rose legend

the plots have
plot1
plot2
different legend

i want fix the range of the lengend

my code is here

from windrose import WindroseAxes
from matplotlib import pyplot as plt
import matplotlib.cm as cm
from numpy.random import random
from numpy import arange
import pandas as pd
MON=pd.read_csv(r'data.csv')
ws = MON["Ws"].values
wd = MON["Wd"].values
ax = WindroseAxes.from_ax()
ax.set_ylim(0,50)
ax.bar(wd, ws, normed=True, opening=0.8, edgecolor='white')
ax.set_title('plot2')
ax.set_legend()

[FR] Console warnings: Speed unavailable at timestamp ... is not a number - can we have a "debug_messages: false" option? [overlooked "log_level" option]

Console is flooded by these warnings:

image

Here I got 140 warnings (+1 is for another card) after just pressing F5.
The card:

  - type: custom:windrose-card
    title: Wind direction
    wind_direction_entity:
      entity: sensor.home_gismeteo_wind_bearing
    windspeed_entities:
      - entity: sensor.home_gismeteo_wind_speed
        name: Home
    data_period:
      hours_to_show: 168

As far as I understand, that means that during these 168 hours there are 140 occurrences of "unavailable" value for the "speed".
I do admit that this info may be useful - but I think that we should have an option to switch these "debug messages" OFF.
I do not propose to switch off ALL messages - just messages which are not critical (like these ones).

My proposal is:

  • add a new debug_messages option (true / false) (default is true - but it could be false instead);
  • this option is to switch on/off only WARNINGS - and probably only SOME of them (less critical).

[Feature request] : add the possibility to use weather forecast entity data

This windrose representation of wind data is awesome to display data from the past.
I believe it would also be very useful to display forecast data is the same way !
For example I'd love to be able to draw data provided by an entity called "weather.{some place}" which returns the following forecast data with 1 hour resolution, starting from now, including wind_bearing & wind speed (JSON format) :

temperature: 11.4
temperature_unit: °C
humidity: 90
pressure: 1002.7
pressure_unit: hPa
wind_bearing: 130
wind_speed: 21.6
wind_speed_unit: km/h
visibility_unit: km
precipitation_unit: mm
forecast:
  - datetime: "2023-11-11T21:00:00+00:00"
    condition: rainy
    wind_bearing: 135
    temperature: 11.7
    wind_speed: 21.6
    precipitation: 3.1
    humidity: 95
  - datetime: "2023-11-11T22:00:00+00:00"
    condition: rainy
    wind_bearing: 195
    temperature: 12.5
    wind_speed: 10.8
    precipitation: 1
    humidity: 90
  - datetime: "2023-11-11T23:00:00+00:00"
    condition: rainy
    wind_bearing: 255
    temperature: 13.3
    wind_speed: 21.6
    precipitation: 1
    humidity: 85
  - datetime: "2023-11-12T00:00:00+00:00"
    condition: rainy
    wind_bearing: 270
    temperature: 14.1
    wind_speed: 39.6
    precipitation: 1
    humidity: 85
  - datetime: "2023-11-12T01:00:00+00:00"
    condition: rainy
    wind_bearing: 270
    temperature: 13.9
    wind_speed: 39.6
    precipitation: 0.1
    humidity: 80
  - datetime: "2023-11-12T02:00:00+00:00"
    condition: rainy
    wind_bearing: 270
    temperature: 13.8
    wind_speed: 36
    precipitation: 0.1
    humidity: 80
  - datetime: "2023-11-12T03:00:00+00:00"
    condition: rainy
    wind_bearing: 275
    temperature: 13.7
    wind_speed: 36
    precipitation: 0.1
    humidity: 75
[to be continued]

[Feature request] Format text color based on windspeed color

Hello!

Is it possible to format the text color based on the windspeed color? The default "light" color scheme uses a dark blue background and black text for the initial windspeed / center of rose - it is difficult to read.

If you change rose_percentages to white then they become illegable outside of the center. If you change bar_percentages then they become illegable on the lighter wind speed colors.

Card Blank

HI, I followed all steps in the manual including the error ones. I have a blank card with the default config...

What steps can I try?

[Feature request] Show Current Wind Speed and Gust Values

Perhaps display the current speed values at the bottom or left end of the Legend Bars depending on orientation, or separately. Also, adding a straight line or lines, or pointers, to the graph for current and maybe recent wind directions
Thanks

Feature Request: Set Color of Rose Lines, Percentage Displays

First off, thank you so much for your work on this. It's just freakin' awesome. :)

I'd be cool if we had the ability to set custom colors for (separately):

  • he rose lines/wind speed box
  • NESW letters
  • Wind Speed words
  • Rose percentages
  • Speed bar percentages

And if you aren't interested or don't have time, thanks anyway. What a great card.

Card not displaying

Any idea why is the card simply not displaying? Neither in edit mode nor in view mode.

Card:

`

type: custom:windrose-card
title: Wind rose
data_period:
hours_to_show: 24
max_width: 400
refresh_interval: 60
windspeed_bar_location: bottom
windspeed_bar_full: true
wind_direction_entity:
entity: sensor.gw1100a_wind_direction
direction_unit: degrees
use_statistics: true
direction_compensation: 0
windspeed_entities:

  • entity: sensor.gw1100a_wind_speed
    speed_unit: auto
    use_statistics: false
    speed_range_beaufort: true
    windrose_draw_north_offset: 0
    cardinal_direction_letters: NESW
    matching_strategy: direction-first
    center_calm_percentage: true

`

How it shows:
image

Javascript is latest, wind_direction has a unit °, speed has a unit km/h.

Correction to instructions (hope this helps)

Maybe this is copied from something a long time ago, but you canot add resource settings any more the way it is described. When I get into the raw configuration editor* and try to save the resources it does not allow me to add it. I was forced to add the resources by using this:

  1. Open any lovelace view
  2. Select from the three dot menu - "edit dashboard"
  3. The three dot menu is then replaced with another one, select the new three-dot menu (and do not select raw configuration editor*, it will tell you when you try to save it with the resource section, that for adding resources you have to use the three-dot menu choice "Manage Resources" instead). Select "Manage Resources"
    4a. Click "Add Resource",
    4b. enter this for url:
    /local/wndrose-card/js?v=0.0.1
    4c. click the check box for "Javascript Module" and
    4d. click the word "Create" in the corner to add the entry.

empty panel after HA update to 2023.6.1

After updating HA to version 2023.6.1 there is only an empty panel.
Using latest windrose card version 1.0.0.

  - type: custom:windrose-card
    windspeed_bar_full: true
    speed_range_beaufort: false
    input_speed_unit: kph
    output_speed_unit: kph
    cardinal_direction_letters: NOSW
    windspeed_entities:
      - entity: sensor.gw1100a_v2_2_3_wind_speed
        name: ''
    wind_direction_entity:
      entity: sensor.gw1100a_v2_2_3_wind_direction

Card Dynamically Keeps Growing and Growing in Size

I'm using this card within the custom:layout-card to create a weather page using a grid layout like this:

  - type: custom:layout-card
    layout_type: grid-layout
    layout:
     grid-template-columns: 3fr 3fr repeat(6, 1fr) 
     grid-column-gap: 0px
     grid-row-gap: 0px
     grid-template-rows: 30px 235px 235px 200px 200px
     grid-template-areas: |
       "   .           .        .        .       .      . temp-hist header"
       "windy       windy   graph1   graph1 graph1 summary summary summary"
       "windy       windy   graph2   graph2 graph2 summary summary summary"
       "windrose   rain2   hour1    hour2   hour3    hour4   hour5  hour6"
       "windrose   rain2   hour7    hour8   hour9   hour10  hour11 hour12"  

When I include the windrose card the view starts dynamically growing. The windrose card expands compressing the fields to the right as if ignoring the frs.

I've tried both with and without the max_width parameter and replacing the windy iframe with a markdown card. (Windy grows as well, but not until the windrose is included.) This all worked fine until I included the windrose. Note, the black areas in the screenshot are other graphs that don't render after including the windrose.

Of course, this may not be an issue with this card, but it happens when adding the card to an existing layout.
This is immediately after a View Refresh:
image
Then, a few seconds after the View Refresh:
Windrose grows only to the right (with the max_width set) which drags the iframe down and right proportionally.
image
This is the happy and stable view without including the windrose card into the lower left corner.
image

Here is the complete windrose card definition.

type: custom:windrose-card
title: Wind direction
view_layout:
  grid-row-start:       windrose
  grid-row-end:        windrose
  grid-column-start: windrose
  grid-column-end:  windrose
data_period:
  hours_to_show: 24
refresh_interval: 60
max_width: 350
windspeed_bar_full: true
windspeed_bar_location: right
wind_direction_entity:
  entity: sensor.gw2000b_wind_direction
  direction_unit: degrees
  use_statistics: false
  direction_compensation: 0
windspeed_entities:
  - entity: sensor.gw2000b_wind_speed
    name: Average
    speed_unit: auto
    use_statistics: false
  - entity: sensor.gw2000b_wind_gust
    name: Gust
    speed_unit: auto
    use_statistics: false
output_speed_unit: mph
speed_range_beaufort: false
speed_ranges:
  - from_value: 0
    color: rgb(0,255,0)
  - from_value: 1
    color: yellow
  - from_value: 5
    color: hsl(200, 100%, 60%)
  - from_value: 10
    color: orange
  - from_value: 20
    color: red
#speed_range_beaufort: true
windrose_draw_north_offset: 0
cardinal_direction_letters: NESW
matching_strategy: direction-first
center_calm_percentage: true

Slightly Off Beaufort Scale Numbers

It seems in some instances the hardcoded values for Beaufort scale conversion are slightly off. When using just m/s, these are close enough to not really matter. When converting to mph or other units, though, these are off by a multiplier and move the boundaries in an unintuitive way.

private generateBeaufortSpeedRanges(): SpeedRange[] {
const colors = new ColorUtil().getColorArray(13);
return [
new SpeedRange(0, 0, 0.3, colors[0]),
new SpeedRange(1, 0.3, 1.6, colors[1]),
new SpeedRange(2, 1.6, 3.4, colors[2]),
new SpeedRange(3, 3.4, 5.5, colors[3]),
new SpeedRange(4, 5.5, 8, colors[4]),
new SpeedRange(5, 8, 10.8, colors[5]),
new SpeedRange(6, 10.8, 13.9, colors[6]),
new SpeedRange(7, 13.9, 17.2, colors[7]),
new SpeedRange(8, 17.2, 20.8, colors[8]),
new SpeedRange(9, 20.8, 24.5, colors[9]),
new SpeedRange(10, 24.5, 28.5, colors[10]),
new SpeedRange(11, 28.5, 32.7, colors[11]),
new SpeedRange(12, 32.7, -1, colors[12])

Beaufort number Wind speed code value
0 < 0.5 m/s 0.3
1 0.5–1.5 m/s 1.6
2 1.6–3.3 m/s 3.4
3 3.4–5.5 m/s 5.5
4 5.5–7.9 m/s 8
5 8–10.7 m/s 10.8
6 10.8–13.8 m/s 13.9
7 13.9–17.1 m/s 17.2
8 17.2–20.7 m/s 20.8
9 20.8–24.4 m/s 24.5
10 24.5–28.4 m/s 28.5
11 28.5–32.6 m/s 32.7
12 ≥ 32.7 m/s N/A

Sources for Beaufort Scale Values

Card background mismatch with custom HA theme

The background of the card doesn't match the colour of the other cards when using custom home assistant themes. The issue doesn't appear when using the default theme.
This is what it looks like in my case with google theme for example.

image

`No matching speed found for direction` but data is present and accounted for

Hello!

I've got the card configured like so:

type: custom:windrose-card
title: Wind direction
hours_to_show: 0.3
max_width: 500
refresh_interval: 12
windspeed_bar_location: bottom
windspeed_bar_full: true
wind_direction_entity: sensor.wind_direction
windspeed_entities:
  - entity: sensor.average_wind
    name: Average
wind_direction_unit: degrees
input_speed_unit: mps
output_speed_unit: mph
cardinal_direction_letters: NESW
matching_strategy: direction-first
direction_speed_time_diff: 1

The console is filled up wlth messages like:

No matching speed found for direction 115 at timestamp 1677966836.649485
No matching speed found for direction 323 at timestamp 1677967652.440865
No matching speed found for direction 178 at timestamp 1677967812.34858
No matching speed found for direction 47 at timestamp 1677968036.220359

The sensors are mqtt sensors coming from rtl_433:

mqtt:
  sensor:
    - name: Average Wind
      device_class: wind_speed
      unit_of_measurement: "m/s"
      value_template: "{{ value_json.wind_avg_m_s }}"
      state_topic: rtl_433/Cotech-367959

    - name: Peak Wind
      device_class: wind_speed
      unit_of_measurement: "m/s"
      value_template: "{{ value_json.wind_max_m_s }}"
      state_topic: rtl_433/Cotech-367959

    - name: Wind Direction
      unit_of_measurement: "°"
      state_class: measurement
      value_template: "{{ value_json.wind_dir_deg }}"
      state_topic: rtl_433/Cotech-367959

The source data doesn't have any gaps in it (ie: at any given moment, the sensors are never unavailable):
Screenshot_History – Home Assistant — Mozilla Firefox_1
Screenshot_History – Home Assistant — Mozilla Firefox_2

Any clues why the data is unable to be matched to the speed? I can dig deeper or collect the raw data if that would help

[Feature request] Use vector graphics (fix Low resolution graphic)

Thanks for this useful card. I noticed the graphic has a low rendering resolution:

image

Although it's still usable it makes the text blurry and hard to read both on mobile view and on desktop. Also the card elements themselves are not sharp. Not sure if this is easy to solve, as it's probably a result of the renderer you use.

Card may not be displayed (observed in Edit mode)

1.2.1
2023.7.0
When a dashboard is in Edit mode, the windrose-card may not be displayed.
This is a very weird issue - please read it carefully.

Code for a view:

  - theme: ''
    title: test_panel_1
    path: test_panel_1
    badges: []
    cards:
      - type: vertical-stack
        cards:
          - type: history-graph
            entities:
              - sun.sun
      - type: custom:windrose-card
        title: Wind direction
        wind_direction_entity:
          entity: sensor.home_gismeteo_wind_bearing
        windspeed_entities:
          - entity: sensor.home_gismeteo_wind_speed
            name: Home
        data_period:
          hours_to_show: 24

How the view is supposed to look:

image

The windrose-card in Editor:

image


And now about the problem:

  1. Switch the current dashboard to the Edit mode.
  2. Add 2 new cards (history-graph, windrose-card - see a code above).
  3. Both cards are displayed:

image

  1. Refresh the page (F5 in Chrome) - the windrose-card is NOT displayed:

image

Pressing F5 does not help.

  1. Leave Edit mode - the windrose-card is still NOT dispalyed:

image

  1. Refresh the page - the windrose card is displayed:

image

  1. Switch to the Edit mode - the windrose-card is displayed:

image

  1. Refresh the page - - the windrose-card is NOT displayed:

image


I see same in Chrome & FF (Win10):

image

image


What I managed to see in Code Inspector (Chrome):

image


Why "history-graph"?
I realized this config as a minimal working example.
Use "history-graph" w/o "vertical-stack", or place in to the stack "entities card" instead of "history-graph" - then the "windrose-card" is displayed properly...


I do not see the issue in the iOS Companion App (iPad Air 2, iOS 15.x).

Speed unit locked to beaufort

Since quite a few releases I have noticed my speed unit in the graph is beaufort, despite configured for kph. I just checked the documentation again and was unable to find a mistake in my config.

image

This is the config in text:

type: custom:windrose-card
title: Wind direction
max_width: 400
windspeed_bar_full: true
wind_direction_entity:
  entity: sensor.gw1100a_v2_2_1_wind_direction
windspeed_entities:
  - entity: sensor.gw1100a_v2_2_1_wind_speed
    name: Average
    speed_unit: kph
input_speed_unit: kph
output_speed_unit: kph
speed_range_step: 5
speed_range_max: 50
data_period:
  hours_to_show: 168

[Feature Request] Compass North Offset

Might it be possible to add a configuration for the north heading of the compass to be offset by a number of degrees? My property isn't oriented due north and it would be very nice to understand the wind speeds relative to my frame of reference. I saw the direction_compensation value, but that seems to be more intended to correct for a wind gauge that might be installed not facing north.

Here's a quick mock of the general idea where one could set an offset of n degrees, for instance:

image psd(1)

Thanks for the great project!

1 Hour chart not updating

Version 1.2.0 with Hass 2023.6.3, Frontend 20230608.0 - latest

After updating to the data_period: with hours_to_show value of 1, the chart does not update unless there's a manual refresh of the page. Even changing the refresh_interval to a low number doesn't seem to change the chart.

Here's an example card:

- type: custom:windrose-card
  title: Last Hour
  data_period:
    hours_to_show: 1
  max_width: 400
  refresh_interval: 60
  windspeed_bar_location: bottom
  wind_direction_entity: 
    entity: sensor.home_wind_angle
  windspeed_entities:
    - entity: sensor.home_wind_speed
      name: Speed
    - entity: sensor.home_wind_gust
      name: Gusts
  wind_direction_unit: degrees
  #direction_compensation: 0
  speed_range_beaufort: false
  input_speed_unit: mph
  output_speed_unit: mph
  speed_ranges:
    - from_value: 0
      color: rgb(32,174,32)
    - from_value: 3
      color: yellow
    - from_value: 6
      color: orange
    - from_value: 8
      color: red
    - from_value: 10
      color: purple
  #cardinal_direction_letters: NESW
  card_mod:
    class: top-level-card

Provide a full, working example

Hello, can you please provide a complete, working example on how to configure this card in YAML? None of the examples in the docs currently work out of the box.

Some issues in Firefox

I am getting error in my Home Assistant while using Firefox:

Logger: frontend.js.latest.202401040
Source: components/system_log/__init__.py:300
First occurred: 21:12:57 (1 occurrences)
Last logged: 21:12:57

Uncaught error from Firefox 121.0 on Windows 10 Error: Failed to execute 'define' on 'CustomElementRegistry': the name "windrose-card" has already been used with this registry 87659/</window.CustomElementRegistry.prototype.define (src/scoped-custom-element-registry.js:44:14) e/</< (/hacsfiles/lovelace-windrose-card/windrose-card.js:54:60) e/< (/hacsfiles/lovelace-windrose-card/windrose-card.js:54:75) __decorate (/hacsfiles/lovelace-windrose-card/windrose-card.js:19:95) /hacsfiles/lovelace-windrose-card/windrose-card.js:2224:16

Not sure what is exactly the reason for this error. The card seems to be working fine despite the error.

Blank windrose when selecting 16+ hours of data

Whenever I select to show 16 or more hours, I get a blank windrose and this error shows up in my browser console:

Uncaught (in promise) TypeError: firstSpeedData[i] is undefined
    updateWindData https://home-assistant.example.com/hacsfiles/lovelace-windrose-card/windrose-card.js?hacstag=591270696010:975

Line: windrose-card.js:975:76
Version: 0.1.0 and 0.0.2 (did not try 0.0.1)

Display on top of picture card

Hi, maybe not the right place to ask here. But since I really like the concept of this card but mainly use the picture elemnts card in hass I would like to know of it is possible to "transparant" display your card on top of my existing "garden" card. Would that be possible?

Card does not show direction

I am using a sensor from my KNX wind sensor which provides wind direction in degrees. Unfortunately the card does not show the distribution of the wind direction:

image

type: custom:windrose-card
title: Wind direction
hours_to_show: 24
max_width: 400
refresh_interval: 300
windspeed_bar_location: bottom
windspeed_bar_full: true
wind_direction_entity: sensor.ws_dach_wind_richtung
windspeed_entities:
  - entity: sensor.ws_dach_wind
    name: Dach
wind_direction_unit: degrees
input_speed_unit: mps
output_speed_unit: mps
direction_compensation: 0
windrose_draw_north_offset: -32
cardinal_direction_letters: NOSW
matching_strategy: speed-first
direction_speed_time_diff: 1

[Feature request] Show first speed range instead of full circle

It would be nice to be able to see the individual directions of the first speed range instead of a full circle. Could it be added as an option?

This is an example taken on Plotly website
Plotly example

Also, it might be nice to have a option to hide the value in the middle of the graph for the first speed range (and just have the percentage in the windspeed bar).

Your card is mind blowing by the way. Thank you so much!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.