Core: Dark Sky Precipitation attributes unknown or zero

Created on 30 Dec 2016  路  69Comments  路  Source: home-assistant/core

Make sure you are running the latest version of Home Assistant before reporting an issue.
Yup - 0.35.3
You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version):
$ hass --version
0.35.3

Python release (python3 --version):
$ python3 --version
Python 3.4.2

Component/platform:
Dark Sky

Description of problem:
While some attributes of Dark Sky show up, precipitation related fields are unknown or 0 and have been since at least 16th Dec (my older history is configured to be purged).

Other fields seem to be updating.

Expected:
Anything but unknown, or 0%.

Problem-relevant configuration.yaml entries and steps to reproduce:

# Weather Prediction
sensor:
  - platform: darksky
    api_key: !secret dark_sky_api
    monitored_conditions:
      - summary
      - icon
      - nearest_storm_distance
      - nearest_storm_bearing
      - precip_type
      - precip_intensity
      - precip_probability
      - temperature
      - apparent_temperature
      - dew_point
      - wind_speed
      - wind_bearing
      - cloud_cover
      - humidity
      - pressure
      - visibility
      - minutely_summary
      - hourly_summary
      - daily_summary
      - temperature_max
      - temperature_min
      - apparent_temperature_max
      - apparent_temperature_min
      - precip_intensity_max
  1. Set this up as above
  2. See precip values fail to get values
  3. See other vaues come in such as temperature.

Traceback (if applicable):


Additional info:

Most helpful comment

precipType is only shown when precipProbability and precipIntensity are nonzero. (This has always been the case in the API, so no breaking changes have occurred!)

All 69 comments

I have the same issue. Haven't had it report anything but 'unknown' for the past few weeks.

Agreed, my precip intensity and precip probability values have been at 0% despite being in the midst of rain.

It started working today...

And now broken again! For about 11 hours now

Do you get the data manually for your location?

>>> import forecastio
>>> api_key = "YOUR_API_KEY"
>>> lat = 48.1234
>>> lon = "1234"
>>> forecast = forecastio.load_forecast(api_key, lat, lng)
>>> details = forecast.currently()
>>> print(details.precipitation)

I get this:

pi@raspberrypi:~ $ python3 test_dark_sky.py 
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/forecastio/models.py", line 103, in __getattr__
    return self.d[name]
KeyError: 'precipitation'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test_dark_sky.py", line 7, in <module>
    print(details.precipitation)
  File "/usr/local/lib/python3.4/dist-packages/forecastio/models.py", line 107, in __getattr__
    " or is not available for this forecast".format(name)
forecastio.utils.PropertyUnavailable: Property 'precipitation' is not valid or is not available for this forecast

Just to help, the working version of what you asked to test but with the private details swapped out:

import forecastio
api_key = "YOUR_API_KEY"
lat = YOURLAT
lon = YOURLON
forecast = forecastio.load_forecast(api_key, lat, lon)
details = forecast.currently()
print(details.precipitation)

We are getting snow at my location...

>>> details = forecast.currently()
>>> details.__dict__
{'d': {'dewPoint': -7.02, 'windBearing': 267, 'precipProbability': 0.31, 'windSpeed': 6.06, 'humidity': 0.68, 'pressure': 1021.52, 'precipIntensity': 0.1829, 'icon': 'partly-cloudy-night', 'cloudCover': 0.74, 'temperature': -1.96, 'ozone': 324.51, 'time': 1483552851, 'precipType': 'sleet', 'apparentTemperature': -7.97, 'summary': 'Mostly Cloudy', 'visibility': 9.99}, 'sunriseTime': None, 'sunsetTime': None, 'utime': 1483552851, 'time': datetime.datetime(2017, 1, 4, 18, 0, 51)}
>>> print(details.precipType)
sleet

If the response from Dark Sky don't contain information for the precipitation then HA is showing that the state is unknown.

So the Dark Sky API has seemingly stopped working for quite a few locations with respect to just the precipitation values - how do we proceed from here? Likely not an HASS coding issue, but an issue nonetheless as a client of an API - I haven't been able to find where on their site you can report issues, though they say if they don't have data, or its bad then they won't show it - but it was showing these attributes reliably up until a few weeks ago.

Think I'm going to close this one soon unless others are still having issues...
...as though there was a blip of a few weeks with no data for me, it seems to be coming in for me now and then, though I could have sworn it wasn't unknown when there was no precipitation but "none"

