Bear with me guys, as I am a newbie. Initially I set up a Raspberry Pi with a RTL-SDR to see if I could get data from my sensors directly. It seemed to work pretty good, but it is kind of bulky with the pi, sdr, power supply, and the antenna with all the cords. I am excited about getting the same information from a just received LilyGo T3 v1.6.1. I have set it up with the web loader and partially configured it. But all of the values that are sent to my mqtt broker are metric except the temperatures, which I managed to change with the devices web server. On the Pi/RTL-SDR I had a way of sending RTL-433 a ‘-C customary’ command to get the values in imperial values (mph instead of km/h and inches instead of mm). Is there a way of achieving that with OMG?
I found a location in the code to place a change that will give me the settings I want. It appears that the WebUI, when selecting the ‘Configure WebUI’, unchecking the ‘Display Metric’ checkbox, and then saving is placing the rtl_433_esp library conversion mode into ‘CONVERT_NATIVE’ mode instead of the ‘CONVERT_CUSTOMARY’ mode. Apparently, the NATIVE mode only converts temperature from Celcius to Fahrenheit but leaves everything else as metric. This code is beautiful but complex.
The workaround I found is on line 68 of the signalDecoder.cpp file of the rtl_433_ESP library.
cfg->conversion_mode = CONVERT_SI; // Default all output to Celsius
What I have done is replaced it with:
cfg->conversion_mode = CONVERT_CUSTOMARY;
This does what I need, but isn’t very elegant. If I uncheck ‘Display Metric’ in the WebUI I would have to reprogram the board to get the CUSTOMARY reporting working again. I think I might be able to rearrange the structure ’ conversion_mode_t’ starting on line 33 of rtl_433.h in the rtl_433_ESP library, but whatever I do will have to be done every time we get an update to the source code.
What would work best, in my view, is when changing the setting in the WebUI, the non-metric mode would become ‘CONVERT_CUSTOMARY’. If there is a way to do this, I’m interested in learning how. It would be a good suggestion for a change in the code. It would be favorable for those of us who are stuck with the imperial mindset.
Does anyone have any ideas?