Xiaomi Mi Flora

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
florisi
Posts: 78
Joined: Saturday 30 July 2016 10:14
Target OS: Linux
Domoticz version: 2020beta
Location: Arnhem
Contact:

Xiaomi Mi Flora

Post by florisi »

I've installed two Xiaomi Mi Flora sensors via Python Plugin Manager.
Per Mi Flora I have now 4 devices.
The moisture device is in 'cb' with the correct value.
When I add the device to Dashticz it appears as 'AAN' with a bulb icon.

The conductivity device is presented right in Dashticz.

What can I do to present the right value.
Running Domoticz 2020.1 and Dashticz V3.3.3.1
Lokonli
Posts: 2287
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Xiaomi Mi Flora

Post by Lokonli »

Can you post the json response of the device data?

http://<domoticz ip>/json.htm?type=devices&rid=IDX

Replace IDX with the Domoticz device id of your sensor.
florisi
Posts: 78
Joined: Saturday 30 July 2016 10:14
Target OS: Linux
Domoticz version: 2020beta
Location: Arnhem
Contact:

Re: Xiaomi Mi Flora

Post by florisi »

Here is the json output

Code: Select all

{
	"ActTime" : 1585676721,
	"AstrTwilightEnd" : "22:08",
	"AstrTwilightStart" : "05:12",
	"CivTwilightEnd" : "20:43",
	"CivTwilightStart" : "06:38",
	"DayLength" : "12:57",
	"NautTwilightEnd" : "21:24",
	"NautTwilightStart" : "05:56",
	"ServerTime" : "2020-03-31 19:45:21",
	"SunAtSouth" : "13:40",
	"Sunrise" : "07:12",
	"Sunset" : "20:09",
	"app_version" : "2020.1 (build 11839)",
	"result" : 
	[
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 99,
			"CustomImage" : 0,
			"Data" : "44 cb",
			"Desc" : "irrigation advise",
			"Description" : "",
			"Favorite" : 1,
			"HardwareID" : 16,
			"HardwareName" : "MiFlowerMate",
			"HardwareType" : "Xiaomi Mi Flower Mate",
			"HardwareTypeVal" : 94,
			"HaveTimeout" : false,
			"ID" : "00100002",
			"LastUpdate" : "2020-03-31 18:00:17",
			"Name" : "MiFlowerMate - #0 Moisture",
			"Notifications" : "true",
			"PlanID" : "0",
			"PlanIDs" : 
			[
				0
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "Soil Moisture",
			"SwitchTypeVal" : 0,
			"Timers" : "false",
			"Type" : "General",
			"TypeImg" : "moisture",
			"Unit" : 2,
			"Used" : 1,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "223"
		}
	],
	"status" : "OK",
	"title" : "Devices"
}
tonbor
Posts: 153
Joined: Monday 17 February 2014 9:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Xiaomi Mi Flora

Post by tonbor »

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.Log("Created device: "+Devices[sensorNumber].Name)

Soil Moisture should be "percentage" in the plugin code

Just change this part in the plugin code plugin.py
Domoticz.Device(Name=sensorName, Unit=sensorNumber, TypeName="Percentage", Used=1).Create()

then delete the plugin and update the plugin

Moisture will then be the right label %
florisi
Posts: 78
Joined: Saturday 30 July 2016 10:14
Target OS: Linux
Domoticz version: 2020beta
Location: Arnhem
Contact:

Re: Xiaomi Mi Flora

Post by florisi »

Thanks, i will look at it tomorrow
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest