[miio] add support for Mi Smart Standing Fan Pro Global (dmaker.fan.p15) (#10855)

* [miio] add support for Mi Smart Standing Fan Pro Global (dmaker.fan.p15)

add support Mi Smart Standing Fan Pro EU/Global (dmaker.fan.p15)
Improve p8 & p9 fans
close #10843

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* [miio] improve timeunit

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
Marcel
2021-06-16 00:03:46 +02:00
committed by GitHub
parent d0f4b84841
commit 8bd05c0f9f
5 changed files with 613 additions and 184 deletions

View File

@@ -56,6 +56,7 @@ public enum MiIoDevices {
DMAKER_FAN_P8("dmaker.fan.p8", "Mi Smart Standing Fan 1C", THING_TYPE_BASIC),
DMAKER_FAN_P9("dmaker.fan.p9", "Mi Smart Tower Fan", THING_TYPE_BASIC),
DMAKER_FAN_P10("dmaker.fan.p10", "Mi Smart Standing Fan 2", THING_TYPE_BASIC),
DMAKER_FAN_P15("dmaker.fan.p15", "Mi Smart Standing Fan Pro", THING_TYPE_BASIC),
DREAME_VACUUM_MC1808("dreame.vacuum.mc1808", "Mi Robot Vacuum Mop 1C STYTJ01ZHM", THING_TYPE_BASIC),
DREAME_VACUUM_P2008("dreame.vacuum.p2008", "Dreame Robot Vacuum-Mop F9", THING_TYPE_BASIC),
DREAME_VACUUM_P2009("dreame.vacuum.p2009", "Dreame Robot Vacuum D9 ", THING_TYPE_BASIC),

View File

@@ -0,0 +1,319 @@
{
"deviceMapping": {
"id": [
"dmaker.fan.p15"
],
"propertyMethod": "get_properties",
"maxProperties": 1,
"channels": [
{
"property": "on",
"siid": 2,
"piid": 1,
"friendlyName": "Fan - Switch Status",
"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 - Gear Fan Level",
"channel": "fan_level",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "1",
"label": "Level1"
},
{
"value": "2",
"label": "Level2"
},
{
"value": "3",
"label": "Level3"
},
{
"value": "4",
"label": "Level4"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"category": "fan",
"tags": [
"SetPoint"
],
"readmeComment": "Value mapping `[\"1\"\u003d\"Level1\",\"2\"\u003d\"Level2\",\"3\"\u003d\"Level3\",\"4\"\u003d\"Level4\"]`"
},
{
"property": "mode",
"siid": 2,
"piid": 3,
"friendlyName": "Fan - Mode",
"channel": "mode",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "0",
"label": "Straight Wind"
},
{
"value": "1",
"label": "Natural Wind"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"category": "flow",
"tags": [
"Control"
],
"readmeComment": "Value mapping `[\"0\"\u003d\"Straight Wind\",\"1\"\u003d\"Natural Wind\"]`"
},
{
"property": "horizontal-swing",
"siid": 2,
"piid": 4,
"friendlyName": "Fan - Horizontal Swing",
"channel": "horizontal_swing",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],
"category": "switch",
"tags": [
"Switch"
]
},
{
"property": "horizontal-angle",
"siid": 2,
"piid": 5,
"friendlyName": "Fan - Horizontal Angle",
"channel": "horizontal_angle",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "30",
"label": "30"
},
{
"value": "60",
"label": "60"
},
{
"value": "90",
"label": "90"
},
{
"value": "120",
"label": "120"
},
{
"value": "140",
"label": "140"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
],
"category": "incline",
"tags": [
"Setpoint"
],
"readmeComment": "Value mapping `[\"30\"\u003d\"30\",\"60\"\u003d\"60\",\"90\"\u003d\"90\",\"120\"\u003d\"120\",\"140\"\u003d\"140\"]`"
},
{
"property": "status",
"siid": 2,
"piid": 6,
"friendlyName": "Fan - Status",
"channel": "status",
"type": "Number",
"stateDescription": {
"minimum": 1,
"maximum": 100,
"step": 1,
"pattern": "%.0f",
"readOnly": true
},
"refresh": true,
"actions": [],
"category": "fan",
"tags": [
"Status"
]
},
{
"property": "on1",
"siid": 4,
"piid": 1,
"friendlyName": "Indicator Light - Switch Status",
"channel": "on1",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],
"category": "lightbulb",
"tags": [
"Control"
]
},
{
"property": "alarm",
"siid": 5,
"piid": 1,
"friendlyName": "Alarm - Alarm",
"channel": "alarm",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],
"category": "alarm"
},
{
"property": "fault",
"siid": 6,
"piid": 2,
"friendlyName": "Motor Controller - Device Fault",
"channel": "fault",
"type": "Number",
"stateDescription": {
"readOnly": true,
"options": [
{
"value": "0",
"label": "No Faults"
}
]
},
"refresh": true,
"actions": [],
"category": "error",
"tags": [
"Status"
],
"readmeComment": "Value mapping `[\"0\"\u003d\"No Faults\"]`"
},
{
"property": "physical-controls-locked",
"siid": 7,
"piid": 1,
"friendlyName": "Physical Control Locked - Physical Control Locked",
"channel": "physical_controls_locked",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
]
},
{
"property": "off-delay-time",
"siid": 3,
"piid": 1,
"friendlyName": "Off Delay Time - Off Delay Time",
"channel": "off_delay_time",
"type": "Number:Time",
"unit": "minutes",
"stateDescription": {
"minimum": 0,
"maximum": 480,
"step": 1,
"pattern": "%.0f"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"category": "time",
"tags": [
"Setpoint"
]
},
{
"property": "",
"friendlyName": "Actions",
"channel": "actions",
"type": "String",
"stateDescription": {
"options": [
{
"value": "off-delay-time-toggle",
"label": "Off Delay Time Toggle"
}
]
},
"actions": [
{
"command": "action",
"parameterType": "EMPTY",
"siid": 3,
"aiid": 1,
"condition": {
"name": "matchValue",
"parameters": [
{
"matchValue": "off-delay-time-toggle"
}
]
}
}
],
"readmeComment": "Value mapping `[\"off-delay-time-toggle\"\u003d\"Off Delay Time Toggle\"]`"
}
],
"readmeComment": "Identified manual actions for execution\u003cbr /\u003e`action{\"did\":\"off-delay-time-toggle\",\"siid\":3,\"aiid\":1,\"in\":[]}`\u003cbr /\u003ePlease test and feedback if they are working to they can be linked to a channel.",
"experimental": false
}
}

