flavio20002 / mitemp_bt Goto Github PK
View Code? Open in Web Editor NEWHome Assistant Sensor for the Mijia Temperature Sensor
License: MIT License
Home Assistant Sensor for the Mijia Temperature Sensor
License: MIT License
Hi,
It appears as if the sensor platform code stops returning values if the temperature is below 10degC. This possibly also affects humidity but I can't verify this.
I'm running Hass.io on a RPI 3 with several of these sensors. The ones above 10degC continue to work normally; only one is dropping below 10deg C and when it does temperature, humidity, and battery values for only this sensor freeze and don't update until temp goes back above 10degC.
Suspect there is a single digit temperature (and humidity) bug in the code? I've never debugged python code before but I'm happy to try and look tonight.
I've had a quick look at the code and this might be the issue:
# Parse the output
res = re.search("( [0-9a-fA-F][0-9a-fA-F])+", result)
which is in
def write_readnotif_ble(mac, handle, value, retries=3, timeout=20, adapter=‘hci0’):
and
def read_ble(mac, handle, retries=3, timeout=20, adapter=‘hci0’):
Appears as if it needs to have 2 characters for a result to be found… But if the display is returning a 0 in front this should work. Wondering if the parse of the handle from the sensor (in format 0xXX) is only returning 1 (e.g. 8.3) rather than 2 (e.g. 08.3) characters for the non-decimal part…
Some comments are here with 2 other users with the same issue:
https://community.home-assistant.io/t/xiaomi-mijia-bluetooth-temperature-humidity-sensor-compatibility/43568/36
Great work on the sensor code - it was a breeze to get the sensors configured and running. Happy to help with this bug if I can!
Cheers,
Stewart
Hi,
so i installed hass.io on a pi3 and added mitemp_bt to my sensors in yaml. Unfortunatelly I only get an "Updating mitemp_bt sensor took longer than the scheduled" for both of my xiaomi sensor.
This is my config:
`sensor:
platform: yr
platform: mitemp_bt
mac: '4c-65-a8-d4-c5-xx'
name: Living Room Temp
force_update: false
median: 3
monitored_conditions:
platform: mitemp_bt
mac: '4c-65-a8-d5-41-xx'
name: Hall Temp
force_update: true
median: 1
monitored_conditions:
As you can see, neither false nor true force_update is working. What am I doing wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.