I'm also having this issue. I had an automated notification for when it was raining/snowing/etc. and it stopped working a few weeks ago. I traced it back to the same issue as described here.

So looks like even though we've had rain here today, Dark Sky itself is definitely not returning anything to do with Precipitation - except the daily max...

I'm getting this right now:

{'sunsetTime': None, 'utime': 1483994422, 'd': {'nearestStormDistance': 47, 'pressure': 1011.71, 'summary': 'Partly Cloudy', 'visibility': 9.46, 'temperature': 6.62, 'precipProbability': 0, 'apparentTemperature': 4.26, 'icon': 'partly-cloudy-night', 'windSpeed': 7.37, 'precipIntensity': 0, 'humidity': 0.94, 'nearestStormBearing': 86, 'ozone': 345.57, 'cloudCover': 0.3, 'time': 1483994422, 'windBearing': 283, 'dewPoint': 5.68}, 'time': datetime.datetime(2017, 1, 9, 20, 40, 22), 'sunriseTime': None}

I haven't been able to find where on their site you can report issues

Email to [email protected] appears to be the only method

And to confirm something else, yes - if there was no precip it used to read as "none". It started as unknown for me around the same time as it did for you, at which time my automations stopped working.

I dropped them a mail and linked to this issue

We're supposed to have rain tonight so I'll check status and report back. Thanks! I was beginning to think it was just me.

Hi! Jay LaPorte from Dark Sky, here.

Can somebody aware of the implementation of this let me know if this is making Time Machine API calls, or Forecast API calls? We're separately investigating another issue with historical data missing precipitation in a number of locations, but if this is a Forecast request, this would be a new issue to us.

FYI, we have made no changes to our platform in the last couple months: indeed, December is a quiet period since we operate on a skeleton crew, given the holidays. Most likely you're either encountering a bug in our platform, a data source regression (which _does_ happen from time to time, as governments like to change things on us), or else are somehow misinterpreting the data.

Thanks!

I believe it's making Forecast API calls, but maybe @fabaff can verify this.

It uses python-forecastio.

@ironwallaby I think (am not the expert though) that the code is calling a timemachine request actually - the sensor is defined here: https://github.com/home-assistant/home-assistant/blob/b9dcc2777b0cff2f874ad7de1b846958070e4777/homeassistant/components/sensor/darksky.py

It has hourly, minutely, etc so I think that makes it a timemachine request(?)

@NaffanDroo is correct - sorry.

Have also been seeing this error lately:

17-01-11 09:44:31 homeassistant.components.sensor.darksky: Unable to connect to Dark Sky. EOF occurred in violation of protocol (_ssl.c:600)
17-01-11 10:05:01 homeassistant.components.sensor.darksky: Unable to connect to Dark Sky. EOF occurred in violation of protocol (_ssl.c:600)

Are you also seeing this?

Understood, so it's making a Forecast request. This is a new bug to us, then!

Can you pass me some latitude,longitude pairs that exhibit the issue? Additionally, if possible, could you let me know what part of the response (e.g. minutely, hourly, daily) is missing precipitation data?

@rpitera Huh! We've been hearing a couple other people report SSL issues, too. (Starting over the weekend.) We've been unable to confirm them from our end, but are looking into it.

Yes I do see these too -

homeassistant.components.sensor.darksky: Unable to connect to Dark Sky. EOF occurred in violation of protocol (_ssl.c:600)
17-01-09 06:00:00 homeassistant.components.sensor.speedtest: Executing speedtest...
17-01-09 06:01:31 homeassistant.components.sensor.darksky: Unable to connect to Dark Sky. EOF occurred in violation of protocol (_ssl.c:600)
17-01-09 06:14:00 homeassistant.components.sensor.darksky: Unable to connect to Dark Sky. EOF occurred in violation of protocol (_ssl.c:600)

Though I imagine that might be a separate issue as other data comes back.

@ironwallaby If you scroll back to comment 6 or 7 it shows a separate python test and we got no precipitation object back at all.

Not sure if it's minutely but I think it's mainly just data for now

I'm getting rain data for now. If you still need longitude/latitude I can share by email directly - rather than publicly.

