Giter Site home page Giter Site logo

vrachieru / xiaomi-flower-care-api Goto Github PK

View Code? Open in Web Editor NEW
168.0 12.0 12.0 11 KB

Xiaomi Flower Care (MiFlora) API wrapper.

License: MIT License

Python 100.00%
xiaomi xiaomi-flower-care xiaomi-flora miflora smart-home bluetooth-low-energy plants sensor iot home-automation

xiaomi-flower-care-api's Issues

New MAC address range

Hi,

My Flower Care has MAC address 80:ea:ca:88:e8:e9, which means the scanner won't find it. Please consider broadening the list of accepted MAC addresses.

Small error in historical entry table

The table for historical entries lists the brightness value as uint32 value but only mentions the bytes 7 to 9 with 10 as a padding byte while its actually part of the brightness.

Updated Table:

Bytes Type Value Description
00-03 uint32 2156400 timestamp, seconds since device epoch (boot)
04-05 uint16 235 temperature in 0.1 °C
06 ? ? ?
07-10 uint32 90 brightness in lux
11 uint8 21 moisture in %
12-13 uint16 179 conductivity in µS/cm
14-15 ? ?

Can't install

Hi,

I'm trying to install your api. I had some problems to install bluepy, but now I solved it, I get this error I don't know how to resolve:

pip3 install ./xiaomi-flower-care-api/
Processing ./xiaomi-flower-care-api
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-89uw8bo2-build/setup.py", line 13, in <module>
        long_description=readme(),
      File "/tmp/pip-89uw8bo2-build/setup.py", line 7, in readme
        return readme_file.read()
      File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 830: ordinal not in range(128)

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-89uw8bo2-build/

Can you help me? I don't know a lot of python, so maybe it's trivial, sorry if I asking something too simple.

Thanks!

Disconnexion while reading historicals values

Hello,
I've tried to use your readme file informations to write a javascript page allowing to view data from my flower care.

Everything is OK, except that I often face disconnexion while reading historical values, about every 30 to 40 values.

Did you face this issue to ? Is there any workaround to manage this ?

Thanks a lot for your clear documentation about xiaomi protocol !

Crash after finding the device

Hello, Thanks for sharing this !

I'm running into issues after finding the device...
I'm running this on a pi zero and stretch. I've updated bluepy from the sources but that didn't solve this issue... Any idea ?

$ sudo python3 scan.py
Found device c4:7c:8d:65:af:07
Traceback (most recent call last):
File "scan.py", line 28, in
('name', device.name),
File "/usr/local/lib/python3.5/dist-packages/flowercare/reader.py", line 39, in name
response = self._read_handle(_HANDLE_DEVICE_NAME)
File "/usr/local/lib/python3.5/dist-packages/flowercare/reader.py", line 127, in _read_handle
with Peripheral(self._mac, iface=self._interface) as connection:
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 391, in init
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 434, in _connect
rsp = self._getResp('stat')
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 407, in _getResp
resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 339, in _waitResp
raise BTLEInternalError("Helper exited")
bluepy.btle.BTLEInternalError: Helper exited
Exception ignored in: <bound method Peripheral.del of <bluepy.btle.Peripheral object at 0xb6947090>>
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 630, in del
self.disconnect()
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 453, in disconnect
self._writeCmd("disc\n")
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 305, in _writeCmd
self._helper.stdin.flush()
BrokenPipeError: [Errno 32] Broken pipe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.