Skip to content

Commit

Permalink
[miioemu] update devices
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Verpaalen <[email protected]>
  • Loading branch information
marcelrv committed Sep 13, 2023
1 parent 9176eec commit 0347277
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
</attributes>
</classpathentry>
<classpathentry kind="src" path="include"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
Expand All @@ -17,6 +18,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="org.eclipse.jdt.annotation_2.2.600.v20200408-1511.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
2 changes: 1 addition & 1 deletion miio-default.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"model": "chuangmi.remote.v2",
"model": "roborock.vacuum.a23",
"token": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"did": "AABBCCDD"
}
115 changes: 115 additions & 0 deletions roborock.vacuum.a23.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"model": "roborock.vacuum.a23",
"ismiot": false,
"commands": [
{
"command": "get_dnd_timer",
"param": [],
"fakeresponse": [
{
"enabled": 1,
"end_hour": 8,
"end_minute": 0,
"start_hour": 22,
"start_minute": 0
}
]
},
{
"command": "get_clean_summary",
"param": [],
"fakeresponse": {
"clean_time": 38629,
"clean_area": 650425000,
"clean_count": 68,
"dust_collection_count": 0,
"records": [
1626292843,
1626260657,
1626255012,
1626206412,
1626174164,
1626168621,
1626036597,
1626036415,
1626035701,
1626035555,
1626033643,
1626028227,
1626021936,
1626021732,
1626021575,
1626020891,
1626020332,
1626019286,
1626019207,
1626019147
]
}
},
{
"command": "get_status",
"param": [],
"fakeresponse": [
{
"msg_ver": 2,
"msg_seq": 52,
"state": 8,
"battery": 100,
"clean_time": 15,
"clean_area": 140000,
"error_code": 0,
"map_present": 1,
"in_cleaning": 0,
"in_returning": 0,
"in_fresh_state": 1,
"lab_status": 1,
"water_box_status": 1,
"fan_power": 102,
"dnd_enabled": 0,
"map_status": 3,
"is_locating": 0,
"lock_status": 0,
"water_box_mode": 204,
"water_box_carriage_status": 0,
"mop_forbidden_enable": 0
}
]
},
{
"command": "get_consumable",
"param": [],
"fakeresponse": [
{
"main_brush_work_time": 32030,
"side_brush_work_time": 32030,
"filter_work_time": 32030,
"filter_element_work_time": 7037,
"sensor_dirty_time": 34922
}
]
},
{
"command": "get_map_v1",
"param": [],
"fakeresponse": null
},
{
"command": "get_clean_record",
"param": [
1626292843
],
"fakeresponse": [
[
1497163727,
1497165195,
1468,
22902500,
0,
1
]
]
}
],
"properties": []
}
2 changes: 1 addition & 1 deletion src/miio/EmulatorMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public static void main(String[] args) {
*/
private static void listDevices() {
for (MiIoDevices d : MiIoDevices.values()) {
logger.info("Device {} : {}", d.ordinal(), d.getModel());
logger.info("Device {} : {} - {}", d.ordinal(), d.getModel(), d.getDescription());
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/miio/MiIoBindingConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ public final class MiIoBindingConstants {
public static final String THING_TYPE_BASIC = "basic";
public static final String THING_TYPE_VACUUM = "vacuum";
public static final String THING_TYPE_UNSUPPORTED = "unsupported";
public static final String THING_TYPE_LUMI = "lumi";
public static final String THING_TYPE_GATEWAY = "gateway";

}
53 changes: 45 additions & 8 deletions src/miio/emulator/MiIoDevices.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public enum MiIoDevices {
CGLLC_AIRM_CGDN1("cgllc.airm.cgdn1", "Qingping Air Monitor Lite", THING_TYPE_BASIC),
CGLLC_AIRMONITOR_B1("cgllc.airmonitor.b1", "Mi Multifunction Air Monitor", THING_TYPE_BASIC),
CGLLC_AIRMONITOR_S1("cgllc.airmonitor.s1", "Qingping Air Monitor", THING_TYPE_BASIC),
CHUANGMI_IR_V2("chuangmi.ir.v2", "Mi Universal Remote", THING_TYPE_BASIC),
CHUANGMI_IR_V2("chuangmi.ir.v2", "Mi Universal Remote", THING_TYPE_UNSUPPORTED),
CHUANGMI_PLUG_212A01("chuangmi.plug.212a01", "Mi Smart Power Plug 2 (Wi-Fi and Bluetooth Gateway)",
THING_TYPE_BASIC),
CHUANGMI_PLUG_HMI205("chuangmi.plug.hmi205", "Mi Smart Plug WiFi", THING_TYPE_BASIC),
Expand Down Expand Up @@ -68,6 +68,7 @@ public enum MiIoDevices {
DREAME_VACUUM_P2009("dreame.vacuum.p2009", "Dreame Robot Vacuum D9 ", THING_TYPE_BASIC),
DREAME_VACUUM_P2027("dreame.vacuum.p2027", "Dreame Bot W10", THING_TYPE_BASIC),
DREAME_VACUUM_P2028("dreame.vacuum.p2028", "Dreame Bot Z10 Pro", THING_TYPE_BASIC),
DREAME_VACUUM_P2029("dreame.vacuum.p2029", "Dreame Bot L10 Pro", THING_TYPE_BASIC),
DREAME_VACUUM_P2036("dreame.vacuum.p2036", "Trouver Robot LDS Vacuum-Mop Finder", THING_TYPE_BASIC),
DREAME_VACUUM_P2041O("dreame.vacuum.p2041o", "Mi Robot Vacuum-Mop 2 Pro+", THING_TYPE_BASIC),
DREAME_VACUUM_P2156O("dreame.vacuum.p2156o", "MOVA Z500 Robot Vacuum and Mop Cleaner", THING_TYPE_BASIC),
Expand Down Expand Up @@ -95,16 +96,36 @@ public enum MiIoDevices {
HUAYI_LIGHT_ZW131("huayi.light.zw131", "HUIZUO ZIWEI Ceiling Lamp", THING_TYPE_BASIC),
HUNMI_COOKER_NORMAL3("hunmi.cooker.normal3", "MiJia Rice Cooker", THING_TYPE_UNSUPPORTED),
IDELAN_AIRCONDITION_V1("idelan.aircondition.v1", "Jinxing Smart Air Conditioner", THING_TYPE_UNSUPPORTED),
IJAI_VACUUM_V19("ijai.vacuum.v19", "Xiaomi Robot Vacuum-Mop 2S", THING_TYPE_BASIC),
IKEA_LIGHT_LED1545G12("ikea.light.led1545g12", "IKEA E27 white spectrum opal", THING_TYPE_LUMI),
IKEA_LIGHT_LED1546G12("ikea.light.led1546g12", "IKEA E27 white spectrum clear", THING_TYPE_LUMI),
IKEA_LIGHT_LED1536G5("ikea.light.led1536g5", "IKEA E14 white spectrum", THING_TYPE_LUMI),
IKEA_LIGHT_LED1537R6("ikea.light.led1537r6", "IKEA GU10 white spectrum", THING_TYPE_LUMI),
IKEA_LIGHT_LED1623G12("ikea.light.led1623g12", "IKEA E27 warm white", THING_TYPE_LUMI),
IKEA_LIGHT_LED1650R5("ikea.light.led1650r5", "IKEA GU10 warm white", THING_TYPE_LUMI),
IKEA_LIGHT_LED1649C5("ikea.light.led1649c5", "IKEA E14 warm white", THING_TYPE_LUMI),
LUMI_CTRL_NEUTRAL1_V1("lumi.ctrl_neutral1.v1", "Aqara Wall Switch(No Neutral, Single Rocker)",
THING_TYPE_UNSUPPORTED),
LUMI_CTRL_NEUTRAL2_V1("lumi.ctrl_neutral2.v1", "Aqara Wall Switch (No Neutral, Double Rocker)",
THING_TYPE_UNSUPPORTED),
LUMI_CURTAIN_HAGL05("lumi.curtain.hagl05", "Xiaomiyoupin Curtain Controller (Wi-Fi)", THING_TYPE_BASIC),
LUMI_GATEWAY_MGL03("lumi.gateway.mgl03", "Mi Air Purifier virtual", THING_TYPE_BASIC),
LUMI_GATEWAY_V1("lumi.gateway.v1", "Mi smart Home Gateway Hub v1", THING_TYPE_BASIC),
LUMI_GATEWAY_V2("lumi.gateway.v2", "Mi smart Home GatewayHub v2", THING_TYPE_BASIC),
LUMI_GATEWAY_V3("lumi.gateway.v3", "Mi smart Home Gateway Hub v3", THING_TYPE_BASIC),
LUMI_GATEWAY_MIEU01("lumi.gateway.mieu01", "Mi smart Home Gateway Hub", THING_TYPE_BASIC),
LUMI_GATEWAY_MGL03("lumi.gateway.mgl03", "Mi Air Purifier virtual", THING_TYPE_GATEWAY),
LUMI_GATEWAY_MIEU01("lumi.gateway.mieu01", "Mi smart Home Gateway Hub", THING_TYPE_GATEWAY),
LUMI_GATEWAY_V1("lumi.gateway.v1", "Mi smart Home Gateway Hub v1", THING_TYPE_GATEWAY),
LUMI_GATEWAY_V2("lumi.gateway.v2", "Mi smart Home GatewayHub v2", THING_TYPE_GATEWAY),
LUMI_GATEWAY_V3("lumi.gateway.v3", "Mi smart Home Gateway Hub v3", THING_TYPE_GATEWAY),
LUMI_LIGHT_AQCN02("lumi.light.aqcn02", "Aqara LED Light Bulb (Tunable White)", THING_TYPE_LUMI),
LUMI_LOCK_V1("lumi.lock.v1", "Door lock", THING_TYPE_LUMI),
LUMI_LOCK_AQ1("lumi.lock.aq1", "Aqara Door Lock", THING_TYPE_LUMI),
LUMI_LOCK_ACN02("lumi.lock.acn02", "Aqara Door Lock S2", THING_TYPE_LUMI),
LUMI_LOCK_ACN03("lumi.lock.acn03", "Aqara Door lock S2 Pro", THING_TYPE_LUMI),
LUMI_PLUG_MMEU01("lumi.plug.mmeu01", "Mi Smart Plug (Zigbee)", THING_TYPE_LUMI),
LUMI_SENSOR_MAGNET_V2("lumi.sensor_magnet.v2", "Mi Window and Door Sensor", THING_TYPE_LUMI),
LUMI_SENSOR_MOTION_AQ2("lumi.sensor_motion.aq2", "Mi Motion Sensor", THING_TYPE_LUMI),
LUMI_SENSOR_MOTION_V2("lumi.sensor_motion.v2", "Mi Motion Sensor", THING_TYPE_LUMI),
LUMI_SENSOR_HT_V1("lumi.sensor_ht.v1", "Mi Temperature and Humidity Sensor", THING_TYPE_LUMI),
LUMI_SENSOR_WLEAK_AQ1("lumi.sensor_wleak.aq1", "Water Leak Sensor", THING_TYPE_LUMI),
LUMI_WEATHER_V1("lumi.weather.v1", "Aqara Temperature and Humidity Sensor", THING_TYPE_LUMI),
MIDEA_AIRCONDITION_V1("midea.aircondition.v1", "Midea AC-i Youth", THING_TYPE_UNSUPPORTED),
MIDEA_AIRCONDITION_V2("midea.aircondition.v2", "Midea Air Conditioner v2", THING_TYPE_UNSUPPORTED),
MIDEA_AIRCONDITION_XA1("midea.aircondition.xa1", "Midea AC-Cool Golden", THING_TYPE_UNSUPPORTED),
Expand Down Expand Up @@ -139,7 +160,7 @@ public enum MiIoDevices {
PHILIPS_LIGHT_MONO1("philips.light.mono1", "Philips Smart Lamp", THING_TYPE_BASIC),
PHILIPS_LIGHT_MOONLIGHT("philips.light.moonlight", "Philips ZhiRui Bedside Lamp", THING_TYPE_BASIC),
PHILIPS_LIGHT_OBCEIL("philips.light.obceil", "Zhirui Ceiling Lamp Black 80W", THING_TYPE_BASIC),
PHILIPS_LIGHT_OBCEIM("philips.light.obceim", " Zhirui Ceiling Lamp Black 40W", THING_TYPE_BASIC),
PHILIPS_LIGHT_OBCEIM("philips.light.obceim", "Zhirui Ceiling Lamp Black 40W", THING_TYPE_BASIC),
PHILIPS_LIGHT_OBCEIS("philips.light.obceis", "Zhirui Ceiling Lamp Black 28W", THING_TYPE_BASIC),
PHILIPS_LIGHT_RWREAD("philips.light.rwread", "Mijia Philips Study Desk Lamp", THING_TYPE_BASIC),
PHILIPS_LIGHT_SCEIL("philips.light.sceil", "Zhirui Ceiling Lamp Starry 80W", THING_TYPE_BASIC),
Expand All @@ -165,6 +186,18 @@ public enum MiIoDevices {
ROBOROCK_VACUUM_A15("roborock.vacuum.a15", "Roborock S7", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A19("roborock.vacuum.a19", "Roborock S4 Max", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A23("roborock.vacuum.a23", "Roborock T7S Plus", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A26("roborock.vacuum.a26", "Roborock G10S Pro", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A27("roborock.vacuum.a27", "Roborock S7 MaxV", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A29("roborock.vacuum.a29", "Roborock G10", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A30("roborock.vacuum.a30", "Roborock G10", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A34("roborock.vacuum.a34", "Roborock Q5", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A37("roborock.vacuum.a37", "Roborock T8", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A38("roborock.vacuum.a38", "Roborock Q7 Max", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A40("roborock.vacuum.a40", "Roborock Q7", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A46("roborock.vacuum.a46", "Roborock G10S", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A52("roborock.vacuum.a52", "Roborock T8 Plus", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A62("roborock.vacuum.a62", "Roborock S7 Pro Ultra", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_A75("roborock.vacuum.a75", "Roborock Q Revo", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_C1("roborock.vacuum.c1", "Xiaowa C1", THING_TYPE_VACUUM),
ROBOROCK_VACUUM_E2("roborock.vacuum.e2", "Roborock Xiaowa E Series Vacuum v2", THING_TYPE_UNSUPPORTED),
ROBOROCK_VACUUM_M1S("roborock.vacuum.m1s", "Mi Robot Vacuum 1S", THING_TYPE_VACUUM),
Expand All @@ -189,6 +222,7 @@ public enum MiIoDevices {
ROCKROBO_VACUUM_S6("rockrobo.vacuum.s6", "Roborock Vacuum S6", THING_TYPE_VACUUM),
ROCKROBO_VACUUM_V1("rockrobo.vacuum.v1", "Mi Robot Vacuum", THING_TYPE_VACUUM),
ROIDMI_VACUUM_V60("roidmi.vacuum.v60", "ROIDMI EVE vacuum", THING_TYPE_BASIC),
ROIDMI_VACUUM_V66("roidmi.vacuum.v66", "ROIDMI EVA", 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),
Expand Down Expand Up @@ -355,6 +389,10 @@ public enum MiIoDevices {
ZHIMI_AIRFRESH_VA4("zhimi.airfresh.va4", "Smartmi Fresh Air System (Heating)", THING_TYPE_BASIC),
ZHIMI_AIRFRESH_UA1("zhimi.airfresh.ua1", "Mi Fresh Air Ventilator C1-80", THING_TYPE_BASIC),
ZHIMI_AIRMONITOR_V1("zhimi.airmonitor.v1", "Mi PM2.5 Air Quality Monitor", THING_TYPE_BASIC),
ZHIMI_AIRP_CPA4("zhimi.airp.cpa4", "Xiaomi Smart Air Purifier 4 Compact", THING_TYPE_BASIC),
ZHIMI_AIRP_MB4A("zhimi.airp.mb4a", "Mi Air Purifier 3C", THING_TYPE_BASIC),
ZHIMI_AIRP_MB5("zhimi.airp.mb5", "Xiaomi Smart Air Purifier 4", THING_TYPE_BASIC),
ZHIMI_AIRP_VB4("zhimi.airp.vb4", "Xiaomi Smart Air Purifier 4 Pro", THING_TYPE_BASIC),
ZHIMI_AIRPURIFIER_M1("zhimi.airpurifier.m1", "Mi Air Purifier 2 (mini)", THING_TYPE_BASIC),
ZHIMI_AIRPURIFIER_M2("zhimi.airpurifier.m2", "Mi Air Purifier 2", THING_TYPE_BASIC),
ZHIMI_AIRPURIFIER_MA1("zhimi.airpurifier.ma1", "Mi Air Purifier 2S", THING_TYPE_BASIC),
Expand All @@ -366,7 +404,6 @@ public enum MiIoDevices {
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),
ZHIMI_AIRPURIFIER_SA1("zhimi.airpurifier.sa1", "Mi Air Purifier Super", THING_TYPE_BASIC),
ZHIMI_AIRPURIFIER_BMA("zhimi.airp.mb4a", "Mi Air Purifier Super", THING_TYPE_BASIC),
ZHIMI_AIRPURIFIER_SA2("zhimi.airpurifier.sa2", "Mi Air Purifier MAX / MAX Pro", THING_TYPE_BASIC),
ZHIMI_AIRPURIFIER_V1("zhimi.airpurifier.v1", "Mi Air Purifier v1", THING_TYPE_BASIC),
ZHIMI_AIRPURIFIER_V2("zhimi.airpurifier.v2", "Mi Air Purifier v2", THING_TYPE_BASIC),
Expand Down

0 comments on commit 0347277

Please sign in to comment.