Xiaomi Miio Binding Aqara A1 Curtain Motors

I’ve managed to get these Curtain Motors working using the Miio Binding and local discovery. This created the json file below which has a Motor control channel that has Pause Open Close and Toggle which work fine.

The remote control has some preset buttons F1, F2, F3 which I have programmed outside of Openhab. I can’t seem to find a way to either replicate these button presses or even just send a direct command to open the curtains to a %'age.

Has anyone had any luck doing this - or could explain how to do it?

{
	"deviceMapping": {
		"id": [
			"lumi.curtain.hagl08"
		],
		"propertyMethod": "get_properties",
		"maxProperties": 1,
		"channels": [
			{
				"property": "fault",
				"siid": 2,
				"piid": 1,
				"friendlyName": "Curtain - Device Fault",
				"channel": "fault",
				"type": "Number",
				"stateDescription": {
					"readOnly": true,
					"options": [
						{
							"value": "0",
							"label": "No Faults"
						}
					]
				},
				"refresh": true,
				"actions": [],
				"readmeComment": "Value mapping [\"0\"\u003d\"No Faults\"]"
			},
			{
				"property": "motor-control",
				"siid": 2,
				"piid": 2,
				"friendlyName": "Curtain - Motor Control",
				"channel": "motor_control",
				"type": "Number",
				"stateDescription": {
					"options": [
						{
							"value": "0",
							"label": "Pause"
						},
						{
							"value": "1",
							"label": "Open"
						},
						{
							"value": "2",
							"label": "Close"
						},
						{
							"value": "3",
							"label": "Toggle"
						}
					]
				},
				"refresh": false,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				],
				"readmeComment": "Value mapping [\"0\"\u003d\"Pause\",\"1\"\u003d\"Open\",\"2\"\u003d\"Close\",\"3\"\u003d\"Toggle\"]"
			},
			{
				"property": "current-position",
				"siid": 2,
				"piid": 3,
				"friendlyName": "Curtain - Current Position",
				"channel": "current_position",
				"type": "Number:Dimensionless",
				"unit": "percentage",
				"stateDescription": {
					"minimum": 0,
					"maximum": 100,
					"step": 1,
					"pattern": "%.0f %unit%",
					"readOnly": true
				},
				"refresh": true,
				"actions": []
			},
			{
				"property": "status",
				"siid": 2,
				"piid": 6,
				"friendlyName": "Curtain - Status",
				"channel": "status",
				"type": "Number",
				"stateDescription": {
					"readOnly": true,
					"options": [
						{
							"value": "0",
							"label": "Stopped"
						},
						{
							"value": "1",
							"label": "Opening"
						},
						{
							"value": "2",
							"label": "Closing"
						}
					]
				},
				"refresh": true,
				"actions": [],
				"readmeComment": "Value mapping [\"0\"\u003d\"Stopped\",\"1\"\u003d\"Opening\",\"2\"\u003d\"Closing\"]"
			},
			{
				"property": "target-position",
				"siid": 2,
				"piid": 7,
				"friendlyName": "Curtain - Target Position",
				"channel": "target_position",
				"type": "Number:Dimensionless",
				"unit": "percentage",
				"stateDescription": {
					"minimum": 0,
					"maximum": 100,
					"step": 1,
					"pattern": "%.0f %unit%"
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				]
			},
			{
				"property": "manual-enabled",
				"siid": 4,
				"piid": 1,
				"friendlyName": "Curtain Cfg - Manual Enabled",
				"channel": "manual_enabled",
				"type": "Number",
				"stateDescription": {
					"options": [
						{
							"value": "0",
							"label": "Disable"
						},
						{
							"value": "1",
							"label": "Enable"
						}
					]
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				],
				"readmeComment": "Value mapping [\"0\"\u003d\"Disable\",\"1\"\u003d\"Enable\"]"
			},
			{
				"property": "polarity",
				"siid": 4,
				"piid": 2,
				"friendlyName": "Curtain Cfg - Polarity",
				"channel": "polarity",
				"type": "Number",
				"stateDescription": {
					"options": [
						{
							"value": "0",
							"label": "Positive"
						},
						{
							"value": "1",
							"label": "Reverse"
						}
					]
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				],
				"readmeComment": "Value mapping [\"0\"\u003d\"Positive\",\"1\"\u003d\"Reverse\"]"
			},
			{
				"property": "pos-limit",
				"siid": 4,
				"piid": 3,
				"friendlyName": "Curtain Cfg - Pos Limit",
				"channel": "pos_limit",
				"type": "Number",
				"stateDescription": {
					"options": [
						{
							"value": "0",
							"label": "Unlimit"
						},
						{
							"value": "1",
							"label": "Limit"
						}
					]
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				],
				"readmeComment": "Value mapping [\"0\"\u003d\"Unlimit\",\"1\"\u003d\"Limit\"]"
			},
			{
				"property": "en-night-tip-light",
				"siid": 4,
				"piid": 4,
				"friendlyName": "Curtain Cfg - En Night Tip Light",
				"channel": "en_night_tip_light",
				"type": "Number",
				"stateDescription": {
					"options": [
						{
							"value": "0",
							"label": "Disable"
						},
						{
							"value": "1",
							"label": "Enable"
						}
					]
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				],
				"readmeComment": "Value mapping [\"0\"\u003d\"Disable\",\"1\"\u003d\"Enable\"]"
			},
			{
				"property": "run-time",
				"siid": 4,
				"piid": 5,
				"friendlyName": "Curtain Cfg - Run Time",
				"channel": "run_time",
				"type": "Number",
				"stateDescription": {
					"minimum": 0,
					"maximum": 255,
					"step": 1,
					"pattern": "%.0f",
					"readOnly": true
				},
				"refresh": true,
				"actions": []
			},
			{
				"property": "debug-info",
				"siid": 4,
				"piid": 6,
				"friendlyName": "Curtain Cfg - Debug Info",
				"channel": "debug_info",
				"type": "String",
				"stateDescription": {
					"readOnly": true
				},
				"refresh": true,
				"actions": []
			},
			{
				"property": "light-off-time-range",
				"siid": 4,
				"piid": 7,
				"friendlyName": "Curtain Cfg - Light Off Time Range",
				"channel": "light_off_time_range",
				"type": "Number",
				"stateDescription": {
					"minimum": 0,
					"maximum": 389748539,
					"step": 1,
					"pattern": "%.0f"
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "STRING"
					}
				]
			},
			{
				"property": "adjust-value",
				"siid": 5,
				"piid": 1,
				"friendlyName": "Motor Controller - Adjust Value",
				"channel": "adjust_value",
				"type": "Number",
				"stateDescription": {
					"minimum": -100,
					"maximum": 100,
					"step": 1,
					"pattern": "%.0f"
				},
				"refresh": false,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				]
			},
			{
				"property": "proportion-incream",
				"siid": 5,
				"piid": 2,
				"friendlyName": "Motor Controller - Proportion Incream",
				"channel": "proportion_incream",
				"type": "Number",
				"stateDescription": {
					"minimum": 0,
					"maximum": 100,
					"step": 1,
					"pattern": "%.0f"
				},
				"refresh": false,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				]
			},
			{
				"property": "proportion-decream",
				"siid": 5,
				"piid": 3,
				"friendlyName": "Motor Controller - Proportion Decream",
				"channel": "proportion_decream",
				"type": "Number",
				"stateDescription": {
					"minimum": 0,
					"maximum": 100,
					"step": 1,
					"pattern": "%.0f"
				},
				"refresh": false,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				]
			},
			{
				"property": "remote-identify",
				"siid": 7,
				"piid": 1,
				"friendlyName": "Remote Cfg - Remote Identify",
				"channel": "remote_identify",
				"type": "String",
				"stateDescription": {
					"readOnly": true
				},
				"refresh": true,
				"actions": []
			},
			{
				"property": "remote-list",
				"siid": 7,
				"piid": 2,
				"friendlyName": "Remote Cfg - Remote List",
				"channel": "remote_list",
				"type": "String",
				"stateDescription": {
					"readOnly": true
				},
				"refresh": true,
				"actions": []
			},
			{
				"property": "remote-pair",
				"siid": 7,
				"piid": 3,
				"friendlyName": "Remote Cfg - Remote Pair",
				"channel": "remote_pair",
				"type": "Number",
				"stateDescription": {
					"options": [
						{
							"value": "0",
							"label": "Exit"
						},
						{
							"value": "1",
							"label": "Enter"
						}
					]
				},
				"refresh": false,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				],
				"readmeComment": "Value mapping [\"0\"\u003d\"Exit\",\"1\"\u003d\"Enter\"]"
			},
			{
				"property": "remote-pair-status",
				"siid": 7,
				"piid": 4,
				"friendlyName": "Remote Cfg - Remote Pair Status",
				"channel": "remote_pair_status",
				"type": "Number",
				"stateDescription": {
					"readOnly": true,
					"options": [
						{
							"value": "0",
							"label": "配对成功"
						},
						{
							"value": "1",
							"label": "配对失败"
						},
						{
							"value": "2",
							"label": "配对中"
						},
						{
							"value": "3",
							"label": "退出配对"
						}
					]
				},
				"refresh": true,
				"actions": [],
				"readmeComment": "Value mapping [\"0\"\u003d\"配对成功\",\"1\"\u003d\"配对失败\",\"2\"\u003d\"配对中\",\"3\"\u003d\"退出配对\"]"
			},
			{
				"property": "remote-delete",
				"siid": 7,
				"piid": 5,
				"friendlyName": "Remote Cfg - Remote Delete",
				"channel": "remote_delete",
				"type": "String",
				"refresh": false,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "STRING"
					}
				]
			},
			{
				"property": "f-one-wireless",
				"siid": 8,
				"piid": 2,
				"friendlyName": "Remote Button - F One Wireless",
				"channel": "f_one_wireless",
				"type": "Number",
				"stateDescription": {
					"options": [
						{
							"value": "0",
							"label": "Disable"
						},
						{
							"value": "1",
							"label": "Enable"
						}
					]
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				],
				"readmeComment": "Value mapping [\"0\"\u003d\"Disable\",\"1\"\u003d\"Enable\"]"
			},
			{
				"property": "f-two-wireless",
				"siid": 8,
				"piid": 3,
				"friendlyName": "Remote Button - F Two Wireless",
				"channel": "f_two_wireless",
				"type": "Number",
				"stateDescription": {
					"options": [
						{
							"value": "0",
							"label": "Disable"
						},
						{
							"value": "1",
							"label": "Enable"
						}
					]
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				],
				"readmeComment": "Value mapping [\"0\"\u003d\"Disable\",\"1\"\u003d\"Enable\"]"
			},
			{
				"property": "f-three-wireless",
				"siid": 8,
				"piid": 4,
				"friendlyName": "Remote Button - F Three Wireless",
				"channel": "f_three_wireless",
				"type": "Number",
				"stateDescription": {
					"options": [
						{
							"value": "0",
							"label": "Disable"
						},
						{
							"value": "1",
							"label": "Enable"
						}
					]
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				],
				"readmeComment": "Value mapping [\"0\"\u003d\"Disable\",\"1\"\u003d\"Enable\"]"
			},
			{
				"property": "f-one-position",
				"siid": 8,
				"piid": 5,
				"friendlyName": "Remote Button - F One Position",
				"channel": "f_one_position",
				"type": "Number:Dimensionless",
				"unit": "percentage",
				"stateDescription": {
					"minimum": 0,
					"maximum": 100,
					"step": 1,
					"pattern": "%.0f %unit%"
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				]
			},
			{
				"property": "f-two-position",
				"siid": 8,
				"piid": 6,
				"friendlyName": "Remote Button - F Two Position",
				"channel": "f_two_position",
				"type": "Number:Dimensionless",
				"unit": "percentage",
				"stateDescription": {
					"minimum": 0,
					"maximum": 100,
					"step": 1,
					"pattern": "%.0f %unit%"
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				]
			},
			{
				"property": "f-three-position",
				"siid": 8,
				"piid": 7,
				"friendlyName": "Remote Button - F Three Position",
				"channel": "f_three_position",
				"type": "Number:Dimensionless",
				"unit": "percentage",
				"stateDescription": {
					"minimum": 0,
					"maximum": 100,
					"step": 1,
					"pattern": "%.0f %unit%"
				},
				"refresh": true,
				"actions": [
					{
						"command": "set_properties",
						"parameterType": "NUMBER"
					}
				]
			}
		],
		"experimental": true
	}
}

sweet that you (almost) got it working
looking at the channels, My best guess is that the f_two_wireless and f-three-wireless etc may represent the buttons.What happens if you enable those ?

there are also similar channels like f_three_position which are I guess the related positions for the presets.

btw. let me know if you got it working, than I’ll add this device json to the binding

Sorry been away - so the f_two_wireless buttons don’t seem to do anything if I enable or disable them. The f_two_position holds the percentage value that I set for that curtain preset. Yes would be nice to be able to get these working even if I am limited to executing the presets.

if it helps you here is the source of the mihome app widget for your device
https://verpaalen.com/openhab/lumi.curtain.hagl08-v2-signed_10038_1002372_19.zip

When unzipping, there is a file main.bundle which you can open with text editor and it can maybe give you hint on what to send.

Thanks but I had a look at this and it does not make a lot of sense to me! I’m not much of a coder…