However I am getting no precipitation back in the test I ran in a script..
pi@raspberrypi:~ $ python3 test_dark_sky.py {'time': datetime.datetime(2017, 1, 12, 10, 25, 26), 'd': {'icon': 'rain', 'cloudCover': 0.68, 'windBearing': 226, 'nearestStormDistance': 0, 'time': 1484216726, 'precipIntensity': 0.5791, 'humidity': 0.87, 'precipIntensityError': 0.0584, 'apparentTemperature': 3.11, 'temperature': 5.64, 'precipProbability': 1, 'summary': 'Light Rain', 'precipType': 'rain', 'ozone': 325.73, 'dewPoint': 3.57, 'pressure': 1008.34, 'visibility': 6.96, 'windSpeed': 7.28}, 'utime': 1484216726, 'sunriseTime': None, 'sunsetTime': None}

With code:
import forecastio api_key = "MYKEY" lat = MYLATITUDE lon = MYLONGITUDE forecast = forecastio.load_forecast(api_key, lat, lon) details = forecast.currently() print(details.__dict__) print(details.precipitation)

But wait... in your example there _is_ precipitation information:

'precipIntensity': 0.5791,
'precipIntensityError': 0.0584,
'precipProbability': 1,
'precipType': 'rain',

Could you explain what you're looking for that's missing?

Apologies. Ignore that last bit then - was based on some code specified in earlier comments but best to just check the dictionary

I looked earlier upthread but can't find any lat,lon pairs except this one:

>>> lat = 48.1234
>>> lon = "1234"

That's obviously not valid... latitude has to be in the range [-90,+90] and longitude has to be in the range [-180,+180], and requests outside of those bounds will be rejected. (But I assume that's a separate error than the ones being reported.)

When I make Dark Sky Forecast requests for various locations (https://api.darksky.net/forecast/APIKEY/LAT,LON) I don't see any missing precipitation data. (I see precipIntensity: 0 in areas where there's no rain, of course, but no areas that are undefined. However, the issue you folks have been seeing may be extremely localized?)

@ironwallaby let me reply to your email with a real lat and lon

I am using the following coordinates, which are taken from the configuration of HomeAssistant:

latitude: 40.658939
longitude: -74.39030385

Here is a picture of how the data is displayed:

clipboard01

My point is simply that up until a few weeks ago, if it there was no precipitation, the highlighted sensor would read "None", where it now reads "unknown". There has been no change in the HA code since the update from forecast.io to darksky.io; this change was made when the brand was changed and when it was released, this worked as it did previously up until recently. I also didn't have any connection or SSL errors until recently.

The data isn't missing in the summaries, it's missing the individual attribute.

I think in addition though there have been general "outages" where its actually raining but these attributes have not shown up.

Correct. And the problems started when the attribute above stopped reporting None. I did get a "Rain" indicator last night at some points though and no additional SSL errors for the evening.

I've been getting a Dark Sky Precip unknown for a while now as well. Even 2 minutes ago it was still showing unknown.

I've been attempting to replicate this and haven't been able to.

I suspect there's something going on client-side, but it seems very difficult to tell given that we're looking at three stacks (Dark Sky's API, the python client lib, and home-assistant itself). It'd be very helpful if there was a way to get at the actual HTTP response from the Dark Sky servers鈥攖he full plaintext dump with headers, if at all possible鈥攚henever an unknown precip error pops up. Being able to see what the API is returning would be a huge help to trying to debug further.

What's interesting is that I have an automation to make an announcement via TTS when it's raining/snowing and it uses the state in the TTS:

# Rain Alert

- alias: 'Raining'
  trigger:
    platform: state
    entity_id: sensor.dark_sky_precip_intensity
    from: '0'
  action:
    - service: tts.google_say
      entity_id: media_player.living_room_home
      data_template:
        message: 'Excuse me Robert, but is currently {{ states.sensor.dark_sky_precip.state }}ing and it is {{ states.sensor.dark_sky_temperature.state | int }}degrees outside.  Forecast says {{ states.sensor.dark_sky_minutely_summary.state }}.'
        cache: false
    - service: automation.turn_off
      entity_id: automation.raining
    - delay: 00:30:00
    - service: automation.turn_on
      entity_id: automation.raining

All the announcements yesterday stated, "...it is currently _unknowning_ and it is..." despite the fact that the precip state sensor was showing 'rain'.

For what it's worth, I get a configuration error for my Darksky sensor unless I comment out the precip_probability under the monitored conditions section of the sensor configuration. Not sure if it's related.

What is also interesting for me is that my automation for the state switching to rain/sleet/snow almost never gets triggered:

alias: Raining
trigger:
  - platform: state
    entity_id: sensor.dark_sky_precip
    state: 'rain'
  - platform: state
    entity_id: sensor.dark_sky_precip
    state: 'sleet'
  - platform: state
    entity_id: sensor.dark_sky_precip
    state: 'snow'
condition:
  condition: and
  conditions:
    - condition: state
      entity_id: group.all_mobile_devices
      state: 'home'
    - condition: numeric_state
      entity_id: sun.sun
      value_template: '{{ state.attributes.elevation }}'
      above: !secret sunset_elevation
action:
  - service: notify.telegram
    data:
      message: "It's {{ states('sensor.dark_sky_precip') }}ing!"

But when it stops, it mostly does get triggered:
```alias: Stopped raining
trigger:

  • platform: state
    entity_id: sensor.dark_sky_precip_intensity
    state: '0'
    condition:
    condition: and
    conditions:

    • condition: state

      entity_id: group.all_mobile_devices

      state: 'home'

    • condition: numeric_state

      entity_id: sun.sun

      value_template: '{{ state.attributes.elevation }}'

      above: !secret sunset_elevation

      action:

  • service: notify.telegram
    data:
    message: "It stopped raining!"
    ```
    They used to both work, last time the raining trigger worked for me was Weds Feb 15th at 16:05 GMT, but even on that day it only worked once and then seemingly I didn't get notified that it stopped raining afterwards:

Home Assistant, [15.02.17 11:41]
It stopped raining!

Home Assistant, [15.02.17 13:12]
It stopped raining!

Home Assistant, [15.02.17 14:40]
It stopped raining!

Home Assistant, [15.02.17 15:59]
It stopped raining!

Home Assistant, [15.02.17 16:05]
It's raining!

And in response to @ironwallaby

It'd be very helpful if there was a way to get at the actual HTTP response from the Dark Sky servers鈥攖he full plaintext dump with headers, if at all possible鈥攚henever an unknown precip error pops up. Being able to see what the API is returning would be a huge help to trying to debug further.

I guess I might be able to invoke the manual script we used earlier at the time that the state changes to unknown... bear with me.

@ironwallaby In the last day or so we have had quite a few users come forward saying they are now experiencing the SSL issues. I have now redirected them from that issue (#6095) to this one. It appears that the error is being generated from the requests library based on this issue.

/cc @covrig @rrubin0

I've been getting a ton of them this morning:

17-02-20 07:43:02 ERROR (Thread-11) [homeassistant.components.sensor.darksky] Unable to connect to Dark Sky. 502 Server Error: Bad Gateway for url: https://api.darksky.net/forecast/76434809a6a15ba6f5b2177eef2c5be4/40.658939,-74.39030385?units=us
17-02-20 07:45:37 ERROR (Thread-1) [homeassistant.components.sensor.darksky] Unable to connect to Dark Sky. 502 Server Error: Bad Gateway for url: https://api.darksky.net/forecast/76434809a6a15ba6f5b2177eef2c5be4/40.658939,-74.39030385?units=us
17-02-20 07:48:15 ERROR (Thread-11) [homeassistant.components.sensor.darksky] Unable to connect to Dark Sky. 502 Server Error: Bad Gateway for url: https://api.darksky.net/forecast/76434809a6a15ba6f5b2177eef2c5be4/40.658939,-74.39030385?units=us
17-02-20 07:52:45 ERROR (Thread-10) [homeassistant.components.sensor.darksky] Unable to connect to Dark Sky. EOF occurred in violation of protocol (_ssl.c:600)

_UPDATE: Note to the person from Sweden who stole my API key from this posting - It's reset and it won't happen again._

The 502 errors are indeed known and should be fixed: http://status.darksky.net/2017/02/20/downtime-incident.html

As for the SSL issues, thanks for letting us know. We're still unable to reproduce those, though a small handful of users are reporting them as of yesterday, so we're looking into it.

@Danielhiversen - Thanks! I don't know why I hadn't subscribed to their feed before, but I am now.

@ironwallaby - Appreciate your involvement and let me know if I can provide any more data to help.

I'm getting the SSL errors. Just started recently.
0.38.3
Python 3.5.2

Not sure why this bug about PRECIPITATION only has quite been converted to purely SSL dark sky issues, but its kind of gone off topic now...

It was potentially related but not really as other attributes were coming through. Can we stay on topic please?

Managed to add a script to be invoked when the precipication changes:

HASS INFO: It's unknowning!
{'utime': 1487764768, 'time': datetime.datetime(2017, 2, 22, 11, 59, 28), 'sunriseTime': None, 'd': {'visibility': 9.74, 'windSpeed': 14.33, 'apparentTemperature': 11.58, 'pressure': 1009.37, 'dewPoint': 8.78, 'time': 1487764768, 'ozone': 334.1, 'cloudCover': 0.84, 'windBearing': 256, 'icon': 'partly-cloudy-day', 'nearestStormBearing': 9, 'humidity': 0.83, 'temperature': 11.58, 'precipProbability': 0, 'summary': 'Mostly Cloudy', 'nearestStormDistance': 2, 'precipIntensity': 0}, 'sunsetTime': None}

However it never went to Raining despite my other notifications:

Home Assistant, [22.02.17 11:25]
It stopped raining!

Home Assistant, [22.02.17 11:25]
It's unknowning!

Home Assistant, [22.02.17 12:00]
It stopped raining!

Home Assistant, [22.02.17 12:00]
It's unknowning!

My triggers are:

trigger:
  - platform: state
    entity_id: sensor.dark_sky_precip
    state: 'rain'
  - platform: state
    entity_id: sensor.dark_sky_precip
    state: 'sleet'
  - platform: state
    entity_id: sensor.dark_sky_precip
    state: 'snow'
  - platform: state
    entity_id: sensor.dark_sky_precip
    state: 'unknown'

Yay! Finally a log entry! Looking at the "currently" point you pasted in:

'precipProbability': 0, 'precipIntensity': 0

That's "no precipitation", not "unknown"! Perhaps the way Home Assistant is checking for the data is mistaken?

Some output:

hass@raspberrypi:~$ for f in $(ls -rt darksky_debug_*.log); do echo ; echo $f; cat $f; done

darksky_debug_2017-02-22_131555.623970.log
HASS INFO: It's raining!
{'d': {'cloudCover': 1, 'summary': 'Overcast', 'precipIntensityError': 0.0203, 'time': 1487769356, 'temperature': 11.66, 'nearestStormDistance': 0, 'precipType': 'rain', 'ozone': 333.42, 'visibility': 10, 'precipProbability': 0.05, 'dewPoint': 8.9, 'pressure': 1008.91, 'windSpeed': 17, 'icon': 'cloudy', 'precipIntensity': 0.0787, 'apparentTemperature': 11.66, 'humidity': 0.83, 'windBearing': 248}, 'sunriseTime': None, 'time': datetime.datetime(2017, 2, 22, 13, 15, 56), 'sunsetTime': None, 'utime': 1487769356}

darksky_debug_2017-02-22_134452.019101.log
HASS INFO: It's unknowning!
{'time': datetime.datetime(2017, 2, 22, 13, 44, 52), 'sunriseTime': None, 'sunsetTime': None, 'd': {'time': 1487771092, 'summary': 'Mostly Cloudy', 'precipProbability': 0, 'nearestStormDistance': 1, 'ozone': 333.25, 'windSpeed': 13.6, 'nearestStormBearing': 102, 'apparentTemperature': 11.72, 'pressure': 1008.71, 'precipIntensity': 0, 'cloudCover': 0.79, 'temperature': 11.72, 'icon': 'partly-cloudy-day', 'windBearing': 256, 'dewPoint': 8.68, 'humidity': 0.82, 'visibility': 10}, 'utime': 1487771092}

darksky_debug_2017-02-22_134655.776443.log
HASS INFO: It's raining!
{'sunsetTime': None, 'utime': 1487771216, 'sunriseTime': None, 'time': datetime.datetime(2017, 2, 22, 13, 46, 56), 'd': {'temperature': 11.71, 'nearestStormDistance': 0, 'precipType': 'rain', 'precipIntensity': 0.0584, 'summary': 'Mostly Cloudy', 'icon': 'partly-cloudy-day', 'time': 1487771216, 'apparentTemperature': 11.71, 'precipProbability': 0.01, 'humidity': 0.82, 'precipIntensityError': 0.0152, 'windSpeed': 13.67, 'dewPoint': 8.68, 'cloudCover': 0.79, 'visibility': 10, 'ozone': 333.24, 'windBearing': 256, 'pressure': 1008.69}}

darksky_debug_2017-02-22_134859.723925.log
HASS INFO: It's unknowning!
{'time': datetime.datetime(2017, 2, 22, 13, 49), 'd': {'humidity': 0.82, 'nearestStormDistance': 1, 'summary': 'Mostly Cloudy', 'pressure': 1008.68, 'icon': 'partly-cloudy-day', 'ozone': 333.23, 'dewPoint': 8.67, 'precipIntensity': 0, 'windSpeed': 13.75, 'precipProbability': 0, 'temperature': 11.69, 'time': 1487771340, 'visibility': 10, 'nearestStormBearing': 102, 'windBearing': 255, 'cloudCover': 0.79, 'apparentTemperature': 11.69}, 'sunsetTime': None, 'sunriseTime': None, 'utime': 1487771340}

darksky_debug_2017-02-22_135715.804540.log
HASS INFO: It's raining!
{'time': datetime.datetime(2017, 2, 22, 13, 57, 16), 'utime': 1487771836, 'sunriseTime': None, 'd': {'time': 1487771836, 'precipProbability': 0.01, 'windSpeed': 14.05, 'pressure': 1008.62, 'precipIntensityError': 0.0127, 'precipType': 'rain', 'apparentTemperature': 11.65, 'dewPoint': 8.65, 'summary': 'Mostly Cloudy', 'cloudCover': 0.8, 'precipIntensity': 0.0584, 'nearestStormDistance': 0, 'icon': 'partly-cloudy-day', 'ozone': 333.18, 'temperature': 11.65, 'humidity': 0.82, 'visibility': 10, 'windBearing': 255}, 'sunsetTime': None}

darksky_debug_2017-02-22_135919.916550.log
HASS INFO: It's unknowning!
{'time': datetime.datetime(2017, 2, 22, 13, 59, 20), 'd': {'precipProbability': 0, 'ozone': 333.17, 'humidity': 0.82, 'cloudCover': 0.8, 'precipIntensity': 0, 'apparentTemperature': 11.63, 'nearestStormBearing': 164, 'icon': 'partly-cloudy-day', 'windBearing': 255, 'dewPoint': 8.64, 'nearestStormDistance': 14, 'time': 1487771960, 'summary': 'Mostly Cloudy', 'windSpeed': 14.12, 'visibility': 10, 'temperature': 11.63, 'pressure': 1008.61}, 'utime': 1487771960, 'sunriseTime': None, 'sunsetTime': None}

Script if anyone else wants it:

#!/usr/bin/env python3
import fileinput
import forecastio
import sys
import datetime

timenow='{:%Y-%m-%d_%H%M%S.%f}'.format(datetime.datetime.now())
filename="/home/hass/darksky_debug_%s.log" % timenow
sys.stdout = open(filename, "w")

#if len(sys.argv) > 1:
#    msg = sys.argv[1]
#    print("HASS INFO: %s" % msg)
for line in fileinput.input():
    print("HASS INFO: %s" %  line)

api_key = "BLANKED OUT"
lat = BLANKED
lon = BLANKED
forecast = forecastio.load_forecast(api_key, lat, lon)
details = forecast.currently()
print(details.__dict__)

Notify set up:

notify:
  - platform: command_line
    command: "/home/hass/test_dark_sky.py"
    name: darksky_test

Automation:

alias: Raining
trigger:
  - platform: state
    entity_id: sensor.dark_sky_precip
    state: 'rain'
  - platform: state
    entity_id: sensor.dark_sky_precip
    state: 'sleet'
  - platform: state
    entity_id: sensor.dark_sky_precip
    state: 'snow'
  - platform: state
    entity_id: sensor.dark_sky_precip
    state: 'unknown'
condition:
  condition: and
  conditions:
    - condition: state
      entity_id: group.all_mobile_devices
      state: 'home'
    - condition: numeric_state
      entity_id: sun.sun
      value_template: '{{ state.attributes.elevation }}'
      above: !secret sunset_elevation
action:
  - service: notify.telegram
    data:
      message: "It's {{ states('sensor.dark_sky_precip') }}ing!"
  - service: notify.darksky_test
    data:
      message: "It's {{ states('sensor.dark_sky_precip') }}ing!"

@ironwallaby If you have any test script you want me to run that I can insert my location and API key into to retrieve the HTTP dump you're after, I can get it to be executed on each time the status changes. Preferably if it writes out to a timestamped file then it won't clash with multiple quick changes that seem to be happening together.

Thanks!

From the looks of things, it looks like Home Assistant is treating "no rain" as "unknown", which is not a problem with the Dark Sky API, it's a problem with how Home Assistant is interpreting it. Somebody familiar with Home Assistant will need to look into why that is, but it sounds like 0 is being treated the same as undefined, which is not correct!

Has the API stopped reporting back precipType or has it always only sent that back when there is rain/sleet/snow/pigsflying/etc :)

precipType is only shown when precipProbability and precipIntensity are nonzero. (This has always been the case in the API, so no breaking changes have occurred!)

The only place I could see this creeping in from formerly working could be the updates done when the branding changed. I'm trying to see if I can find anything...

@rpitera
I wonder if its related to the library change:
-REQUIREMENTS = ['python-forecastio==1.3.4']
+REQUIREMENTS = ['python-forecastio==1.3.5']

It may well be, because looking at the sensor definition in darksky.py it precip type appears only once and the definition is pretty straightforward (just showing the relative excerpt):

# Sensor types are defined like so:
# Name, si unit, us unit, ca unit, uk unit, uk2 unit
SENSOR_TYPES = {
    'summary': ['Summary', None, None, None, None, None, None, []],
    'minutely_summary': ['Minutely Summary',
                         None, None, None, None, None, None, []],
    'hourly_summary': ['Hourly Summary', None, None, None, None, None, None,
                       []],
    'daily_summary': ['Daily Summary', None, None, None, None, None, None, []],
    'icon': ['Icon', None, None, None, None, None, None,
             ['currently', 'hourly', 'daily']],
    'nearest_storm_distance': ['Nearest Storm Distance',
                               'km', 'mi', 'km', 'km', 'mi',
                               'mdi:weather-lightning', ['currently']],
    'nearest_storm_bearing': ['Nearest Storm Bearing',
                              '掳', '掳', '掳', '掳', '掳',
                              'mdi:weather-lightning', ['currently']],
    'precip_type': ['Precip', None, None, None, None, None,
                    'mdi:weather-pouring',
                    ['currently', 'minutely', 'hourly', 'daily']],

Here's a link to the repo: https://github.com/ZeevG/python-forecast.io

Hmm, lack of tags for that release makes it a little difficult to trace what is different.

My lack of python skills ain't helping me either. LOL

Thing is, I wasn't using dark sky until it was called dark sky in HASS, so I'm not sure its that either... I perhaps it is worth a try, I think that version was updated in 0.30 release, so potentially anything before then might be worth trying anyway, guess it might have been called forecast.io back then... that or potentially reverse this locally in the version I'm using...
-REQUIREMENTS = ['python-forecastio==1.3.4']
+REQUIREMENTS = ['python-forecastio==1.3.5']

Tried that and restarted hass, still "unknown", I reckon I might have to try 0.29 of HASS in a test instance somehow... might take a while to set up as I suspect my current config needs stripping back a bit to remove things like packages.

@NaffanDroo Unfortunately due to testing for devs on three different platforms, I can't downgrade at the moment - sorry. Thanks for continuing to look into this.

Back to this again today...

Feb 24 08:32:53 raspi1 hass[19631]: 17-02-24 08:32:53 ERROR (Thread-4) [homeassistant.components.sensor.darksky] Unable to connect to Dark Sky. 500 Server Error: Internal Server Error for url: https://api.darksky.net/forecast/OLD_REDACTED_KEY/40.658939,-74.39030385?units=us

500 errors are unrelated. We're looking into that one!

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

Still an issue as of 0.45.1
clipboard01

I bumped into this too, but in my case it is because it doesn't have this information for my country. So be aware if you find this issue that they do need to support it for your location.

I also have this problem on the latest build 0.46.0

image

This is still occurring in 0.51.2.

If you execute the code I provided at the beginning of this issue you will most likely see:

forecastio.utils.PropertyUnavailable: Property 'precipitation' is not valid or is not available for this forecast

This results in an unknown state and is shown in the frontend.

A PR to handle all different precip types would be appreciated.

Was this page helpful?
0 / 5 - 0 ratings