Custom weather location solution

Discussion in 'General' started by littlematt, December 5, 2017.

  1. littlematt

    littlematt Portal Pro

    Joined:
    October 1, 2006
    Messages:
    104
    Likes Received:
    5
    Ratings:
    +5 / 0
    Home Country:
    New Zealand New Zealand
    Living in a tiny wee town in South Otago I couldn't get MP2 to find my exact location, just the nearest city.
    If you are in a similar situation, this might help you. I am suing WIN10 so location may differ....
    Go to "C:\ProgramData\Team MediaPortal\MP2-Client\Config\<USERNAME>\"
    Find the files "MediaPortal.UiComponents.Weather.Settings.WeatherSettings.xml"

    edit in notepad, go to the line that looks like
    "
    <Name>Lawrence</Name>
    <Id>2179825</Id>
    <Detail>Lat. -45.91 Lon. 169.68</Detail>"

    and change my details for yours.
    There is also a file called "MediaPortal.UiComponents.Weather.Settings.WeatherSettings.bak" that I have changed in the same way, assuming it is a backup file in case the original goes missing/corrupted or whatever.
    Not sure what the <id>xxxx</id> line means heh probably critical lol.
    Job done =)


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. littlematt

    littlematt Portal Pro

    Joined:
    October 1, 2006
    Messages:
    104
    Likes Received:
    5
    Ratings:
    +5 / 0
    Home Country:
    New Zealand New Zealand
    Okay so the <id> is for a city code as per openweathermaps API
    Thinking MP2 would call the city code rather than the lat/long I deleted that line from the xml file.
    Unfortunately my fears were confirmed now I dont get a forecast in MP2.
    Is there a way of tweaking the xml file so it calls the lat/long coordinates rather than the city code?
     
  4. HTPCSourcer
    • Team MediaPortal
    • Administrator

    HTPCSourcer MP2 Product Manager

    Joined:
    May 16, 2008
    Messages:
    10,762
    Likes Received:
    1,125
    Gender:
    Male
    Ratings:
    +2,408 / 22
    Home Country:
    Germany Germany
    Show System Specs
    It doesn't work this way. OpenWeatherMap requires the ID to deliver the corresponding weather data. Keep in mind that OpenWeatherMap uses (private) weather stations that submit data to the website.

    Now it's not that this information would really change if you moved 10 mi from location A to location B. So what you may want to do is to go to the OpenWatherMap website, allow Windows to use your location and then click on the "geo coords" (bottom-left). A map will appear that displays the OpenWeatherMap locations known in your area. Identify the closest spot to your place and either edit the MP2 setting file to use this ID or enter the chosen city name into the MP2 weather search field.

    owm1.JPG owm2.JPG
     
  5. littlematt

    littlematt Portal Pro

    Joined:
    October 1, 2006
    Messages:
    104
    Likes Received:
    5
    Ratings:
    +5 / 0
    Home Country:
    New Zealand New Zealand
    Thanks for your reply. Unfortunately the closest location to us is Dunedin which is about 90kms away and has quite different weather to us being on the coast.
    Reading the openweather API description you can use coordinates only for weather data, without city code... As per here. Is there a way for MP2 to use this ability?
    Thanks again...
     
  6. HTPCSourcer
    • Team MediaPortal
    • Administrator

    HTPCSourcer MP2 Product Manager

    Joined:
    May 16, 2008
    Messages:
    10,762
    Likes Received:
    1,125
    Gender:
    Male
    Ratings:
    +2,408 / 22
    Home Country:
    Germany Germany
    Show System Specs
    @morpheus_xx , is OWM implemented i such way that a user can enter geo coordinate instead a city code/ID?
     
  7. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    Joined:
    March 24, 2007
    Messages:
    11,070
    Likes Received:
    4,762
    Ratings:
    +6,818 / 11
    Home Country:
    Germany Germany
    Show System Specs
    Lookup by coordinates should work by following format:
    upload_2017-12-6_20-31-25.png

    upload_2017-12-6_20-31-41.png

    upload_2017-12-6_20-37-35.png
    But I get results only randomly, no idea why it sometimes work and sometimes not. First seen results after I started Fiddler proxy to inspect what is going over wire.
     
  8. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    Joined:
    March 24, 2007
    Messages:
    11,070
    Likes Received:
    4,762
    Ratings:
    +6,818 / 11
    Home Country:
    Germany Germany
    Show System Specs
    I see there is also a way to load weather forecast also based on lat/lon coordinate. So this could be an alternative if the city selection provides not the wanted values.
     
  9. Lautenbaugh

    Lautenbaugh New Member

    Joined:
    December 16, 2017
    Messages:
    4
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United States of America United States of America
    I'm a newbie here and to MP2 (version 1.18.0.0). I can't enter any information-- either in the weather screen or in the settings for weather. I'm in Omaha, NE. Tried New York and London too-- it doesn't give me any option to select anything--nothing comes up. I tried just letting it use my location-- also failed.
     
  10. Lautenbaugh

    Lautenbaugh New Member

    Joined:
    December 16, 2017
    Messages:
    4
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United States of America United States of America
    And I tried changing the file above -- "MediaPortal.UiComponents.Weather.Settings.WeatherSettings.xml". But the text of it did not contain the lines pictured above-- for city code or lat/long.
     
  11. HTPCSourcer
    • Team MediaPortal
    • Administrator

    HTPCSourcer MP2 Product Manager

    Joined:
    May 16, 2008
    Messages:
    10,762
    Likes Received:
    1,125
    Gender:
    Male
    Ratings:
    +2,408 / 22
    Home Country:
    Germany Germany
    Show System Specs
    1.18.0 sounds like you are using MP1.

    The weather data connection with OpenWeatherMap is not working at this moment. Functionality should return in a few days.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!