Python plugin: Xiaomi Mi Flower Mate

Python and python framework
tonbor
Posts: 35
Joined: Monday 17 February 2014 10:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Flower Mate

Post by tonbor » Tuesday 19 June 2018 16:15

First accept new sensors as a default in settings. Second choose the plugin at the new hardware list.

NeoMod
Posts: 20
Joined: Friday 07 July 2017 22:02
Target OS: Raspberry Pi
Domoticz version: Latest β
Location: Italy
Contact:

Re: Python plugin: Xiaomi Mi Flower Mate

Post by NeoMod » Tuesday 19 June 2018 16:33

corederoma82 wrote:
Tuesday 19 June 2018 11:38
Hi,
after the installation of the script, how I add the sensor in the dashboard?

Thanks
Let me know how it works out for you.

For me, on Pi 3 B+ with latest Domoticz Beta, the plug-in never worked: the auto-scan feature failed to initialize (generic error code did not help troubleshooting the source problem) and BLE was not triggered properly.

Hence, the sensor (actually 4 dummy dashboard items for temp, hum, lux, and fertilizer) was never added to the dashboard.
Even after forcing “Manual Method” and adding the MiFlower MAC Address the plug-in showed errors while attempting a communication.

tonbor
Posts: 35
Joined: Monday 17 February 2014 10:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Flower Mate

Post by tonbor » Wednesday 20 June 2018 15:31

The script Works perfectly, the plug-in is worthless. Does NOT work at alllllll :cry:

blauwebuis
Posts: 334
Joined: Wednesday 21 December 2016 10:11
Target OS: Raspberry Pi
Domoticz version: current
Contact:

Re: Python plugin: Xiaomi Mi Flower Mate

Post by blauwebuis » Wednesday 11 July 2018 16:33

For me the plugin works intermittently.

The problem is difficult to pinpoint.
- Was it a problem with too many devices being called at once? Well, I made it so that it only polls one device per heartbeat. But the problem remained.
- Was it a problem with the switch position? Well, I made it into a push-button now. But the problem remains.
- Is it a problem with the BluePy library? There are similar errors in the library's issue que on Github, but they don't seem to get fixed. One option is to switch to another bluetooth library. I tried to BluePy one because of it's simplicity to install, and it integrates well since it's built in python itself. An alternative option is the Bluez/GATT route, but when people have to (still after all this time) update to a new version of Bluez manually, meaning they have to compile it. This is how the manual script works.
- It could also be a problem with the Domoticz python framework. Python Plugins are not allowed to wait for things. And a plugin of this nature has to wait for the device to be found/communicated with. This could cause the time-out issue. But I simply don't know enough about how the plugin system works internally.

NeoMod
Posts: 20
Joined: Friday 07 July 2017 22:02
Target OS: Raspberry Pi
Domoticz version: Latest β
Location: Italy
Contact:

Re: Python plugin: Xiaomi Mi Flower Mate

Post by NeoMod » Wednesday 11 July 2018 17:42

I don't know about the plug-in (as I said, for me has never worked) but for the other points:

- Try to use Bluez library: easy to install if you are on STRETCH (it's already on the debian repo, nothing more to do than a simple apt-get install bluez) or to manually compile otherwise. It's stable and don't create any problems.
- I have 6 bluetooth devices working fine so I don't thing it's a problem "how many devices" are you trying to pull data from.
- Python framework seems good to me: I'm using other plugins and they are working flawless. But also, I'm using a Python script to pull data from my Mi Flower devices and a simple cronjob to control the timing. So far so good.

tonbor
Posts: 35
Joined: Monday 17 February 2014 10:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Flower Mate

Post by tonbor » Wednesday 11 July 2018 18:50

11 devices and no problem with the python script and Stretch.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests