Page 5 of 5

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Monday 26 April 2021 21:51
by kwieto
I will repeat the question stated in some post above - does this plugin work with Domoticz installed on Windows?

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Tuesday 27 April 2021 0:18
by waltervl
kwieto wrote: Monday 26 April 2021 21:51 I will repeat the question stated in some post above - does this plugin work with Domoticz installed on Windows?
Does not look so according the library issue where this plugin is based on: https://github.com/basnijholt/miflora/issues/51

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Tuesday 27 April 2021 8:34
by kwieto
But this is about different plugin than the one for Domoticz?
Or both use the same code?

I'm not an IT guy, so I my understanding about interconnections between those two is just so-so :(

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Tuesday 27 April 2021 9:18
by waltervl
This is the Python library were the plugin is based on, see the thanks note in
https://github.com/flatsiedatsie/Mi_Flower_mate_plugin

So the plugin is a wrapper around this library. If the library is not windows compatible the plugin probably is also not.

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Wednesday 23 June 2021 13:42
by waltervl
From Topic viewtopic.php?f=47&t=32370
New Icons for this plugin.
HM31 wrote: Tuesday 22 June 2021 20:11 Added these above icons in a new version (plus correction of conductivity device unit) in https://github.com/flatsiedatsie/Mi_Flower_mate_plugin

This plugin works with all sensors that have 'flower mate' or 'flower care' in there name (when bluetooth scanned, or that have C4:7C:8D: in BT mac address prefix), thus not only Xiaomi sensors.

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Tuesday 27 July 2021 7:04
by dorjey
Hi all, I've successfully could plugged my Flower Mate device to my Domoticz server, it works perfectly fine: the script I have set up retrieves the information from the sensor every hour. (for those who are facing power connection problems due to distance: I'm using 3,5v rechargeable battery, works great!).

Now, I have a question: wouldn't be possible to retrieve the data history from the device to the Domoticz DB as the Xiami App does from the device to the smartphone App? In that case, this would save battery power in one fell swoop while achieving a much finer granularity of data.

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Monday 09 August 2021 18:58
by HM31
Hi,

I'm facing a strange behavior when a sensor came out of scope. The plugin's thread seems to last very long (even after detecting a scan error) and all other Python threads seem to end unexpectedly during heartbeat execution (including Xiaomi Mi Flower Mate plugin itself). All return to normal after the end of the erroneous scan process. Until the next time.
Is there a way to stop the scan process after the initial
Flower Sensors: (Flower Sensors) poller error
?

See log below :

Code: Select all

 2021-08-09 12:35:14.195 Flower Sensors hardware started.
2021-08-09 12:35:14.591 Flower Sensors: (Flower Sensors) Manual mode is selected
2021-08-09 12:35:14.195 Status: Flower Sensors: (Flower Sensors) Started.
2021-08-09 12:35:14.195 Status: Flower Sensors: (Flower Sensors) Entering work loop.
2021-08-09 12:35:14.587 Status: Flower Sensors: (Flower Sensors) Initialized version 1.0.0, author 'blauwebuis'
2021-08-09 12:35:46.578 Flower Sensors: (Flower Sensors) amount of Flower Mates to now ask for data: 3
2021-08-09 12:35:46.573 Status: User: Admin (IP: 192.168.x.y) initiated a switch command (420/Flower Sensors - update Mi Flowermates/On)
2021-08-09 12:35:54.084 Flower Sensors: (Flower Sensors) getting data from sensor: C4:7C:8D:XX:XX:C4
2021-08-09 12:35:57.199 Flower Sensors: (Flower Sensors) moisture = 56
2021-08-09 12:35:57.204 Flower Sensors: (Flower Sensors) temperature = 26.0
2021-08-09 12:35:57.210 Flower Sensors: (Flower Sensors) light = 799
2021-08-09 12:35:57.216 Flower Sensors: (Flower Sensors) conductivity = 398
2021-08-09 12:36:04.081 Flower Sensors: (Flower Sensors) getting data from sensor: C4:7C:8D:YY:YY:E2
2021-08-09 12:36:36.433 Flower Sensors: (Flower Sensors) moisture = 53
2021-08-09 12:36:36.445 Flower Sensors: (Flower Sensors) temperature = 25.5
2021-08-09 12:36:36.456 Flower Sensors: (Flower Sensors) light = 496
2021-08-09 12:36:36.468 Flower Sensors: (Flower Sensors) conductivity = 1571
2021-08-09 12:36:36.659 Flower Sensors: (Flower Sensors) getting data from sensor: C4:7C:8D:ZZ:ZZ:2C

