flatsiedatsie / Mi_Flower_mate_plugin

A plugin for Domoticz, the open source home automation software, which allows it to easily connect to Xiaomi Mi Flower Mate devices
GNU General Public License v3.0
13 stars 5 forks source link

Poller error? #9

Open EvJd2016 opened 4 years ago

EvJd2016 commented 4 years ago

I updated my Domoticz, and now when I use the 'update flowermates' switch in Domoticz, I recieve this errors. Before updating it all worked fine, but now I don't know how to fix it:

2019-10-27 11:07:59.562 (Plantsensor) amount of Flower Mates to now ask for data: 1 2019-10-27 11:07:59.563 (Kappelt gBridge) Message from base 2019-10-27 11:07:59.563 (Kappelt gBridge) Incoming message!{'Verb': 'PINGRESP'} 2019-10-27 11:07:59.517 Status: User: pi initiated a switch command (24/Plantsensor - update Mi Flowermates/On) 2019-10-27 11:08:00.015 (Plantsensor) getting data from sensor: C4:7C:8D:66:E4:3B 2019-10-27 11:08:16.839 (Plantsensor) poller error 2019-10-27 11:08:24.387 Kodi: Restarting I/O service thread. 2019-10-27 11:08:31.042 (Plantsensor) error getting moisture data 2019-10-27 11:08:31.043 (Plantsensor) error getting temperature data 2019-10-27 11:08:31.044 (Plantsensor) error getting light data 2019-10-27 11:08:31.045 (Plantsensor) Error getting conductivity data

SzemiSun commented 4 years ago

Hi, I got the same error and I updated the python from repository and it has been resolved

eserero commented 4 years ago

hi @SzemiSun - can you please explain what you did? I have the same poller error happening now... in fact, it crashes all the domoticz hardware thread as well...

eserero commented 4 years ago

scratch that, found the problem on my end (no connectivity). however this bring another problem. if I loose connectivity, then the plugin cause all the hardware thrads to crash and cause domoticz event queue to get stuck for a couple of minutes. any way to run this in the background?

flatsiedatsie commented 4 years ago

Perhaps you could spin it off into a thread (don't know if that's compatible), or add a try/catch mechanism. I won't build it for you as I no longer use Domoticz. But if you add it and create a pull request I could add it in.

BabaIsYou commented 2 years ago

cause domoticz event queue to get stuck for a couple of minutes.

It seems it's inherent to the way the implemented poller in this plugin handles not responding devices. I'm not a python specialist but in miflora_poller.py there are a lot of references to retry after waiting 5 mn that is a huge amount of time in home automation processes.

And it seems that during this waiting time, Domoticz is enabled to execute other python threads.

That's why I finally stopped using this (by other ways excellent) plugin