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

Report FlowerMate Moisture sensor as an humidity sensor #4

Closed lboue closed 5 years ago

lboue commented 6 years ago

Hello,

Could you help me to report FlowerMate Moisture sensor as an humidity sensor in Domoticz. This is better because it can be exported and recognized by HomeKit.

Currently it is reported as a 'General Percentage' sensor.

lowerMate Moisture sensor exemple

flowermate_moisture

Xiaomi Temp+humidity sensor exemple

xiaomi_humidity_exemple

Regards, Ludovic

flatsiedatsie commented 5 years ago

The Xiaomi device reports a percentage. Does the moisture level work as a percentage too?

flatsiedatsie commented 5 years ago

I just tried to change this. In theory it should now report moisture data instead.

lboue commented 5 years ago

Hello,

Thanks. I tried against the last commit and I am getting this error:

2018-12-17 19:18:14.573  Error: (Mi_flower_mate) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Mi_Flower_mate_plugin/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2018-12-17 19:18:14.573  Error: (Pots_Fleurs) Module Import failed, exception: 'TabError'
2018-12-17 19:18:14.574  Error: (Pots_Fleurs) Import detail: File: /home/pi/domoticz/plugins/Mi_Flower_mate_plugin/plugin.py, Line: 163, offset: 28
2018-12-17 19:18:14.574  Error: (Pots_Fleurs) Error Line '                      nValue = 0
'

Regards, Ludovic

lboue commented 5 years ago

See PR #7 But still recognized as "Unknown" type.

image

flatsiedatsie commented 5 years ago

I think I see the problem. It should be "Soil moisture" instead of "Moisture". I guessed wrong :-)

lboue commented 5 years ago

You can find details here: https://wiki.domoticz.com/wiki/Domoticz_API/JSON_URL's#Soil_Moisture

flatsiedatsie commented 5 years ago

For python plugins you need to look here actually: https://www.domoticz.com/wiki/Developing_a_Python_plugin

Lars65 commented 5 years ago

The are now no moisture sensor in domoticz with percentage, it creates another sensor looking like this: skarmavbild 2018-12-25 kl 10 21 18 And it don't add any values.

lboue commented 5 years ago

Hello,

I think there is an issue when updating the data from the script because when I manually update it, it works fine. See the Domoticz_API Soil_Moisture

IDX = id of your device (This number can be found in the devices tab in the column "IDX")
MOISTURE = moisture content in cb 0-200 where:
00 - 09 = saturated,
10 - 19 = adequately wet,
20 - 59 = irrigation advice, 
60 - 99 = irrigation, 
100-200 = Dangerously dry,

You can see the HTTP request/response below:

GET /json.htm?type=command&param=udevice&idx=281&nvalue=30 HTTP/1.1
Host: 1.2.3.4:8080
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7
Cookie: PHPSESSID=4e12t4q1r5pqh8dsfcs0bshmn1; session=eyJvYXV0aF9zdGF0ZSI6ImYzUHF0dzF5RmVIWnJPbUt0cnlvWXFvNUZQbml6ayJ9.Dusl6g.bBuWHTPJ0nBcqRvXzuhLi16j2Ig; SID=6b282ef92c993bd6c1eae54fcdceb9e1_OGRhYzU5MzAtOWM2NS00MjBiLTg3MjMtZmI4OTFkODljYzM4.1545928294

HTTP/1.1 200 OK
Content-Length: 53
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache
Pragma: no-cache
Access-Control-Allow-Origin: *
Connection: Keep-Alive
Keep-Alive: max=20, timeout=20

{
   "status" : "OK",
   "title" : "Update Device"
}

Manual test

So I call the Domoticz API URL from my browser with '30' as the value: http://:8080/json.htm?type=command&param=udevice&idx=281&nvalue=30

image

Mi_Flower_mate_plugin script

And with the script it fails:

Plugin start

