[miio] add support for huayi Fans, heater and lights (#9348)

* [miio] add support for huayi Fans, heater and lights
* [miio] incl right names

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
Marcel
2020-12-12 15:29:39 -08:00
committed by GitHub
parent 5bfc8940f4
commit 12e5e38cb0
7 changed files with 980 additions and 55 deletions

View File

@@ -91,6 +91,8 @@ public enum MiIoDevices {
LUMI_GATEWAY_MGL03("lumi.gateway.mgl03", "Mi Air Purifier virtual", THING_TYPE_BASIC),
HUAYI_LIGHT_ARI013("huayi.light.ari013", "HUIZUO ARIES For Bedroom", THING_TYPE_BASIC),
HUAYI_LIGHT_ARIES("huayi.light.aries", "HUIZUO ARIES For Living Room", THING_TYPE_BASIC),
HUAYI_LIGHT_FANWY("huayi.light.fanwy", "HUIZUO Fan Light", THING_TYPE_BASIC),
HUAYI_LIGHT_FANWY2("huayi.light.fanwy2", "HUIZUO Fan Light(2020)", THING_TYPE_BASIC),
HUAYI_LIGHT_PEG091("huayi.light.peg091", "HUIZUO PEGASUS For Living Room", THING_TYPE_BASIC),
HUAYI_LIGHT_PEG093("huayi.light.peg093", "HUIZUO PEGASUS For Bedroom", THING_TYPE_BASIC),
HUAYI_LIGHT_PIS123("huayi.light.pis123", "HUIZUO PISCES For Bedroom", THING_TYPE_BASIC),
@@ -100,6 +102,12 @@ public enum MiIoDevices {
HUAYI_LIGHT_VIR063("huayi.light.vir063", "HUIZUO VIRGO For Bedroom", THING_TYPE_BASIC),
HUAYI_LIGHT_VIRGO("huayi.light.virgo", "HUIZUO VIRGO For Living Room", THING_TYPE_BASIC),
HUAYI_LIGHT_WY("huayi.light.wy", "HUIZUO Ceiling Light", THING_TYPE_BASIC),
HUAYI_LIGHT_WY200("huayi.light.wy200", "HUIZUO LIANGCHEN(BLE Mesh)", THING_TYPE_BASIC),
HUAYI_LIGHT_WY201("huayi.light.wy201", "HUIZUO SAG Downlight (BLE Mesh)", THING_TYPE_BASIC),
HUAYI_LIGHT_WY202("huayi.light.wy202", "HUIZUO Bulb (BLE Mesh)", THING_TYPE_BASIC),
HUAYI_LIGHT_WY203("huayi.light.wy203", "HUIZUO YONG Downlight (BLE Mesh)", THING_TYPE_BASIC),
HUAYI_LIGHT_WY204("huayi.light.wy204", "huayi.light.wy204", THING_TYPE_BASIC),
HUAYI_LIGHT_WYHEAT("huayi.light.wyheat", "HUIZUO Heating Lamp", THING_TYPE_BASIC),
HUAYI_LIGHT_ZW131("huayi.light.zw131", "HUIZUO ZIWEI Ceiling Lamp", THING_TYPE_BASIC),
LUMI_CTRL_NEUTRAL1_V1("lumi.ctrl_neutral1.v1", "Aqara Wall Switch(No Neutral, Single Rocker)",
THING_TYPE_UNSUPPORTED),
@@ -192,9 +200,9 @@ public enum MiIoDevices {
VIOMI_VACUUM_V8("viomi.vacuum.v8", "Mi Robot Vacuum-Mop P", THING_TYPE_BASIC),
ROBOROCK_SWEEPER_E2V2("roborock.sweeper.e2v2", "Rockrobo Xiaowa Sweeper v2", THING_TYPE_UNSUPPORTED),
ROBOROCK_SWEEPER_E2V3("roborock.sweeper.e2v3", "Rockrobo Xiaowa Sweeper v3", THING_TYPE_UNSUPPORTED),
SWITCH_XSWITCH01("090615.switch.xswitch01", "PTX OneKey Switch (WIFI)", THING_TYPE_BASIC),
SWITCH_XSWITCH02("090615.switch.xswitch02", "PTX Twokey switch(wifi)", THING_TYPE_BASIC),
SWITCH_XSWITCH03("090615.switch.xswitch03", "PTX ThreeKey Switch (WIFI)", THING_TYPE_BASIC),
S090615_SWITCH_XSWITCH01("090615.switch.xswitch01", "PTX OneKey Switch (WIFI)", THING_TYPE_BASIC),
S090615_SWITCH_XSWITCH02("090615.switch.xswitch02", "PTX Twokey switch(wifi)", THING_TYPE_BASIC),
S090615_SWITCH_XSWITCH03("090615.switch.xswitch03", "PTX ThreeKey Switch (WIFI)", THING_TYPE_BASIC),
YUNMI_WATERPURIFIER_V1("yunmi.waterpurifier.v1", "Mi Water Purifier v1", THING_TYPE_BASIC),
YUNMI_WATERPURIFIER_V2("yunmi.waterpurifier.v2", "Mi Water Purifier v2", THING_TYPE_BASIC),
YUNMI_WATERPURIFIER_V3("yunmi.waterpurifier.v3", "Mi Water Purifier (Under sink) v3", THING_TYPE_BASIC),

View File

@@ -0,0 +1,165 @@
{
"deviceMapping": {
"id": [
"huayi.light.fanwy"
],
"propertyMethod": "get_properties",
"maxProperties": 1,
"channels": [
{
"property": "on",
"siid": 2,
"piid": 1,
"friendlyName": "Light - Power",
"channel": "on",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],
"category": "light",
"tags": [
"Switch"
]
},
{
"property": "brightness",
"siid": 2,
"piid": 2,
"friendlyName": "Light - Brightness",
"channel": "brightness",
"type": "Dimmer",
"unit": "percentage",
"stateDescription": {
"minimum": 1,
"maximum": 100,
"step": 1,
"pattern": "%.0f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"category": "light",
"tags": [
"Setpoint",
"Light"
]
},
{
"property": "color-temperature",
"siid": 2,
"piid": 3,
"friendlyName": "Light - Color Temperature",
"channel": "color-temperature",
"type": "Number:Temperature",
"unit": "kelvin",
"stateDescription": {
"minimum": 3000,
"maximum": 6400,
"step": 1,
"pattern": "%.1f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
]
},
{
"property": "on1",
"siid": 3,
"piid": 1,
"friendlyName": "Fan - Power",
"channel": "on1",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],"category": "fan",
"tags": [
"Switch"
]
},
{
"property": "fan-level",
"siid": 3,
"piid": 2,
"friendlyName": "Fan - Fan Level",
"channel": "fan-level",
"type": "Number:Dimensionless",
"unit": "percentage",
"stateDescription": {
"minimum": 1.0,
"maximum": 100.0,
"step": 1.0,
"pattern": "%.0f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
]
},
{
"property": "motor-reverse",
"siid": 3,
"piid": 3,
"friendlyName": "Fan - Motor Reverse",
"channel": "motor-reverse",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
]
},
{
"property": "mode",
"siid": 3,
"piid": 4,
"friendlyName": "Fan - Mode",
"channel": "mode",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "1",
"label": "Normal Wind"
},
{
"value": "2",
"label": "Natural Wind"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"category": "fan"
,"readmeComment": "Value mapping [1\u003d\"Normal Wind\",2\u003d\"Natural Wind\"]"
}
],
"experimental": true
}
}

View File

@@ -0,0 +1,307 @@
{
"deviceMapping": {
"id": [
"huayi.light.fanwy2"
],
"propertyMethod": "get_properties",
"maxProperties": 1,
"channels": [
{
"property": "on",
"siid": 2,
"piid": 1,
"friendlyName": "Light - Power",
"channel": "on",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],
"category": "light",
"tags": [
"Switch"
]
},
{
"property": "brightness",
"siid": 2,
"piid": 2,
"friendlyName": "Light - Brightness",
"channel": "brightness",
"type": "Dimmer",
"unit": "percentage",
"stateDescription": {
"minimum": 1,
"maximum": 100,
"step": 1,
"pattern": "%.0f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"category": "light",
"tags": [
"Setpoint",
"Light"
]
},
{
"property": "color-temperature",
"siid": 2,
"piid": 3,
"friendlyName": "Light - Color Temperature",
"channel": "color-temperature",
"type": "Number:Temperature",
"unit": "kelvin",
"stateDescription": {
"minimum": 3000,
"maximum": 5700,
"step": 1,
"pattern": "%.1f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
]
},
{
"property": "on1",
"siid": 3,
"piid": 1,
"friendlyName": "Fan - Power",
"channel": "on1",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],"category": "fan",
"tags": [
"Switch"
]
},
{
"property": "fan-level",
"siid": 3,
"piid": 2,
"friendlyName": "Fan - Fan Level",
"channel": "fan-level",
"type": "Number:Dimensionless",
"unit": "percentage",
"stateDescription": {
"minimum": 1.0,
"maximum": 100.0,
"step": 1.0,
"pattern": "%.0f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
]
},
{
"property": "mode",
"siid": 3,
"piid": 3,
"friendlyName": "Fan - Mode",
"channel": "mode",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "0",
"label": "Basic"
},
{
"value": "1",
"label": "Natural Wind"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"readmeComment": "Value mapping [0\u003d\"Basic\",1\u003d\"Natural Wind\"]"
},
{
"property": "time-off",
"siid": 4,
"piid": 1,
"friendlyName": "Presets - Time Off",
"channel": "time-off",
"type": "Number:Time",
"unit": "minutes",
"stateDescription": {
"minimum": 1,
"maximum": 1440,
"step": 1,
"pattern": "%.1f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
]
},
{
"property": "pre-colortemp",
"siid": 4,
"piid": 2,
"friendlyName": "Presets - Pre Colortemp",
"channel": "pre-colortemp",
"type": "Number:Temperature",
"unit": "kelvin",
"stateDescription": {
"minimum": 3000,
"maximum": 5700,
"step": 1,
"pattern": "%.1f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
]
},
{
"property": "pre-brightness",
"siid": 4,
"piid": 3,
"friendlyName": "Presets - Pre Brightness",
"channel": "pre-brightness",
"type": "Number:Dimensionless",
"unit": "percentage",
"stateDescription": {
"minimum": 1.0,
"maximum": 100.0,
"step": 1.0,
"pattern": "%.0f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
]
},
{
"property": "pre-speed",
"siid": 4,
"piid": 4,
"friendlyName": "Presets - Pre Speed",
"channel": "pre-speed",
"type": "Number:Dimensionless",
"unit": "percentage",
"stateDescription": {
"minimum": 1.0,
"maximum": 100.0,
"step": 1.0,
"pattern": "%.0f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
]
},
{
"property": "reversal",
"siid": 4,
"piid": 5,
"friendlyName": "Presets - Reversal",
"channel": "reversal",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "0",
"label": "Postitive"
},
{
"value": "1",
"label": "Reverse"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"readmeComment": "Value mapping [0\u003d\"Positive\",1\u003d\"Reverse\"]"
},
{
"property": "pre-custom",
"siid": 4,
"piid": 7,
"friendlyName": "Presets - Pre Custom",
"channel": "pre-custom",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "0",
"label": "Switch Off"
},
{
"value": "1",
"label": "Open"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
],
"readmeComment": "Value mapping [0\u003d\"Switch Off\",1\u003d\"Open\"]"
},
{
"property": "flabellum",
"siid": 4,
"piid": 8,
"friendlyName": "Presets - Flabellum",
"channel": "flabellum",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
]
}
],
"experimental": true
}
}