2021-08-09 12:37:49.174 Error: APC UPS ES-350 hardware (19) thread seems to have ended unexpectedly
2021-08-09 12:37:49.175 Error: Piles hardware (23) thread seems to have ended unexpectedly
2021-08-09 12:37:49.175 Error: Aspirateur Papi hardware (28) thread seems to have ended unexpectedly
2021-08-09 12:37:49.175 Error: ASUS Mesh hardware (29) thread seems to have ended unexpectedly
2021-08-09 12:37:49.175 Error: Prise rideaux salon hardware (31) thread seems to have ended unexpectedly
2021-08-09 12:37:49.175 Error: Flower Sensors hardware (30) thread seems to have ended unexpectedly
2021-08-09 12:38:03.186 Error: APC UPS ES-350 hardware (19) thread seems to have ended unexpectedly
2021-08-09 12:38:03.186 Error: Piles hardware (23) thread seems to have ended unexpectedly
2021-08-09 12:38:03.186 Error: Aspirateur Papi hardware (28) thread seems to have ended unexpectedly
2021-08-09 12:38:03.186 Error: ASUS Mesh hardware (29) thread seems to have ended unexpectedly
2021-08-09 12:38:03.187 Error: Prise rideaux salon hardware (31) thread seems to have ended unexpectedly
2021-08-09 12:38:03.187 Error: Flower Sensors hardware (30) thread seems to have ended unexpectedly
2021-08-09 12:38:17.190 Error: APC UPS ES-350 hardware (19) thread seems to have ended unexpectedly
2021-08-09 12:38:17.190 Error: Piles hardware (23) thread seems to have ended unexpectedly
2021-08-09 12:38:17.190 Error: Aspirateur Papi hardware (28) thread seems to have ended unexpectedly
2021-08-09 12:38:17.191 Error: ASUS Mesh hardware (29) thread seems to have ended unexpectedly
2021-08-09 12:38:17.191 Error: Prise rideaux salon hardware (31) thread seems to have ended unexpectedly
2021-08-09 12:38:17.191 Error: Flower Sensors hardware (30) thread seems to have ended unexpectedly
2021-08-09 12:38:31.194 Error: APC UPS ES-350 hardware (19) thread seems to have ended unexpectedly
2021-08-09 12:38:31.195 Error: Piles hardware (23) thread seems to have ended unexpectedly
2021-08-09 12:38:31.195 Error: Aspirateur Papi hardware (28) thread seems to have ended unexpectedly
2021-08-09 12:38:31.195 Error: ASUS Mesh hardware (29) thread seems to have ended unexpectedly
2021-08-09 12:38:31.195 Error: Prise rideaux salon hardware (31) thread seems to have ended unexpectedly
2021-08-09 12:38:31.196 Error: Flower Sensors hardware (30) thread seems to have ended unexpectedly
2021-08-09 12:38:37.801 Flower Sensors: (Flower Sensors) poller error
2021-08-09 12:38:45.199 Error: APC UPS ES-350 hardware (19) thread seems to have ended unexpectedly
2021-08-09 12:38:45.199 Error: Piles hardware (23) thread seems to have ended unexpectedly
2021-08-09 12:38:45.199 Error: Aspirateur Papi hardware (28) thread seems to have ended unexpectedly
2021-08-09 12:38:45.200 Error: ASUS Mesh hardware (29) thread seems to have ended unexpectedly
2021-08-09 12:38:45.200 Error: Prise rideaux salon hardware (31) thread seems to have ended unexpectedly
2021-08-09 12:38:45.200 Error: Flower Sensors hardware (30) thread seems to have ended unexpectedly
2021-08-09 12:38:59.211 Error: APC UPS ES-350 hardware (19) thread seems to have ended unexpectedly
2021-08-09 12:38:59.211 Error: Piles hardware (23) thread seems to have ended unexpectedly
2021-08-09 12:38:59.211 Error: Aspirateur Papi hardware (28) thread seems to have ended unexpectedly
2021-08-09 12:38:59.212 Error: ASUS Mesh hardware (29) thread seems to have ended unexpectedly
2021-08-09 12:38:59.212 Error: Prise rideaux salon hardware (31) thread seems to have ended unexpectedly
2021-08-09 12:38:59.212 Error: Flower Sensors hardware (30) thread seems to have ended unexpectedly
2021-08-09 12:39:13.216 Error: APC UPS ES-350 hardware (19) thread seems to have ended unexpectedly
2021-08-09 12:39:13.216 Error: Piles hardware (23) thread seems to have ended unexpectedly
2021-08-09 12:39:13.216 Error: Aspirateur Papi hardware (28) thread seems to have ended unexpectedly
2021-08-09 12:39:13.217 Error: ASUS Mesh hardware (29) thread seems to have ended unexpectedly
2021-08-09 12:39:13.217 Error: Prise rideaux salon hardware (31) thread seems to have ended unexpectedly
2021-08-09 12:39:13.217 Error: Flower Sensors hardware (30) thread seems to have ended unexpectedly
2021-08-09 12:39:27.220 Error: APC UPS ES-350 hardware (19) thread seems to have ended unexpectedly
2021-08-09 12:39:27.220 Error: Piles hardware (23) thread seems to have ended unexpectedly
2021-08-09 12:39:27.220 Error: Aspirateur Papi hardware (28) thread seems to have ended unexpectedly
2021-08-09 12:39:27.220 Error: ASUS Mesh hardware (29) thread seems to have ended unexpectedly
2021-08-09 12:39:27.221 Error: Prise rideaux salon hardware (31) thread seems to have ended unexpectedly
2021-08-09 12:39:27.221 Error: Flower Sensors hardware (30) thread seems to have ended unexpectedly
2021-08-09 12:39:41.224 Error: APC UPS ES-350 hardware (19) thread seems to have ended unexpectedly
2021-08-09 12:39:41.224 Error: Piles hardware (23) thread seems to have ended unexpectedly
2021-08-09 12:39:41.224 Error: Aspirateur Papi hardware (28) thread seems to have ended unexpectedly
2021-08-09 12:39:41.224 Error: ASUS Mesh hardware (29) thread seems to have ended unexpectedly
2021-08-09 12:39:41.224 Error: Prise rideaux salon hardware (31) thread seems to have ended unexpectedly
2021-08-09 12:39:41.224 Error: Flower Sensors hardware (30) thread seems to have ended unexpectedly
2021-08-09 12:39:55.227 Error: APC UPS ES-350 hardware (19) thread seems to have ended unexpectedly
2021-08-09 12:39:55.228 Error: Piles hardware (23) thread seems to have ended unexpectedly
2021-08-09 12:39:55.228 Error: Aspirateur Papi hardware (28) thread seems to have ended unexpectedly
2021-08-09 12:39:55.228 Error: ASUS Mesh hardware (29) thread seems to have ended unexpectedly
2021-08-09 12:39:55.228 Error: Prise rideaux salon hardware (31) thread seems to have ended unexpectedly
2021-08-09 12:39:55.228 Error: Flower Sensors hardware (30) thread seems to have ended unexpectedly
2021-08-09 12:40:10.876 Error: APC UPS ES-350 hardware (19) thread seems to have ended unexpectedly
2021-08-09 12:40:10.876 Error: Piles hardware (23) thread seems to have ended unexpectedly
2021-08-09 12:40:10.876 Error: Aspirateur Papi hardware (28) thread seems to have ended unexpectedly
2021-08-09 12:40:10.876 Error: ASUS Mesh hardware (29) thread seems to have ended unexpectedly
2021-08-09 12:40:10.876 Error: Prise rideaux salon hardware (31) thread seems to have ended unexpectedly
2021-08-09 12:40:10.876 Error: Flower Sensors hardware (30) thread seems to have ended unexpectedly
2021-08-09 12:40:24.880 Error: APC UPS ES-350 hardware (19) thread seems to have ended unexpectedly
2021-08-09 12:40:24.880 Error: Piles hardware (23) thread seems to have ended unexpectedly
2021-08-09 12:40:24.880 Error: Aspirateur Papi hardware (28) thread seems to have ended unexpectedly
2021-08-09 12:40:24.881 Error: ASUS Mesh hardware (29) thread seems to have ended unexpectedly
2021-08-09 12:40:24.881 Error: Prise rideaux salon hardware (31) thread seems to have ended unexpectedly
2021-08-09 12:40:24.881 Error: Flower Sensors hardware (30) thread seems to have ended unexpectedly
2021-08-09 12:40:38.760 Flower Sensors: (Flower Sensors) error getting moisture data
2021-08-09 12:40:38.760 Flower Sensors: (Flower Sensors) error getting temperature data
2021-08-09 12:40:38.761 Flower Sensors: (Flower Sensors) error getting light data
2021-08-09 12:40:38.761 Flower Sensors: (Flower Sensors) Error getting conductivity data 
... All returns to normal after that ...


Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Wednesday 18 August 2021 16:53
by dorjey
Hello,

