Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: 1 2 [3]

Author Topic: Updated Weather Program and Widget  (Read 1717 times)

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1030
Re: Updated Weather Program and Widget
« Reply #30 on: December 19, 2020, 03:42:12 PM »

Thanks!   Sorry.  I tried all 3 of my valid API keys, no difference.  I'd help diagnose if I could!  I compared the Javascript code to the original and see where you added stuff.  Original works (same API key).  I deleted all your javascript and replaced it with the original.  No more error showed but still did not work.  I am not sure what the HTML code does?  Does that build the widget and the javascript is the code to fill it in maybe?

Thanks for helping!  Your version is so much better!
Logged

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 375
Re: Updated Weather Program and Widget
« Reply #31 on: December 21, 2020, 11:16:29 AM »

OK, I looked into this a bit this morning.  I do not see anything wrong with the code on my eld, and the program (my version) has been working with no issues for awhile.

Here are my current settings, maybe there is one that is different than what you have and it is causing the problem.

In HomeGenie Maintenance page, under System Options I have the Longitude and Latitude defined for my area, and under the User Interface I have Fahrenheit and Month/Day/Year 12hr am/pm as my settings.

In the jkUtils - Solar Altitude Program I have the Latitude and Longitude settings defined (same as what I have on the Maintenace page, but both are defined).

I have the standard OpenWeatherMap program Disabled (the button for it is gray).

The Soxfan1966 version of the OpenWeatherMap program is active (the button is green) .
Here are my settings for my program:
Debug Mode = 0 (disabled)
Fahrenheit Enable = 1
Forecast time - Afternoon = 12
Forecast time - Evening = 21
Forecast time - morning = 6
Language = EN
Location - Use Lat & Lon for data = 1
OpenWeatherMap API Key = defined (use your own key here)
Precipitation Last 3 Days = 0 (I used this is the summer to track rainfall for watering my lawn, so it was working when this was 1 too)
Precipitation Last 3 Days - Target = 0.65
Precipitation Rate = 1
Temperature Rounding Enable = 1
Update Interval = 30

Under Widgets there are 2 entries - one for the standard and one for mine.
1) homegenie/environment/weather = this is the standard widget and uses the standard program (the bind to module is OpenWeatherMap).  I do not have this on my HomeGenie Dashboard(s).

2) homegenie/generic/weather = this is my version of the widget and uses my version of the program (the bind to module is OpenWeatherMap - Soxfan1966 Version).

Can you check all of those settings on your end and update as needed and let me know the results.  Thanks





Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1030
Re: Updated Weather Program and Widget
« Reply #32 on: December 26, 2020, 12:33:16 PM »

I am feeling the issue may be the widget code instead of the program code?  Not sure what that splice error is...

So summary is all settings pretty much identical to yours.  Trying to point jkUtils to different program didn't work so left it pointing at jkUtil program.

Your program just insists on not getting data;  not sure where it is waiting on data from.  Screen shot attached...  Problem is "Unable to get data from service.  Object reference not set to an instance of an object." 

SOUNDS LIKE YOUR PROGRAM CANNOT FIND THE IP ADDRESS OR DOMAIN OF OPENWEATHERMAP.ORG...   

I have 3 API keys I made years ago;  jkUtils uses any and gets the info, but maybe I need a newer one for your call?  I will make a new API key and try that...

If I knew which line of code the above error referred to...

Can you check all of those settings on your end and update as needed and let me know the results.  Thanks

BIG THANK YOU FOR THIS INFO!    I will go down your list one by one and check them off!

In HomeGenie Maintenance page, under System Options I have the Longitude and Latitude defined for my area
- MINE IS ALSO SET


under the User Interface I have Fahrenheit and Month/Day/Year 12hr am/pm as my settings.
- BOTH MINE OPPOSITE - i CHANGED

In the jkUtils - Solar Altitude Program I have the Latitude and Longitude settings defined (same as what I have on the Maintenace page, but both are defined).
- I RECALL ONCE THERE MAYBE DIFFERENT VERSIONS OF jkUtils?  Mine does not ask for long/latitude - but it shows it on the widget!  It picked up the close by city rather than MY entered values - which is fine, close enough...

I have the standard OpenWeatherMap program Disabled (the button for it is gray).
- I TRIED BOTH WAYS;  LATEST NOW I HAVE IT DELETED.

The Soxfan1966 version of the OpenWeatherMap program is active (the button is green) .
- YES, BOTH jkUtils & YOUR PROGRAM ARE GREEN.

Here are my settings for my program:
Debug Mode = 0 (disabled)
Fahrenheit Enable = 1
Forecast time - Afternoon = 12
Forecast time - Evening = 21
Forecast time - morning = 6
Language = EN
Location - Use Lat & Lon for data = 1
OpenWeatherMap API Key = defined (use your own key here)
Precipitation Last 3 Days = 0 (I used this is the summer to track rainfall for watering my lawn, so it was working when this was 1 too)
Precipitation Last 3 Days - Target = 0.65
Precipitation Rate = 1
Temperature Rounding Enable = 1
Update Interval = 30
- ALL SET SAME HERE

Under Widgets there are 2 entries - one for the standard and one for mine.
1) homegenie/environment/weather = this is the standard widget and uses the standard program (the bind to module is OpenWeatherMap).  I do not have this on my HomeGenie Dashboard(s).
- I BELIEVE I USED TO HAVE THIS ONE BEFORE i DELETED THE STANDARD PROGRAM.  NOT THERE NOW.

2) homegenie/generic/weather = this is my version of the widget and uses my version of the program (the bind to module is OpenWeatherMap - Soxfan1966 Version).
- YEP, GOT IT, AS WELL AS A "jkUtils/OpenWeatherMap/OpenWeatherMap"
- I WONDER IF I SHOULD MAYBE try to point the jkUtils widget to your program instead?  not possible.

« Last Edit: December 26, 2020, 12:53:17 PM by mike »
Logged

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 375
Re: Updated Weather Program and Widget
« Reply #33 on: December 27, 2020, 09:22:48 AM »

The issue is that the call to the API is not getting all of the fields / info it needs to make a valid call and therefore there is no data being returned to parse.

I don't think the issue is in the code (widget or program) unless it's related to one of the settings - which you said all match mine

In one of your earlier screen shots of the settings/parameters you did not have the long/lat settings defined in my widget and your API key was missing.  Can you check those again?

You may also want to try deleting the program and widget and then import them again to make sure nothing got messed up when you were tinkering.

From there, if you can screen shot your params/settings again I can try setting things on my end to match yours and possibly track down what the issue is.  Not sure what else you can try at this point, sorry.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1030
Re: Updated Weather Program and Widget
« Reply #34 on: December 27, 2020, 09:45:32 AM »

any clue in farenheight not changing? 
Logged

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 375
Re: Updated Weather Program and Widget
« Reply #35 on: December 27, 2020, 09:48:57 AM »

You need the HG system setting (preference) to be Fahrenheit too I believe.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1030
Re: Updated Weather Program and Widget
« Reply #36 on: December 27, 2020, 09:50:34 AM »

