CodeFoodPixels / robovac

Add a Eufy RoboVac easily to Home Assistant
Other
129 stars 28 forks source link

WIP: Adding support for the Eufy S1 Pro #87

Closed azielman closed 3 months ago

azielman commented 3 months ago

Unfortunately, they used a whole new set of codes for this vacuum/mop.

There are a few status codes that aren't plaintext, but they seem to be hashed or coded. Will try to figure out what's going on there.

Screenshot 2024-06-30 at 3 12 45 PM

This at least gets the entity to show up properly + working battery level, however none of the commands work quite yet.

Example Entry:

 {'<id>': {'id': '<id>',
   'model': 'T2080A',
   'name': 'RoboVac',
   'description': 'MACH R1 Always-Clean™',
   'mac': '<mac>',
   'ip_address': '',
   'autodiscovery': True,
   'access_token': '<token>'}

The schema; will need to work to extract the codes, a lot of entities we can pull out from here.

{'switch_go': '1',
 'pause': '2',
 'switch_charge': '3',
 'mode': '4',
 'status': '5',
 'clean_time': '6',
 'clean_area': '7',
 'battery_percentage': '8',
 'suction': '9',
 'cistern': '10',
 'direction_control': '12',
 'map_reset': '13',
 'path_data': '14',
 'command_trans': '15',
 'request': '16',
 'fault': '28',
 'device_timer': '32',
 'mop_state': '40',
 'work_mode': '41',
 'power_switch': '151',
 'mode_ctrl': '152',
 'robot_status': '153',
 'clean_param': '154',
 'remote_ctrl': '155',
 'continue_clean': '156',
 'undisturbed': '157',
 'vaccum_level': '158',
 'boost_iq': '159',
 'search_robot': '160',
 'volume': '161',
 'language_manage': '162',
 'battery_level': '163',
 'schedule': '164',
 'reserved1': '165',
 'debug_setting': '166',
 'clean_statistics': '167',
 'consumable': '168',
 'app_device': '169',
 'map_edit': '170',
 'multi_map_ctrl': '171',
 'multi_map_manage': '172',
 'station': '173',
 'reserved3': '174',
 'common_setting': '176',
 'fault_report': '177',
 'hint': '178',
 'upgrade_status': '180',
 'video_manager': '181',
 'device_manager': '196',
 'reserved2': '197',
 'smart_setting': '198',
 'wash_mob_setting': '199'}

Raw:

[
   {
      "attr":672,
      "canTrigger":false,
      "code":"switch_go",
      "defaultRecommend":true,
      "editPermission":false,
      "executable":true,
      "extContent":"",
      "iconname":"icon-power",
      "id":1,
      "mode":"rw",
      "name":"清扫开关",
      "property":{
         "type":"bool"
      },
      "type":"obj"
   },
   {
      "attr":672,
      "canTrigger":false,
      "code":"pause",
      "defaultRecommend":true,
      "editPermission":false,
      "executable":true,
      "extContent":"",
      "iconname":"icon-dp_pause",
      "id":2,
      "mode":"rw",
      "name":"暂停/继续",
      "property":{
         "type":"bool"
      },
      "type":"obj"
   },
   {
      "attr":160,
      "canTrigger":false,
      "code":"switch_charge",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"",
      "iconname":"icon-a_power",
      "id":3,
      "mode":"rw",
      "name":"回充开关",
      "property":{
         "type":"bool"
      },
      "type":"obj"
   },
   {
      "attr":704,
      "canTrigger":true,
      "code":"mode",
      "defaultRecommend":true,
      "editPermission":false,
      "executable":false,
      "extContent":"",
      "iconname":"icon-dp_mode",
      "id":4,
      "mode":"rw",
      "name":"清扫模式",
      "property":{
         "range":[
            "smart",
            "goto_charge",
            "zone",
            "pose",
            "part",
            "select_room"
         ],
         "type":"enum"
      },
      "type":"obj"
   },
   {
      "attr":706,
      "canTrigger":true,
      "code":"status",
      "defaultRecommend":true,
      "editPermission":false,
      "executable":false,
      "extContent":"",
      "iconname":"icon-zhuangtai",
      "id":5,
      "mode":"ro",
      "name":"当前状态",
      "property":{
         "range":[
            "standby",
            "smart",
            "zone_clean",
            "part_clean",
            "cleaning",
            "paused",
            "goto_pos",
            "pos_arrived",
            "pos_unarrive",
            "goto_charge",
            "charging",
            "charge_done",
            "sleep",
            "select_room",
            "seek_dust_bucket",
            "collecting_dust",
            "mapping"
         ],
         "type":"enum"
      },
      "type":"obj"
   },
   {
      "attr":1216,
      "canTrigger":true,
      "code":"clean_time",
      "defaultRecommend":false,
      "editPermission":true,
      "executable":false,
      "extContent":"",
      "iconname":"icon-dp_time3",
      "id":6,
      "mode":"ro",
      "name":"本次清扫时间",
      "property":{
         "unit":"min",
         "min":0,
         "max":9999,
         "scale":0,
         "step":1,
         "type":"value"
      },
      "type":"obj"
   },
   {
      "attr":1216,
      "canTrigger":true,
      "code":"clean_area",
      "defaultRecommend":false,
      "editPermission":true,
      "executable":false,
      "extContent":"",
      "iconname":"icon-icon-test10",
      "id":7,
      "mode":"ro",
      "name":"本次清扫面积",
      "property":{
         "unit":"㎡",
         "min":0,
         "max":9999,
         "scale":0,
         "step":1,
         "type":"value"
      },
      "type":"obj"
   },
   {
      "attr":194,
      "canTrigger":true,
      "code":"battery_percentage",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":false,
      "extContent":"",
      "iconname":"icon-dp_battery",
      "id":8,
      "mode":"ro",
      "name":"电池剩余电量",
      "property":{
         "unit":"%",
         "min":0,
         "max":100,
         "scale":0,
         "step":1,
         "type":"value"
      },
      "type":"obj"
   },
   {
      "attr":1152,
      "canTrigger":true,
      "code":"suction",
      "defaultRecommend":false,
      "editPermission":true,
      "executable":true,
      "extContent":"",
      "iconname":"icon-Strong",
      "id":9,
      "mode":"rw",
      "name":"吸力选择",
      "property":{
         "range":[
            "closed",
            "gentle",
            "normal",
            "strong",
            "max"
         ],
         "type":"enum"
      },
      "type":"obj"
   },
   {
      "attr":1152,
      "canTrigger":true,
      "code":"cistern",
      "defaultRecommend":false,
      "editPermission":true,
      "executable":true,
      "extContent":"",
      "iconname":"icon-dp_water",
      "id":10,
      "mode":"rw",
      "name":"水量选择",
      "property":{
         "range":[
            "closed",
            "low",
            "middle",
            "high"
         ],
         "type":"enum"
      },
      "type":"obj"
   },
   {
      "attr":1248,
      "canTrigger":false,
      "code":"direction_control",
      "defaultRecommend":false,
      "editPermission":true,
      "executable":false,
      "extContent":"",
      "iconname":"icon-dp_compass",
      "id":12,
      "mode":"rw",
      "name":"清扫方向",
      "property":{
         "range":[
            "forward",
            "backward",
            "turn_left",
            "turn_right",
            "stop",
            "exit"
         ],
         "type":"enum"
      },
      "type":"obj"
   },
   {
      "attr":128,
      "canTrigger":true,
      "code":"map_reset",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"",
      "iconname":"icon-dp_loop",
      "id":13,
      "mode":"rw",
      "name":"地图重置",
      "property":{
         "type":"bool"
      },
      "type":"obj"
   },
   {
      "attr":736,
      "canTrigger":false,
      "code":"path_data",
      "defaultRecommend":true,
      "editPermission":false,
      "executable":false,
      "extContent":"",
      "iconname":"icon-dp_fly",
      "id":14,
      "mode":"rw",
      "name":"路径传输(预留)",
      "property":{
         "type":"raw",
         "maxlen":128
      },
      "type":"raw"
   },
   {
      "attr":736,
      "canTrigger":false,
      "code":"command_trans",
      "defaultRecommend":true,
      "editPermission":false,
      "executable":false,
      "extContent":"",
      "iconname":"icon-dp_fly",
      "id":15,
      "mode":"rw",
      "name":"复杂指令传输",
      "property":{
         "type":"raw",
         "maxlen":128
      },
      "type":"raw"
   },
   {
      "attr":736,
      "canTrigger":false,
      "code":"request",
      "defaultRecommend":true,
      "editPermission":false,
      "executable":false,
      "extContent":"",
      "iconname":"icon-dp_mode",
      "id":16,
      "mode":"rw",
      "name":"请求数据",
      "property":{
         "range":[
            "get_map",
            "get_path",
            "get_both"
         ],
         "type":"enum"
      },
      "type":"obj"
   },
   {
      "attr":1728,
      "canTrigger":true,
      "code":"fault",
      "defaultRecommend":true,
      "editPermission":true,
      "executable":false,
      "extContent":"",
      "iconname":"icon-baojing",
      "id":28,
      "mode":"rw",
      "name":"故障上报",
      "property":{
         "label":[
            "edge_sweep",
            "middle_sweep",
            "left_wheel",
            "right_wheel",
            "garbage_box",
            "land_check",
            "collision"
         ],
         "type":"bitmap",
         "maxlen":7
      },
      "type":"obj"
   },
   {
      "attr":224,
      "canTrigger":false,
      "code":"device_timer",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":false,
      "extContent":"",
      "iconname":"icon-dp_time2",
      "id":32,
      "mode":"rw",
      "name":"设备本地定时",
      "property":{
         "type":"raw",
         "maxlen":128
      },
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"mop_state",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"",
      "id":40,
      "mode":"ro",
      "name":"拖布安装状态",
      "property":{
         "range":[
            "none",
            "installed"
         ],
         "type":"enum"
      },
      "type":"obj"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"work_mode",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"",
      "id":41,
      "mode":"rw",
      "name":"扫拖工作模式选择",
      "property":{
         "range":[
            "both_work",
            "only_sweep",
            "only_mop"
         ],
         "type":"enum"
      },
      "type":"obj"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"power_switch",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":151,
      "mode":"rw",
      "name":"电源开关",
      "property":{
         "type":"bool"
      },
      "type":"obj"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"mode_ctrl",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":152,
      "mode":"rw",
      "name":"模式控制",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"robot_status",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":153,
      "mode":"rw",
      "name":"工作状态",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"clean_param",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":154,
      "mode":"rw",
      "name":"清洁参数",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"remote_ctrl",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":155,
      "mode":"wr",
      "name":"遥控方向",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"continue_clean",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":156,
      "mode":"rw",
      "name":"断点续扫",
      "property":{
         "type":"bool"
      },
      "type":"obj"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"undisturbed",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":157,
      "mode":"rw",
      "name":"勿扰",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"vaccum_level",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":158,
      "mode":"rw",
      "name":"吸力档位",
      "property":{
         "range":[
            "Quiet",
            "Standard",
            "Turbo",
            "Max"
         ],
         "type":"enum"
      },
      "type":"obj"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"boost_iq",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":159,
      "mode":"rw",
      "name":"BoostIQ",
      "property":{
         "type":"bool"
      },
      "type":"obj"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"search_robot",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":160,
      "mode":"rw",
      "name":"寻找机器人",
      "property":{
         "type":"bool"
      },
      "type":"obj"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"volume",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":161,
      "mode":"rw",
      "name":"音量",
      "property":{
         "unit":"1%",
         "min":0,
         "max":100,
         "scale":0,
         "step":1,
         "type":"value"
      },
      "type":"obj"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"language_manage",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":162,
      "mode":"rw",
      "name":"语言管理",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"battery_level",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"",
      "id":163,
      "mode":"rw",
      "name":"电池电量",
      "property":{
         "unit":"1%",
         "min":0,
         "max":100,
         "scale":0,
         "step":1,
         "type":"value"
      },
      "type":"obj"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"schedule",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"",
      "id":164,
      "mode":"rw",
      "name":"定时任务",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"reserved1",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":165,
      "mode":"rw",
      "name":"保留",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"debug_setting",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":166,
      "mode":"rw",
      "name":"调试设置",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"clean_statistics",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":167,
      "mode":"rw",
      "name":"清洁统计",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"consumable",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":168,
      "mode":"rw",
      "name":"耗材",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"app_device",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":169,
      "mode":"rw",
      "name":"App和设备",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"map_edit",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":170,
      "mode":"rw",
      "name":"地图编辑",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"multi_map_ctrl",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":171,
      "mode":"rw",
      "name":"多地图控制",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"multi_map_manage",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":172,
      "mode":"rw",
      "name":"多地图管理",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"station",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":173,
      "mode":"rw",
      "name":"基站",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"reserved3",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"",
      "id":174,
      "mode":"rw",
      "name":"保留(T2320媒体管理)",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"common_setting",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":176,
      "mode":"rw",
      "name":"通用设置",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"fault_report",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"",
      "id":177,
      "mode":"rw",
      "name":"故障提醒",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"hint",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"",
      "id":178,
      "mode":"ro",
      "name":"提示",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"upgrade_status",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":180,
      "mode":"rw",
      "name":"升级状态",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"video_manager",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":181,
      "mode":"rw",
      "name":"视频管家",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"device_manager",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":196,
      "mode":"rw",
      "name":"设备管理",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"reserved2",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"",
      "id":197,
      "mode":"rw",
      "name":"保留",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"smart_setting",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":198,
      "mode":"rw",
      "name":"智能设置",
      "type":"raw"
   },
   {
      "attr":0,
      "canTrigger":true,
      "code":"wash_mob_setting",
      "defaultRecommend":false,
      "editPermission":false,
      "executable":true,
      "extContent":"{}",
      "id":199,
      "mode":"rw",
      "name":"洗拖布设置",
      "type":"raw"
   }
]
azielman commented 3 months ago

Closing; I now see the large PR for better DPS :) Will add a PR to that branch with the model code