I'd like to display temperature graph I got from my Xiaomi Mi Flower Mate with a customised period range, but I get problem in displaying data:
- When I used default configuration, data are correctly displayed:
Image
- When I configure CONFIG.js, data with a day range can be displayed, but not with month range.
Image
Image

here is an extract of CONFIG.js:
Spoiler: show
blocks['lux'] = {
title: 'Tomate 15: lumière',
debugButton: true,
graph: 'line',
lineTension: 0.3,
datasetColors: ['yellow'],
devices: [15],
legend: { 'd.lux_15': 'lux'},
legend: true,
height: '200px',
custom : {
"12h": {range: 'day' , filter: '12 hours', data: {lux: 'd.lux_15'},},
"12h(moy)" : {range: 'last' , groupBy: 'hour', filter: '12 hours', data: {lux: 'd.lux_15'},},
"7j": {range: 'month', filter: '7 days', data: {lux: 'd.lux_15'},},
"Par semaine": {range: 'month', groupBy: 'week', data: {lux: 'd.lux_15'},},
"année": {range: 'year' , groupBy: 'month', data: {lux: 'd.lux_15'},}

}

I've investigated in the database and I see that monthly data for temperature are stored in 'MultiMeter_Calendar' table. I think it should be stored in 'Meter_Calendar' table (no data for my 15 idx device)

How I can correct this? thank you :-)

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Thursday 09 September 2021 9:21
by Cyroq
Hi! This plugin works great. After a few months my batteries are running low (<15%) and now I'm getting a push notification twice a day. Since the devices are split into four seperate devices and it's being pushed as a priority, PushOver makes quite some noise as if all hell broke loose. I'm not sure whether I set these notification up myself, or if it's a setting in Domoticz or in the plugin.

