home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.8k stars 30.06k forks source link

Miflora Sensor reads '655350' if temperature drops below zero degree celsius #11546

Closed Bit-River closed 6 years ago

Bit-River commented 6 years ago

Hassio: 0.60.1, Miflora plant Sensor

Sensor reads the temperature incorrectly when the value is below zero, the value returned is 655350.

The sensor values return to normal once it has been moved back to a positive temperature area.

How it looks on Grafana:

screenshot_20180109_105844

Danielhiversen commented 6 years ago

@ChristianKuehnel

puuu commented 6 years ago

Same problem here. This seems to be already fixed upstream in open-homeautomation/miflora#65 . Please switch to miflora version 0.2.

thijsdejong commented 6 years ago

miflora 0.2.0 is included in the 0.61 release (which is being prepared now).

Bit-River commented 6 years ago

Waiting on local temperatures to drop below zero, upgraded without issue.

thijsdejong commented 6 years ago

You can put it in your freezer to test

ChristianKuehnel commented 6 years ago

Yes there was a bug in decoding the one's complement. Should be fixed in hass 61.

puuu commented 6 years ago

I can confirm that 0.61 can read negative temperatures properly.

Danielhiversen commented 6 years ago

Then I close this

Bit-River commented 6 years ago

This issue has reoccured for me on Hassio v1.0.1 and HA v0.62.1.

miflora-negative-value

ChristianKuehnel commented 6 years ago

That is weird. That issue should have been fixed in version 0.2.0 of the miflora library. We do have tests for negative temperatures.

What was the last valid temperature before the spike? And the next valid temperature after the spike?

To debug this, I need more data, so that I can analyze the problem. Can you please switch on logging for the miflora library, and send me the binary data read from the sensor?

Add this to your configuration.yaml:

logger:
  default: info
  logs:
    homeassistant.components.sensor.miflora: debug
    miflora: debug
Bit-River commented 6 years ago

My apologies, the update hadn't gone through! I thought it had. Mea Culpa!

I expect all is well. Thanks for this great code!