View File

@@ -8,56 +8,42 @@
"maxProperties": 2,
"channels": [
{
"property": "manufacturer",
"siid": 1,
"piid": 1,
"friendlyName": "Device Information-Device Manufacturer",
"channel": "Manufacturer",
"channelType": "miot_string",
"property": "",
"friendlyName": "Actions",
"channel": "actions",
"type": "String",
"refresh": true,
"actions": []
},
{
"property": "model",
"siid": 1,
"piid": 2,
"friendlyName": "Device Information-Device Model",
"channel": "Model",
"channelType": "miot_string",
"type": "String",
"refresh": true,
"actions": []
},
{
"property": "serial-number",
"siid": 1,
"piid": 3,
"friendlyName": "Device Information-Device Serial Number",
"channel": "SerialNumber",
"channelType": "miot_string",
"type": "String",
"refresh": true,
"actions": []
},
{
"property": "firmware-revision",
"siid": 1,
"piid": 4,
"friendlyName": "Device Information-Current Firmware Version",
"channel": "FirmwareRevision",
"channelType": "miot_string",
"type": "String",
"refresh": true,
"actions": []
"stateDescription": {
"options": [
{
"value": "fan-toggle",
"label": "Fan Toggle"
}
]
},
"actions": [
{
"command": "action",
"parameterType": "EMPTY",
"siid": 2,
"aiid": 1,
"condition": {
"name": "matchValue",
"parameters": [
{
"matchValue": "fan-toggle"
}
]
}
}
],
"readmeComment": "Value mapping `[\"fan-toggle\"\u003d\"Fan Toggle\"]`"
},
{
"property": "on",
"siid": 2,
"piid": 1,
"friendlyName": "Fan-Switch Status",
"friendlyName": "Fan - Switch Status",
"channel": "On",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [
@@ -77,15 +63,35 @@
"piid": 2,
"friendlyName": "Fan-Fan Level",
"channel": "FanLevel",
"channelType": "miot_uint8",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "1",
"label": "Level1"
},
{
"value": "2",
"label": "Level2"
},
{
"value": "3",
"label": "Level3"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
]
],
"category": "fan",
"tags": [
"SetPoint"
],
"readmeComment": "Value mapping `[\"1\"\u003d\"Level1\",\"2\"\u003d\"Level2\",\"3\"\u003d\"Level3\"]`"
},
{
"property": "horizontal-swing",
@@ -93,7 +99,6 @@
"piid": 3,
"friendlyName": "Fan-Horizontal Swing",
"channel": "HorizontalSwing",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [
@@ -109,8 +114,19 @@
"piid": 7,
"friendlyName": "Fan-Mode",
"channel": "Mode",
"channelType": "miot_uint8",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "0",
"label": "Straight Wind"
},
{
"value": "1",
"label": "Sleep"
}
]
},
"refresh": true,
"actions": [
{
@@ -118,9 +134,11 @@
"parameterType": "NUMBER"
}
],
"category": "flow",
"tags": [
"Control"
]
],
"readmeComment": "Value mapping `[\"0\"\u003d\"Straight Wind\",\"1\"\u003d\"Sleep\"]`"
},
{
"property": "off-delay-time",
@@ -128,14 +146,24 @@
"piid": 10,
"friendlyName": "Fan-Power Off Delay Time",
"channel": "OffDelayTime",
"channelType": "miot_uint16",
"type": "Number",
"type": "Number:Time",
"unit": "minutes",
"stateDescription": {
"minimum": 0,
"maximum": 480,
"step": 1,
"pattern": "%.0f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"category": "time",
"tags": [
"Setpoint"
]
},
{
@@ -144,7 +172,6 @@
"piid": 11,
"friendlyName": "Fan-Alarm",
"channel": "Alarm",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [
@@ -161,7 +188,6 @@
"piid": 12,
"friendlyName": "Fan-Brightness",
"channel": "Brightness",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [
@@ -182,7 +208,6 @@
"piid": 1,
"friendlyName": "Physical Control Locked-Physical Control Locked",
"channel": "PhysicalControlsLocked",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [
@@ -192,6 +217,8 @@
}
]
}
]
],
"readmeComment": "Identified manual actions for execution\u003cbr /\u003e`action{\"did\":\"fan-toggle\",\"siid\":2,\"aiid\":1,\"in\":[]}`\u003cbr /\u003ePlease test and feedback if they are working to they can be linked to a channel.",
"experimental": true
}
}

