Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a service to control "follow me" feature #50

Merged
merged 10 commits into from
Nov 2, 2023

Conversation

mill1000
Copy link
Owner

@mill1000 mill1000 commented Nov 1, 2023

The justification for using a service over a switch is to obscure the feature slightly due to the following reasons.

  • There is no capability to determine if this function exists. Without a capability we can't decide when to create a "follow me" switch entity intelligently. Otherwise we would hide the feature behind an integration option.
  • Usage of this feature isn't straightforward and is very device specific.

Close #49 and related to mill1000/midea-msmart#89

@mill1000 mill1000 added the enhancement New feature or request label Nov 1, 2023
@mill1000 mill1000 self-assigned this Nov 1, 2023
@mill1000 mill1000 marked this pull request as ready for review November 2, 2023 01:57
@mill1000 mill1000 merged commit e7a45d8 into main Nov 2, 2023
3 checks passed
@mill1000 mill1000 deleted the feature/follow_me_service branch November 2, 2023 02:01
@tabascoz
Copy link

tabascoz commented Nov 2, 2023

Hi there Mill1000,

updated the component to head and also msmart-ng but i could not find any service exposed in HA. Should i reconfigure the AC to allow it to appear?

I did a reload in one of the objects, please find below the debug log. Thanks
reconfig.log

@mill1000
Copy link
Owner Author

mill1000 commented Nov 2, 2023

Your system still appears to be running msmart-ng 2023.10.0

nov 02 15:56:15 note hass[11155]: 2023-11-02 15:56:15.077 INFO (MainThread) [custom_components.midea_ac] Starting midea-ac-py. Using msmart-ng version 2023.10.0.

@tabascoz
Copy link

tabascoz commented Nov 2, 2023

hi, will reboot and test again, files in FS are tee right versions, I am unsure about what is caching the scripts

@tabascoz
Copy link

tabascoz commented Nov 2, 2023

got that sorted out - my mistake - had replaced some files testing the fork and gentoo ebuild could not take care of them (obviously). Removed all the cruft and now is good with 2023.11.0

find below:

note /usr/lib/python3.11 # msmart-ng query --capabilities --debug --auto 192.168.51.11
DEBUG:asyncio:Using selector: EpollSelector
INFO:msmart.cli:Discovering 192.168.51.11 on local network.
DEBUG:msmart.discover:Discovery sent to 192.168.51.11:6445.
DEBUG:msmart.discover:Discovery sent to 192.168.51.11:20086.
DEBUG:msmart.discover:Waiting 5 seconds for responses...
DEBUG:msmart.discover:Discovery response from 192.168.51.11: 837000c8200f00005a5a0111b8007a8000000000ae0b0117020b171485bb0200008c00000000000000000180000000004b348d72d8889acb7240f464358f60cbc820cce3bcf8e9a84ccb3d
138590a2f1c872b27cb206d16a913c10599e1df2ab6bc94ee8cdf7c791796aa54d53e8bd1b6bb051d02cd1aa372d6943fcab72a2baaf07247d607980f5ea909c34540b991f4bdfb3e16e33d88768cc4c3d0658937d0bb19369bf0317b24d3a4de9e6a131062e6e76707
4840d2701668a6417b7a4e95f54dd1eacc3d0512c34ad6728bfe1f8
DEBUG:msmart.discover:Decrypted data from 192.168.51.11: 0b33a8c02c19000030303030303050303030303030305131383846324244343146313143303030300b6e65745f61635f463131430000870002000000000000000000ac00acac0000000088f2bd
41f11c150029092122000301000000000000000000000000000000000000000000000000000000000000000000
INFO:msmart.cloud:Using Midea cloud server: https://mp-prod.appsmb.com (China: False).
INFO:httpx:HTTP Request: POST https://mp-prod.appsmb.com/mas/v5/app/proxy?alias=%2Fv1%2Fuser%2Flogin%2Fid%2Fget "HTTP/1.1 200 "
DEBUG:msmart.cloud:API response: {"code":"0","msg":"ok","data":{"loginId":"9083a440-1e41-436a-b160-537873e7"}}
DEBUG:msmart.cloud:Received loginId: 9083a440-1e41-436a-b160-537873e7
DEBUG:msmart.discover:Discovered 1 devices.
INFO:httpx:HTTP Request: POST https://mp-prod.appsmb.com/mas/v5/app/proxy?alias=%2Fmj%2Fuser%2Flogin "HTTP/1.1 200 OK"
DEBUG:msmart.cloud:API response: {"code":0,"msg":"成功","data":{"randomData":"fb0dbdb9cf7fe62884c863748cde56ac69bab89beffdbc147e211b48bf2dab35","uid":"83947250d2448ffdf02e111c74bad51e","accountId":"1023665078","
nickname":"midea","mdata":{"tokenPwdInfo":{"tokenPwd":"ef39928683934880aa2c449686eb1b9b","expiredDate":1701558077409,"createDate":1698966077409},"userInfo":{"sourceId":"mj_12345","empId":"5456771537545216","addr
ess":"","gender":"0","mobile":"[email protected]","userDeptInfoList":null,"extras":null,"nameEn":null,"employeeNumber":null,"headPhoto":null,"uid":"83947250d2448ffdf02e111c74bad51e","name":"[email protected]
om","email":null},"doDeviceBind":null,"accessToken":"T1ieepysjif44fd26","signUnlockEnabled":null},"accessToken":"d91b46cd982dcfc0e57177c589f882446a61c02649cdeb63351ac3af359f0c5e","userId":"89056511576065","email
":"[email protected]"}}
DEBUG:msmart.cloud:Received accessToken: T1ieepysjif44fd26
DEBUG:msmart.discover:Fetching token and key for udpid '476c45dc37a93fa5c7f0f7edd247d8ca' (little).
INFO:httpx:HTTP Request: POST https://mp-prod.appsmb.com/mas/v5/app/proxy?alias=%2Fv1%2Fiot%2Fsecure%2FgetToken "HTTP/1.1 200 OK"
DEBUG:msmart.cloud:API response: {"code":"0","msg":"ok","data":{"tokenlist":[{"udpId":"476c45dc37a93fa5c7f0f7edd247d8ca","key":"c4dfde800bf44d4aa3edbcc01056dbd4336accec31a64ecebde923d1797f6085","token":"95099634
B1804A967C78A9BEACDCDE29F992016D15DADDBDC9E5F552871CFAC10A425CBD9D0C2A2327785BE852BC2B2D1006175DEE7203BB86285006D3E45D57"}]}}
INFO:msmart.lan:Creating new connection to 192.168.51.11:6444.
DEBUG:msmart.lan:Connected to 192.168.51.11:6444.
INFO:msmart.lan:Authenticating with 192.168.51.11:6444.
DEBUG:msmart.lan:Sending data to 192.168.51.11:6444: 837000402000000095099634b1804a967c78a9beacdcde29f992016d15daddbdc9e5f552871cfac10a425cbd9d0c2a2327785be852bc2b2d1006175dee7203bb86285006d3e45d57
DEBUG:msmart.lan:Received data from 192.168.51.11:6444: 83700005200f00204552524f52
DEBUG:msmart.discover:Fetching token and key for udpid '5f54dd1eacc3d0512c34ad6728bfe1f8' (big).
INFO:httpx:HTTP Request: POST https://mp-prod.appsmb.com/mas/v5/app/proxy?alias=%2Fv1%2Fiot%2Fsecure%2FgetToken "HTTP/1.1 200 OK"
DEBUG:msmart.cloud:API response: {"code":"0","msg":"ok","data":{"tokenlist":[{"udpId":"5f54dd1eacc3d0512c34ad6728bfe1f8","key":"4377ea0938354e8d9b290cb0d57f92342be3419105d8436f8b73cc0a80de419f","token":"020BDC3A
4A203192E9F846C37AD4B2CB836076778129D0A635CCFF2872C6ABCA44EDC8E1E758FC8AFE1D017D8E478547F169BBE8A65588EA4A3EC6230BEE7B3B"}]}}
INFO:msmart.lan:Authenticating with 192.168.51.11:6444.
DEBUG:msmart.lan:Sending data to 192.168.51.11:6444: 8370004020000001020bdc3a4a203192e9f846c37ad4b2cb836076778129d0a635ccff2872c6abca44edc8e1e758fc8afe1d017d8e478547f169bbe8a65588ea4a3ec6230bee7b3b
DEBUG:msmart.lan:Received data from 192.168.51.11:6444: 8370004020018d4e80118e3add882050ae54c680590e1af1fbc04e56a9a088f10f95a4fba0c6896eb13a6fb79384f768e4800b9c38052d1eabb9326444b271e5442d2ea6e17972dc
INFO:msmart.lan:Authentication successful. Expiration: 2023-11-03T11:01:19, Local key: 185c143fb2c837ba473cf484e1c1e900b4a9baa4ee47b95ab5d6b63f04913baa
DEBUG:msmart.base_device:Sending command to 192.168.51.11:6444: aa21ac8d000000000003418100ff03ff000200000000000000000000000003016971
DEBUG:msmart.lan:Sending packet to 192.168.51.11:6444: 5a5a0111680020000000000038140117020b171485bb0200008c0000000000000000000000000000b8436dd15e84d5a4fc6fbf77d2b12486e10c552981b23022cb71ea0fc54dc25ecfa0ce55888a
c57fc42a7eacc3285d3727f32b0c5f040e93388a8977b7ea50f6
DEBUG:msmart.lan:Sending data to 192.168.51.11:6444: 8370008e20663c44adae338d18860f10f4dff39c2763c0c0c57f9454a8e2daae1c1418aa584842d1353b5e0d3f076d2a7a87cb2250d6a934646ce6a30a0be1f152437707f868fe67734761b45274e8
acdf93a1f966cb6accd4cb4c30059fd311b4f08b31efebc2475d114f3aff8d3eda66dd9500295d86fa885ceedd2dbe394b1e107da49feabdc1c2fca685405e04f1eb05bf08c26a
DEBUG:msmart.lan:Received data from 192.168.51.11:6444: 8370008e2063f9445b700ff07d33d1ac77b8eef36fdb19f255501f995176b87a5a89e76573dc3d1257e4c1032c06bc6b76634330cb21deec05f90e2b8a18d7eb087ba3684e8832102e0bc3783e9
00dad0d4c7cc70f2a41ff9e58bb0a4911ff0d61866231595917274225d29eab09358618f09187358572c4f23225883abc1922fe8a11a357a5ebe5d0c94f73cb056539afe4d3c0f2c5
DEBUG:msmart.lan:Received packet from 192.168.51.11:6444: 5a5a0111680020800000000073150117020b171485bb0200008c00000000000000000180000000002cb0ab226b623f535a159ed9890d14dd23b3b0cbeea13b1a82f50b3ce8d13acbdb02087fc
130190d2c92515b84178f3231065738bf7e2169d9930b1e3060ff67
DEBUG:msmart.lan:Received response from 192.168.51.11:6444: aa22ac00000000000303c00087667f7f0030000000564c00000000000000000069b98d
DEBUG:msmart.base_device:Response from 192.168.51.11:6444 in 0.590000 seconds.
DEBUG:msmart.device.AC.command:State response payload: c00087667f7f0030000000564c00000000000000000069
INFO:msmart.cli:Querying device capabilities.
DEBUG:msmart.base_device:Sending command to 192.168.51.11:6444: aa0faca3000000000003b50111022fa7
DEBUG:msmart.lan:Sending packet to 192.168.51.11:6444: 5a5a011158002000000000000f150117020b171485bb0200008c000000000000000000000000000008863383a51f6d4436ea7dd0f0c64916915c618b02ed2747fad73f2ffa0db1d31f965ead4a26
2ef67a53332f7237fcbc
DEBUG:msmart.lan:Sending data to 192.168.51.11:6444: 8370007e20668945f431e6f245b739ef677db8580e771426d13d485816b03f4febfeb937312dc5bec1c8dbec36dc3ca1c53a56e90a02560f4be97f1e8bfad9020a0c10515ad37452f2c59ca6c6f5b7
03d80b576fc53a0faf4b4fed738ffa79c67ebe20179cd1a9529e41024d7173571b5c2c56314b07f167525fee338eebd21ea8fa5487c383
DEBUG:msmart.lan:Received data from 192.168.51.11:6444: 8370008e2063b32b8298dd85d50948b474cc911615ca61ba060b36a9ad071e64bb56614ce1e08b5238fe20ec9885e236155dc6c6f7c9ea3c1645008a71a3b2ed77e883dd6789cd1ce97a3ecfe4d
451a7816354049257816af971a4e0883e87bbab44884b82e904d6905efffe30a8d3aa934b0b51f34b4879ed8284c5aa5bedceab32c92a3279b0c2ef224157da0e696d17c2f45887a7
DEBUG:msmart.lan:Received packet from 192.168.51.11:6444: 5a5a0111680020800000000032950117020b171485bb0200008c00000000000000000180000000002ed30f7318deb2150985a069e6df704fc6c5350d624b48edff5254e941e2aad1eb8d98ade
0f90bb5f67d9331fb42c16d300448b8f086c48abe2ba03ff12b6670
DEBUG:msmart.lan:Received response from 192.168.51.11:6444: aa29ac00000000000303b5071202010113020101140201011502010116020101170201001a020101dedb
DEBUG:msmart.base_device:Response from 192.168.51.11:6444 in 0.450000 seconds.
DEBUG:msmart.device.AC.command:Capabilities response payload: b5071202010113020101140201011502010116020101170201001a020101
DEBUG:msmart.device.AC.command:Supported capabilities: {'eco_mode': True, 'eco_mode_2': False, 'freeze_protection': True, 'heat_mode': True, 'cool_mode': True, 'dry_mode': True, 'auto_mode': True, 'swing_horizon
tal': True, 'swing_vertical': True, 'power_stats': False, 'power_setting': False, 'power_bcd': False, 'filter_notice': False, 'filter_clean': False, 'turbo_heat': True, 'turbo_cool': True}
INFO:msmart.cli:{'supported_modes': [<OperationalMode.FAN_ONLY: 5>, <OperationalMode.DRY: 3>, <OperationalMode.COOL: 2>, <OperationalMode.HEAT: 4>, <OperationalMode.AUTO: 1>], 'supported_swing_modes': [<SwingMod
e.OFF: 0>, <SwingMode.HORIZONTAL: 3>, <SwingMode.VERTICAL: 12>, <SwingMode.BOTH: 15>], 'supported_fan_speeds': [<FanSpeed.LOW: 40>, <FanSpeed.MEDIUM: 60>, <FanSpeed.HIGH: 100>, <FanSpeed.AUTO: 102>], 'supports_c
ustom_fan_speed': False, 'supports_eco_mode': True, 'supports_turbo_mode': True, 'supports_freeze_protection_mode': True, 'supports_display_control': False, 'supports_filter_reminder': False, 'max_target_tempera
ture': 30, 'min_target_temperature': 16}

@tabascoz
Copy link

tabascoz commented Nov 2, 2023

Working - called the service now again after a reboot and service works as expected - will do some automation with that ! :) appreciate again!!

@tabascoz
Copy link

tabascoz commented Nov 3, 2023

Just a note, perhaps worth to add in the functionality description: Did the automation. it seems for the first time it to activate, I have to issue Fup disable and then enable it. If i try to enable it straight, AB beeps but nothing happens.

I'd bet it might be dependent of AC model... Cheers,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for "Follow Me"
2 participants