On Ground / Parked detection in SimConnect

Now that i am flying again (thanks Covid), I finally have a ForeFlight subscription so i can continue working on my ForeFlight Link. I’m implementing the traffic and have things generally working, but i have 2 issues that are related.

  1. One of the thing ForeFlight asks for is if the plane is on the ground. Looking at SimConnect, best thing i can do is look at the landing gear and see if it’s touching the ground. Great! But looking at the results, things are…. Well…. Not consistent with what i expect. Blue is in the air, Brown is on the ground. Plenty of planes that are on the ground are coming back as in the air.

  1. related to the above, I want to filter out all the planes that are obviously in parking spots, as those IRL would have avionics still off and not be sending out ADS-B. So i see there is a variable PLANE IN PARKING STATE. Unfortunately this always returns false. Has anyone gotten that variable to actually show true on planes? (Especially AI planes)

//bool onGroundFlag;
simconnect.AddToDataDefinition(DEFINITIONS.OnGround, “SIM ON GROUND”, “bool”, SIMCONNECT_DATATYPE.INT64, 0.0f, SimConnect.SIMCONNECT_UNUSED); //VERIFIED

will get OnGround status

devsupport forms got me that too, yep that works. And instead of parked, apparently I can use TRANSPONDER STATE:1 (the index is missing in the docs) to get me if the transponder is off/on/test/standby/etc, so I used that for filtering.