2018-12-27 17:22:44.151  Status: (Flower) Started.
2018-12-27 17:22:44.445  Status: (Flower) Entering work loop.
2018-12-27 17:22:44.446  Status: (Flower) Initialized version 1.0.0, author 'blauwebuis'
2018-12-27 17:22:44.450  (Flower) Automatic mode is selected
2018-12-27 17:22:44.450  (Flower) Scanning for Mi Flower Mate sensors
2018-12-27 17:22:44.482  (Flower) Already known devices:['C4:7C:8D:65:EA:E9', 'C4:7C:8D:65:E9:D2']
2018-12-27 17:22:47.638  (Flower) Number of devices found via bluetooth scan = 2

Force update


2018-12-27 17:23:01.828  Status: User: Admin initiated a switch command (280/Flower - update Mi Flowermates/On)
2018-12-27 17:23:01.863  (Flower) amount of Flower Mates to now ask for data: 2
2018-12-27 17:23:07.173  (Flower) getting data from sensor: C4:7C:8D:65:EA:E9
2018-12-27 17:23:09.407  (Flower) moisture = 30
2018-12-27 17:23:09.418  (Flower) temperature = 19.0
2018-12-27 17:23:09.427  (Flower) light = 254
2018-12-27 17:23:09.435  (Flower) conductivity = 124
2018-12-27 17:23:09.505  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["deviceID"]="", ["changed"]=true, ["switchTypeValue"]=0, ["data"]={["icon"]="moisture", ["hardwareName"]="Flower", ["hardwareTypeValue"]=94, ["hardwareType"]="Xiaomi Mi Flower Mate", ["unit"]=2, ["_nValue"]=0, ["protected"]=false, ["hardwareID"]=16, ["_state"]="30"}, ["deviceType"]="General", ["timedOut"]=false, ["lastLevel"]=255, ["rawData"]={"30"}, ["name"]="Flower - #0 Moisture", ["signalLevel"]=0, ["description"]="", ["batteryLevel"]=0, ["id"]=281, ["subType"]="Soil Moisture", ["switchType"]="On/Off", ["lastUpdate"]="", ["baseType"]="device"}
2018-12-27 17:23:09.672  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["rawData"]={"19.0"}, ["lastLevel"]=255, ["switchTypeValue"]=0, ["name"]="Flower - #0 Temperature", ["lastUpdate"]="", ["deviceID"]="", ["id"]=282, ["switchType"]="On/Off", ["baseType"]="device", ["timedOut"]=false, ["changed"]=true, ["signalLevel"]=0, ["deviceType"]="Temp", ["data"]={["unit"]=3, ["_state"]="19.0", ["temperature"]=19, ["hardwareName"]="Flower", ["hardwareID"]=16, ["hardwareTypeValue"]=94, ["hardwareType"]="Xiaomi Mi Flower Mate", ["icon"]="temperature", ["protected"]=false, ["_nValue"]=0}, ["description"]="", ["batteryLevel"]=0, ["subType"]="LaCrosse TX3"}
2018-12-27 17:23:09.690  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["rawData"]={"254"}, ["lastLevel"]=255, ["switchTypeValue"]=0, ["name"]="Flower - #0 Light", ["lastUpdate"]="", ["deviceID"]="", ["id"]=283, ["switchType"]="On/Off", ["baseType"]="device", ["timedOut"]=false, ["changed"]=true, ["signalLevel"]=0, ["deviceType"]="Lux", ["data"]={["unit"]=4, ["_state"]="254", ["lux"]=254, ["hardwareName"]="Flower", ["hardwareID"]=16, ["hardwareTypeValue"]=94, ["hardwareType"]="Xiaomi Mi Flower Mate", ["icon"]="lux", ["protected"]=false, ["_nValue"]=0}, ["description"]="", ["batteryLevel"]=0, ["subType"]="Lux"}
2018-12-27 17:23:09.691  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["rawData"]={"124"}, ["lastLevel"]=255, ["switchTypeValue"]=0, ["name"]="Flower - #0 Conductivity", ["lastUpdate"]="", ["deviceID"]="", ["id"]=284, ["switchType"]="On/Off", ["baseType"]="device", ["timedOut"]=false, ["changed"]=true, ["signalLevel"]=49, ["deviceType"]="General", ["data"]={["sensorUnit"]="", ["_state"]="124", ["hardwareName"]="Flower", ["hardwareID"]=16, ["sensorType"]=1, ["hardwareTypeValue"]=94, ["unit"]=5, ["hardwareType"]="Xiaomi Mi Flower Mate", ["icon"]="Custom", ["protected"]=false, ["_nValue"]=0}, ["description"]="", ["batteryLevel"]=1, ["subType"]="Custom Sensor"}
2018-12-27 17:23:18.956  (Flower) getting data from sensor: C4:7C:8D:65:E9:D2
2018-12-27 17:23:22.050  (Flower) moisture = 30
2018-12-27 17:23:22.062  (Flower) temperature = 19.4
2018-12-27 17:23:22.070  (Flower) light = 95
2018-12-27 17:23:22.079  (Flower) conductivity = 80
2018-12-27 17:23:22.171  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["name"]="Flower - #1 Moisture", ["deviceType"]="General", ["signalLevel"]=0, ["data"]={["hardwareTypeValue"]=94, ["icon"]="moisture", ["hardwareName"]="Flower", ["_state"]="30", ["_nValue"]=0, ["hardwareType"]="Xiaomi Mi Flower Mate", ["unit"]=6, ["protected"]=false, ["hardwareID"]=16}, ["rawData"]={"30"}, ["subType"]="Soil Moisture", ["changed"]=true, ["description"]="", ["timedOut"]=false, ["deviceID"]="", ["switchTypeValue"]=0, ["switchType"]="On/Off", ["id"]=285, ["batteryLevel"]=0, ["lastUpdate"]="", ["lastLevel"]=255, ["baseType"]="device"}
2018-12-27 17:23:22.442  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["description"]="", ["timedOut"]=false, ["baseType"]="device", ["lastUpdate"]="", ["id"]=280, ["name"]="Flower - update Mi Flowermates", ["data"]={["hardwareName"]="Flower", ["hardwareID"]=16, ["hardwareTypeValue"]=94, ["_state"]="Off", ["unit"]=1, ["_nValue"]=0, ["maxDimLevel"]=15, ["hardwareType"]="Xiaomi Mi Flower Mate", ["internalState"]="Off", ["usedByCamera"]=false, ["protected"]=false, ["levelVal"]=0, ["icon"]="push"}, ["switchTypeValue"]=9, ["deviceType"]="Lighting 2", ["changed"]=true, ["rawData"]={"Off"}, ["lastLevel"]=255, ["batteryLevel"]=0, ["deviceID"]="", ["switchType"]="Push On Button", ["subType"]="AC", ["signalLevel"]=0}
2018-12-27 17:23:22.460  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["description"]="", ["timedOut"]=false, ["baseType"]="device", ["lastUpdate"]="", ["id"]=286, ["name"]="Flower - #1 Temperature", ["data"]={["hardwareName"]="Flower", ["hardwareID"]=16, ["hardwareTypeValue"]=94, ["_state"]="19.4", ["unit"]=7, ["_nValue"]=0, ["hardwareType"]="Xiaomi Mi Flower Mate", ["icon"]="temperature", ["protected"]=false, ["temperature"]=19.39999961853}, ["switchTypeValue"]=0, ["deviceType"]="Temp", ["changed"]=true, ["rawData"]={"19.4"}, ["lastLevel"]=255, ["batteryLevel"]=0, ["deviceID"]="", ["switchType"]="On/Off", ["subType"]="LaCrosse TX3", ["signalLevel"]=0}
2018-12-27 17:23:22.463  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["description"]="", ["timedOut"]=false, ["baseType"]="device", ["lastUpdate"]="", ["id"]=287, ["name"]="Flower - #1 Light", ["data"]={["hardwareName"]="Flower", ["hardwareID"]=0, ["hardwareTypeValue"]=94, ["lux"]=95, ["unit"]=8, ["_nValue"]=0, ["hardwareType"]="Xiaomi Mi Flower Mate", ["icon"]="lux", ["protected"]=false, ["_state"]="95"}, ["switchTypeValue"]=0, ["deviceType"]="Lux", ["changed"]=true, ["rawData"]={"95"}, ["lastLevel"]=255, ["batteryLevel"]=1993179136, ["deviceID"]="", ["switchType"]="On/Off", ["subType"]="Lux", ["signalLevel"]=1}
2018-12-27 17:23:22.465  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["description"]="", ["timedOut"]=false, ["baseType"]="device", ["lastUpdate"]="", ["id"]=288, ["name"]="Flower - #1 Conductivity", ["data"]={["hardwareName"]="Flower", ["sensorUnit"]="", ["hardwareTypeValue"]=94, ["_state"]="80", ["unit"]=9, ["_nValue"]=0, ["hardwareType"]="Xiaomi Mi Flower Mate", ["icon"]="Custom", ["protected"]=false, ["sensorType"]=1, ["hardwareID"]=16}, ["switchTypeValue"]=0, ["deviceType"]="General", ["changed"]=true, ["rawData"]={"80"}, ["lastLevel"]=255, ["batteryLevel"]=1, ["deviceID"]="", ["switchType"]="On/Off", ["subType"]="Custom Sensor", ["signalLevel"]=49}

