Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Current/Hourly Time & Temperature Conversion #3

Open
nitewing76 opened this issue Feb 28, 2021 · 2 comments
Open

Incorrect Current/Hourly Time & Temperature Conversion #3

nitewing76 opened this issue Feb 28, 2021 · 2 comments
Labels
question Further information is requested

Comments

@nitewing76
Copy link

nitewing76 commented Feb 28, 2021

Both locations in the screenshot are using the same GPS coordinates and OpenWeatherMap API. MMM-DarkSkyForecast is using gerjomarty's fork and the data is near identical to The Weather Channel iOS app.

Time

    {
        module: "MMM-OpenWeatherForecast",  
        position: "top_left",
        config: {
            apikey: "******",
            latitude: "41.8781136",
            longitude: "-87.6297982",
            updateInterval: 10,
            updateFadeSpeed: 2000,
            units: "imperial",        
            concise: false,
            useAnimatedIcons: true,
            animateMainIconOnly: true,
            forecastLayout: "table", 
            iconset: "4c", 
            showForecastTableColumnHeaderIcons: true,
            showFeelsLikeTemp: true,
            forecastHeaderText: "Weather Forecast",
            label_maximum: "",
            label_high: "",
            label_low: "",
            label_ordinals: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
            showExtraCurrentConditions: true,
            extraCurrentConditions: {
              highLowTemp: true,
              precipitation: true,
              sunrise: true,
              sunset: true,
              wind: true,
              barometricPressure: false,
              humidity: false,
              dewPoint: false,
              uvIndex: false,
              visibility: false
            },
            showHourlyForecast: true,
            hourlyForecastTableHeaderText: "",
            hourlyExtras: {
              precipitation: true,
              wind: true,
              barometricPressure: false,
              humidity: false,
              dewPoint: false,
              uvIndex: false,
              visibility: false
            },
            maxDailiesToShow: 3,
            showDailyTableHeaderRow: false,
            dailyExtras: {
              precipitation: true,
              sunrise: false,
              sunset: false,
              wind: true,
              barometricPressure: false,
              humidity: false,
              dewPoint: false,
              uvIndex: false
            },
        }
    },{
        module: "MMM-DarkSkyForecast", 
        position: "top_right",
        config: {
            apikey: "******",
            latitude: "41.8781136",
            longitude: "-87.6297982",
            updateInterval: 10,
            units: "imperial",
            showHourlyForecast: true,
            maxDailiesToShow: 4,
            concise: true,
            animateMainIconOnly: true,
            forecastLayout: "table", //tiled
            iconset: "4c",  //3c 5c
            showForecastTableColumnHeaderIcons: true,
        }
    },
@nitewing76 nitewing76 changed the title Incorrect Location Data & Time Incorrect Current/Hourly Time & Temperature Conversion Mar 2, 2021
@jclarke0000
Copy link
Owner

jclarke0000 commented Mar 7, 2021

For the time issue, It appears that I've misinterpreted OpenWeather's API documentation. The docs state that the time is returned in UTC. Also provided is a timezone offset. So interpreted this to mean that in order to get local time I needed to add the offset to the UTC time to get local time, and had done that in my code.

At first your config worked fine for me, so I couldn't figure out what was going on... it turns out that OpenWeather returns time local to where the request was made (e.g. timezone translation has already been done. So if I look up Chicago from London, the hourly times I see will be in MY local time, not Chicago's. Similarly if I change my computer's timezone to Chicago's the hourlies are translated correctly.

I will remove the the part of my code that explicitly adds the offset to hourly times.

As for the temperature showing incorrectly, you have showFeelsLikeTemp set to true in the config. This will replace the actual temperature with the "Feels like" temperature anywhere you see temperature (except Hi/Lo... that is always actual). If you set this config to false do you then see correct temperatures? Also keep in mind that OpenWeather uses the weather station closest to the long/lat you provide. It's normal to see a difference of a degree or two if you slightly change you long/lat so that another weather station is used as the source.

@jclarke0000
Copy link
Owner

Code has been updated to remove the explicit timezone offset calculation. Hourly forecast time display should now be fixed. @nitewing76 Can you also try changing the config to showFeelsLikeTemp : false and tell me if you're seeing more consistent temperatures?

@jclarke0000 jclarke0000 added the question Further information is requested label Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants