Weathersnoop reporting station pressure to WU

Good morning all, I was just wondering if anyone knows the script for the Sea Level Pressure as its reporting to the station’s pressure to WU. Current Air pressure at my tempest is 101.8 hpa. I attached some screen shots so you can see what I am talking about. I tried the elevation in the Agent but it wants it in inches but still no change.

Screen Shot 2021-05-30 at 9.40.03 AM

all the formula’s are here for derived metrics

in node-red I wrote this and it is pretty close

var Pres = msg.payload;
var sendString = "Sea Level Pressure:";
P0 = 1013.25
Rd = 287.05
GammaS = 0.0065
g = 9.80665
T0 = 288.15
Elev = 250.1
SLP =  Pres * (1 + ((P0/Pres)**((Rd*GammaS)/g)) * ((GammaS*Elev)/T0))**(g/(Rd*GammaS));
sendString += SLP;
var newMsg = {payload:sendString};
return [newMsg];

Thank you @Eric, so how would I enter it for my station in particular? Sorry I am new to all this scripting stuff haha. Official elevation is 671m and current station pressure is 932.2 mb

‘Pres’ would be your measured pressure and ‘Elev’ your elevation

in tor case you will have to modify the formula with the values instead variables I guess. Never played with weathersnoop.

So would it look like this:

SLP = 937.1 * (1 + ((1013.25/937.1)((287.05*0.0065)/0.90665)) * ((0.0065 * 671)/288.15))(9.80665/(287.05*0.0065));
sendString += SLP;
var newMsg = {payload:sendString};
return [newMsg];

that’s what is my variables atm