GithubHelp home page GithubHelp logo

Comments (8)

aukedejong avatar aukedejong commented on May 29, 2024 1

Hi.
I fixed the readme. The examples should work now.

Sorry for the slow response.

from lovelace-windrose-card.

ildar170975 avatar ildar170975 commented on May 29, 2024

Probably you should add data_period option:

data_period:
  hours_to_show: 24

It is not marked in Docs as required (which seems to be an error):
image

from lovelace-windrose-card.

aukedejong avatar aukedejong commented on May 29, 2024

I will investigate and fix. Thanks.

from lovelace-windrose-card.

olivierouellet avatar olivierouellet commented on May 29, 2024

Hi @langestefan. If you create a new card, you'll get the default template.

Just add your wind_speed_entity and your wind_direction_entity. Make sure the values are state values, not attributes. Check that under Developer Tools -> States in Home Assistant. You'll need to create a template sensor if the ones you already have use attributes (see below).

Then make sure your direction_unit is ok (letters or degrees). Also check cardinal_direction_letters if you use letters.

type: custom:windrose-card
title: Wind direction
data_period:
  hours_to_show: 4
max_width: 400
refresh_interval: 300
windspeed_bar_location: bottom
windspeed_bar_full: true
wind_direction_entity:
  entity: 'sensor.wind_direction'
  direction_unit: degrees
  use_statistics: false
  direction_compensation: 0
windspeed_entities:
  - entity: 'sensor.wind_speed'
    name: ''
    speed_unit: auto
    use_statistics: false
output_speed_unit: mps
speed_range_beaufort: true
windrose_draw_north_offset: 0
cardinal_direction_letters: NESW
matching_strategy: direction-first
center_calm_percentage: true

You should then at least get a basic windrose.

To create a template sensor for a sensor using attributes, add the following in you configuration.yaml file.

Under

template:
  - sensor:

Add the wind speed sensor (modify it to fit your setup)

      - name: Wind Speed
        device_class: wind_speed
        state_class: measurement
        unit_of_measurement: "km/h"
        state: >
          {% if state_attr("sensor.weather_station", "wind_speed_last") != None %}
            {{ state_attr("sensor.weather_station", "wind_speed_last")|float }}
          {% else %}  {% endif %}
        availability: '{{ state_attr("sensor.weather_station", "wind_speed_last")|is_number }}'
        icon: mdi:tailwind

Then add either one of these two for the wind direction sensor :

      - name: Wind Direction
        state: >
          {% if state_attr("sensor.weather_station", "wind_dir_last") != None %}
            {{ state_attr("sensor.weather_station", "wind_dir_last") }}
          {% else %}  {% endif %}
        availability: '{{ state_attr("sensor.weather_station", "wind_dir_last")|is_number }}'
        icon: mdi:compass-rose
      - name: Wind Direction
        state: >
          {% if state_attr("sensor.weather_station", "wind_dir_last") != None %}
            {% set direction = ['N','NNE','NE','ENE','E','ESE','SE','SSE','S','SSW','SW','WSW','W','WNW','NW','NNW','N'] %}
            {% set degree = state_attr("sensor.weather_station", "wind_dir_last")|float %}
            {{ direction[((degree+11.25)/22.5)|int] }}
          {% else %}  {% endif %}
        availability: '{{ state_attr("sensor.weather_station", "wind_dir_last")|is_number }}'
        icon: mdi:compass-rose

You should also and a unique_id: to each one.

from lovelace-windrose-card.

langestefan avatar langestefan commented on May 29, 2024

Probably you should add data_period option:

data_period:
  hours_to_show: 24

It is not marked in Docs as required (which seems to be an error): image

yes correct, that was the problem. It's also not in the examples.

from lovelace-windrose-card.

langestefan avatar langestefan commented on May 29, 2024

Hi @langestefan. If you create a new card, you'll get the default template.

Yes, I know. I'm just talking about the examples in the docs specifically.

from lovelace-windrose-card.

ljmerza avatar ljmerza commented on May 29, 2024

none of this seems to be working. i keep getting Error: Unknown speed unit: auto. why isnt there a basic example config?

from lovelace-windrose-card.

ildar170975 avatar ildar170975 commented on May 29, 2024

@ljmerza
Then post a code made from an example from the Repo which is not working. Just add this as it was suggested above.

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.