basnijholt / miflora

☘️🌡🌼🥀🏡 Mi Flora Plant sensor Python package
MIT License
363 stars 98 forks source link

Deal with negative temperatures #49

Closed ChristianKuehnel closed 6 years ago

ChristianKuehnel commented 6 years ago

As temperatures can be negative (at least in some countries :wink: ), we need to implement a conversion of negative temperatures to float.

Tasks:

namanshenoy commented 6 years ago

Hey!

What are data[0] and data[1] in miflora/miflora_poller.py, def _parse_data?

ChristianKuehnel commented 6 years ago

Hey @namanshenoy,

That was fast :smile:

From my understanding these are 2 bytes that we receive from the sensor. They somehow contain the temperature measured by the sensor. I'm not fully sure how to decode these values properly.

I guess the best idea is to put the sensor in the freezer (<0°C), look at the values the app reports and then try to figure out how to decode negative temperatures based on the values of data[0] and data[1].