Dark Sky sensor low temperature

How do I get today’s low temperature from Dark Sky?
I have configured:

  - platform: darksky
    api_key: <my key>
    forecast:
      - 0
      monitored_conditions:
      - temperature_high
      - temperature_low

It creates sensor.dark_sky_overnight_low_temperature_0 and sensor.dark_sky_daytime_high_temperature_0,
The high temperature is ok, but the low temperature shows low for tomorrow, not for today (validating with Dark Sky phone app)

I guess from tomorrow onwards, I can shift it to show temperature for day-1, but how do I get low for today? There is no sensor.dark_sky_overnight_low_temperature_-1

Never checked if my config returns correct results. I use the following:

- forecast:
  - 1

And have sensors ‘sensor.dark_sky_overnight_low_temperature’ and ‘sensor.dark_sky_overnight_low_temperature_1’ available that show different temperatures.

This is the way I had it, but it changed in 0.83.0. The sensor.dark_sky_overnight_low_temperature is not there anymore, so I am trying to fix that.

The point is, that sensor.dark_sky_overnight_low_temperature_x always shows temperature for the day x+1. It says overnight, I get it. But it kind of sucks. But now with removing sensor.dark_sky_overnight_low_temperature I do not know how to get to today, as _0 shows tomorrow…

I’m still on 0.82.1, so I didn’t yet notice. The change is this one and it’s obviously a breaking change.

[irony]The idea is probably that today’s low temperature was at 6 a.m. and HA-users get up at 8.[irony off]

I think temperature_min gives the minimum temperature for the previous night, but using that generates a deprecated warning in the HA log

See this from the DarkSky api documentation.

Overnight low temperatures usually occur around dawn, and so will usually occur on a different date from the daytime high temperatures. (This is the primary difference between temperatureLow and temperatureMin.)

Look, the first screenshot is from Dark Sky website. It shows today -7/0, tomorrow -1/3, Sunday 0/9
Then there is he darsksky sensor, it show today -1/0, tomorrow 0/3, Sunday 8/7
If you say low is -1 day shifted, then I get today ???/0, tomorrow -1/3, Sunday 0/7

Which I can deal with, but how do I get low for today?

Ok, I will use the deprecated metod then. But I guess it will stop working going forward, so then what?

image

image

1 Like

temperature_min produces a warning because it is deprecated in the Darksky API and will probably disappear soon:

I suppose you could use their Time Machine method to request it somehow
https://darksky.net/dev/docs#time-machine-request

One way to do this is with a small appdaemon script. Basically take the low between 12:00 and 23:30 and save it to a separate entity. After midnight the dark sky sensor updates to the next night and the value for the current night is lost. Because of this, having automatons that rely on knowing the low after midnight is tough without a hack like this.

    def initialize(self):
        self.listen_state(self.darksky1, "sensor.dark_sky_overnight_low_temperature_0d")

    def darksky1(self, entity, attribute, old, new, kwargs):
        if datetime.time(12,00) <= datetime.datetime.now().time() <= datetime.time(23,30):
            self.set_state("sensor.custom_current_night_low_temp", state = new, attributes = {"unit_of_measurement": "°F"})