You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generic calculations taken from temperature, relative humidity and pressure #752
api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-device-bindingsDevice Bindings for audio, sensor, motor, and display hardware that can used with System.Device.Gpio
There are some formulas that can be done from sensor data, such as taking the temperature, relative humidity and pressure and outputting the absolute humidity.
Or getting the dew point from temperature and relative humidity.
Also a constant for the default sea level pressure, which I believe is incorrect in Bme280.sample.cs (I believe it should read 1013.25 instead of 1033.00).
Where would be the best place to put these? I'd like to make a pull request.
if the calculation/data is BME280 specific (or you don't have knowledge/devices to test) then put it directly under Bme280.cs otherwise upgrade on the base class.
For sea level pressure - I'd recommend creating a separate PR for that since this might trigger some extra conversations. I agree that mean sea level pressure should be 1013.25 but mean implies that it differs depending on location (if I was living at the sea level and it always read 1033 I'd strongly argue with people claiming 1013.25).
I can currently see only using that value in the samples though - which specific API are you referring to? (if this is just sample then fine with updating in the same PR)
Agreed with mean sea level pressure varying, but since 1013.25 is widely considered the global average, shouldn't this meaningful number be put somewhere in the code?
and add it as a constant (or static readonly field).
Since I was already thinking of proposing Pressure unit (because seems like there are at least 4 different units of pressure) I think we should just go ahead and do it.
Full scope of this feature might require a bit more work to convert all usages of Pressure in the repo but we could help with that.
For the formula since I don't know much about this specific domain my gut feeling tells me to create new project under devices/ called WeatherHelpers or some even more generic names where we could gather all helper functions (project name doesn't matter that much since we don't use it anywhere but namespace and class name does)
@MarkCiliaVincenti please also see #753 if there is no overlap. Also might be worth to check with @RobinTTY so that you don't get really bad merge conflict
Just adding my thoughts: I think @krwq 's idea of creating a new project with WeatherHelpers is good since the GetAltitude() method in the Bmx280 binding is not a sensor specific feature and instead just a calculation made from the pressure value, so it should probably haven't been in the device binding in the first place.
@MarkCiliaVincenti cool, if possible please review all similar sensors if they don't have some other helpful utils we can re-use.
I'd go with creating library like "Utilities" and put WeatherHelper there but WeatherHelpers as a project is fine too for now but I suspect it will be too small to stay as a seperate project on its own
api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-device-bindingsDevice Bindings for audio, sensor, motor, and display hardware that can used with System.Device.Gpio
Activity
krwq commentedon Sep 30, 2019
@MarkCiliaVincenti you will need to inspect:
https://github.com/dotnet/iot/tree/master/src/devices/Bmxx80
if the calculation/data is BME280 specific (or you don't have knowledge/devices to test) then put it directly under Bme280.cs otherwise upgrade on the base class.
For sea level pressure - I'd recommend creating a separate PR for that since this might trigger some extra conversations. I agree that mean sea level pressure should be 1013.25 but mean implies that it differs depending on location (if I was living at the sea level and it always read 1033 I'd strongly argue with people claiming 1013.25).
I can currently see only using that value in the samples though - which specific API are you referring to? (if this is just sample then fine with updating in the same PR)
MarkCiliaVincenti commentedon Sep 30, 2019
I'm not talking about BME280-specific calculations but very generic weather formulas which shouldn't be tied to specific sensors. Here's an example:
Agreed with mean sea level pressure varying, but since 1013.25 is widely considered the global average, shouldn't this meaningful number be put somewhere in the code?
krwq commentedon Sep 30, 2019
@MarkCiliaVincenti in case of SeaLevel I think we should consider adding another unit to:
https://github.com/dotnet/iot/tree/master/src/devices/Units
and add it as a constant (or static readonly field).
Since I was already thinking of proposing Pressure unit (because seems like there are at least 4 different units of pressure) I think we should just go ahead and do it.
Full scope of this feature might require a bit more work to convert all usages of Pressure in the repo but we could help with that.
For the formula since I don't know much about this specific domain my gut feeling tells me to create new project under
devices/calledWeatherHelpersor some even more generic names where we could gather all helper functions (project name doesn't matter that much since we don't use it anywhere but namespace and class name does)krwq commentedon Sep 30, 2019
Interestingly when I calculate altitude with 1013.25hPa it tells me my altitude is negative where 1033 shows 150m which sounds reasonable
krwq commentedon Oct 1, 2019
@MarkCiliaVincenti please also see #753 if there is no overlap. Also might be worth to check with @RobinTTY so that you don't get really bad merge conflict
RobinTTY commentedon Oct 1, 2019
Just adding my thoughts: I think @krwq 's idea of creating a new project with WeatherHelpers is good since the
GetAltitude()method in the Bmx280 binding is not a sensor specific feature and instead just a calculation made from the pressure value, so it should probably haven't been in the device binding in the first place.MarkCiliaVincenti commentedon Oct 7, 2019
@krwq @RobinTTY, once #768 gets merged into master, I will work on the WeatherHelper. Hope the pull request gets approved soon :)
MarkCiliaVincenti commentedon Oct 8, 2019
Pressure part has been handled by #768 which was merged to master. I'll create a new pull request for the WeatherHelper.
krwq commentedon Oct 8, 2019
@MarkCiliaVincenti cool, if possible please review all similar sensors if they don't have some other helpful utils we can re-use.
I'd go with creating library like "Utilities" and put WeatherHelper there but WeatherHelpers as a project is fine too for now but I suspect it will be too small to stay as a seperate project on its own
MarkCiliaVincenti commentedon Oct 12, 2019
This is completed by pull requests #768 (merged) and #783 (awaiting merge).
MarkCiliaVincenti commentedon Apr 23, 2020
#783 was merged as well. Closing issue.
krwq commentedon Apr 23, 2020
Thanks @MarkCiliaVincenti and @pgrawehr for helping to push this!