core icon indicating copy to clipboard operation
core copied to clipboard

Dark Sky Units setting not working

Open labrunning opened this issue 9 years ago • 12 comments

Home Assistant release (hass --version): 0.45.1

Python release (python3 --version): Python 3.4.2

Component/platform: darksky

Description of problem: units setting has no effect

Expected: "si","auto" or "uk2" to return Centigrade instead of Fahrenheit (and other associated UK values)

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

- platform: darksky
  api_key: $API_KEY
  latitude: 53.6755
  longitude: -1.87244
  units: "auto"
  monitored_conditions:
    - icon
    - nearest_storm_distance
    - summary
    - precip_type
    - precip_intensity
    - precip_probability
    - temperature
    - apparent_temperature
    - dew_point
    - wind_speed
    - wind_bearing
    - cloud_cover
    - humidity
    - pressure
    - visibility
    - ozone
    - minutely_summary
    - hourly_summary
    - daily_summary
    - temperature_max
    - temperature_min
    - apparent_temperature_max
    - apparent_temperature_min
    - precip_intensity_max

Additional info:

I have tried "uk2" and "si" (without the longitude and latitude; this is set in my configuration.yaml) in my sensors.yaml and restarted each time but no change occurs. Example of returned value;

{
  "friendly_name": "Dark Sky Daily High Temperature",
  "attribution": "Powered by Dark Sky",
  "icon": "mdi:thermometer",
  "unit_of_measurement": "°F"
}

labrunning avatar Jun 05 '17 11:06 labrunning

I have units: auto (without the quotes around auto) in my config and the units are correct for the UK. Centigrade for temperature, miles for visibility, mph for wind-speed, mm for rainfall and mbar for pressure - as expected.

I haven't specified the long/lat in the sensor, so it should default back to my HA one.

point-4ward avatar Jun 07 '17 12:06 point-4ward

Are your versions and config all the same as mine @mf-social ?

labrunning avatar Jun 07 '17 12:06 labrunning

I'm on 0.46 now, but I didn't have any issues on 0.45.1 . Python version is the same.

My sensor:

- platform: darksky
  api_key: !secret darksky_api_key
  units: auto
  update_interval:
    minutes: 30
  monitored_conditions:
    - summary
    - precip_type
    - precip_intensity
    - precip_probability
    - temperature
    - apparent_temperature
    - dew_point
    - wind_speed
    - wind_bearing
    - cloud_cover
    - humidity
    - pressure
    - visibility
    - ozone
    - minutely_summary
    - hourly_summary
    - daily_summary
    - temperature_max
    - temperature_min
    - apparent_temperature_max
    - apparent_temperature_min
    - precip_intensity_max

point-4ward avatar Jun 07 '17 13:06 point-4ward

Must be the quotes! I will remove them and see if that works.

labrunning avatar Jun 07 '17 13:06 labrunning

Tried no quotes and single quotes with auto and uk2. No change. By any chance is your Dark Sky sensor in a sensors.yaml or in your configuration.yaml?

labrunning avatar Jun 07 '17 13:06 labrunning

My config is split quite considerably:

In configuration.yaml:

sensor: !include_dir_merge_list config/sensor/

Directory sensor contains:

  • environmental.yaml
  • services.yaml
  • system.yaml
  • tracking.yaml

environmental.yaml:

- platform: moon

- platform: time_date
  display_options:
   - 'time'
   - 'date'

- platform: darksky
  api_key: !secret darksky_api_key
  units: auto
  update_interval:
    minutes: 30
  monitored_conditions:
    - summary
    - precip_type
    - precip_intensity
    - precip_probability
    - temperature
    - apparent_temperature
    - dew_point
    - wind_speed
    - wind_bearing
    - cloud_cover
    - humidity
    - pressure
    - visibility
    - ozone
    - minutely_summary
    - hourly_summary
    - daily_summary
    - temperature_max
    - temperature_min
    - apparent_temperature_max
    - apparent_temperature_min
    - precip_intensity_max

My whole config is on my github if you want to browse.

point-4ward avatar Jun 07 '17 13:06 point-4ward

I take it you're happy that your long / lat and timezone are all correct? And when you click on the map in your interface the home symbol is in the right place?

point-4ward avatar Jun 07 '17 13:06 point-4ward

I was clutching at straws really =] I will browse your config though, always really helpful to see what other people are doing.

Yeah I have a separate sensors.yaml. I seem to recall when I first set this up about a month ago the units were fine.

labrunning avatar Jun 07 '17 13:06 labrunning

Yep the lat/long are fine, my home is in the right place. I've got some automations based on location as well and they work.

I'll try updating when I get home, see if that makes a difference. Thanks for your help.

labrunning avatar Jun 07 '17 14:06 labrunning

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:

balloobbot avatar Aug 12 '17 20:08 balloobbot

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

balloobbot avatar Sep 04 '17 23:09 balloobbot

Sorry I should have updated this a while ago. I realised that I had a setting in my configuration YAML that set the default to imperial settings (as being in the UK we have this wierd mish-mash of imperial and metric values we like to use!).

I changed;

# metric for Metric, imperial for Imperial
  unit_system: imperial

to

# metric for Metric, imperial for Imperial
  unit_system: metric

and hey presto the Dark Sky values are now correct. Not sure if the above can be left out to ensure that specific component settings are honoured?

labrunning avatar Sep 08 '17 12:09 labrunning