Closed owingst closed 1 year ago
The people who wrote the cotech driver copied the SDL code (which was ok - open source) for the FT020T but they still have bugs in it for temperature and light. You can compare the code and fix the cotech code.
The problem appears to be invalid data. Cotech code throws out invalid data but switchdoc version does not. Here is the rtl_433 guys response to this issue. Just fyi.
To be clear: the values you captured as code were 7.173 kLux and UV-Index 29, so pretty shaded with chance of severe burn in mere minutes. Or the values you posted 97.677 kLux UV-Index 25, very bright day but still UV death rays. Those values don't mean anything sensible, the sensor could be broken perhaps.
The switchdoclabs fork is old and unmaintained I guess, otherwise both decoders are basically the same (though different on sanity checks).
The reason why the SDL driver passes the invalid values through is because there is information in the values. We filter this out in the receiving software so we can detect problems and errors. We had a number of customers request this. The definition of the errors and their values are here:
https://www.switchdoc.com/2022/12/weatherrack3-data-formats-2/
The values in the JSON message are show below (as well as being defined here: https://shop.switchdoc.com/products/wireless-weatherrack2 )
Note that the UV value received is 10 times the value. So you are getting a UV value of 2.9
Here is an example of results coming in from the WeatherRack2 from the PythonTest Software: pi@SwitchDocLabs:~/SDL_Pi_WeatherRack2 $ sudo python3 readWeatherSensors.py Starting Wireless Read
{"time" : "2020-11-22 06:40:15", "model" : "SwitchDoc Labs FT020T AIO", "device" : 12, "id" : 0, "batterylow" : 0, "avewindspeed" : 2, "gustwindspeed" : 3, "winddirection" : 18, "cumulativerain" : 180, "temperature" : 1011, "humidity" : 27, "light" : 1432, "uv" : 4, "mic" : "CRC"}
RAW DATA DESCRIPTION time: Time of Message Reception model: SwitchDoc Labs FT020T AIO device: Serial Number of the sensor - changed on powerup but can be used to discriminate from other similar sensors in the area batterylow: 0 if battery good, 1 if battery is getting low avewindspeed: Average Wind Speed in m/s 10 gustwindspeed: Last Gust Speed in m/s 10 winddirection: Wind Direction in degrees from 0-359. cumulativerain: Total rain since last reset or power off. in mm.10 temperature: outside temperature in F with 400 offset and 10 T = (value-400)/10.0 humidity: Relative Humidity in %. light: Visible Sunlight in lux. uv: UV Index * 10 (meaning an uv index of 0.8 is in the example message above)
Hope that clears everything up.
SwitchDoc Labs
I moved to using main rtl_433 build to pick up ecowitt soil moisture sensor as the switchdoclabs build does not support it. In doing so, I had to change to use Cotech-367959 to read FT020T. After doing so, I no longer received light/uv data. The reason is those were invalid values and ignored by rtl_433. Can some check to see why those value are off? Thanks!
time : 2023-02-17 14:41:34 model : SwitchDoc Labs FT020T AIO Device : 12 Serial Number: 205 Battery Low: 0 Ave Wind Speed: 15 Gust : 26 Wind Direction: 234 Cum Rain : 318 Temperature: 937 Humidity : 29 Light : 96300 UV Index : 37 Integrity : CRC