GithubHelp home page GithubHelp logo

Comments (13)

aukedejong avatar aukedejong commented on May 30, 2024

I'm not sure. It uses a method that gets the history from HA, through a websocket connection.
Just checked, the history panel in HA uses an other method, not the same as the card. Maybe I should change the card to use the same method.
I'll have a look and keep the ticket updated.

from lovelace-windrose-card.

DirkMu avatar DirkMu commented on May 30, 2024

Great to hear. I wonder if it might be beneficial if you use the statistics websocket instead. It might not be that accurate but will be faster.

from lovelace-windrose-card.

aukedejong avatar aukedejong commented on May 30, 2024

How did you exclude these entities? Excluding only from the logbook should keep the card working.

I tried getting the card working with the same method the history panel is using, but couldn't get it to work, so I will keep it as it is, for now.

About the statistics data. I think this card works best if you put in the raw sensor data.
Do you have a performance problem? I'm running on a Pi4 without a performance issues.
If you want this, please open an feature request. (other issue)

from lovelace-windrose-card.

DirkMu avatar DirkMu commented on May 30, 2024

I checked today again. Yesterday the card was empty today the values are shown. Is it possible that it takes time selecting and calculating the values? Maybe this is due to performance? My instance is running as a container on a Synology NAS with a designated MariaDB (another container). My Nas should not have any performance issues, I guess but my DB is pretty big 30.000.000 entries and 6.4 GB.

From my perspective using the 5 minute statistics would fit the requirement of the card best, since the card is intended to show wind speed and direction of a time period. Considering each and every state would not improve the accuracy, I would assume. However, I don't insist to have statistics. I just thought it might be a good improvement as the number of values you need to select can be reduced by a huge factor. For instance, if wind speed changes often my KNX wind speed sensor will provide values almost every second. That can end up with approx. 86.400 state entries in the state table for a time period of 24h. Similar for wind direction. In contrast the 5 minute statistics will provide 288 entries with a mean, max and min value for the same period. However, as I said, it was just an idea.

from lovelace-windrose-card.

aukedejong avatar aukedejong commented on May 30, 2024

I will have a look. I'm curious what the visible difference will be. Maybe very little to none, then this is a good option.

from lovelace-windrose-card.

EarlTommel avatar EarlTommel commented on May 30, 2024

Hi @aukedejong,
great lovelace-card .. and great work - thanks for that.

I am facing also an issue which results into a blank card.
Base for me are the DWD (German Weather Service) data from my location.
The wind direction is used as well as the speed and gusts data.
My configuration of the lovelace card looks like this:

type: custom:windrose-card
title: Wind direction
hours_to_show: 1
max_width: 400
refresh_interval: 300
windspeed_bar_location: bottom
windspeed_bar_full: true
wind_direction_entity: sensor.wind_direction_[my_location]
windspeed_entities:

  • entity: sensor.wind_speed__[my_location]
    name: "wind speed"
  • entity: sensor.wind_gusts__[my_location]
    name: "gusts"
    wind_direction_unit: letters
    input_speed_unit: kph
    output_speed_unit: kph
    direction_compensation: 0
    windrose_draw_north_offset: 0
    cardinal_direction_letters: NOSW
    matching_strategy: direction-first
    direction_speed_time_diff: 1

I changed the wind_direction_unit from degrees to letters. If I use degrees, then the graph is illustrated without number (infinity). DWD provides the data (direction) in units of NESW (East = Ost), therefore I changed the cardinal_direction_letters to NOSW.

Any hints why my card is blank?
Thanks in advance..

from lovelace-windrose-card.

aukedejong avatar aukedejong commented on May 30, 2024

Hi Earl,
The cardinal_direction_letters configuration is only for display on the card. It not used for the sensor interpretation.
But maybe it should. All direction combination are done with these 4 letters. I'll think about this.

If I understand you correctly, the direction sensor uses the states N, O, S, W and the combinations.
The card only works with the english direction letter combinations. Perhaps that is the reason for the blank card.
If so, you could create an template sensor to translate these values to degrees.

If you press F12 in de browser an panel appears, which has an console tab. Do you see any error on that tab?

I need to think about better error feedback.

Ow, next time, please open an new issue.

from lovelace-windrose-card.

aukedejong avatar aukedejong commented on May 30, 2024

Just had a look at the docs of the DWD integration. It refreshes every 15 minutes. You configuration shows 1 hour. Maybe increasing the hours_to_show config also helps.

from lovelace-windrose-card.

EarlTommel avatar EarlTommel commented on May 30, 2024

thanks for the quick response.. and sorry for bringing my topic in here . .next time I will create a new issue.
The impact on changing hours_to_show from 1 to 4 (default) was not helping.
The error on the console tab looks like this:

No matching speed found for direction W at timestamp 1684695631.489105

In case I change the hours_to_show to any other value, the following message comes:

No matching speed found for direction W at timestamp 1684695631.489105
windrose-card.js?hacstag=5912706960110:976 Uncaught (in promise) Error: Could not convert direction NO to degrees.
at WindRoseCalculator.addDataPoint (windrose-card.js?hacstag=5912706960110:976:23)
at windrose-card.js?hacstag=5912706960110:1468:41
addDataPoint @ windrose-card.js

And the data from DWD come in an array with values per hour for the next 24 hours.
The interration I use for DWD is located here: https://github.com/FL550/dwd_weather

from lovelace-windrose-card.

olivierouellet avatar olivierouellet commented on May 30, 2024

Hi Earl,
I think the main problem here is that your sensor is not using the English letters for the cardinal directions.
You should create a new sensor to do the translation and use this sensor instead.

In the configuration.yaml, under

template:
  - sensor:

Put something like this and replace sensor.wind_direction with your sensor from DWD (make sure you replace on the 3rd and 5th line) :

      - name: wind_direction_english
        state: >
          {% if has_value("sensor.wind_direction") %}
            {% set foreign_to_english = { 'N':'N','NNO':'NNE','NO':'NE','ONO':'ENE','O':'E','OSO':'ESE','SO':'SE','SSO':'SSE','S':'S','SSW':'SSW','SW':'SW','WSW':'WSW','W':'W','WNW':'WNW','NW':'NW','NNW':'NNW' } %}
            {% set wind_sensor = states('sensor.wind_direction') %}
            {{ foreign_to_english[ wind_sensor ] }}
          {% else %}  {% endif %}

You'll need to restart Home Assistant after creating the new sensor. It won't convert old data, so you'll need to wait at least the value you put in hours_to_show to get a working card. Also make sure you update to the newest card version (at least 1.0.2).

from lovelace-windrose-card.

aukedejong avatar aukedejong commented on May 30, 2024

Hi Earl and Olivier,
I tried it with the DWD integration last week and it works here.
When setting up the integration you can choose cardinal directions letters or degrees as the direction state.

When choosing the degrees option, it works without custom made sensors.
Olivier option is also working.

I'm thinking about an config option to adjust the letters used for the cardinal directions.

from lovelace-windrose-card.

EarlTommel avatar EarlTommel commented on May 30, 2024

Hi @olivierouellet & @aukedejong,
thanks a lo for the proposes solutions. Actually I got it running with the additional sensor mapping as stated by @olivierouellet.
Cheers,

from lovelace-windrose-card.

aukedejong avatar aukedejong commented on May 30, 2024

Thanks for letting us know. I'll close this issue.

from lovelace-windrose-card.

Related Issues (20)

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.