[miio] Add support for mijia.vacuum.v2 (#9036)

* [miio] Add support for mijia.vacuum.v2

related issue #9005
* [miio] fix channelTypes based on review

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
Marcel
2020-11-16 02:17:59 +01:00
committed by GitHub
parent 3fbb07d8c6
commit 406b7e4392
4 changed files with 737 additions and 0 deletions

View File

@@ -92,6 +92,7 @@ public enum MiIoDevices {
MRBOND_AIRER_M1PRO("mrbond.airer.m1pro", "Mr Bond M1 Pro Smart Clothes Dryer", THING_TYPE_BASIC),
MRBOND_AIRER_M1S("mrbond.airer.m1s", "Mr Bond M1 Smart Clothes Dryer", THING_TYPE_BASIC),
MRBOND_AIRER_M1SUPER("mrbond.airer.m1super", "Mr Bond M1 Super Smart Clothes Dryer", THING_TYPE_BASIC),
MIJIA_VACUUM_V2("mijia.vacuum.v2", " Xiaomi Mi Robot Vacuum MOP Essential", THING_TYPE_BASIC),
SCISHARE_COFFEE_S1102("scishare.coffee.s1102", "Xiaomi Scishare smart capsule coffee machine", THING_TYPE_BASIC),
SCISHARE_COFFEE_S1301("scishare.coffee.s1301", "Xiaomi Scishare smart capsule coffee machine", THING_TYPE_BASIC),
PHILIPS_SR1("philips.light.sread1", "Xiaomi Philips Eyecare Smart Lamp 2", THING_TYPE_BASIC),

View File

@@ -534,4 +534,122 @@
</options>
</command>
</channel-type>
<channel-type id="MijiaVacuumV2_status">
<item-type>Number</item-type>
<label>Robot Cleaner - Status</label>
<state>
<options>
<option value="1">Idle</option>
<option value="2">Sweeping</option>
<option value="3">Paused</option>
<option value="4">Error</option>
<option value="5">Charging</option>
<option value="6">Go Charging</option>
</options>
</state>
</channel-type>
<channel-type id="MijiaVacuumV2_fault">
<item-type>Number</item-type>
<label>Robot Cleaner - Device Fault</label>
<state>
<options>
<option value="0">No Faults</option>
<option value="1">Left-wheel-error</option>
<option value="2">Right-wheel-error</option>
<option value="3">Cliff-error</option>
<option value="4">Low-battery-error</option>
<option value="5">Bump-error</option>
<option value="6">Main-brush-error</option>
<option value="7">Side-brush-error</option>
<option value="8">Fan-motor-error</option>
<option value="9">Dustbin-error</option>
<option value="10">Charging-error</option>
<option value="11">No-wate-error</option>
<option value="12">Pick-up-error</option>
</options>
</state>
</channel-type>
<channel-type id="MijiaVacuumV2_mode">
<item-type>Number</item-type>
<label>Robot Cleaner - Mode</label>
<state>
<options>
<option value="1">Auto-clean</option>
<option value="2">Spot-clean</option>
<option value="3">Wallflow-clean</option>
</options>
</state>
</channel-type>
<channel-type id="MijiaVacuumV2_target-water-level">
<item-type>Number</item-type>
<label>Robot Cleaner - Target Water Level</label>
<state>
<options>
<option value="1">Level1</option>
<option value="2">Level2</option>
<option value="3">Level3</option>
</options>
</state>
</channel-type>
<channel-type id="MijiaVacuumV2_fan-level">
<item-type>Number</item-type>
<label>Robot Cleaner - Fan Level</label>
<state>
<options>
<option value="0">Silence</option>
<option value="1">Stanrd</option>
<option value="2">Middle</option>
<option value="3">Enchance</option>
</options>
</state>
</channel-type>
<channel-type id="MijiaVacuumV2_charging-state">
<item-type>Number</item-type>
<label>Battery - Charging State</label>
<state>
<options>
<option value="0">Not-charging</option>
<option value="1">Charging</option>
<option value="2">Charging-competely</option>
</options>
</state>
</channel-type>
<channel-type id="MijiaVacuumV2_language">
<item-type>Number</item-type>
<label>Language - Language</label>
<state>
<options>
<option value="0">English</option>
<option value="1">简体中文</option>
<option value="2">Español</option>
<option value="3">Русский</option>
<option value="4">Italiano</option>
<option value="5">Français</option>
<option value="6">Deutsch</option>
<option value="7">한국어</option>
<option value="8">Polski</option>
</options>
</state>
</channel-type>
<channel-type id="MijiaVacuumV2_mop-status">
<item-type>Number</item-type>
<label>Other Status - Mop Status</label>
<state>
<options>
<option value="0">Mop UnInstall</option>
<option value="1">Mop Install</option>
</options>
</state>
</channel-type>
<channel-type id="MijiaVacuumV2_action">
<item-type>String</item-type>
<label>Robot Cleaner - Actions</label>
<state>
<options>
<option value="start">Start Vacuum</option>
<option value="stop">Stop Vacuum</option>
<option value="dock">Go-To Dock</option>
</options>
</state>
</channel-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,549 @@
{
"deviceMapping": {
"id": [
"mijia.vacuum.v2"
],
"propertyMethod": "get_properties",
"maxProperties": 1,
"channels": [
{
"property": "",
"friendlyName": "Vacuum Action",
"channel": "vacuumaction",
"channelType": "MijiaVacuumV2_action",
"type": "String",
"refresh": false,
"actions": [
{
"command": "action",
"parameterType": "EMPTY",
"siid": 2,
"aiid": 1,
"condition": {
"name": "matchValue",
"parameters": [
{
"matchValue": "start"
}
]
}
},
{
"command": "action",
"parameterType": "EMPTY",
"siid": 2,
"aiid": 2,
"condition": {
"name": "matchValue",
"parameters": [
{
"matchValue": "stop"
}
]
}
},
{
"command": "action",
"parameterType": "EMPTY",
"siid": 2,
"aiid": 3,
"condition": {
"name": "matchValue",
"parameters": [
{
"matchValue": "dock"
}
]
}
}
],
"readmeComment": "This channel accepts `start`, `stop` and `dock`. The commands have not been confirmed working yet. Please feedback"
},
{
"property": "status",
"siid": 2,
"piid": 1,
"friendlyName": "Robot Cleaner - Status",
"channel": "status",
"channelType": "MijiaVacuumV2_status",
"type": "Number",
"refresh": true,
"actions": [],
"value-list": [
{
"value": 1,
"description": "Idle"
},
{
"value": 2,
"description": "Sweeping"
},
{
"value": 3,
"description": "Paused"
},
{
"value": 4,
"description": "Error"
},
{
"value": 5,
"description": "Charging"
},
{
"value": 6,
"description": "Go Charging"
}
],
"readmeComment": "Value mapping [1\u003d\"Idle\",2\u003d\"Sweeping\",3\u003d\"Paused\",4\u003d\"Error\",5\u003d\"Charging\",6\u003d\"Go Charging\"]"
},
{
"property": "fault",
"siid": 2,
"piid": 2,
"friendlyName": "Robot Cleaner - Device Fault",
"channel": "fault",
"channelType": "MijiaVacuumV2_fault",
"type": "Number",
"refresh": true,
"actions": [],
"value-list": [
{
"value": 0,
"description": "No Faults"
},
{
"value": 1,
"description": "Left-wheel-error"
},
{
"value": 2,
"description": "Right-wheel-error"
},
{
"value": 3,
"description": "Cliff-error"
},
{
"value": 4,
"description": "Low-battery-error"
},
{
"value": 5,
"description": "Bump-error"
},
{
"value": 6,
"description": "Main-brush-error"
},
{
"value": 7,
"description": "Side-brush-error"
},
{
"value": 8,
"description": "Fan-motor-error"
},
{
"value": 9,
"description": "Dustbin-error"
},
{
"value": 10,
"description": "Charging-error"
},
{
"value": 11,
"description": "No-wate-error"
},
{
"value": 12,
"description": "Pick-up-error"
}
],
"readmeComment": "Value mapping [0\u003d\"No Faults\",1\u003d\"Left-wheel-error\",2\u003d\"Right-whelel-error\",3\u003d\"Cliff-error\",4\u003d\"Low-battery-error\",5\u003d\"Bump-error\",6\u003d\"Main-brush-error\",7\u003d\"Side-brush-error\",8\u003d\"Fan-motor-error\",9\u003d\"Dustbin-error\",10\u003d\"Charging-error\",11\u003d\"No-wate-error\",12\u003d\"Pick-up-error\"]"
},
{
"property": "mode",
"siid": 2,
"piid": 4,
"friendlyName": "Robot Cleaner - Mode",
"channel": "mode",
"channelType": "MijiaVacuumV2_mode",
"type": "Number",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"value-list": [
{
"value": 1,
"description": "Auto-clean"
},
{
"value": 2,
"description": "Spot-clean"
},
{
"value": 3,
"description": "Wallflow-clean"
}
],
"readmeComment": "Value mapping [1\u003d\"Auto-clean\",2\u003d\"Spot-clean\",3\u003d\"Wallflow-clean\"]"
},
{
"property": "target-water-level",
"siid": 2,
"piid": 5,
"friendlyName": "Robot Cleaner - Target Water Level",
"channel": "target-water-level",
"channelType": "MijiaVacuumV2_target-water-level",
"type": "Number",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"value-list": [
{
"value": 1,
"description": "Level1"
},
{
"value": 2,
"description": "Level2"
},
{
"value": 3,
"description": "Level3"
}
],
"readmeComment": "Value mapping [1\u003d\"Level1\",2\u003d\"Level2\",3\u003d\"Level3\"]"
},
{
"property": "fan-level",
"siid": 2,
"piid": 6,
"friendlyName": "Robot Cleaner - Fan Level",
"channel": "fan-level",
"channelType": "MijiaVacuumV2_fan-level",
"type": "Number",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"value-list": [
{
"value": 0,
"description": "Silence"
},
{
"value": 1,
"description": "Stanrd"
},
{
"value": 2,
"description": "Middle"
},
{
"value": 3,
"description": "Enchance"
}
],
"readmeComment": "Value mapping [0\u003d\"Silence\",1\u003d\"Stanrd\",2\u003d\"Middle\",3\u003d\"Enchance\"]"
},
{
"property": "battery-level",
"siid": 3,
"piid": 1,
"friendlyName": "Battery - Battery Level",
"channel": "battery-level",
"channelType": "miot_uint8",
"type": "Number",
"refresh": true,
"actions": []
},
{
"property": "charging-state",
"siid": 3,
"piid": 2,
"friendlyName": "Battery - Charging State",
"channel": "charging-state",
"channelType": "MijiaVacuumV2_charging-state",
"type": "Number",
"refresh": true,
"actions": [],
"value-list": [
{
"value": 0,
"description": "Not-charging"
},
{
"value": 1,
"description": "Charging"
},
{
"value": 2,
"description": "Charging-competely"
}
],
"readmeComment": "Value mapping [0\u003d\"Not-charging\",1\u003d\"Charging\",2\u003d\"Charging-competely\"]"
},
{
"property": "alarm",
"siid": 4,
"piid": 1,
"friendlyName": "Alarm - Alarm",
"channel": "alarm",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
]
},
{
"property": "volume",
"siid": 4,
"piid": 2,
"friendlyName": "Alarm - Volume",
"channel": "volume",
"channelType": "miot_uint8",
"type": "Number",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
]
},
{
"property": "filter-life-level",
"siid": 11,
"piid": 1,
"friendlyName": "Filter - Filter Life Level",
"channel": "filter-life-level",
"channelType": "miot_uint8",
"type": "Number",
"refresh": true,
"actions": []
},
{
"property": "filter-left-time",
"siid": 11,
"piid": 2,
"friendlyName": "Filter - Filter Left Time",
"channel": "filter-left-time",
"channelType": "miot_uint16",
"type": "Number",
"refresh": true,
"actions": []
},
{
"property": "brush-life-level",
"siid": 14,
"piid": 1,
"friendlyName": "Brush Cleaner - Brush Life Level",
"channel": "brush-life-level",
"channelType": "miot_uint8",
"type": "Number",
"refresh": true,
"actions": []
},
{
"property": "brush-left-time",
"siid": 14,
"piid": 2,
"friendlyName": "Brush Cleaner - Brush Left Time",
"channel": "brush-left-time",
"channelType": "miot_uint16",
"type": "Number",
"refresh": true,
"actions": []
},
{
"property": "brush-life-level1",
"siid": 15,
"piid": 1,
"friendlyName": "Brush Cleaner - Brush Life Level",
"channel": "brush-life-level1",
"channelType": "miot_uint8",
"type": "Number",
"refresh": true,
"actions": []
},
{
"property": "brush-left-time1",
"siid": 15,
"piid": 2,
"friendlyName": "Brush Cleaner - Brush Left Time",
"channel": "brush-left-time1",
"channelType": "miot_uint16",
"type": "Number",
"refresh": true,
"actions": []
},
{
"property": "clean-area",
"siid": 9,
"piid": 1,
"friendlyName": "Clean Record - Clean Area",
"channel": "clean-area",
"channelType": "miot_uint16",
"type": "Number",
"refresh": true,
"actions": []
},
{
"property": "clean-time",
"siid": 9,
"piid": 2,
"friendlyName": "Clean Record - Clean Time",
"channel": "clean-time",
"channelType": "miot_uint16",
"type": "Number",
"refresh": true,
"actions": []
},
{
"property": "total-clean-area",
"siid": 9,
"piid": 3,
"friendlyName": "Clean Record - Total Clean Area",
"channel": "total-clean-area",
"channelType": "miot_uint32",
"type": "Number",
"refresh": true,
"actions": []
},
{
"property": "total-clean-time",
"siid": 9,
"piid": 4,
"friendlyName": "Clean Record - Total Clean Time",
"channel": "total-clean-time",
"channelType": "miot_uint32",
"type": "Number",
"refresh": true,
"actions": []
},
{
"property": "total-clean-count",
"siid": 9,
"piid": 5,
"friendlyName": "Clean Record - Total Clean Count",
"channel": "total-clean-count",
"channelType": "miot_uint16",
"type": "Number",
"refresh": true,
"actions": []
},
{
"property": "language",
"siid": 12,
"piid": 1,
"friendlyName": "Language - Language",
"channel": "language",
"channelType": "MijiaVacuumV2_language",
"type": "Number",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"value-list": [
{
"value": 0,
"description": "English"
},
{
"value": 1,
"description": "简体中文"
},
{
"value": 2,
"description": "Español"
},
{
"value": 3,
"description": "Русский"
},
{
"value": 4,
"description": "Italiano"
},
{
"value": 5,
"description": "Français"
},
{
"value": 6,
"description": "Deutsch"
},
{
"value": 7,
"description": "한국어"
},
{
"value": 8,
"description": "Polski"
}
],
"readmeComment": "Value mapping [0\u003d\"English\",1\u003d\"简体中文\",2\u003d\"Español\",3\u003d\"Русский\",4\u003d\"Italiano\",5\u003d\"Français\",6\u003d\"Deutsch\",7\u003d\"한국어\",8\u003d\"Polski\"]"
},
{
"property": "not-disturb-switch",
"siid": 12,
"piid": 2,
"friendlyName": "Language - Not Disturb Switch",
"channel": "not-disturb-switch",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
]
},
{
"property": "mop-status",
"siid": 16,
"piid": 1,
"friendlyName": "Other Status - Mop Status",
"channel": "mop-status",
"channelType": "MijiaVacuumV2_mop-status",
"type": "Number",
"refresh": true,
"actions": [],
"value-list": [
{
"value": 0,
"description": "Mop Uninstall"
},
{
"value": 1,
"description": "Mop Install"
}
],
"readmeComment": "Value mapping [0\u003d\"MopUninstall\",1\u003d\"MopInstall\"]"
}
],
"readmeComment": "Action commands are unknown at this time. According to spec identified actions for execution are:\r\n`action{\"did\":\"vacuum-start-sweep\",\"siid\":2,\"aiid\":1,\"in\":[]}`\r\n`action{\"did\":\"vacuum-stop-sweeping\",\"siid\":2,\"aiid\":2,\"in\":[]}`\r\n`action{\"did\":\"vacuum-start-charge\",\"siid\":2,\"aiid\":3,\"in\":[]}`\r\n`action{\"did\":\"filter-reset-filter-life\",\"siid\":11,\"aiid\":1,\"in\":[]}`\r\n`action{\"did\":\"brush-cleaner-reset-brush-life\",\"siid\":14,\"aiid\":1,\"in\":[]}`\r\n`action{\"did\":\"brush-cleaner-reset-brush-life\",\"siid\":15,\"aiid\":1,\"in\":[]}`\r\n. Please test and feedback if they are working to they can be linked to a channel."
}
}