0 votes
by (190 points)
edited by
Downloaded weather station and would like to change date,time as well as location.Read several things on internet but am still confused.Seems that the location DL ,CH and Zurich has to be changed in json file, was not able to do or understand the how to .Would like it to show my area USA,  Brockport NY. The time also is off by 6 hrs ,my time is 8 am and the display is 14:00. Tried to change values to show Fahrenheit but still shows Celsius.Would greatly appriciate it if someone could guide me here,thanks

Using Arduino 1.8.3

I changed DL to EN and got english

still need assistance on :

Still trying to fix CH country and State info

Time off by + 6hrs

2 Answers

0 votes
by (10.0k points)
selected by
 
Best answer

Hi Larry

Country/state, city and language are part of the settings. They are either located at the top of the demo (simple demo) or in the settings.h file. If you are in the US you replace CH with your state otherwise use the country code. This is an example for San Francisco, California:
http://api.wunderground.com/api/Your_Key/conditions/q/CA/San_Francisco.json

Don't forget to replace Your_Key with the key you got from Wonderground.

I created a step-by-step guide which explains all the required steps:
https://blog.squix.org/weatherstation-guide

You usually get this guide by either subscribing to my newsletter or by buying my starter kit. So if you like the guide (or my support) please consider helping me with a nice review either on Amazon:

https://www.amazon.com/Original-Squix-Electronic-Internet-Exploration/dp/B01KE7BA3O/

 or on my own shop:

https://blog.squix.org/product/weatherstation-kit-w-white-oled

You would help me a lot!