View File

@@ -5,51 +5,38 @@
"dmaker.fan.p10"
],
"propertyMethod": "get_properties",
"maxProperties": 2,
"maxProperties": 1,
"channels": [
{
"property": "manufacturer",
"siid": 1,
"piid": 1,
"friendlyName": "Device Information-Device Manufacturer",
"channel": "Manufacturer",
"channelType": "miot_string",
"property": "",
"friendlyName": "Actions",
"channel": "actions",
"type": "String",
"refresh": true,
"actions": []
},
{
"property": "model",
"siid": 1,
"piid": 2,
"friendlyName": "Device Information-Device Model",
"channel": "Model",
"channelType": "miot_string",
"type": "String",
"refresh": true,
"actions": []
},
{
"property": "serial-number",
"siid": 1,
"piid": 3,
"friendlyName": "Device Information-Device Serial Number",
"channel": "SerialNumber",
"channelType": "miot_string",
"type": "String",
"refresh": true,
"actions": []
},
{
"property": "firmware-revision",
"siid": 1,
"piid": 4,
"friendlyName": "Device Information-Current Firmware Version",
"channel": "FirmwareRevision",
"channelType": "miot_string",
"type": "String",
"refresh": true,
"actions": []
"stateDescription": {
"options": [
{
"value": "fan-toggle",
"label": "Fan Toggle"
}
]
},
"actions": [
{
"command": "action",
"parameterType": "EMPTY",
"siid": 2,
"aiid": 1,
"condition": {
"name": "matchValue",
"parameters": [
{
"matchValue": "fan-toggle"
}
]
}
}
],
"readmeComment": "Value mapping `[\"fan-toggle\"\u003d\"Fan Toggle\"]`"
},
{
"property": "on",
@@ -57,7 +44,6 @@
"piid": 1,
"friendlyName": "Fan-Switch Status",
"channel": "On",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [
@@ -77,24 +63,27 @@
"piid": 2,
"friendlyName": "Fan-Fan Level",
"channel": "FanLevel",
"channelType": "miot_uint8",
"type": "Number",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
]
},
{
"property": "mode",
"siid": 2,
"piid": 4,
"friendlyName": "Fan-Mode",
"channel": "Mode",
"channelType": "miot_uint8",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "1",
"label": "Level1"
},
{
"value": "2",
"label": "Level2"
},
{
"value": "3",
"label": "Level3"
},
{
"value": "4",
"label": "Level4"
}
]
},
"refresh": true,
"actions": [
{
@@ -102,9 +91,47 @@
"parameterType": "NUMBER"
}
],
"category": "fan",
"tags": [
"SetPoint"
],
"readmeComment": "Value mapping `[\"1\"\u003d\"Level1\",\"2\"\u003d\"Level2\",\"3\"\u003d\"Level3\",\"4\"\u003d\"Level4\"]`"
},
{
"property": "mode",
"siid": 2,
"piid": 4,
"friendlyName": "Fan-Mode",
"channel": "Mode",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "0",
"label": "Straight Wind"
},
{
"value": "1",
"label": "Natural Wind"
},
{
"value": "2",
"label": "Sleep"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"category": "flow",
"tags": [
"Control"
]
],
"readmeComment": "Value mapping `[\"0\"\u003d\"Straight Wind\",\"1\"\u003d\"Natural Wind\",\"2\"\u003d\"Sleep\"]`"
},
{
"property": "horizontal-swing",
@@ -112,7 +139,6 @@
"piid": 5,
"friendlyName": "Fan-Horizontal Swing",
"channel": "HorizontalSwing",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [
@@ -120,6 +146,10 @@
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],
"category": "switch",
"tags": [
"Switch"
]
},
{
@@ -128,15 +158,43 @@
"piid": 6,
"friendlyName": "Fan-Horizontal Angle",
"channel": "HorizontalAngle",
"channelType": "miot_uint8",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "30",
"label": "30"
},
{
"value": "60",
"label": "60"
},
{
"value": "90",
"label": "90"
},
{
"value": "120",
"label": "120"
},
{
"value": "150",
"label": "150"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
]
],
"category": "incline",
"tags": [
"Setpoint"
],
"readmeComment": "Value mapping `[\"30\"\u003d\"30\",\"60\"\u003d\"60\",\"90\"\u003d\"90\",\"120\"\u003d\"120\",\"150\"\u003d\"150\"]`"
},
{
"property": "alarm",
@@ -144,7 +202,6 @@
"piid": 7,
"friendlyName": "Fan-Alarm",
"channel": "Alarm",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [
@@ -159,16 +216,26 @@
"property": "off-delay-time",
"siid": 2,
"piid": 8,
"friendlyName": "Fan-Power Off Delay Time",
"friendlyName": "Fan - Power Off Delay Time",
"channel": "OffDelayTime",
"channelType": "miot_uint8",
"type": "Number",
"type": "Number:Time",
"unit": "minutes",
"stateDescription": {
"minimum": 0,
"maximum": 480,
"step": 1,
"pattern": "%.0f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"category": "time",
"tags": [
"Setpoint"
]
},
{
@@ -177,7 +244,6 @@
"piid": 9,
"friendlyName": "Fan-Brightness",
"channel": "Brightness",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [
@@ -188,8 +254,7 @@
],
"category": "light",
"tags": [
"Control",
"Light"
"Control"
]
},
{
@@ -198,7 +263,6 @@
"piid": 10,
"friendlyName": "Fan-Motor Control",
"channel": "MotorControl",
"channelType": "miot_uint8",
"type": "Number",
"refresh": true,
"actions": [
@@ -214,8 +278,13 @@
"piid": 11,
"friendlyName": "Fan-Speed Level",
"channel": "SpeedLevel",
"channelType": "miot_uint8",
"type": "Number",
"stateDescription": {
"minimum": 1,
"maximum": 100,
"step": 1,
"pattern": "%.0f"
},
"refresh": true,
"actions": [
{
@@ -230,7 +299,6 @@
"piid": 1,
"friendlyName": "Physical Control Locked-Physical Control Locked",
"channel": "PhysicalControlsLocked",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [