[App][Pro] OpenWeather

The red one is for the free API key (see its name).
The green ones are for OneCall API (subscription). You need a location device (current weather). Then you can add further devices for details (daily, hourly…).

If your location device is not working (wrong API key), the detail (child) devices won’t work, too.

Just create a OneCall API key and add a subscription. Add a limit for 1000 calls/day and you have a free API access :wink:

hi, installed OW a couple of days ago and all working great. 2 days ago though, rain prediction and amount stopped working. all other metrics work. if I look in homey at the sensor, all data is updated except for rain prediction and amount. it has data of a couple of days old.

anybody have the same issue? any ideas on what to do to solve it?

thanks!

Thanks Ronny for the great app. It was very helpful in creating a flow that is designed to control my SmartWIngs Zigbee Outdoor Shades based on current weather conditions. Here is my latest YouTube video featuring the advanced Homey flow. Thanks again!

1 Like

This looks really cool :slight_smile: I already had an openweathermap API key, so started playing with this.

We have heat tape on the bottom edges of the roof to help prevent snow buildup, each one controlled via a smart switch. The ideal flow would be to turn them on when it’s actually snowing, and turn them off when it has not been snowing for at least 4 hours

I see 2 cards that might be useful -

  • Snow becomes greater than XX mm
  • Snow precipitation is more than XX

I think either of those would be good to start the flow, turning on the heat tapes. XX mm is total accumulation, right ? But what is the units for the 2nd precipitation card, just XX ?

I’m not sure how to do the 2nd part, turning off the heat tape after 4 hours of no snow. Something along the lines of noting when snow precipitation stops and setting a variable or timer. Then checking that until it goes over 4 hours, then turning off the heat tapes.

Any ideas ?

Has anyone played with the Snow precipitation cards ? I’m not sure of the right way to do this - as mentioned above, I want to turn on the heat tape when it has snowed more than, say, 20mm. This is what I have - note the two paths

They both look right, but I don’t know the actual conditions to trigger them. I think the “becomes greater than” one is a one-shot right ? It will only trigger once, when the total snow accumulation goes over 20mm.

How often would the lower path fire ? I’m guessing whenever openweather updates the total accumulation, and that is checked every 5 mins (actually I think I set it to 15mins). But is that “snow precip is more than 20mm” the total accumulation ? Over what time period ? Or just since the last update ?

The perticiparion for current weather is only an estimated value for this day. It can happen or not.

A more realistic value you could get using thw daily history device. Based on the API description is should show the amount of precipitation in the past.

But I don’t know how exact it will be.

You can try a daily history device with an offset =0. This should be the amount from today (until now).

But: OWM only delivers percipitation (possible only rain or rain+show). You can check the values and use max.temp. as condition to check only percipitation is its <0°C.

The data depends on the local weather provider used by OWM for the country. Quality can be different…

OK, I’ve been doing a bit of experimenting, and I think I’m getting a better idea of what’s available from OpenWeather. I set up these flows to shoot log entries to a remote log

We had some snow the last couple of days, not much, about 10cm total maybe. I set this up towards the end of the snow period though, so I missed the start and full run of snowing. The results of the log …

