[OH 2.5.12] [Xiaomi Mi IO] Binding - add support for Smartmi Standing Fan 3 (zhimi.fan.za5)

Hi @marcel_verpaalen ,
What are the steps for adding local support for the “Smartmi Standing Fan 3 (zhimi.fan.za5)” in the OH 2.5 binding?
I see it as experimental in the 3.2 binding version.

Thank you.

I have the token.
Do I need to add the thing manually?
If I let it discover with my login details I get an unsupported device thing added.

  1. Where can I get the experimental json file from OH3 binding?
    Is this the correct location to get the latest file: https://github.com/openhab/openhab-addons/tree/main/bundles/org.openhab.binding.miio/src/main/resources/database
{
	"deviceMapping": {
		"id": [
			"zhimi.fan.za5"
		],
		"propertyMethod": "get_properties",
		"maxProperties": 1,
		"channels": [
			{
				"property": "on",
				"siid": 2,
				"piid": 1,
				"friendlyName": "Fan - Power",
				"channel": "on",
				"type": "Switch",
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "ONOFFBOOL"
					}
				],
				"category": "switch",
				"tags": [
					"Switch"
				]
			},
			{
				"property": "fan-level",
				"siid": 2,
				"piid": 2,
				"friendlyName": "Fan - Fan Level",
				"channel": "fan_level",
				"type": "Number",
				"stateDescription": {
					"options": [
						{
							"value": "1",
							"label": "Level 1"
						},
						{
							"value": "2",
							"label": "Level 2"
						},
						{
							"value": "3",
							"label": "Level 3"
						},
						{
							"value": "4",
							"label": "Level 4"
						}
					]
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				],
				"readmeComment": "Value mapping `[\"1\"\u003d\"Level 1\",\"2\"\u003d\"Level 2\",\"3\"\u003d\"Level 3\",\"4\"\u003d\"Level 4\"]`"
			},
			{
				"property": "horizontal-swing",
				"siid": 2,
				"piid": 3,
				"friendlyName": "Fan - Horizontal Swing",
				"channel": "horizontal_swing",
				"type": "Switch",
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "ONOFFBOOL"
					}
				]
			},
			{
				"property": "horizontal-angle",
				"siid": 2,
				"piid": 5,
				"friendlyName": "Fan - Horizontal Angle",
				"channel": "horizontal_angle",
				"type": "Number",
				"stateDescription": {
					"minimum": 30,
					"maximum": 120,
					"step": 1,
					"pattern": "%.0f"
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "STRING"
					}
				]
			},
			{
				"property": "mode",
				"siid": 2,
				"piid": 7,
				"friendlyName": "Fan - Mode",
				"channel": "mode",
				"type": "Number",
				"stateDescription": {
					"options": [
						{
							"value": "0",
							"label": "Natural Wind"
						},
						{
							"value": "1",
							"label": "Straight Wind"
						}
					]
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				],
				"readmeComment": "Value mapping `[\"0\"\u003d\"Natural Wind\",\"1\"\u003d\"Straight Wind\"]`"
			},
			{
				"property": "off-delay",
				"siid": 2,
				"piid": 10,
				"friendlyName": "Fan - Power Off Delay",
				"channel": "off_delay",
				"type": "Number",
				"stateDescription": {
					"minimum": 0,
					"maximum": 36000,
					"step": 1,
					"pattern": "%.0f"
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "STRING"
					}
				]
			},
			{
				"property": "anion",
				"siid": 2,
				"piid": 11,
				"friendlyName": "Fan - Anion",
				"channel": "anion",
				"type": "Switch",
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "ONOFFBOOL"
					}
				]
			},
			{
				"property": "physical-controls-locked",
				"siid": 3,
				"piid": 1,
				"friendlyName": "Physical Control Locked - Physical Control Locked",
				"channel": "physical_controls_locked",
				"type": "Switch",
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "ONOFFBOOL"
					}
				]
			},
			{
				"property": "brightness",
				"siid": 4,
				"piid": 3,
				"friendlyName": "Indicator Light - Brightness",
				"channel": "brightness",
				"type": "Number:Dimensionless",
				"unit": "percentage",
				"stateDescription": {
					"minimum": 0,
					"maximum": 100,
					"step": 1,
					"pattern": "%.0f %unit%"
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				],
				"category": "light",
				"tags": [
					"Control",
					"Light"
				]
			},
			{
				"property": "alarm",
				"siid": 5,
				"piid": 1,
				"friendlyName": "Alarm - Alarm",
				"channel": "alarm",
				"type": "Switch",
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "ONOFFBOOL"
					}
				]
			},
			{
				"property": "relative-humidity",
				"siid": 7,
				"piid": 1,
				"friendlyName": "Environment - Relative Humidity",
				"channel": "relative_humidity",
				"type": "Number:Dimensionless",
				"unit": "percentage",
				"stateDescription": {
					"minimum": 0,
					"maximum": 100,
					"step": 1,
					"pattern": "%.0f %unit%",
					"readOnly": true
				},
				"refresh": true,
				"actions": [],
				"tags": [
					"Measurement",
					"Humidity"
				]
			},
			{
				"property": "temperature",
				"siid": 7,
				"piid": 7,
				"friendlyName": "Environment - Temperature",
				"channel": "temperature",
				"type": "Number:Temperature",
				"unit": "celsius",
				"stateDescription": {
					"minimum": -30,
					"maximum": 100,
					"pattern": "%.1f %unit%",
					"readOnly": true
				},
				"refresh": true,
				"actions": [],
				"category": "temperature",
				"tags": [
					"Setpoint",
					"Temperature"
				]
			},
			{
				"property": "button-press",
				"siid": 6,
				"piid": 1,
				"friendlyName": "Custom Service - Button Press",
				"channel": "button_press",
				"type": "Number",
				"stateDescription": {
					"readOnly": true,
					"options": [
						{
							"value": "1",
							"label": "power"
						},
						{
							"value": "2",
							"label": "swing"
						},
						{
							"value": "0",
							"label": "No Button Pressed"
						}
					]
				},
				"refresh": true,
				"actions": [],
				"readmeComment": "Value mapping `[\"1\"\u003d\"power\",\"2\"\u003d\"swing\",\"0\"\u003d\"No Button Pressed\"]`"
			},
			{
				"property": "battery-state",
				"siid": 6,
				"piid": 2,
				"friendlyName": "Custom Service - Battery State",
				"channel": "battery_state",
				"type": "Switch",
				"stateDescription": {
					"readOnly": true
				},
				"refresh": true,
				"actions": []
			},
			{
				"property": "speed-now",
				"siid": 6,
				"piid": 4,
				"friendlyName": "Custom Service - Speed Now",
				"channel": "speed_now",
				"type": "Number",
				"stateDescription": {
					"minimum": 0,
					"maximum": 3000,
					"step": 1,
					"pattern": "%.0f",
					"readOnly": true
				},
				"refresh": true,
				"actions": []
			},
			{
				"property": "ac-state",
				"siid": 6,
				"piid": 5,
				"friendlyName": "Custom Service - Ac State",
				"channel": "ac_state",
				"type": "Switch",
				"stateDescription": {
					"readOnly": true
				},
				"refresh": true,
				"actions": []
			},
			{
				"property": "speed-level",
				"siid": 6,
				"piid": 8,
				"friendlyName": "Custom Service - Speed Level",
				"channel": "speed_level",
				"type": "Number:Dimensionless",
				"unit": "percent",
				"stateDescription": {
					"minimum": 1,
					"maximum": 100,
					"step": 1,
					"pattern": "%.0f %unit%"
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				]
			}
		],
		"experimental": true
	}
}

  1. Is it compatible with OH2.5 binding? Can I just use it or does it need adjustments?

  2. In case it is compatible, I copied the json file to /misc/miio folder but I get warning in my log about RSSI# etc…

  1. yes, that seems to be the right one
  2. It will work to some extend. Most likely the actions will work. You will need to change all quantity types (number:something to just number, e.g. "type": "Number:Dimensionless", needs to be "type": "Number",) to normal numbers. Keep in mind that everything in the ‘statedescription’ is not understood in by the 2.5. (it will most likely just ignore it)
  3. yes… that’s the way. the rssi error seems unrelated to this file

Note: It can’t break anything if you are trying… worse that can happen that channels don’t work…