View File

@@ -21,7 +21,7 @@
"property": "on",
"siid": 2,
"piid": 1,
"friendlyName": "Light - Switch Status",
"friendlyName": "Light - Power",
"channel": "on",
"type": "Switch",
"refresh": true,
@@ -42,7 +42,7 @@
"piid": 2,
"friendlyName": "Light - Brightness",
"channel": "brightness",
"type": "Number:Dimensionless",
"type": "Dimmer",
"unit": "percentage",
"stateDescription": {
"minimum": 1,
@@ -57,7 +57,7 @@
"parameterType": "NUMBER"
}
],
"category": "dimmablelight",
"category": "light",
"tags": [
"Setpoint",
"Light"

View File

@@ -0,0 +1,89 @@
{
"deviceMapping": {
"id": [
"huayi.light.wy200",
"huayi.light.wy201",
"huayi.light.wy202",
"huayi.light.wy203",
"huayi.light.wy204"
],
"propertyMethod": "get_properties",
"maxProperties": 1,
"channels": [
{
"property": "on",
"siid": 2,
"piid": 1,
"friendlyName": "Light - Power",
"channel": "on",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],
"category": "light",
"tags": [
"Switch"
]
},
{
"property": "brightness",
"siid": 2,
"piid": 2,
"friendlyName": "Light - Brightness",
"channel": "brightness",
"type": "Dimmer",
"unit": "percentage",
"stateDescription": {
"minimum": 1,
"maximum": 100,
"step": 1,
"pattern": "%.0f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"category": "light",
"tags": [
"Setpoint",
"Light"
]
},
{
"property": "color-temperature",
"siid": 2,
"piid": 3,
"friendlyName": "Light - Color Temperature",
"channel": "color-temperature",
"type": "Number:Temperature",
"unit": "kelvin",
"stateDescription": {
"minimum": 3000,
"maximum": 6400,
"step": 1,
"pattern": "%.1f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
],
"category": "rgb",
"tags": [
"Setpoint",
"ColorTemperature"
]
}
],
"experimental": true
}
}

View File

@@ -0,0 +1,160 @@
{
"deviceMapping": {
"id": [
"huayi.light.wyheat"
],
"propertyMethod": "get_properties",
"maxProperties": 1,
"channels": [
{
"property": "on",
"siid": 2,
"piid": 1,
"friendlyName": "Light - Power",
"channel": "on",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],
"category": "light",
"tags": [
"Switch"
]
},
{
"property": "brightness",
"siid": 2,
"piid": 2,
"friendlyName": "Light - Brightness",
"channel": "brightness",
"type": "Dimmer",
"unit": "percentage",
"stateDescription": {
"minimum": 1,
"maximum": 100,
"step": 1,
"pattern": "%.0f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"category": "light",
"tags": [
"Setpoint",
"Light"
]
},
{
"property": "color-temperature",
"siid": 2,
"piid": 3,
"friendlyName": "Light - Color Temperature",
"channel": "color-temperature",
"type": "Number:Temperature",
"unit": "kelvin",
"stateDescription": {
"minimum": 3000,
"maximum": 6400,
"step": 1,
"pattern": "%.1f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
],
"category": "rgb",
"tags": [
"Setpoint",
"ColorTemperature"
]
},
{
"property": "on1",
"siid": 3,
"piid": 1,
"friendlyName": "Heater - Power",
"channel": "on1",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],
"category": "switch",
"tags": [
"Switch"
]
},
{
"property": "fault",
"siid": 3,
"piid": 2,
"friendlyName": "Heater - 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": "heat-level",
"siid": 3,
"piid": 3,
"friendlyName": "Heater - Heat Level",
"channel": "heat-level",
"type": "Number",
"stateDescription": {
"minimum": 1,
"maximum": 3,
"step": 1,
"pattern": "%.0f"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
]
},
{
"property": "screenshow",
"siid": 4,
"piid": 1,
"friendlyName": "Other - Screenshow",
"channel": "screenshow",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
]
}
],
"experimental": true
}
}