This may work, I should try this. Can current smartphone resolution decide the elevation difference between the first and the second floors of a building?
lots of phones have barometric sensors that can be used for more accurate elevation differences. sadly it seems to be a "premium" feature and i can't find it in any phone <300 dollars in price
https://ieeexplore.ieee.org/document/6817923
Those sensors you are referring to are not reliable enough to tell elevation accurately. In addition to that, buildings may have different pressure to the outside
i have successfully told the difference between the ground and 3rd floor with a galaxy note 3's barometric sensor(for triggering home routines only when actually at home vs just arriving at the location)
To reliably triangulate elevation from GPS data you need quite a lot of satellites. Air pressure gives a better signal, but obviously needs to be calibrated for weather etc.