Xiaomi Miflora Sensor Integration

json
xiaomi
miflora
Tags: #<Tag:0x00007f01429803d8> #<Tag:0x00007f0142980298> #<Tag:0x00007f0142980158>

(Christian Günzl) #60

Hi Sergey,
I just took them from the sample files inside the jar. They are located in the folder test/resources.
You just need to extract the jar. The jar is basically a zip file, you may also alter the extension to zip and extract it with your favorite unzip program.
I did not change the values so far, because I also need to experiment a little more, maybe other plants need different values.
I hope this will answer your question.


(Sergey M) #61

Thank you for your time!
I’m sure that the data should be different for different plants, so I asked, I thought, maybe someone knows the resource where you can find this information. But in any case, thanks!


(Christian Günzl) #62

Hi,
Some of the information could be found here:
https://garden.org/plants

I guess it would be helpful to find some more resources and maybe have a grabber to create a database.
I am also curious how to utilize the capacity measures. After some googleing I’ve got a rough idea what this measure means, but so far I did not digg deeper into it.

Probably it’ll be helpful to open another thread about this special topic.


(Seaside) #63

Hi!

I usually look in the official app (Flower Care), what limits and thresholds each plant has.
I agree that it could be a good idea to set up a database for that.

In openhab2 I only send push notifications to warn about watering level, I’m currently ignoring conductivity.

Regards, S


(Sergey M) #64

Hello! I wanted to show if someone could not see:
https://www.aliexpress.com/item/Original-Xiaomi-Mi-Flora-Smart-Flower-Pot-Monitor-Digital-Plants-Grass-Soil-Water-Light-Tester-Sensor/32792593455.html?spm=2114.40010308.4.38.E2rlgi


(Ham Wong) #65

HI, Christian,

Thanks, tried with you info regarding sproute.properties, it works. Thank you


(Mutdwlt) #66

Today I switch to Pi 2 and I delete the #Enable real-time data reading part and everything work fine


(Mark Lavercombe) #67

@mutdwlt
I have the same problem but deleting that line doesn’t fix.
Is this script still working for you?


(xxxxxxxxxxxxxxxxx) #68

Just registered in here purely to say THANKS!!! i have been spending the odd evening attempting to install gattlib on a raspberry pi zero-w so i can play with a couple of the mi-flora sensors bought on a whim a little too long ago…

The ‘face palm’ moment came today reading through this post when i realised i had not installed Java 8…

Luckily i had installed a fresh version of full blown jessie with the desktop so i could vpn over to it to download the relevant java file Which is now U8_131 (as of this date…) slightly different from the how to linked to above.

I now have a slightly modded version of the demo.py reading both my sensors…

Thanks again for all the useful info…


(Simon) #69

Hi @Seaside ,
can you share the downloadable files again? I get some content not available notification if i click on your links.

Thank you!


(rud) #70

Hi, I tried this today after a new openhabian 1.3 installation and after sudo pip3 install gattlib

at least I got : Successfully installed gattlib

Then I tried python /home/openhabian/miflora/miflora.py C4:7C:8D:62:84:72 miflora.json

and got: ImportError: No module named gattlib

I’m confused about this! Can someone help?

To provide complete information, here is what I did and got: console.pdf (271.5 KB)


( ) #71

If you install a package with pip3 you can use it with python3 :wink:


(rud) #72

@ThomDietrich Thank you Thom.
To be honest, I don’t know what I’m doing. I thought I could get away by following the instructions from @Csongor_Varga and copy & paste the miflora.py above.

Now with python3 /home/openhabian/miflora/miflora.py C4:7C:8D:62:84:72 miflora.json
I found out that miflora.py needs to be customized to work with python3. I tried, but I failed.
Even the demo.py don’t worked. Maybe I should do further investigations why not.

Can someone please provide the right miflora.py file that works with pyhton3?


( ) #73

Ah, my bad. If the script is a python2 script it’s the other way around, you need to install a python package with pip instead of with pip3.

Anyhow, if you are looking for a solution, that “just works”, you could check out my latest project:


(rud) #74

Thanks alot. I’ll try again.


(Simon) #75

hi @ThomDietrich ,

thanks for the daemon. In theory it works like a charm.

Did you recognize, that the values differ when you run your daemon or you look them up in the miflora app?


Xiaomi Mi Flora Plant Sensor MQTT Client/Daemon
( ) #76

Just so you know, I’ve opened a new thread for the daemon:


(Car118) #77

@Seaside Can you please repost all files? I’m unable to download.
wget http://www.zoidberg.se/pub/sproute.jar
–2017-08-17 10:04:48-- http://www.zoidberg.se/pub/sproute.jar
Resolving www.zoidberg.se (www.zoidberg.se)… 217.215.218.47
Connecting to www.zoidberg.se (www.zoidberg.se)|217.215.218.47|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2017-08-17 10:04:48 ERROR 404: Not Found.
Thanks.


(Seaside) #78

Hi!

Been offline for quite some time. This is because I moved to a new house, had a 6 week vacation, waiting for internet connection and finally pretty much started from scratch with Openhab.

I’m back now though and files should be there!

Regards, S


(Car118) #79

@ Seaside
File downloaded.
Thanks for your work.