Comments (8)
Which thermometer are you using?
I thought I'd fixed the problem with the h5074, which is the only one I've left outside, but it doesn't surprise me that I've got problems with the h5075 or h5175.
from goveebttemplogger.
int iTemp = int(data[5]) << 16 | int(data[6]) << 8 | int(data[7]);
Temperature = float(iTemp) / 10000.0;
Humidity = float(iTemp % 1000) / 10.0;
that can not be a negative number for Temperature
I tried:
if iTemp > 223 then iTemp -= 224
but that gives wrong numbers (~ -870 or so)
from goveebttemplogger.
This seems to work:
if iTemp >=8388608: iTemp = 8388608 - iTemp
temp = float(iTemp)/1000.
and for hum then use
hum = abs(iTemp)%1000 / 10.
from goveebttemplogger.
8388608 = 2exp(23)
from goveebttemplogger.
Thanks. I'll see if I can get it fixed tonight when I'm back near my development machine.
I didn't see an answer as to which device you are working with.
from goveebttemplogger.
from goveebttemplogger.
the device name: HS5101
But the problem in the code is for both types: one with 3 bytes (that is the complicated one) but also the one with 2 bytes. There it is a simple 2 complement with 16 bits.
The 3 byte is not a 2 complement. I have never seen it done that way before.
Looks like they where trying to save a byte in the message and made it really complicated.
Karl
from goveebttemplogger.
I updated the two supported models (h5075 and h5177) I have that use the three byte encoding to properly handle negative temperatures. (Tested with the h5075 by putting it in my freezer)
The two byte data model code of the h5074 had already been tested to work properly with negative temperatures. I believe it's working because of the handling of data types. I was specifically using a short integer to handle the data, so the sign data was in a normal bit.
from goveebttemplogger.
Related Issues (20)
- Simple output? HOT 1
- TIME setting not being honored HOT 6
- Add some ability to make filenames friendlier HOT 5
- [feature request] allow to use custom bluetooth adapter
- Checking on H5179, is it supported? HOT 6
- new argument "--no-logging" to disable the local file logging HOT 8
- H5179? HOT 13
- Define ganularity of logging HOT 1
- Abort on Default SystemD Unit on Ubuntu 20.04 and Raspberry Pi OS (Latest) HOT 4
- No rule to make target 'deb' HOT 3
- H5181 support? (like the H5182 but only one probe) HOT 14
- Single output option flag HOT 2
- Question: goveebttemplogger.service doesn't seem to accept '-c' and '--celsius' HOT 3
- Failing on ubuntu 22.04 (linux mint 21) - LE Set Scan Parameters Command Disallowed HOT 20
- 2037 dates in SVG creation HOT 1
- Very new user looking to try the code out HOT 5
- Checkout for <dirent.h> ..? HOT 3
- Temperature for H5075 slightly wrong HOT 4
- Input/Output Error Starting GoveeBTTempLogger HOT 16
- --index {filepath} \ in service config causes service to exit directly after writing index file HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goveebttemplogger.