Feb 18 19:38:47 Homey snow_all_changes Snow > 0mm (1) with precip (0)
Feb 18 19:38:47 Homey Snow precip changed (1) with (0.75) mm and precip (0)
Feb 18 19:53:47 Homey Snow precip changed (0) with (0.21) mm and precip (0)
Feb 18 20:38:47 Homey Snow precip changed (0) with (0.14) mm and precip (0)
Feb 18 21:08:47 Homey Snow precip changed (0) with (0) mm and precip (0)
Feb 19 02:38:48 Homey Snow precip changed (0) with (0.1) mm and precip (0)
Feb 19 03:38:49 Homey Snow precip changed (0) with (0.13) mm and precip (0)
Feb 19 04:38:49 Homey Snow precip changed (0) with (0.33) mm and precip (0)
Feb 19 05:38:49 Homey Snow precip changed (0) with (0.15) mm and precip (0)
Feb 19 06:38:50 Homey Snow precip changed (0) with (0.24) mm and precip (0)
Feb 19 07:38:50 Homey Snow precip changed (0) with (0.33) mm and precip (0)
Feb 19 08:38:50 Homey Snow precip changed (0) with (0.22) mm and precip (0)
Feb 19 09:38:50 Homey Snow precip changed (0) with (0) mm and precip (0)
Feb 19 10:23:51 Homey Snow precip changed (0) with (0.25) mm and precip (0)
Feb 19 10:53:51 Homey Snow precip changed (0) with (0.32) mm and precip (0)
Feb 19 11:08:51 Homey Snow > 0mm (1) with precip (0)
Feb 19 11:08:51 Homey Snow precip changed (1) with (0.51) mm and precip (0)
Feb 19 11:23:51 Homey Snow precip changed (1) with (0.76) mm and precip (0)
Feb 19 11:38:51 Homey Snow precip changed (1) with (0.51) mm and precip (0)
Feb 19 11:53:51 Homey Snow precip changed (1) with (1.27) mm and precip (0)
Feb 19 12:08:51 Homey Snow precip changed (1) with (0.89) mm and precip (0)
Feb 19 12:23:51 Homey Snow precip changed (1) with (0.76) mm and precip (0)
Feb 19 12:53:51 Homey Snow precip changed (1) with (0.89) mm and precip (0)
Feb 19 13:08:51 Homey Snow precip changed (0) with (0) mm and precip (1.78)
Feb 19 13:23:51 Homey Snow > 0mm (1) with precip (0)
Feb 19 13:23:51 Homey Snow precip changed (1) with (1.27) mm and precip (0)
Feb 19 13:38:51 Homey Snow precip changed (0) with (0) mm and precip (0.51)
Feb 19 15:38:52 Homey Snow > 0mm (1) with precip (0)
Feb 19 15:38:52 Homey Snow precip changed (1) with (1.27) mm and precip (0)
Feb 19 16:08:52 Homey Snow precip changed (0) with (0) mm and precip (0.25)

The Snow precip changed entries appear to trigger on any change in snow precip. The Snow precipitation in millimeters variable is available in this flow as you can see from the image above, and is shown in the log entries as with (0.24) mm for example. The Snow variable is just the rounded up/down value of the Snow precipitation in millimeters variable.

But I don’t know if that is since last check, or over last hour or last . What that value represents is kind of critical - anyone have any idea ?

The Snow > 0mm entries look like they only trigger when the snowfall transitions from 0 to >1. That makes sense. Oddly though the Snow precipitation in millimeters variable is NOT available to the flow.

I exported the flows, and these are the json blobs for the message in the logging cards

Snow precip changed

"message": "Snow precip changed ([[homey:device:0352642f-a0bd-410f-a2cf-1bd1b601821a|measure_snow]]) with ([[trigger::e49b6a0b-4293-40b2-a186-4778db578051::measure_snow]]) mm and precip ([[homey:device:0352642f-a0bd-410f-a2cf-1bd1b601821a|measure_rain]])"

Snow > 0mm

"message": "Snow > 0mm ([[homey:device:0352642f-a0bd-410f-a2cf-1bd1b601821a|measure_snow]]) with precip ([[homey:device:0352642f-a0bd-410f-a2cf-1bd1b601821a|measure_rain]])"

From this it seems that the #Snow variable is just the rounded up/down value of the #Snow precipitation in millimeters variable, the measure_snow value. The #Precipitation variable is the amount of rain, not snow (I think).

I’m think that when the #Snow variable transitions from 1→0 the #Precipitation variable (measure_rain) is actually measuring rainfall, like it got warmer so the snow changed to rain. In the 3x instances of that in the log at the bottom the #Snow precipitation in millimeters variable was 0.

There is one instance of that 1→0 change at the top of the log where the #Snow precipitation in millimeters variable was 0.21 and the #Precipitation variable was 0, so that makes sense. It was still snowing, not raining.

We need a heavier snowfall to see if the #Snow variable increases to 2 for a 2.5mm value of #Snow precipitation in millimeters

Now I need to figure out the logic to figure out how much snow has fallen, and when to turn on the heat tapes. Ideal would be a rolling window, say over 25mm over the last 24 hours. For example, it gets up to 50mm and then stops. As the window moves forward in time, eventually the entries will total up to < 25mm, and we turn the heat tapes off.

I don’t think we can do this with just logic, so it will probably have to be a script that can maintain state. Maybe 24 buckets and the collected total snow precipitation for each hour dropped into each bucket. Then total up the buckets and if > 25mm turn on the tapes, if < 25mm turn them off. Something like that. Hrm, the Simple (sys) Log app can export in csv or json …