I'd like to turn off the battery notifications for de Mi Flower, how can I do this?

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Thursday 09 September 2021 13:05
by waltervl
Battery level Notifications is an application setting, not per device/hardware. See https://www.domoticz.com/wiki/Applicati ... r_Settings

The only other thing you could do is switch off battery level notifications completely and do a Battery level script in for example dzVents for only those devices you want a notification on. There should be examples here to be found. Edit: tada: https://www.domoticz.com/wiki/Battery_level_check

Temporarely you can lower the level in settings to get rid of the current notifications until that lower level has been reached (or you change the batteries :-) )

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Friday 04 March 2022 19:45
by HM31
HM31 wrote: Monday 09 August 2021 18:58 Hi,

I'm facing a strange behavior when a sensor came out of scope. The plugin's thread seems to last very long (even after detecting a scan error) and all other Python threads seem to end unexpectedly during heartbeat execution (including Xiaomi Mi Flower Mate plugin itself). All return to normal after the end of the erroneous scan process. Until the next time.

After some research, and the same issue with other python plugins that keep waiting for a response, it seems to be inherent in how the used libraries handle waiting for said response, or rather not responding.

In this specific case, the time for the time-out to be reached while waiting for the non-response of the sensor the other "threads" of the python plugins cannot be executed and crash. Until the function wants to return control ...

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Tuesday 08 March 2022 11:55
by dorjey
Hi All,
I have 2 Xiaomi Mi Flower Mate installed for a while, and I noticed a data inconsistency between what is displayed by Domoticz and what I receive from my device :

Image
vs
Image

Is there anyone experiencing this issue?

(domoticz v2022.1 but had the same issue with the previous version I remember)

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Friday 07 October 2022 12:54
by bernard038
Hello All,

I am trying to get the Flower Mate plugin working again with my two Flower Mates. Plugin is installed, the distance between the RPI and the Flower Mates is less than one meter. When i scan for the Flower Mates using

Code: Select all

hcitool lescan
, they are found. MAC-adresses are correctly entered. But when i try to start the plugin in Domoticz, this happens:

Code: Select all

2022-10-07 12:11:41.193 Status: User: Admin (IP: 192.168.XXX.YYY) initiated a switch command (45/Flower Mate - update Mi Flowermates/On)
2022-10-07 12:11:49.065 Flower Mate: getting data from sensor: <MAC-ADDRESS>
2022-10-07 12:11:49.069 Flower Mate: poller error
2022-10-07 12:13:25.162 Error: Flower Mate hardware (14) thread seems to have ended unexpectedly
I am using a Raspberry PI, with buster installed,, Domoticz version: 2022.1 (build 14535), Python Version: 3.9.2.