by (190 points)
edited by
Sorry for my ignorance here, very new to all this, created a .json file using notepad , updated it to Arduino and sent it to Node MCU , time is still off by +6 and now my display shows N/A C and NA for the days and still in Celius
json
{
  "response": {
  "version":"0.1",
  "termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
  "features": {
  "conditions": 1
  }
    }
  ,    "current_observation": {
        "image": {
        "url":"http://icons.wxug.com/graphics/wu2/logo_130x80.png",
        "title":"Weather Underground",
        "link":"http://www.wunderground.com"
        },
        "display_location": {
        "full":"Brockport, NY",
        "city":"Brockport",
        "state":"NY",
        "state_name":"New York",
        "country":"US",
        "country_iso3166":"US",
        "zip":"14420",
        "magic":"1",
        "wmo":"99999",
        "latitude":"43.20999908",
        "longitude":"-77.94000244",
        "elevation":"157.9"
        },
        "observation_location": {
        "full":"Village of Brockport, NY, Brockport, New York",
        "city":"Village of Brockport, NY, Brockport",
        "state":"New York",
        "country":"US",
        "country_iso3166":"US",
        "latitude":"43.219856",
        "longitude":"-77.929291",
        "elevation":"600 ft"
        },
        "estimated": {
        },
        "station_id":"KNYBROCK5",
        "observation_time":"Last Updated on August 2, 9:04 AM EDT",
        "observation_time_rfc822":"Wed, 02 Aug 2017 09:04:13 -0400",
        "observation_epoch":"1501679053",
        "local_time_rfc822":"Wed, 02 Aug 2017 09:16:58 -0400",
        "local_epoch":"1501679818",
        "local_tz_short":"EDT",
        "local_tz_long":"America/New_York",
        "local_tz_offset":"-0400",
        "weather":"Partly Cloudy",
        "temperature_string":"74.1 F (23.4 C)",
        "temp_f":74.1,
        "temp_c":23.4,
        "relative_humidity":"71%",
        "wind_string":"From the South at 3.2 MPH",
        "wind_dir":"South",
        "wind_degrees":180,
        "wind_mph":3.2,
        "wind_gust_mph":0,
        "wind_kph":5.1,
        "wind_gust_kph":0,
        "pressure_mb":"1018",
        "pressure_in":"30.08",
        "pressure_trend":"+",
        "dewpoint_string":"64 F (18 C)",
        "dewpoint_f":64,
        "dewpoint_c":18,
        "heat_index_string":"NA",
        "heat_index_f":"NA",
        "heat_index_c":"NA",
        "windchill_string":"NA",
        "windchill_f":"NA",
        "windchill_c":"NA",
        "feelslike_string":"74.1 F (23.4 C)",
        "feelslike_f":"74.1",
        "feelslike_c":"23.4",
        "visibility_mi":"10.0",
        "visibility_km":"16.1",
        "solarradiation":"--",
        "UV":"2","precip_1hr_string":"-999.00 in ( 0 mm)",
        "precip_1hr_in":"-999.00",
        "precip_1hr_metric":" 0",
        "precip_today_string":"0.00 in (0 mm)",
        "precip_today_in":"0.00",
        "precip_today_metric":"0",
        "icon":"partlycloudy",
        "icon_url":"http://icons.wxug.com/i/c/k/partlycloudy.gif",
        "forecast_url":"http://www.wunderground.com/US/NY/Brockport.html",
        "history_url":"http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=KNYBROCK5",
        "ob_url":"http://www.wunderground.com/cgi-bin/findweather/getForecast?query=43.219856,-77.929291",
        "nowcast":""
    }
by (550 points)
Just a quick note, you mentioned in your comments that you changed from true to false, but the code you pasted still shows true.
the line that reads
const boolean IS_METRIC = ....
should read false

ie const boolean IS_METRIC = false;

that will change the calculations, but not the C display character.

To change the letter C to F, there are a few places to look:
Easiest way to find where it's used is to search the code for
C"
thats a capitol C, followed by a single double quote.

search this and note where it stops -
You will likely see lines like this:
  String temp = wunderground.getCurrentTemp() + "°C";

just change each C to an F
( you'll need to do this in a few places.)
0 votes
by (190 points)
Resolved my Time difference, all I needed to do was change my setting from 2 to -4, read it somewhere that it increments by 30 so that is working ok now. Great learning experience here.Still struggling with the country part of this, got english working but when I tried to change .json to read Brockport it did not work correctly.
by (10.0k points)
Hi Larry
I am not really sure what you do with this json file. There should not be any need for one. The ESP8266 downloads a file like yours from the server. To know which weather information it should download you have to change some settings in the demo. Which sample are you using? If you are using the simple demo have a look at these lines:
const boolean IS_METRIC = true;
const String WUNDERGRROUND_API_KEY = "WUNDERGROUND_API_KEY";
const String WUNDERGRROUND_LANGUAGE = "DL";
const String WUNDERGROUND_COUNTRY = "CH";
const String WUNDERGROUND_CITY = "Zurich";

and change them into something like

const boolean IS_METRIC = false;
const String WUNDERGRROUND_API_KEY = "WUNDERGROUND_API_KEY";
const String WUNDERGRROUND_LANGUAGE = "EN";
const String WUNDERGROUND_COUNTRY = "NY";
const String WUNDERGROUND_CITY = "Brockport";

DON'T FORGET TO CHANGE THE WUNDERGROUND_API_KEY with the one you created on the wunderground website! The guide I linked explaines this step-by-step...
by (190 points)
edited by
Thank you very much , you make things very clear and I appriciate it .
// Wunderground Settings changed boolen default from true to false 8/2
const boolean IS_METRIC = true;
const String WUNDERGRROUND_API_KEY = "##############";
const String WUNDERGRROUND_LANGUAGE = "EN";
const String WUNDERGROUND_COUNTRY = "NY";
const String WUNDERGROUND_CITY = "Brockport";

The part that threw me is that Country I put in USA not State  NY and for some reason I still read temps as Celius
Partly cloudy 26.9C
Indoor 26.0C
Also , how do I get outdoor temp to show, do I need to change code or should it be updated from Wunderground.Not sure if I need to add something like another sensor.

Thursday and the rest read out as 19/27 which I have to assume is again C ,so maybe I still need to change something.I can start over from scratch seeing how you did all the work and all I had to do was attache a few wires and edit code.LOL  , Thanks again for the kind and clear instruction and also all your hard work.Someday I hope to be able to do this from scratch ,that is my goal.
by (190 points)
Thanks , I need to buy you coffee for sure.Oddly enough it was just that simple,I guess I was reading more into it than necessary, nice project. All works just fine, I have noticed that what Wunderground has on thrie sirte is not what my display shows,some parts is close but others are quite a bit off. ie , its raining and the site shows humidity 98%  temp 69 deg while my display shows 87.5 deg38%. I know it is neither  87 0r 38% so that is something I would like to correct,any ideas? Also serious about your coffee , i went to do that but it was in German for Paypal and would not translate. to english.

Welcome to ThingPulse Q&A, where you can ask questions and receive answers from other members of the community.

https://thingpulse.com

...