Regards

lboue commented 5 years ago

I also tried with an Humidity sensor type but it fails too:

diff --git plugin.py plugin.py
index 90f805c..3e85e89 100644
--- plugin.py
+++ plugin.py
@@ -126,7 +126,8 @@ class BasePlugin:
                                        sensorName = sensorBaseName + "Moisture"
                                        Domoticz.Debug("Creating first sensor, #"+str(sensorNumber))
                                        Domoticz.Debug("Creating first sensor, name: "+str(sensorName))
-                                       Domoticz.Device(Name=sensorName, Unit=sensorNumber, TypeName="Soil Moisture", Used=1).Create()   
+                                       Domoticz.Device(Name=sensorName, Unit=sensorNumber, TypeName="Humidity", Used=1).Create()
                                        Domoticz.Log("Created device: "+Devices[sensorNumber].Name)

And logs here:

2018-12-27 18:01:39.484  Status: User: Admin initiated a switch command (280/Flower - update Mi Flowermates/On)
2018-12-27 18:01:39.534  (Flower) amount of Flower Mates to now ask for data: 2
2018-12-27 18:01:42.089  (Flower) getting data from sensor: C4:7C:8D:65:EA:E9
2018-12-27 18:01:44.073  (Flower) moisture = 28
2018-12-27 18:01:44.082  (Flower) temperature = 18.6
2018-12-27 18:01:44.091  (Flower) light = 205
2018-12-27 18:01:44.101  (Flower) conductivity = 144
2018-12-27 18:01:44.181  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["lastUpdate"]="", ["changed"]=true, ["deviceID"]="", ["lastLevel"]=255, ["batteryLevel"]=0, ["id"]=281, ["switchTypeValue"]=0, ["baseType"]="device", ["rawData"]={"28"}, ["name"]="Flower - #0 Moisture", ["signalLevel"]=0, ["deviceType"]="Humidity", ["switchType"]="On/Off", ["data"]={["protected"]=false, ["hardwareTypeValue"]=94, ["_nValue"]=0, ["_state"]="0", ["hardwareName"]="Flower", ["humidityStatus"]="Unknown", ["humidity"]=0, ["icon"]="temperature", ["hardwareType"]="Xiaomi Mi Flower Mate", ["unit"]=2, ["hardwareID"]=16}, ["description"]="", ["subType"]="LaCrosse TX3", ["timedOut"]=false}
2018-12-27 18:01:44.351  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["lastUpdate"]="", ["changed"]=true, ["deviceID"]="", ["lastLevel"]=255, ["batteryLevel"]=0, ["id"]=282, ["switchTypeValue"]=0, ["baseType"]="device", ["rawData"]={"18.6"}, ["name"]="Flower - #0 Temperature", ["signalLevel"]=0, ["deviceType"]="Temp", ["switchType"]="On/Off", ["data"]={["protected"]=false, ["hardwareID"]=16, ["_nValue"]=0, ["_state"]="18.6", ["hardwareName"]="Flower", ["icon"]="temperature", ["hardwareType"]="Xiaomi Mi Flower Mate", ["temperature"]=18.60000038147, ["unit"]=3, ["hardwareTypeValue"]=94}, ["description"]="", ["subType"]="LaCrosse TX3", ["timedOut"]=false}
2018-12-27 18:01:44.369  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["lastUpdate"]="", ["changed"]=true, ["deviceID"]="", ["lastLevel"]=255, ["batteryLevel"]=0, ["id"]=283, ["switchTypeValue"]=0, ["baseType"]="device", ["rawData"]={"205"}, ["name"]="Flower - #0 Light", ["signalLevel"]=0, ["deviceType"]="Lux", ["switchType"]="On/Off", ["data"]={["protected"]=false, ["hardwareID"]=16, ["_nValue"]=0, ["_state"]="205", ["hardwareName"]="Flower", ["icon"]="lux", ["hardwareType"]="Xiaomi Mi Flower Mate", ["lux"]=205, ["unit"]=4, ["hardwareTypeValue"]=94}, ["description"]="", ["subType"]="Lux", ["timedOut"]=false}
2018-12-27 18:01:44.371  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["lastUpdate"]="", ["changed"]=true, ["deviceID"]="", ["lastLevel"]=255, ["batteryLevel"]=1, ["id"]=284, ["switchTypeValue"]=0, ["baseType"]="device", ["rawData"]={"144"}, ["name"]="Flower - #0 Conductivity", ["signalLevel"]=49, ["deviceType"]="General", ["switchType"]="On/Off", ["data"]={["protected"]=false, ["sensorUnit"]="", ["_nValue"]=0, ["_state"]="144", ["hardwareName"]="Flower", ["unit"]=5, ["icon"]="Custom", ["hardwareType"]="Xiaomi Mi Flower Mate", ["sensorType"]=1, ["hardwareTypeValue"]=94, ["hardwareID"]=16}, ["description"]="", ["subType"]="Custom Sensor", ["timedOut"]=false}
2018-12-27 18:01:53.622  (Flower) getting data from sensor: C4:7C:8D:65:E9:D2
2018-12-27 18:01:57.555  (Flower) moisture = 22
2018-12-27 18:01:57.564  (Flower) temperature = 18.3
2018-12-27 18:01:57.573  (Flower) light = 113
2018-12-27 18:01:57.582  (Flower) conductivity = 103
2018-12-27 18:01:57.640  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["baseType"]="device", ["changed"]=true, ["subType"]="LaCrosse TX3", ["data"]={["unit"]=6, ["hardwareID"]=16, ["hardwareName"]="Flower", ["humidityStatus"]="Unknown", ["protected"]=false, ["hardwareType"]="Xiaomi Mi Flower Mate", ["humidity"]=0, ["hardwareTypeValue"]=94, ["icon"]="temperature", ["_nValue"]=0, ["_state"]="0"}, ["timedOut"]=false, ["deviceID"]="", ["switchType"]="On/Off", ["id"]=285, ["signalLevel"]=0, ["batteryLevel"]=0, ["switchTypeValue"]=0, ["lastUpdate"]="", ["description"]="", ["deviceType"]="Humidity", ["lastLevel"]=255, ["rawData"]={"22"}, ["name"]="Flower - #1 Moisture"}
2018-12-27 18:01:57.809  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["baseType"]="device", ["changed"]=true, ["subType"]="AC", ["data"]={["unit"]=1, ["usedByCamera"]=false, ["maxDimLevel"]=15, ["hardwareID"]=16, ["hardwareName"]="Flower", ["protected"]=false, ["_nValue"]=0, ["hardwareType"]="Xiaomi Mi Flower Mate", ["hardwareTypeValue"]=94, ["internalState"]="Off", ["icon"]="push", ["levelVal"]=0, ["_state"]="Off"}, ["timedOut"]=false, ["deviceID"]="", ["switchType"]="Push On Button", ["id"]=280, ["signalLevel"]=0, ["batteryLevel"]=0, ["switchTypeValue"]=9, ["lastUpdate"]="", ["description"]="", ["deviceType"]="Lighting 2", ["lastLevel"]=255, ["rawData"]={"Off"}, ["name"]="Flower - update Mi Flowermates"}
2018-12-27 18:01:57.828  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["baseType"]="device", ["changed"]=true, ["subType"]="LaCrosse TX3", ["data"]={["temperature"]=18.299999237061, ["unit"]=7, ["hardwareID"]=16, ["hardwareName"]="Flower", ["protected"]=false, ["hardwareType"]="Xiaomi Mi Flower Mate", ["hardwareTypeValue"]=94, ["icon"]="temperature", ["_nValue"]=0, ["_state"]="18.3"}, ["timedOut"]=false, ["deviceID"]="", ["switchType"]="On/Off", ["id"]=286, ["signalLevel"]=0, ["batteryLevel"]=0, ["switchTypeValue"]=0, ["lastUpdate"]="", ["description"]="", ["deviceType"]="Temp", ["lastLevel"]=255, ["rawData"]={"18.3"}, ["name"]="Flower - #1 Temperature"}
2018-12-27 18:01:57.830  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["baseType"]="device", ["changed"]=true, ["subType"]="Lux", ["data"]={["unit"]=8, ["hardwareID"]=16, ["lux"]=113, ["protected"]=false, ["hardwareType"]="Xiaomi Mi Flower Mate", ["hardwareTypeValue"]=94, ["_nValue"]=0, ["icon"]="lux", ["hardwareName"]="Flower", ["_state"]="113"}, ["timedOut"]=false, ["deviceID"]="", ["switchType"]="On/Off", ["id"]=287, ["signalLevel"]=0, ["batteryLevel"]=0, ["switchTypeValue"]=0, ["lastUpdate"]="", ["description"]="", ["deviceType"]="Lux", ["lastLevel"]=255, ["rawData"]={"113"}, ["name"]="Flower - #1 Light"}
2018-12-27 18:01:57.830  Status: dzVents: Error (2.4.9): Discarding device. No last update info found: {["baseType"]="device", ["changed"]=true, ["subType"]="Custom Sensor", ["data"]={["unit"]=9, ["hardwareID"]=16, ["hardwareName"]="Flower", ["protected"]=false, ["sensorType"]=1, ["hardwareType"]="Xiaomi Mi Flower Mate", ["sensorUnit"]="", ["hardwareTypeValue"]=94, ["icon"]="Custom", ["_nValue"]=0, ["_state"]="103"}, ["timedOut"]=false, ["deviceID"]="", ["switchType"]="On/Off", ["id"]=288, ["signalLevel"]=49, ["batteryLevel"]=1, ["switchTypeValue"]=0, ["lastUpdate"]="", ["description"]="", ["deviceType"]="General", ["lastLevel"]=255, ["rawData"]={"103"}, ["name"]="Flower - #1 Conductivity"}
LiloBzH commented 5 years ago

