Xiaomi Mi Flora Plant Sensor MQTT Client/Daemon

mqtt
xiaomi
miflora
Tags: #<Tag:0x00007f51df6c4fe8> #<Tag:0x00007f51df6c4d40> #<Tag:0x00007f51df6c4a20>

(Markus) #141

maybe this will help you:


(Kim Skatun) #142

Thanks, how should the config.ini file look like with the new inbuilt broker? I have now successfully created a miflora.things file and updated my miflora.items… So now I only need to be able to connect to the broker:

[2019-02-05 21:52:26] Connecting to MQTT broker ...
[2019-02-05 21:52:26] MQTT connection error. Please check your settings in the configuration file "config.ini"

(Markus) #143

Have you installed the addon “Embedded MQTT Broker” (to be found under Misc) besides the MQTT binding?


(Kim Skatun) #144

Thanks that did the trick, I will share my setup sometime next week when everything is working again.


(Kim Skatun) #145

It is a common fact that the physical bluetooth range of the miflora devices are not the best… So to extend this my idea is to use a rpi zero. So does anyone has an image for this purpose, it seems overkill to install openhabian for this. (or is it possible to easily deactivate OH server somehow?)

The second thing is that the config.ini file is located on the OH master, and this should be updated to rpi zero slave every time the file are edited on the master, i.e every time you add a new sensor(so not super often…).

By this strategy we will spam the MQTT broker with same sensor information, if the sensor are picked up the OH master as well as rpi zero slave, not a big issue but it could be avoided or? So can the slave subscribe to MQTT topic and check if the topic has same value as what is suppose to send just now? Or is this already implemented, that it only send messages if it has changed it value?


(Thomas Bail) #146

openHabian assembles a lot of things. Currently i am not using the script anymore because i use the 3rd Party Bluetooth binding with the mifloras. Anyhow i have range problem too as expected with bluetooth le.

I use some old Raspberry pi version 1 with a DietPi Image. DietPi is small and lightweight and the MiFlora script should run on a pi zero as well


(Kim Skatun) #147

This makes it hard to make a slave, because then miflora needs to be connected to the master only.

Do you have an image file for this? Or should we make one where it comes preinstalled with miflora and share it somewhere here?


(Thomas Bail) #148

Yeah, my approach is different, but you should be able to download a DietPi imange install it on a pi zero and trasfer some scripts from openHabian to the pi zero. i Think an onwn image is to much


(Thomas Bail) #149

Has someone manged to use a BlueGiga Adapter instead of a HCI Adapter? Currently i am struggeling at installing the pygatt library

Any hints?


(Thomas Bail) #150

Ok, slved the problem with pygatt. Just include it in the requirements.txt. Next step is then to change the BT BAckend in the script. Unfortunately the script is not working properly with two sensors and bluegiga adapters. Have to digg in it more deaply.