[miio] improve/add properties for qmi powerstrip (#11118)

improve mija vacuum channels

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
Marcel
2021-08-16 14:02:09 +02:00
committed by GitHub
parent 3a7835e122
commit 0d286e7a89
4 changed files with 358 additions and 72 deletions

View File

@@ -34,7 +34,8 @@
]
}
}
]
],
"readmeComment": "Value mapping `[\"fan-toggle\"\u003d\"Fan Toggle\"]`"
},
{
"property": "on",
@@ -272,7 +273,7 @@
"parameterType": "NUMBER"
}
],
"readmeComment": "Value mapping [\"0\"\u003d\"NO\",\"1\"\u003d\"LEFT\",\"2\"\u003d\"RIGHT\"]"
"readmeComment": "Value mapping `[\"0\"\u003d\"NO\",\"1\"\u003d\"LEFT\",\"2\"\u003d\"RIGHT\"]`"
},
{
"property": "speed-level",

View File

@@ -10,7 +10,6 @@
"property": "",
"friendlyName": "Vacuum Action",
"channel": "vacuumaction",
"channelType": "MijiaVacuumV2_action",
"type": "String",
"refresh": false,
"actions": [
@@ -82,7 +81,6 @@
"piid": 1,
"friendlyName": "Robot Cleaner - Status",
"channel": "status",
"channelType": "MijiaVacuumV2_status",
"type": "Number",
"stateDescription": {
"readOnly": true,
@@ -127,7 +125,6 @@
"piid": 2,
"friendlyName": "Robot Cleaner - Device Fault",
"channel": "fault",
"channelType": "MijiaVacuumV2_fault",
"type": "Number",
"stateDescription": {
"readOnly": true,
@@ -199,7 +196,6 @@
"piid": 4,
"friendlyName": "Robot Cleaner - Mode",
"channel": "mode",
"channelType": "MijiaVacuumV2_mode",
"type": "Number",
"stateDescription": {
"options": [
@@ -235,7 +231,6 @@
"piid": 5,
"friendlyName": "Robot Cleaner - Target Water Level",
"channel": "target-water-level",
"channelType": "MijiaVacuumV2_target-water-level",
"type": "Number",
"stateDescription": {
"readOnly": true,
@@ -272,7 +267,6 @@
"piid": 6,
"friendlyName": "Robot Cleaner - Fan Level",
"channel": "fan-level",
"channelType": "MijiaVacuumV2_fan-level",
"type": "Number",
"stateDescription": {
"options": [
@@ -312,8 +306,15 @@
"piid": 1,
"friendlyName": "Battery - Battery Level",
"channel": "battery-level",
"channelType": "miot_uint8",
"type": "Number",
"type": "Number:Dimensionless",
"unit": "percentage",
"stateDescription": {
"minimum": 0,
"maximum": 100,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
@@ -323,7 +324,6 @@
"piid": 2,
"friendlyName": "Battery - Charging State",
"channel": "charging-state",
"channelType": "MijiaVacuumV2_charging-state",
"type": "Number",
"stateDescription": {
"readOnly": true,
@@ -355,7 +355,6 @@
"piid": 1,
"friendlyName": "Alarm - Alarm",
"channel": "alarm",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [
@@ -375,8 +374,14 @@
"piid": 2,
"friendlyName": "Alarm - Volume",
"channel": "volume",
"channelType": "miot_uint8",
"type": "Number",
"type": "Number:Dimensionless",
"unit": "percentage",
"stateDescription": {
"minimum": 0,
"maximum": 100,
"step": 1,
"pattern": "%.0f %unit%"
},
"refresh": true,
"actions": [
{
@@ -393,9 +398,16 @@
"siid": 11,
"piid": 1,
"friendlyName": "Filter - Filter Life Level",
"channel": "filter-life-level",
"channelType": "miot_uint8",
"type": "Number",
"channel": "filter_life_level",
"type": "Number:Dimensionless",
"unit": "percentage",
"stateDescription": {
"minimum": 0,
"maximum": 100,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": [],
"tags": [
@@ -408,8 +420,15 @@
"piid": 2,
"friendlyName": "Filter - Filter Left Time",
"channel": "filter-left-time",
"channelType": "miot_uint16",
"type": "Number",
"type": "Number:Time",
"unit": "minutes",
"stateDescription": {
"minimum": 0,
"maximum": 18000,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": [],
"tags": [
@@ -422,8 +441,15 @@
"piid": 1,
"friendlyName": "Brush Cleaner - Brush Life Level",
"channel": "brush-life-level",
"channelType": "miot_uint8",
"type": "Number",
"type": "Number:Dimensionless",
"unit": "percentage",
"stateDescription": {
"minimum": 0,
"maximum": 100,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": [],
"tags": [
@@ -436,8 +462,15 @@
"piid": 2,
"friendlyName": "Brush Cleaner - Brush Left Time",
"channel": "brush-left-time",
"channelType": "miot_uint16",
"type": "Number",
"type": "Number:Time",
"unit": "days",
"stateDescription": {
"minimum": 0,
"maximum": 18000,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": [],
"tags": [
@@ -450,8 +483,15 @@
"piid": 1,
"friendlyName": "Brush Cleaner - Brush Life Level",
"channel": "brush-life-level1",
"channelType": "miot_uint8",
"type": "Number",
"type": "Number:Dimensionless",
"unit": "percentage",
"stateDescription": {
"minimum": 0,
"maximum": 100,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": [],
"tags": [
@@ -464,22 +504,76 @@
"piid": 2,
"friendlyName": "Brush Cleaner - Brush Left Time",
"channel": "brush-left-time1",
"channelType": "miot_uint16",
"type": "Number",
"type": "Number:Time",
"unit": "minutes",
"stateDescription": {
"minimum": 0,
"maximum": 9000,
"step": 1,
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": [],
"tags": [
"Status"
]
},
{
"property": "direction-key",
"siid": 8,
"piid": 1,
"friendlyName": "Remote Control - Direction Key",
"channel": "direction_key",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "0",
"label": "direction 0"
},
{
"value": "1",
"label": "direction 1"
},
{
"value": "2",
"label": "direction 2"
},
{
"value": "3",
"label": "direction 3"
},
{
"value": "4",
"label": "direction 4"
}
]
},
"refresh": false,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"readmeComment": "Value mapping `[\"0\"\u003d\"direction 0\",\"1\"\u003d\"direction 1\",\"2\"\u003d\"direction 2\",\"3\"\u003d\"direction 3\",\"4\"\u003d\"direction 4\"]`"
},
{
"property": "clean-area",
"siid": 9,
"piid": 1,
"friendlyName": "Clean Record - Clean Area",
"channel": "clean-area",
"channelType": "miot_uint16",
"type": "Number:Area",
"unit": "square_metre",
"stateDescription": {
"minimum": 0,
"maximum": 65535,
"step": 1,
"pattern": "%.0f",
"readOnly": true
},
"refresh": true,
"actions": [],
"tags": [
@@ -491,10 +585,15 @@
"siid": 9,
"piid": 2,
"friendlyName": "Clean Record - Clean Time",
"channel": "clean-time",
"channelType": "miot_uint16",
"type": "Number:Time",
"unit": "hours",
"channel": "clean_time",
"type": "Number",
"stateDescription": {
"minimum": 0,
"maximum": 65535,
"step": 1,
"pattern": "%.0f",
"readOnly": true
},
"refresh": true,
"actions": []
},
@@ -504,8 +603,15 @@
"piid": 3,
"friendlyName": "Clean Record - Total Clean Area",
"channel": "total-clean-area",
"channelType": "miot_uint32",
"type": "Number",
"type": "Number:Area",
"unit": "square_metre",
"stateDescription": {
"minimum": 0,
"maximum": -1,
"step": 1,
"pattern": "%.0f",
"readOnly": true
},
"refresh": true,
"actions": []
},
@@ -515,7 +621,6 @@
"piid": 4,
"friendlyName": "Clean Record - Total Clean Time",
"channel": "total-clean-time",
"channelType": "miot_uint32",
"type": "Number",
"refresh": true,
"actions": []
@@ -526,8 +631,14 @@
"piid": 5,
"friendlyName": "Clean Record - Total Clean Count",
"channel": "total-clean-count",
"channelType": "miot_uint16",
"type": "Number",
"stateDescription": {
"minimum": 0,
"maximum": 65535,
"step": 1,
"pattern": "%.0f",
"readOnly": true
},
"refresh": true,
"actions": []
},
@@ -537,7 +648,6 @@
"piid": 1,
"friendlyName": "Language - Language",
"channel": "language",
"channelType": "MijiaVacuumV2_language",
"type": "Number",
"stateDescription": {
"options": [
@@ -594,7 +704,6 @@
"piid": 2,
"friendlyName": "Language - Not Disturb Switch",
"channel": "not-disturb-switch",
"channelType": "miot_bool",
"type": "Switch",
"refresh": true,
"actions": [
@@ -610,7 +719,6 @@
"piid": 1,
"friendlyName": "Other Status - Mop Status",
"channel": "mop-status",
"channelType": "MijiaVacuumV2_mop-status",
"type": "Number",
"stateDescription": {
"readOnly": true,

View File

@@ -0,0 +1,173 @@
{
"deviceMapping": {
"id": [
"qmi.powerstrip.v1"
],
"channels": [
{
"property": "power",
"friendlyName": "Power",
"channel": "power",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_power",
"parameterType": "ONOFF"
}
],
"category": "switch",
"tags": [
"Switch"
]
},
{
"property": "mode",
"friendlyName": "Mode",
"channel": "mode",
"type": "String",
"stateDescription": {
"options": [
{
"value": "normal",
"label": "Normal"
},
{
"value": "green",
"label": "Green"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_mode",
"parameterType": "STRING"
}
],
"tags": [
"Control"
],
"readmeComment": "Value mapping `[\"normal\"\u003d\"Normal\",\"green\"\u003d\"Green\"]`"
},
{
"property": "power_consume_rate",
"friendlyName": "Power Consumption",
"channel": "powerUsage",
"type": "Number:Power",
"unit": "W",
"stateDescription": {
"pattern": "%.2f %unit%"
},
"refresh": true,
"actions": [
{
"parameterType": "EMPTY"
}
]
},
{
"property": "voltage",
"friendlyName": "Voltage",
"channel": "voltage",
"type": "Number:ElectricPotential",
"unit": "V",
"stateDescription": {
"pattern": "%.2f %unit%",
"readOnly": true
},
"refresh": true,
"transformation": "/100",
"actions": [],
"category": "energy",
"tags": [
"Measurement",
"Voltage"
]
},
{
"property": "wifi_led",
"friendlyName": "wifi LED",
"channel": "led",
"channelType": "led",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_wifi_led",
"parameterType": "ONOFF"
}
]
},
{
"property": "power_price",
"friendlyName": "Power Price",
"channel": "power_price",
"type": "Number",
"refresh": true,
"actions": [
{
"command": "set_power_price",
"parameterType": "NUMBER"
}
]
},
{
"property": "power_factor",
"friendlyName": "Power Factor",
"channel": "power_factor",
"type": "Number",
"stateDescription": {
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "current",
"friendlyName": "Current",
"channel": "current",
"type": "Number:ElectricCurrent",
"unit": "mA",
"stateDescription": {
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "elec_leakage",
"friendlyName": "Electic Leakage",
"channel": "elec_leakage",
"type": "Number:ElectricCurrent",
"unit": "mA",
"stateDescription": {
"pattern": "%.0f %unit%",
"readOnly": true
},
"refresh": true,
"actions": []
},
{
"property": "temperature",
"friendlyName": "Temperature",
"channel": "temperature",
"type": "Number:Temperature",
"unit": "CELSIUS",
"stateDescription": {
"pattern": "%.1f %unit%",
"readOnly": true
},
"refresh": true,
"actions": [],
"category": "temperature",
"tags": [
"Measurement",
"Temperature"
]
}
]
}
}