[miio] add support for dreame vacuum d9 (#9859)

* [miio] Add support for Dreame D9 robot

Closing #9558

* [miio] remove channelType
* [miio] dropdown for reset actions

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
Marcel
2021-01-18 21:42:19 +01:00
committed by GitHub
parent 247afd48c8
commit 9fe47f829c
5 changed files with 1029 additions and 98 deletions

View File

@@ -59,6 +59,7 @@ public enum MiIoDevices {
NWT_DERH_WDH318EFW1("nwt.derh.wdh318efw1", "WIDETECH WDH318EFW1 Internet Dehumidifier", THING_TYPE_UNSUPPORTED),
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),
ZHIMI_AIRPURIFIER_MB1("zhimi.airpurifier.mb1", "Mi Air Purifier 2S", THING_TYPE_BASIC),
ZHIMI_AIRPURIFIER_MC1("zhimi.airpurifier.mc1", "Mi Air Purifier 2S", THING_TYPE_BASIC),
ZHIMI_AIRPURIFIER_MC2("zhimi.airpurifier.mc2", "Mi Air Purifier 2H", THING_TYPE_BASIC),

View File

@@ -53,7 +53,7 @@ public enum MiIoQuantiyTypes {
RADIANS(Units.RADIAN, "radians"),
KILOWATT_HOUR(Units.KILOWATT_HOUR, "kwh", "kWH"),
SQUARE_METRE(SIUnits.SQUARE_METRE, "square_meter", "squaremeter"),
PERCENT(Units.PERCENT),
PERCENT(Units.PERCENT, "percentage"),
KGM3(Units.KILOGRAM_PER_CUBICMETRE, "kilogram_per_cubicmeter"),
UGM3(Units.MICROGRAM_PER_CUBICMETRE, "microgram_per_cubicmeter"),
M3(SIUnits.CUBIC_METRE, "cubic_meter", "cubic_metre"),

View File

@@ -10,7 +10,6 @@
"property": "",
"friendlyName": "Vacuum Action",
"channel": "vacuumaction",
"channelType": "dreameControl",
"type": "String",
"stateDescription": {
"readOnly": true,
@@ -124,7 +123,8 @@
]
}
}
]
],
"readmeComment": "Value mapping [\"vacuum\"\u003d\"Vacuum\",\"stop\"\u003d\"Stop\",\"sweep\"\u003d\"Sweep\",\"stopsweep\"\u003d\"Stop Sweep\",\"dock\"\u003d\"Goto Dock\"]"
},
{
"property": "battery-level",

View File

@@ -0,0 +1,842 @@
{
"deviceMapping": {
"id": [
"dreame.vacuum.p2009"
],
"propertyMethod": "get_properties",
"maxProperties": 1,
"channels": [
{
"property": "",
"friendlyName": "Vacuum Action",
"channel": "vacuumaction",
"type": "String",
"stateDescription": {
"readOnly": true,
"options": [
{
"value": "sweep",
"label": "Sweep"
},
{
"value": "stopsweep",
"label": "Stop Sweep"
},
{
"value": "dock",
"label": "Goto Dock"
}
]
},
"refresh": false,
"actions": [
{
"command": "action",
"parameterType": "EMPTY",
"siid": 2,
"aiid": 2,
"condition": {
"name": "matchValue",
"parameters": [
{
"matchValue": "sweep"
}
]
}
},
{
"command": "action",
"parameterType": "EMPTY",
"siid": 2,
"aiid": 2,
"condition": {
"name": "matchValue",
"parameters": [
{
"matchValue": "stopsweep"
}
]
}
},
{
"command": "action",
"parameterType": "EMPTY",
"siid": 3,
"aiid": 1,
"condition": {
"name": "matchValue",
"parameters": [
{
"matchValue": "dock"
}
]
}
}
],
"readmeComment": "Value mapping [\"sweep\"\u003d\"Sweep\",\"stopsweep\"\u003d\"Stop Sweep\",\"dock\"\u003d\"Goto Dock\"]"
},
{
"property": "status",
"siid": 2,
"piid": 1,
"friendlyName": "Robot Cleaner - Status",
"channel": "status",
"type": "Number",
"stateDescription": {
"readOnly": true,
"options": [
{
"value": "1",
"label": "Sweeping"
},
{
"value": "2",
"label": "Idle"
},
{
"value": "3",
"label": "Paused"
},
{
"value": "4",
"label": "Error"
},
{
"value": "5",
"label": "Go Charging"
},
{
"value": "6",
"label": "Charging"
},
{
"value": "7",
"label": "Mopping"
}
]
},
"refresh": true,
"actions": [],
"category": "status",
"tags": [
"Status"
],
"readmeComment": "Value mapping [\"1\"\u003d\"Sweeping\",\"2\"\u003d\"Idle\",\"3\"\u003d\"Paused\",\"4\"\u003d\"Error\",\"5\"\u003d\"Go Charging\",\"6\"\u003d\"Charging\",\"7\"\u003d\"Mopping\"]"
},
{
"property": "fault",
"siid": 2,
"piid": 2,
"friendlyName": "Robot Cleaner - Device Fault",
"channel": "fault",
"type": "Number",
"stateDescription": {
"minimum": 0,
"maximum": 100,
"step": 1,
"pattern": "%.0f",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "battery-level",
"siid": 3,
"piid": 1,
"friendlyName": "Battery - Battery Level",
"channel": "battery-level",
"type": "Number:Dimensionless",
"unit": "percentage",
"stateDescription": {
"minimum": 0,
"maximum": 100,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "charging-state",
"siid": 3,
"piid": 2,
"friendlyName": "Battery - Charging State",
"channel": "charging-state",
"type": "Number",
"stateDescription": {
"readOnly": true,
"options": [
{
"value": "1",
"label": "Charging"
},
{
"value": "2",
"label": "Not Charging"
},
{
"value": "5",
"label": "Go Charging"
}
]
},
"refresh": true,
"actions": [],
"readmeComment": "Value mapping [\"1\"\u003d\"Charging\",\"2\"\u003d\"Not Charging\",\"5\"\u003d\"Go Charging\"]"
},
{
"property": "",
"friendlyName": "Consumables Reset",
"channel": "resetConsumable",
"type": "String",
"stateDescription": {
"readOnly": true,
"options": [
{
"value": "mainbrush-cleaner-reset-brush-life",
"label": "Reset Main Brush"
},
{
"value": "sidebrush-cleaner-reset-brush-life",
"label": "Reset Side Brush"
},
{
"value": "filter-reset-filter-life",
"label": "Reset Filter"
}
]
},
"refresh": false,
"actions": [
{
"command": "action",
"parameterType": "EMPTY",
"siid": 9,
"aiid": 1,
"condition": {
"name": "matchValue",
"parameters": [
{
"matchValue": "mainbrush-cleaner-reset-brush-life"
}
]
}
},
{
"command": "action",
"parameterType": "EMPTY",
"siid": 10,
"aiid": 1,
"condition": {
"name": "matchValue",
"parameters": [
{
"matchValue": "sidebrush-cleaner-reset-brush-life"
}
]
}
},
{
"command": "action",
"parameterType": "EMPTY",
"siid": 11,
"aiid": 1,
"condition": {
"name": "matchValue",
"parameters": [
{
"matchValue": "filter-reset-filter-life"
}
]
}
}
],
"readmeComment": "Value mapping [\"mainbrush-cleaner-reset-brush-life\"\u003d\"Reset Main Brush\",\"sidebrush-cleaner-reset-brush-life\"\u003d\"Reset Side Brush\",\"filter-reset-filter-life\"\u003d\"Reset Filter\"]"
},
{
"property": "brush-left-time",
"siid": 9,
"piid": 1,
"friendlyName": "Main Cleaning Brush - Brush Left Time",
"channel": "brush-left-time",
"type": "Number:Time",
"unit": "hours",
"stateDescription": {
"minimum": 0,
"maximum": 300,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "brush-life-level",
"siid": 9,
"piid": 2,
"friendlyName": "Main Cleaning Brush - Brush Life Level",
"channel": "brush-life-level",
"type": "Number:Dimensionless",
"unit": "percentage",
"stateDescription": {
"minimum": 0,
"maximum": 100,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "brush-left-time1",
"siid": 10,
"piid": 1,
"friendlyName": "Side Cleaning Brush - Brush Left Time",
"channel": "brush-left-time1",
"type": "Number:Time",
"unit": "hours",
"stateDescription": {
"minimum": 0,
"maximum": 200,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "brush-life-level1",
"siid": 10,
"piid": 2,
"friendlyName": "Side Cleaning Brush - Brush Life Level",
"channel": "brush-life-level1",
"type": "Number:Dimensionless",
"unit": "percentage",
"stateDescription": {
"minimum": 0,
"maximum": 100,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "filter-life-level",
"siid": 11,
"piid": 1,
"friendlyName": "Filter - Filter Life Level",
"channel": "filter-life-level",
"type": "Number:Dimensionless",
"unit": "percentage",
"stateDescription": {
"minimum": 0,
"maximum": 100,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "filter-left-time",
"siid": 11,
"piid": 2,
"friendlyName": "Filter - Filter Left Time",
"channel": "filter-left-time",
"type": "Number:Time",
"unit": "hours",
"stateDescription": {
"minimum": 0,
"maximum": 150,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "work-mode",
"siid": 4,
"piid": 1,
"friendlyName": "Vacuum Extend - Work Mode",
"channel": "work-mode",
"type": "Number",
"stateDescription": {
"minimum": 0,
"maximum": 50,
"step": 1,
"pattern": "%.1f",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "cleaning-time",
"siid": 4,
"piid": 2,
"friendlyName": "Vacuum Extend - Cleaning Time",
"channel": "cleaning-time",
"type": "Number:Time",
"unit": "minutes",
"stateDescription": {
"minimum": 0,
"maximum": 32767,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "cleaning-area",
"siid": 4,
"piid": 3,
"friendlyName": "Vacuum Extend - Cleaning Area",
"channel": "cleaning-area",
"type": "Number:Area",
"unit": "square_meter",
"stateDescription": {
"minimum": 0,
"maximum": 32767,
"step": 1,
"pattern": "%.1f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "cleaning-mode",
"siid": 4,
"piid": 4,
"friendlyName": "Vacuum Extend - Cleaning Mode",
"channel": "cleaning-mode",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "0",
"label": "mode 0"
},
{
"value": "1",
"label": "mode 1"
},
{
"value": "2",
"label": "mode 2"
},
{
"value": "3",
"label": "mode 3"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
],
"readmeComment": "Value mapping [\"0\"\u003d\"mode 0\",\"1\"\u003d\"mode 1\",\"2\"\u003d\"mode 2\",\"3\"\u003d\"mode 3\"]"
},
{
"property": "mop-mode",
"siid": 4,
"piid": 5,
"friendlyName": "Vacuum Extend - Mop Mode",
"channel": "mop-mode",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "1",
"label": "low water"
},
{
"value": "2",
"label": "medium water"
},
{
"value": "3",
"label": "high water"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
],
"readmeComment": "Value mapping [\"1\"\u003d\"low water\",\"2\"\u003d\"medium water\",\"3\"\u003d\"high water\"]"
},
{
"property": "waterbox-status",
"siid": 4,
"piid": 6,
"friendlyName": "Vacuum Extend - Waterbox Status",
"channel": "waterbox-status",
"type": "Number",
"stateDescription": {
"readOnly": true,
"options": [
{
"value": "0",
"label": "Status 0"
},
{
"value": "1",
"label": "Status 1"
}
]
},
"refresh": true,
"actions": [],
"readmeComment": "Value mapping [\"0\"\u003d\"Status 0\",\"1\"\u003d\"Status 1\"]"
},
{
"property": "task-status",
"siid": 4,
"piid": 7,
"friendlyName": "Vacuum Extend - Task Status",
"channel": "task-status",
"type": "Number",
"stateDescription": {
"minimum": 0,
"maximum": 20,
"step": 1,
"pattern": "%.1f",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "break-point-restart",
"siid": 4,
"piid": 11,
"friendlyName": "Vacuum Extend - Break Point Restart",
"channel": "break-point-restart",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "0",
"label": "Off"
},
{
"value": "1",
"label": "On"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"readmeComment": "Value mapping [\"0\"\u003d\"Off\",\"1\"\u003d\"On\"]"
},
{
"property": "carpet-press",
"siid": 4,
"piid": 12,
"friendlyName": "Vacuum Extend - Carpet Press",
"channel": "carpet-press",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "0",
"label": "Off"
},
{
"value": "1",
"label": "On"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"readmeComment": "Value mapping [\"0\"\u003d\"Off\",\"1\"\u003d\"On\"]"
},
{
"property": "serial-number1",
"siid": 4,
"piid": 14,
"friendlyName": "Vacuum Extend - Serial Number",
"channel": "serial-number1",
"type": "String",
"stateDescription": {
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "clean-rags-tip",
"siid": 4,
"piid": 16,
"friendlyName": "Vacuum Extend - Clean Rags Tip",
"channel": "clean-rags-tip",
"type": "Number:Time",
"unit": "minutes",
"stateDescription": {
"minimum": 0,
"maximum": 120,
"step": 1,
"pattern": "%.0f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
]
},
{
"property": "keep-sweeper-time",
"siid": 4,
"piid": 17,
"friendlyName": "Vacuum Extend - Keep Sweeper Time",
"channel": "keep-sweeper-time",
"type": "Number:Time",
"unit": "minutes",
"stateDescription": {
"minimum": -1,
"maximum": 1000000,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "faults",
"siid": 4,
"piid": 18,
"friendlyName": "Vacuum Extend - Faults",
"channel": "faults",
"type": "String",
"stateDescription": {
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "enable",
"siid": 5,
"piid": 1,
"friendlyName": "Do Not Disturb - Enable",
"channel": "enable",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
]
},
{
"property": "start-time",
"siid": 5,
"piid": 2,
"friendlyName": "Do Not Disturb - Start Time",
"channel": "start-time",
"type": "String",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
]
},
{
"property": "end-time",
"siid": 5,
"piid": 3,
"friendlyName": "Do Not Disturb - End Time",
"channel": "end-time",
"type": "String",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
]
},
{
"property": "volume",
"siid": 7,
"piid": 1,
"friendlyName": "Audio - Volume",
"channel": "volume",
"type": "Number:Dimensionless",
"unit": "PERCENT",
"stateDescription": {
"minimum": 0,
"maximum": 100,
"step": 1,
"pattern": "%.0f"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
]
},
{
"property": "voice-packet-id",
"siid": 7,
"piid": 2,
"friendlyName": "Audio - Voice Packet Id",
"channel": "voice-packet-id",
"type": "String",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
]
},
{
"property": "voice-change-state",
"siid": 7,
"piid": 3,
"friendlyName": "Audio - Voice Change State",
"channel": "voice-change-state",
"type": "String",
"stateDescription": {
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "time-zone",
"siid": 8,
"piid": 1,
"friendlyName": "Time - Time Zone",
"channel": "time-zone",
"type": "String",
"stateDescription": {
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "timer-clean",
"siid": 8,
"piid": 2,
"friendlyName": "Time - Timer Clean",
"channel": "timer-clean",
"type": "String",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
]
},
{
"property": "first-clean-time",
"siid": 12,
"piid": 1,
"friendlyName": "Clean Logs - First Clean Time",
"channel": "first-clean-time",
"type": "Number",
"stateDescription": {
"minimum": 0,
"step": 1,
"pattern": "%.1f",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "total-clean-time",
"siid": 12,
"piid": 2,
"friendlyName": "Clean Logs - Total Clean Time",
"channel": "total-clean-time",
"type": "Number:Time",
"unit": "minutes",
"stateDescription": {
"minimum": 0,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "total-clean-times",
"siid": 12,
"piid": 3,
"friendlyName": "Clean Logs - Total Clean Times",
"channel": "total-clean-times",
"type": "Number",
"stateDescription": {
"minimum": 0,
"step": 1,
"pattern": "%.1f",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "total-clean-area",
"siid": 12,
"piid": 4,
"friendlyName": "Clean Logs - Total Clean Area",
"channel": "total-clean-area",
"type": "Number",
"stateDescription": {
"minimum": 0,
"step": 1,
"pattern": "%.1f",
"readOnly": true
},
"refresh": true,
"actions": []
}
],
"readmeComment": "Identified manual actions for execution not linked in the database \u003e`action{\"did\":\"vacuum-extend-start-clean\",\"siid\":4,\"aiid\":1,\"in\":[10.0]}`\u003cbr /\u003e`action{\"did\":\"vacuum-extend-stop-clean\",\"siid\":4,\"aiid\":2,\"in\":[]}`\u003cbr /\u003e`action{\"did\":\"map-map-req\",\"siid\":6,\"aiid\":1,\"in\":[2.0]}`\u003cbr /\u003e`action{\"did\":\"map-update-map\",\"siid\":6,\"aiid\":2,\"in\":[4.0]}`\u003cbr /\u003e`action{\"did\":\"audio-position\",\"siid\":7,\"aiid\":1,\"in\":[]}`\u003cbr /\u003e`action{\"did\":\"audio-play-sound\",\"siid\":7,\"aiid\":2,\"in\":[]}`\u003cbr /\u003e`action{\"did\":\"time-delete-timer\",\"siid\":8,\"aiid\":1,\"in\":[3.0]}`\u003cbr /\u003e",
"experimental": false
}
}