Tom Keffer schrieb am Sonntag, 24. Juli 2022 um 13:26:04 UTC+2:
> What is the context? Is the extension being used within [StdWXCalculate]?
>
Yes.
part of weewx.conf:
[StdRESTful]
[[MQTT]]
[[[inputs]]]
[[[[myObsType]]]]
units = hPa
[StdConvert]
target_unit = US
[StdWXCalculate]
[[Calculations]]
myObsType = software
I calculated the value using my extension and output it by MQTT for
testing.
As an example: If the value, returned by the extension, is
(20,'hPa','group_pressure') and the database unit is US and the output unit
of MQTT is hPa, then the output is 677 to the MQTT broker. That means to
me, that the value of 20 is *not* recognized as hPA (as sent in the value
tuple) but as inHG.
If I add weewx.units.convertStd(...,record['usUnits']) at the end, then the
correct value is output to MQTT. But it makes no sense to me to convert the
value to the standard unit system if I return a value tuple. So I asked.
--
You received this message because you are subscribed to the Google Groups
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-development/7c5aa511-56a1-496f-915b-89afb84fe772n%40googlegroups.com.