METAR via SimConnect

Hey Guys, I would like to suggest the idea of getting the METAR-Data via the
SimConnect Interface. In the old SDK (FSX) we had functions called: -
SimConnect_WeatherRequestObservationAtStation -
SimConnect_WeatherRequestObser``vationAtNearestStation (Both listed in the
current Docs as deprecated). Getting the METAR via SimConnect would allow
external tools to get the current weather at a location and use it in internal
process. For our application (AIG Traffic Controller), we would be able to
“hold” all departures at an airport when a thunderstorm is in the area. Kai
Related question: https://devsupport.flightsimulator.com/t/4820

This would be a very helpful feature!

Would also love having it in an in-sim variable, so it could be used in
scripts.

In Javascript you can already use use

      1. Coherent.call('GET_METAR_BY_IDENT', ident);
  2. and
  3. Coherent.call('GET_METAR_BY_LATLON', lat, lon);

Sorry to come with this old topic. I cant make this work. Is this still valid?

function getMetarByIcao(ident) {
            console.log("Fetching METAR for ICAO:", ident);
        
            let metarPromise = Coherent.call('GET_METAR_BY_IDENT', ident);
            
            console.log("Coherent call made:", metarPromise);
        
            metarPromise.then(metarString => {
                console.log("Promise resolved:", metarString);
                if (metarString) {
                    bb711MetarStringID.textContent = metarString;
                } else {
                    bb711MetarStringID.textContent = "METAR not available or no valid ICAO entered.";
                }
            }).catch(error => {
                console.error("Error fetching METAR:", error);
                bb711MetarStringID.textContent = "Error fetching METAR.";
            });
        
            console.log("After promise handling");
        }

getMetarByIcao('KSFO');

Status = pending is all that throws.
Im really sorry, ive searched now quite while, i cannot find anything in the docu about this. I find ambient vars etc but not METAR.

The reason i ask is, i have written this app in flow, they have an API to get the metar so it has to be possible somehow. Now i want to do same in toolbar. For that i would need exacty these 2 functions ^^

You need a facility listener registered in your instrument before the facility Coherent calls will work.

1 Like