Dark Sky Sensor


The darksky platform uses the Dark Sky web service as a source for meteorological data for your location. The location is based on the longitude and latitude coordinates configured in your configuration.yaml file. The coordinates are auto-detected but to take advantage of the hyper-local weather reported by Dark Sky, you can refine them down to your exact home address. GPS coordinates can be found by using Google Maps and clicking on your home or Openstreetmap.

Setup

You need an API key which is free but requires registration. You can make up to 1000 calls per day for free which means that you could make one approximately every 86 seconds.

Dark Sky will charge you $0.0001 per API call if you enter your credit card details and create more than 1000 calls per day.

Configuration

To add Dark Sky to your installation, add the following to your configuration.yaml file:

# Example configuration.yaml entry
sensor:
  - platform: darksky
    api_key: YOUR_API_KEY
    forecast:
      - 0
    hourly_forecast:
      - 0
      - 1
    monitored_conditions:
      - summary
      - icon
      - temperature

Configuration Variables

api_key

(string)(Required)

Your API key.

name

(string)(Optional)

Additional name for the sensors.

Default value:

Dark Sky

forecast

(list)(Optional)

List of days in the 7-day forecast you would like to receive data on, starting with today as day 0 and ending with day 7. Any condition from monitored_conditions with a daily forecast by Dark Sky will generate a sensor with entity_id <condition>_<day>d.

hourly_forecast

(list)(Optional)

List of hours in the 48-hour forecast you would like to receive data on, starting with this hour as hour 0 and ending with hour 48. Any condition from monitored_conditions with an hourly forecast by Dark Sky will generate a sensor with entity_id <condition>_<hour>h.

language

(string)(Optional)

The desired language of the summary properties. The valid options are further down in a table.

Default value:

en

latitude

(float)(Optional)

Latitude coordinate to monitor weather of (required if longitude is specified).

Default value:

coordinates defined in your configuration.yaml

longitude

(float)(Optional)

Longitude coordinate to monitor weather of (required if latitude is specified).

Default value:

coordinates defined in your configuration.yaml

monitored_conditions

(list)(Required)

Conditions to display in the frontend.

summary

A human-readable text summary.

icon

A machine-readable text summary, suitable for selecting an icon for display. See Dark Sky API documentation for the list of possible values.

precip_type

The type of precipitation occurring at the given time. If precip_intensity is zero, then this property will be unknown. See Dark Sky API documentation for the list of possible values.

precip_intensity

The intensity of precipitation occurring at the given time. This value is conditional on probability (that is, assuming any precipitation occurs at all).

precip_probability

The probability of precipitation occurring, in percents.

precip_accumulation

The amount of snowfall accumulation expected to occur. If no snowfall is expected, this property will be undefined.

temperature

The air temperature.

apparent_temperature

The apparent (or “feels like”) temperature.

dew_point

The dew point.

wind_speed

The wind speed.

wind_gust

The wind gust speed.

wind_bearing

The direction that the wind is coming from in degrees, with true north at 0° and progressing clockwise. If wind_speed is 0, then this value is unknown.

cloud_cover

The percentage of sky occluded by clouds.

humidity

The relative humidity.

pressure

The sea-level air pressure in millibars.

visibility

The average visibility.

ozone

The columnar density of total atmospheric ozone at the given time in Dobson units.

minutely_summary

A human-readable text summary for the next hour.

hourly_summary

A human-readable text summary for the next two days.

daily_summary

A human-readable text summary for the next week.

temperature_high

The daytime high temperature.

temperature_low

The overnight low temperature.

apparent_temperature_high

The daytime high apparent temperature.

apparent_temperature_low

The overnight low apparent temperature.

precip_intensity_max

The maximum value of precip_intensity during a given day.

uv_index

The UV index.

moon_phase

The fractional part of the lunation number during the given day: a value of 0 corresponds to a new moon, 0.25 to a first quarter moon, 0.5 to a full moon, and 0.75 to a last quarter moon.

sunrise_time

The time of when the sun will rise during a given day.

sunset_time

The time of when the sun will set during a given day.

nearest_storm_distance

The approximate distance to the nearest storm in miles.

nearest_storm_bearing

The approximate direction of the nearest storm in degrees, with true north at 0° and progressing clockwise.

alerts

Current severe weather advisories.

units

(string)(Optional)

Specify the unit system. Valid options are auto, us, si, ca and uk2. auto will let Dark Sky decide the unit system based on location.

Default value:

si or us, based on the temperature preference in Home Assistant.

scan_interval

(time)(Optional)

Minimum time interval between updates. Supported formats: scan_interval: 'HH:MM:SS', scan_interval: 'HH:MM' and Time period dictionary (see example below).

Default value:

2 minutes

Please note that some monitored conditions, such as temperature_high or temperature_low, may only work when setting the forecast attribute to at least 0 (current day).

Time period dictionary example

scan_interval:
  # At least one of these must be specified:
  days: 0
  hours: 0
  minutes: 3
  seconds: 30
  milliseconds: 0

Language options

All language options are described in this table that you can use for the dark sky sensor.

Language Variable Code
Arabic ar
Azerbaijani az
Belarusian be
Bulgarian bg
Bengali bn
Bosnian bs
Catalan ca
Czech cs
Danish da
German de
Greek el
English en
Esperanto eo
Spanish es
Estonian et
Finnish fi
French fr
Hebrew he
Hindi hi
Croatian hr
Hungarian hu
Indonesian id
Icelandic is
Italian it
Japanese ja
Georgian ka
Kannada kn
Korean ko
Cornish kw
Latvian lv
Malayam ml
Marathi mr
Norwegian Bokmål nb
Dutch nl
Punjabi pa
Polish pl
Portuguese pt
Romanian ro
Russian ru
Slovak sk
Slovenian sl
Serbian sr
Swedish sv
Tamil ta
Telugu te
Tetum tet
Turkish tr
Ukrainian uk
Urdu ur
Igpay Atinlay x-pig-latin
simplified Chinese zh
traditional Chinese zh-tw
While the platform is called "darksky" the sensors will show up in Home Assistant as "dark_sky" (eg: sensor.dark_sky_summary).

More details about the API are available in the Dark Sky API documentation.