Same thing for me

I dont inderstand why Moisture VALUE is 0 CB in domoticz

Manually it's work hum

SzemiSun commented 5 years ago

I think, it is a domoticz error. I changed the plugin.py: 174: Devices[sensorNumber1].Update(nValue=nValue, sValue=val_moist, BatteryLevel=val_bat) to 174: Devices[sensorNumber1].Update(nValue=int(val_moist), sValue=val_moist, BatteryLevel=val_bat) and it works well

lboue commented 5 years ago

It works fine for me wih the PR #8 patch:

2019-04-07 17:38:43.386  Status: User: Admin initiated a switch command (280/Flower - update Mi Flowermates/On)
2019-04-07 17:38:43.434  (Flower) amount of Flower Mates to now ask for data: 2
2019-04-07 17:38:52.957  (Flower) getting data from sensor: C4:7C:8D:65:EA:**
2019-04-07 17:38:56.771  (Flower) moisture = 12
2019-04-07 17:38:56.792  (Flower) temperature = 20.9
2019-04-07 17:38:56.803  (Flower) light = 697
2019-04-07 17:38:56.813  (Flower) conductivity = 11
2019-04-07 17:39:06.336  (Flower) getting data from sensor: C4:7C:8D:65:E9:**
2019-04-07 17:39:09.196  (Flower) moisture = 23
2019-04-07 17:39:09.215  (Flower) temperature = 21.7
2019-04-07 17:39:09.225  (Flower) light = 598
2019-04-07 17:39:09.235  (Flower) conductivity = 61

Regards,