1technophile / OpenMQTTGateway

MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility & LoRa.
https://docs.openmqttgateway.com
GNU General Public License v3.0
3.6k stars 793 forks source link

Readings from RTL_433 are always converted to metric even when unwanted #1346

Closed melyux closed 7 months ago

melyux commented 1 year ago

Describe the bug Right now, the rtl_433 module's library (https://github.com/NorthernMan54/rtl_433_ESP) by @NorthernMan54 converts all readings to metric by default (because the conversion_mode configuration is set to CONVERT_SI by default in that library).

https://github.com/NorthernMan54/rtl_433_ESP/blob/master/src/decoder.cpp#L50

This is okay, I guess, but my sensors report temperature in Fahrenheit by default and I'd like to read it that way too without having to de-convert it from Celsius. Actually, I'd just like all my device readings to be shown in whatever unit the device provides, CONVERT_NATIVE, or convert all to imperial units instead of metric, CONVERT_CUSTOMARY.

Unfortunately, looking through the code for a while, I couldn't figure out how or if OMG interfaces with rtl_433_ESP's configuration options to set this conversion_mode. I'd be up to do a PR to add the option to OMG if I could see a pathway. Some help @NorthernMan54, @1technophile?

NorthernMan54 commented 1 year ago

The conversion setting in rtl_433_ESP is here

https://github.com/NorthernMan54/rtl_433_ESP/blob/77b4c8ac86fefca514c41a34fb6e25de6c409190/src/decoder.cpp#L50

NorthernMan54 commented 1 year ago

Am thinking a compiler directive for RTL_433_ESP is likely the easiest approach to achieve what you’re looking for. The rtl_433 cfg object is not something I have tried changing settings post initialization yet. But if you wanted to, it would need a method exposed from rtl_433_ESP, then a change to openmqttgateway/ZgatewayRTL_433.ino to control the method.

melyux commented 1 year ago

Thanks @NorthernMan54, that's what I thought

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

melyux commented 1 year ago

?

github-actions[bot] commented 10 months ago

This issue is stale because it has been open for 90 days with no activity.

melyux commented 10 months ago

Haven't checked recent versions yet

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] commented 7 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

micander commented 6 months ago

Ugh, stale issue bots are incredibly toxic. This still needs to be fixed. The problem code has been relocated here: https://github.com/NorthernMan54/rtl_433_ESP/blob/276bc2cc6cef73037aaf3325b69be99ccd139742/src/signalDecoder.cpp#L68

micander commented 6 months ago

Since the bot isn't reopening it, I'm making a new issue. Please consider removing auto-closing of stale issues.

See: https://www.youtube.com/watch?v=1lYgB_NHFYk