got both set to F   (:
Logged

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 375
Re: Updated Weather Program and Widget
« Reply #37 on: December 27, 2020, 09:52:31 AM »

If the program is not getting data from the API call it defaults to hardcoded data in the display.  It may be that.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1030
Re: Updated Weather Program and Widget
« Reply #38 on: December 27, 2020, 01:01:37 PM »

Thank you for trying to help me get it running.  Time to throw in the towel here.  Deleted yours, original (#34), & jkUtils, reinstalled all 3 again, put in API keys, city.  Same as before. Just not meant to be!

TypeError: Cannot read property 'Value' of null
Line 7313, Column 20

Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 21
  • Posts: 1685
Re: Updated Weather Program and Widget
« Reply #39 on: December 27, 2020, 06:29:07 PM »

Thank you for trying to help me get it running.  Time to throw in the towel here.  Deleted yours, original (#34), & jkUtils, reinstalled all 3 again, put in API keys, city.  Same as before. Just not meant to be!

TypeError: Cannot read property 'Value' of null
Line 7313, Column 20

Have you tried restoring your SD card to a last know working version. From reading your endeavours here it sounded like you were giving it a good hammering taking chunks of code out to make it work. Maybe following soxfan instructions with a last known stable setup you may have success. If itís worked on one setup thereís no reason why it canít work on yours.
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 21
  • Posts: 1934
Re: Updated Weather Program and Widget
« Reply #40 on: December 27, 2020, 06:58:46 PM »

Just a thought, but when you get to a point where things are working ok, you could use rpi-clone to create a backup card that you can step back to if you break things.  I personally opt for both a backup sd and writing down every command that I've decided is correct into a script of sorts.  When you get to a point where it's too broken, you then have 2 options to get back up and running.  If you are just flailing by throwing commands against the wall without writing down what you've done, you'll never get what you want because even if you succeed this time, the next thing you touch will break your card.

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 21
  • Posts: 1685
Re: Updated Weather Program and Widget
« Reply #41 on: December 27, 2020, 08:31:17 PM »

When you randomly use the sudo command it has consequences if you're not sure what you're doing. There's a lot of so called solutions to problems on the web and many of them are either ill conceived, out of date or just damn lazy hacks to get things working.

Try avoid going for the first solution. Read a number of solutions carefully and weigh up what best fits your problem. There's nothing worse than poorly documented code hacks. They provide little logic and when challenged the authors stock answer is, ah they just worked.

As I mentioned above and have mentioned many times go back to the point where your system was stable and follow the instructions as given. Clearly you need to delete what you had originally in place and replace it with soxfan solution. He did all the hard work so your don't have to. The only difference in his setup and yours is possibly a location and an Api key.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1030
Re: Updated Weather Program and Widget
« Reply #42 on: December 29, 2020, 02:53:17 PM »

Thank you for trying to help me get it running.  Time to throw in the towel here.  Deleted yours, original (#34), & jkUtils, reinstalled all 3 again, put in API keys, city.  Same as before. Just not meant to be!

TypeError: Cannot read property 'Value' of null
Line 7313, Column 20

Thanks for ideas Petera, but I have never had a working version of this so no restore will help.

Have you tried restoring your SD card to a last know working version. From reading your endeavours here it sounded like you were giving it a good hammering taking chunks of code out to make it work. Maybe following soxfan instructions with a last known stable setup you may have success. If itís worked on one setup thereís no reason why it canít work on yours.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1030
Re: Updated Weather Program and Widget
« Reply #43 on: December 29, 2020, 03:03:50 PM »

Just a thought, but when you get to a point where things are working ok, you could use rpi-clone to create a backup card that you can step back to if you break things.  I personally opt for both a backup sd and writing down every command that I've decided is correct into a script of sorts.  When you get to a point where it's too broken, you then have 2 options to get back up and running.  If you are just flailing by throwing commands against the wall without writing down what you've done, you'll never get what you want because even if you succeed this time, the next thing you touch will break your card.

I do keep a good working SD card image backup, so no issue there.

You have a great scheme by writing down each change as you go!  I do the same.  I have bookshelves full of my notebooks with detail by detail notes going back to 1975 of every business phone call, every customer visit to solve tech problems, complete as you say, down to the minute, of exactly every line of code I changed as I went along.  I can unroll every change I made with a customer on site for 45 years, line by line.  It has served me well.  I have been called in many times to solve 'unsolvable' problems others tried to fix for weeks and months and solved every one of them - with this method.

This method, added to my other 2 beliefs (1) "I am from MO. - SHOW ME" - If I did not witness it myself I do not take my customer's word of what is going on, and 2) I am a great believer in what you did last broke it;  so I tend to go overboard asking my customer whom I am trying to help solve a difficult technical issue, when did it last WORK?  Tell me what you did between then and NOW.
Logged
Pages: 1 2 [3]
 

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