Please login or register.

Login with username, password and session length
Pages: [1] 2 3

Author Topic: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp  (Read 12317 times)

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388

I happened to noticed that the OpenWeatherMap widget was cutting off the sunset time when your preferences were to display the time in AM / PM as opposed to 24 hour.

While trying to fix that, I found that there is an OpenWeatehrMap value for Feels Like temp so I updated the program and widget to display those under the large temp display (current temp).

Looks like attached image - could use some help with the HTML formatting (was also thinking of displaying humidity with that).  Also would like to round the current temp so 33 would appear in place of 33.5.

I attached the updated program and widget (as txt files, will need to rename to Import) I have been working on too.  Any assistance would be appreciated.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10528
  • I don't work for X10, I use it successfuly!
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #1 on: February 02, 2020, 09:42:24 AM »

Nice to see others posting improvements to stock HG Programs. :)%
I never experienced the sunset/rise values getting chopped off but maybe I just don't watch those values
The Openweather Api also has a UV value which you may wish to add as well.
 #:)
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #2 on: February 02, 2020, 09:49:52 AM »

I happened to noticed that the OpenWeatherMap widget was cutting off the sunset time when your preferences were to display the time in AM / PM as opposed to 24 hour.

While trying to fix that, I found that there is an OpenWeatehrMap value for Feels Like temp so I updated the program and widget to display those under the large temp display (current temp).

Looks like attached image - could use some help with the HTML formatting (was also thinking of displaying humidity with that).  Also would like to round the current temp so 33 would appear in place of 33.5.

I attached the updated program and widget (as txt files, will need to rename to Import) I have been working on too.  Any assistance would be appreciated.

There's a number of experienced HTML coders over on the HomeGenie Club forum that I'm sure would be only to glad to help you with that. If you haven't joined up I recommend you do so.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10528
  • I don't work for X10, I use it successfuly!
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #3 on: February 02, 2020, 10:03:01 AM »

There actually is a thread on the Homegenie site for the Openweathermap modifications I started. Others have posted their samples to the thread as well.
https://homegenie.club/t/alternate-option-to-3-day-hi-low-weather-display/485
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10528
  • I don't work for X10, I use it successfuly!
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #4 on: February 02, 2020, 11:50:22 AM »

Also would like to round the current temp so 33 would appear in place of 33.5.

If you Google "C# math round" you'll get a number of examples. you may have to play to see which works best for you.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #5 on: February 02, 2020, 01:09:49 PM »

I made a post over on the HomeGenie forum here:
https://homegenie.club/t/openweathermap-to-include-todays-high-temp-forecast-and-feels-like-temperature/586

But could not attach the program and widget as I got an error that new users can not upload attachments.  I was able to include the screen shot though.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10528
  • I don't work for X10, I use it successfuly!
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #6 on: February 02, 2020, 01:15:52 PM »

Most forums have a post limit that must be reached in order to post attachments this helps reduce spammers.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #7 on: February 02, 2020, 01:45:16 PM »

Found the rounding, its actually quite simple.

temperature = Math.round(temperature, 2);

So do that for feels_like too and voila.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10528
  • I don't work for X10, I use it successfuly!
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #8 on: February 02, 2020, 01:58:07 PM »

The OpenWeatherMap API supplies a fair bit of info for users to play with. Nice to read you got the math.round to work the way you wished.
Usually you can find the code to do what you wish with Google it is just a mater of wording the search the right way. ;)
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #9 on: February 02, 2020, 02:03:35 PM »

I also just noticed the wind speed and rain / precipitation is not converted to match the US measurements like temperature is (i.e. inches and not mm, mph and not kmh).

Not sure how to do that.   Lastly, the temp that displays in the dashboard (upper right corner) does not show the rounded temp.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10528
  • I don't work for X10, I use it successfuly!
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #10 on: February 02, 2020, 02:13:59 PM »

I also just noticed the wind speed and rain / precipitation is not converted to match the US measurements like temperature is (i.e. inches and not mm, mph and not kmh).

Not sure how to do that.   Lastly, the temp that displays in the dashboard (upper right corner) does not show the rounded temp.
Not sure where you did the math.round in widget or program code.
The Value in the top right of HG I believe is pulled from the program  as is the humidity.
I never played with the metric to imperial conversion in HG however did with other programs, a search in Google will yield some samples.
However I believe the API can send in metric or imperial so you may wish to look at what Gene was using for the calls.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #11 on: February 02, 2020, 02:26:17 PM »

Was able to find a way to convert the windspeed and the rainmm to US.  Not sure if those are accurate or not, will need to check - but for display purposes it looks right.

Here is the updated screen shot and the program and widget attached.  All for now, time to go get ready to watch the Super Bowl (unfortunately the Patriots are not in it this year - which I assume most people are happy about at this stage - but should be a good game anyway).  If you are watching this year hope you enjoy it.

Thanks
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #12 on: February 02, 2020, 05:32:30 PM »

Jeez you’re flying through HG. Just waiting until your C#, Python and JavaScript skills are up to speed and you will become a net contributor to the HG project. Your quick learning skills will be greatly appreciated over at the HomeGenie Club forum. HG is an application you either take to quickly or struggle through painstakingly.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #13 on: February 02, 2020, 06:08:12 PM »

For anyone trying out @soxfan1966 modified weather utility ensure you export a copy of the originals before you import this modified version should you ever want to revert to the originals as it makes life a lot easier.
Logged

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: OpenWeatherMap to include Today's High Temp forecast and Feels Like Temp
« Reply #14 on: February 03, 2020, 06:52:44 AM »

Should also note that my programs include the Fahrenheit character fix.

Tried finding where the temperature in the top right corner comes from and rounding he weather.temp field in the OpenWeatherProgram but that did not seem to affect it.  It may be pulling in the value directly somewhere else that would need to be updated.

The attached image is what I am referring to (upper right corner on the Dashboard you have the Weather Widget displaying on.
Logged
Pages: [1] 2 3
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.