Does anyone have a clue how to solve this?

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Monday 07 November 2022 19:54
by dorjey
dorjey wrote: Tuesday 08 March 2022 11:55 Hi All,
I have 2 Xiaomi Mi Flower Mate installed for a while, and I noticed a data inconsistency between what is displayed by Domoticz and what I receive from my device :

Image
vs
Image

Is there anyone experiencing this issue?

(domoticz v2022.1 but had the same issue with the previous version I remember)
I've installed the new update yesterday, and unfortunately the issue is still occurring. I am the only one to get this error?

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Wednesday 23 November 2022 18:34
by Menno
I got the plugin working initially.
(After replacing my +10 year old BT dongle from the old stuff drawer that probably never has heard about Bluetooth LE with a modern one)
Encouraged by this success, I got to work on my Xiaomi temperature and humidity sensors (with the custom ATC firmware).
Got those to work too!
At which point the Flower Mate stopped working...

2022-11-23 18:24:42.105 Kalamansi: amount of Flower Mates to now ask for data: 1
2022-11-23 18:24:42.081 Status: User: Admin (IP: 192.168.178.31) initiated a switch command (1074/Kalamansi - update Mi Flowermates/On)
2022-11-23 18:24:47.067 Kalamansi: getting data from sensor: C4:7C:8D:6B:21:8C
2022-11-23 18:25:57.283 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly
2022-11-23 18:26:00.248 Kalamansi: poller error
2022-11-23 18:26:11.288 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly
2022-11-23 18:26:25.292 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly
2022-11-23 18:26:39.296 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly
2022-11-23 18:26:53.301 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly
2022-11-23 18:27:07.311 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly
2022-11-23 18:27:21.316 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly
2022-11-23 18:27:29.300 Kalamansi: error getting moisture data
2022-11-23 18:27:29.300 Kalamansi: error getting temperature data
2022-11-23 18:27:29.300 Kalamansi: error getting light data
2022-11-23 18:27:29.301 Kalamansi: Error getting conductivity data

I would guess the BT system is somehow claimed / locked by the script for the other sensors?
I reduced the polling interval for the Xiaomi TH sensors to ten minutes in crontab to minimise the chance of the plugin and the script requesting Bluetooth at the same time and make sure to issue the switch command in between the interval.

Does anyone recognise this behaviour and know a solution?

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Saturday 26 November 2022 12:34
by Menno
After a bit of fiddling to make sure the script and the plugin don't try to use Bluetooth at the same time, it's working.

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Tuesday 29 November 2022 22:34
by Menno
Menno wrote: Saturday 26 November 2022 12:34 After a bit of fiddling to make sure the script and the plugin don't try to use Bluetooth at the same time, it's working.
,,, and of course after posting this it stops working.

2022-11-29 22:32:25.032 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly
2022-11-29 22:32:39.037 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly
2022-11-29 22:32:53.041 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly
2022-11-29 22:33:07.047 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly
2022-11-29 22:33:21.052 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly
2022-11-29 22:33:35.057 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Wednesday 08 March 2023 13:57
by Siopaos
Dear all,
I have been trying to get the xiaomi flower sensors working for quite some time, but have been unable to. The plugin doesn't seem to work due to polling errors. The script didn't seem to work with python v 3 9, had to change base64 .encodestring() to base64 .encodebytes(). I am not a programmer, so I hope I got that right.. After this edit the script runs and prints:
1: Plant
connect to C4:7C:8D:xx:xx:xx: Connection refused (111)

Does anyone know what I am doing wrong? Help would be much appreciated.

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Thursday 09 March 2023 11:23
by tonbor
I gave up on the plugin long time ago. I have 18 sensors running 4 years with the script.
viewtopic.php?t=13306&hilit=xiaomi+flora+script

Re: Python plugin: Xiaomi Mi Flower Mate

Posted: Monday 22 May 2023 13:57
by Menno
Menno wrote: Tuesday 29 November 2022 22:34
Menno wrote: Saturday 26 November 2022 12:34 After a bit of fiddling to make sure the script and the plugin don't try to use Bluetooth at the same time, it's working.
,,, and of course after posting this it stops working.

2022-11-29 22:33:35.057 Error: Kalamansi hardware (42) thread seems to have ended unexpectedly
If anyone else is still struggling, this might help.
In my case there is a problem with the driver for the Realtek RTL8761 Bluetooth module that is used in a lot of Bluetooth dongles.
For me the solution was to install new firmware with rpi-update.
You'll have to do this again after an update upgrades your kernel.