FL550 / dwd_weather

Deutscher Wetterdienst integration for Home-Assistant
MIT License
194 stars 12 forks source link

Sensors only show "ok" #4

Closed p-rintz closed 4 years ago

p-rintz commented 4 years ago

Version of the custom_component

1.1.0

Describe the bug

The new sensors will all only show "ok" as data on my overview. Data seems to be available, but only with the timestamp as key, see the below screenshot. Is it possible to simply retrieve the daily precipitation % value for today?

image

FL550 commented 4 years ago

Hey, this is not what the sensors are for. The sensors should provide especially the data for every hour, in case someone need this.

The daily precipitation however is already included in the normal weather entity. If you need the specific value as a sensor, have a look at HAs template sensors. With a template sensor you can extract exactly the data you need as a single sensor. Hope this helps!

p-rintz commented 4 years ago

Hi, thanks for the quick reply.

I gathered that it probably was something like that.

Though I cannot see the precipitation in the normal weather entity, is there anything I need to configure for it to show? Using "precipitation" or "precipitation_probability" as secondary values in the entity do not show any values.

image

FL550 commented 4 years ago

The weather entity has more data available, you can see this at the developer settings.

Viele Grüße nach Mühlheim ;-)

p-rintz commented 4 years ago

Ah, yeah. I can see how it is now. Thanks for the help.

I'll have to look into how the templates work for now. I always put off looking into them as I didn't really need them yet.

Grüße zurück. 😄

skipper22hassio commented 4 years ago

Struggeling with the same thing. I get the weather attributes to work as sensors

sensor:
  - platform: template
    sensors:
      dwd_temperature:
        friendly_name: "DWD Temperature"
        entity_id: weather.dwd_weather_frankfurt_m
        unit_of_measurement: '°C'
        device_class: temperature
        value_template: "{{ state_attr('weather.dwd_weather_frankfurt_m', 'temperature') | d }}"

but I don't know how to process the data within an enabled sensor. Any hints?

Grüße aus dem Nordend

FL550 commented 4 years ago

Na klar 😄:

{{ state_attr('sensor.temperature_bad_homburg', 'data')[0] }}          // {'datetime': '2020-08-19T16:00:00.000Z', 'value': 26.3}
{{ state_attr('sensor.temperature_bad_homburg', 'data')[1] }}          // {'datetime': '2020-08-19T17:00:00.000Z', 'value': 25.3}
{{ state_attr('sensor.temperature_bad_homburg', 'data')[0]['value'] }} // 25.3
mrwsl commented 4 years ago

First of all thanks for the DWD implementation. I'm trying to create a illuminance sensor based on the cloud_coverage sensor. How are the data attributes updated? For calculation I would like to take the value for the current hour of course (later on interpolated data maybe). It looks like the sensor keeps some values from the past but when does it "move forward"?

FL550 commented 4 years ago

The data is updated every 6 hours. The data displayed is not an actual measurement, as I haven't found a source for this.