271 lines
11 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

科沃斯IDECJ3FLME
# fix HA不出现实体的问题
- https://bbs.hassbian.com/thread-27784-1-1.html
- https://bbs.hassbian.com/thread-28408-1-1.html
1. 进入容器的CMD
2. cd /usr/local/lib/python3.13/site-packages/deebot_client/hardware/deebot
3. ln -svfT lr4qcs.py 3sp2in.py
删除 rm -rf 3sp2in.py
- https://mitmproxy.org/
- 【mitmproxy抓包工具 从安装到简单使用】 https://www.bilibili.com/video/BV1UC4y1t7EL/?share_source=copy_web&vd_source=fe8142e8e12816535feaeabd6f6cdc8e
- IOS使用MitmProxy
- https://www.jianshu.com/p/498073a8971f
- https://hachibye.medium.com/%E4%BB%A5mitmproxy%E7%8D%B2%E5%8F%96%E6%89%8B%E6%A9%9F%E6%95%B8%E6%93%9A%E5%B0%81%E5%8C%85-9870f6507b63
https://github.com/DeebotUniverse/client.py/issues/492
```
<redacted>
```
# In HA my X5 Pro did'nt accept cleaning commands (rcp not support error)
# Command Json
Start
https://api-ngiot.dc-cn.cn.ecouser.net/api/iot/endpoint/control?si=6btMpMAS6PhZrX3D&ct=q&eid=9b7f3e00-3bea-4354-9ba8-b0dc9ceb6e0e&et=3sp2in&er=96uOLWSM&apn=clean_V2&fmt=j
{"body":{"data":{"act":"start","content":{"type":"auto"}}},"header":{"channel":"iOS","reqid":"RIzVHS","ts":"1741248430546","ver":"0.0.50","m":"request","pri":1,"tzm":480,"tzc":"Asia\/Shanghai"}}
Pause
https://api-ngiot.dc-cn.cn.ecouser.net/api/iot/endpoint/control?si=EKptJpQmzpbr4rKF&ct=q&eid=9b7f3e00-3bea-4354-9ba8-b0dc9ceb6e0e&et=3sp2in&er=96uOLWSM&apn=clean_V2&fmt=j
{"body":{"data":{"act":"pause"}},"header":{"channel":"iOS","reqid":"yepkRW","ts":"1741248436662","ver":"0.0.50","m":"request","pri":1,"tzm":480,"tzc":"Asia\/Shanghai"}}
Resume
https://api-ngiot.dc-cn.cn.ecouser.net/api/iot/endpoint/control?si=6hYStayiak272hKX&ct=q&eid=9b7f3e00-3bea-4354-9ba8-b0dc9ceb6e0e&et=3sp2in&er=96uOLWSM&apn=clean_V2&fmt=j
{"body":{"data":{"act":"resume"}},"header":{"channel":"iOS","reqid":"nYtIgx","ts":"1741248438194","ver":"0.0.50","m":"request","pri":1,"tzm":480,"tzc":"Asia\/Shanghai"}}
Stop
https://api-ngiot.dc-cn.cn.ecouser.net/api/iot/endpoint/control?si=kSFXbynehrfkNWEK&ct=q&eid=9b7f3e00-3bea-4354-9ba8-b0dc9ceb6e0e&et=3sp2in&er=96uOLWSM&apn=clean_V2&fmt=j
{"body":{"data":{"act":"stop"}},"header":{"channel":"iOS","reqid":"EiLUjr","ts":"1741248516782","ver":"0.0.50","m":"request","pri":1,"tzm":480,"tzc":"Asia\/Shanghai"}}
AI Clean Start
https://api-ngiot.dc-cn.cn.ecouser.net/api/iot/endpoint/control?si=trfmKfcdAKwWaRim&ct=q&eid=9b7f3e00-3bea-4354-9ba8-b0dc9ceb6e0e&et=3sp2in&er=96uOLWSM&apn=clean_V2&fmt=j
{"body":{"data":{"act":"start","content":{"type":"entrust"}}},"header":{"channel":"iOS","reqid":"pSKuSb","ts":"1741249424264","ver":"0.0.50","m":"request","pri":1,"tzm":480,"tzc":"Asia\/Shanghai"}}
Charge
https://api-ngiot.dc-cn.cn.ecouser.net/api/iot/endpoint/control?si=JC4G5mYJnMHaA6mR&ct=q&eid=9b7f3e00-3bea-4354-9ba8-b0dc9ceb6e0e&et=3sp2in&er=96uOLWSM&apn=charge&fmt=j
{"body":{"data":{"act":"go"}},"header":{"channel":"iOS","reqid":"GDJHxj","ts":"1741249495751","ver":"0.0.50","m":"request","pri":1,"tzm":480,"tzc":"Asia\/Shanghai"}}
This is a single room vacuum only:
https://api-ngiot.dc-cn.cn.ecouser.net/api/iot/endpoint/control?si=NM7kXnJYG2mszmwY&ct=q&eid=9b7f3e00-3bea-4354-9ba8-b0dc9ceb6e0e&et=3sp2in&er=96uOLWSM&apn=clean_V2&fmt=j
{"body":{"data":{"act":"start","content":{"type":"freeClean","value":"1,0"}}},"header":{"channel":"iOS","reqid":"MMTIad","ts":"1741249568936","ver":"0.0.50","m":"request","pri":1,"tzm":480,"tzc":"Asia\/Shanghai"}}
# Add Deebot X5 Pro Omni 提交
相关的Git提交
https://github.com/DeebotUniverse/client.py/pull/659/commits/da52c671ce544c21b6753b380148f93f8dadc6e5#diff-a5514fb587b325f41e547af3e94ae3470a2366bef25dd8b5ae5842fc25328bc0
- lr4qcs.py:p1jij8.py
- p1jij8.py
## p1jij8.py
```c++
"""Deebot T20 Omni Capabilities."""
from __future__ import annotations
from deebot_client.capabilities import (
Capabilities,
CapabilityClean,
CapabilityCleanAction,
CapabilityCustomCommand,
CapabilityEvent,
CapabilityExecute,
CapabilityLifeSpan,
CapabilityMap,
CapabilitySet,
CapabilitySetEnable,
CapabilitySettings,
CapabilitySetTypes,
CapabilityStats,
CapabilityWater,
DeviceType,
)
from deebot_client.commands.json.advanced_mode import GetAdvancedMode, SetAdvancedMode
from deebot_client.commands.json.battery import GetBattery
from deebot_client.commands.json.carpet import (
GetCarpetAutoFanBoost,
SetCarpetAutoFanBoost,
)
from deebot_client.commands.json.charge import Charge
from deebot_client.commands.json.charge_state import GetChargeState
from deebot_client.commands.json.clean import Clean, CleanArea, GetCleanInfo
from deebot_client.commands.json.clean_count import GetCleanCount, SetCleanCount
from deebot_client.commands.json.clean_logs import GetCleanLogs
from deebot_client.commands.json.clean_preference import (
GetCleanPreference,
SetCleanPreference,
)
from deebot_client.commands.json.continuous_cleaning import (
GetContinuousCleaning,
SetContinuousCleaning,
)
from deebot_client.commands.json.custom import CustomCommand
from deebot_client.commands.json.error import GetError
from deebot_client.commands.json.fan_speed import GetFanSpeed, SetFanSpeed
from deebot_client.commands.json.life_span import GetLifeSpan, ResetLifeSpan
from deebot_client.commands.json.map import (
GetCachedMapInfo,
GetMajorMap,
GetMapTrace,
GetMinorMap,
)
from deebot_client.commands.json.multimap_state import (
GetMultimapState,
SetMultimapState,
)
from deebot_client.commands.json.network import GetNetInfo
from deebot_client.commands.json.play_sound import PlaySound
from deebot_client.commands.json.pos import GetPos
from deebot_client.commands.json.relocation import SetRelocationState
from deebot_client.commands.json.stats import GetStats, GetTotalStats
from deebot_client.commands.json.true_detect import GetTrueDetect, SetTrueDetect
from deebot_client.commands.json.volume import GetVolume, SetVolume
from deebot_client.commands.json.water_info import GetWaterInfo, SetWaterInfo
from deebot_client.commands.json.work_mode import GetWorkMode, SetWorkMode
from deebot_client.const import DataType
from deebot_client.events import (
AdvancedModeEvent,
AvailabilityEvent,
BatteryEvent,
CachedMapInfoEvent,
CarpetAutoFanBoostEvent,
CleanCountEvent,
CleanLogEvent,
CleanPreferenceEvent,
ContinuousCleaningEvent,
CustomCommandEvent,
ErrorEvent,
FanSpeedEvent,
FanSpeedLevel,
LifeSpan,
LifeSpanEvent,
MajorMapEvent,
MapChangedEvent,
MapTraceEvent,
MultimapStateEvent,
NetworkInfoEvent,
PositionsEvent,
ReportStatsEvent,
RoomsEvent,
StateEvent,
StatsEvent,
TotalStatsEvent,
TrueDetectEvent,
VolumeEvent,
WorkMode,
WorkModeEvent,
water_info,
)
from deebot_client.models import StaticDeviceInfo
from deebot_client.util import short_name
from . import DEVICES
DEVICES[short_name(__name__)] = StaticDeviceInfo(
DataType.JSON,
Capabilities(
device_type=DeviceType.VACUUM,
availability=CapabilityEvent(
AvailabilityEvent, [GetBattery(is_available_check=True)]
),
battery=CapabilityEvent(BatteryEvent, [GetBattery()]),
charge=CapabilityExecute(Charge),
clean=CapabilityClean(
action=CapabilityCleanAction(command=Clean, area=CleanArea),
continuous=CapabilitySetEnable(
ContinuousCleaningEvent,
[GetContinuousCleaning()],
SetContinuousCleaning,
),
count=CapabilitySet(CleanCountEvent, [GetCleanCount()], SetCleanCount),
log=CapabilityEvent(CleanLogEvent, [GetCleanLogs()]),
preference=CapabilitySetEnable(
CleanPreferenceEvent, [GetCleanPreference()], SetCleanPreference
),
work_mode=CapabilitySetTypes(
event=WorkModeEvent,
get=[GetWorkMode()],
set=SetWorkMode,
types=(
WorkMode.MOP,
WorkMode.MOP_AFTER_VACUUM,
WorkMode.VACUUM,
WorkMode.VACUUM_AND_MOP,
),
),
),
custom=CapabilityCustomCommand(
event=CustomCommandEvent, get=[], set=CustomCommand
),
error=CapabilityEvent(ErrorEvent, [GetError()]),
fan_speed=CapabilitySetTypes(
event=FanSpeedEvent,
get=[GetFanSpeed()],
set=SetFanSpeed,
types=(
FanSpeedLevel.QUIET,
FanSpeedLevel.NORMAL,
FanSpeedLevel.MAX,
FanSpeedLevel.MAX_PLUS,
),
),
life_span=CapabilityLifeSpan(
types=(LifeSpan.BRUSH, LifeSpan.FILTER, LifeSpan.SIDE_BRUSH),
event=LifeSpanEvent,
get=[GetLifeSpan([LifeSpan.BRUSH, LifeSpan.FILTER, LifeSpan.SIDE_BRUSH])],
reset=ResetLifeSpan,
),
map=CapabilityMap(
cached_info=CapabilityEvent(CachedMapInfoEvent, [GetCachedMapInfo()]),
changed=CapabilityEvent(MapChangedEvent, []),
major=CapabilityEvent(MajorMapEvent, [GetMajorMap()]),
minor=CapabilityExecute(GetMinorMap),
multi_state=CapabilitySetEnable(
MultimapStateEvent, [GetMultimapState()], SetMultimapState
),
position=CapabilityEvent(PositionsEvent, [GetPos()]),
relocation=CapabilityExecute(SetRelocationState),
rooms=CapabilityEvent(RoomsEvent, [GetCachedMapInfo()]),
trace=CapabilityEvent(MapTraceEvent, [GetMapTrace()]),
),
network=CapabilityEvent(NetworkInfoEvent, [GetNetInfo()]),
play_sound=CapabilityExecute(PlaySound),
settings=CapabilitySettings(
advanced_mode=CapabilitySetEnable(
AdvancedModeEvent, [GetAdvancedMode()], SetAdvancedMode
),
carpet_auto_fan_boost=CapabilitySetEnable(
CarpetAutoFanBoostEvent,
[GetCarpetAutoFanBoost()],
SetCarpetAutoFanBoost,
),
true_detect=CapabilitySetEnable(
TrueDetectEvent, [GetTrueDetect()], SetTrueDetect
),
volume=CapabilitySet(VolumeEvent, [GetVolume()], SetVolume),
),
state=CapabilityEvent(StateEvent, [GetChargeState(), GetCleanInfo()]),
stats=CapabilityStats(
clean=CapabilityEvent(StatsEvent, [GetStats()]),
report=CapabilityEvent(ReportStatsEvent, []),
total=CapabilityEvent(TotalStatsEvent, [GetTotalStats()]),
),
water=CapabilityWater(
amount=CapabilitySetTypes(
event=water_info.WaterAmountEvent,
get=[GetWaterInfo()],
set=SetWaterInfo,
types=(
water_info.WaterAmount.LOW,
water_info.WaterAmount.MEDIUM,
water_info.WaterAmount.HIGH,
water_info.WaterAmount.ULTRAHIGH,
),
),
mop_attached=CapabilityEvent(water_info.MopAttachedEvent, [GetWaterInfo()]),
),
),
)
```