Darksky Sensor for 2 locations?

I am trying to configure a dashboard and some automations to handle weather conditions in 2 different locations. I currently user the darksky Sensor to get weather info for one location. Is there are way to get weather for another location as a second instance of the sensor, or any other way?

I’m still very new to HA, but I believe you can just add a second Dark Sky to your configuration.yaml.

There are two versions - sensor and weather.
Both appear to be able to do this, so here is what I think you’ll need to do:

This is probably what your configuration.yaml looks like right now:

weather:
  - platform: darksky
    api_key: YOUR_API_KEY

You’ll probably want to add a name: “FIRST LOCATION” so you know which is which.
The first sensor uses HA latitude and longitude as default, or you can specify them.

Then add a second “weather” like this (corrected per @petro below - do not use “weather:” twice):

weather:
  - platform: darksky
    api_key: YOUR_API_KEY
  - platform: darksky
    api_key: YOUR_API_KEY
    name: SECOND LOCATION
    latitude: ###
    longitude: ####  

If you are using the sensor instead of the weather type, it should work the same.
Add the name, latitude, and longitude.

This of course is my assumption - I am not home currently to test this, but I believe it should work just fine. Remember that DarkSky has a call limit of 1000 per day for free - so if you are using the same API key for both sensors, you’ll need to make sure you don’t go over this limit.

Cheers!
DeadEnd

1 Like

Awesome! Worked first time.
Many thanks

I’m surprised this worked. The correct syntax would be:

weather:
  # First darksky platform
  - platform: darksky
    api_key: YOUR_API_KEY
  # Second darksky platform
  - platform: darksky
    api_key: YOUR_API_KEY
    name: SECOND LOCATION
    latitude: ###
    longitude: #### 

Having 2 separate weather sections will cause one of them to overwrite the other.

@petro
Thanks for the correction.
I will edit my response to to reference your post.

1 Like

I am using sensors so that may explain it. My sensors each have a name and that’s how I refer to the two instances.
They are each reporting the correct data for each location.
Thanks