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

HA无法同步空调状态 #2

Open
angus9487 opened this issue Sep 9, 2021 · 8 comments
Open

HA无法同步空调状态 #2

angus9487 opened this issue Sep 9, 2021 · 8 comments

Comments

@angus9487
Copy link

同步状态的接口应该和一代比也有变化,一直在发消息,收不到返回,大佬有空看看吧
2021-09-09 10:42:07 INFO (SyncWorker_6) [custom_components.gree2.climate] socket send data {'cid': 'app', 'i': 0, 't': 'pack', 'uid': 14225773, 'pack': 'YIePJYaJL+huIkNO24CZxyjZ8dDY2nXoEOre63zRnrWx/8Qwj0oKwJlczLFnm1B4ngi8jYEPelvh8OES33G6fRT47y+DmHMqoLxWrZA9uPtHT5Cj1RTIiWBBqX3FlCJA+7NaMbDxKPHnXumcRMjR8ex7Vi1MYquAP8dDcMxbR4Q13JCeHRcoy44MLajW2AIM', 'tcid': '502cc6536f04'} to 192.168.1.11
2021-09-09 10:42:07 INFO (SyncWorker_6) [custom_components.gree2.climate] socket send pack {'cols': ['Pow', 'Mod', 'SetTem', 'WdSpd', 'Air', 'Blo', 'Health', 'SwhSlp', 'SwingLfRig', 'Quiet', 'SvSt'], 'mac': '255f731a000000', 't': 'status'} to 192.168.1.11
2021-09-09 10:42:07 INFO (SyncWorker_6) [custom_components.gree2.climate] socket send data {'cid': 'app', 'i': 0, 't': 'pack', 'uid': 14225773, 'pack': 'YIePJYaJL+huIkNO24CZxyjZ8dDY2nXoEOre63zRnrWx/8Qwj0oKwJlczLFnm1B4ngi8jYEPelvh8OES33G6fRT47y+DmHMqoLxWrZA9uPtHT5Cj1RTIiWBBqX3FlCJAMtjXNelgTUUdslWQCQogC+x7Vi1MYquAP8dDcMxbR4Q13JCeHRcoy44MLajW2AIM', 'tcid': '502cc6536f04'} to 192.168.1.11
2021-09-09 10:42:07 INFO (SyncWorker_6) [custom_components.gree2.climate] socket send pack {'cols': ['Pow', 'Mod', 'SetTem', 'WdSpd', 'Air', 'Blo', 'Health', 'SwhSlp', 'SwingLfRig', 'Quiet', 'SvSt'], 'mac': 'db7ccb1b000000', 't': 'status'} to 192.168.1.11
2021-09-09 10:42:07 INFO (SyncWorker_6) [custom_components.gree2.climate] socket send data {'cid': 'app', 'i': 0, 't': 'pack', 'uid': 14225773, 'pack': 'YIePJYaJL+huIkNO24CZxyjZ8dDY2nXoEOre63zRnrWx/8Qwj0oKwJlczLFnm1B4ngi8jYEPelvh8OES33G6fRT47y+DmHMqoLxWrZA9uPtHT5Cj1RTIiWBBqX3FlCJAoQ205Za0U43jhbR2jF/glux7Vi1MYquAP8dDcMxbR4Q13JCeHRcoy44MLajW2AIM', 'tcid': '502cc6536f04'} to 192.168.1.11
2021-09-09 10:42:07 INFO (SyncWorker_6) [custom_components.gree2.climate] socket send pack {'cols': ['Pow', 'Mod', 'SetTem', 'WdSpd', 'Air', 'Blo', 'Health', 'SwhSlp', 'SwingLfRig', 'Quiet', 'SvSt'], 'mac': '1018931b000000', 't': 'status'} to 192.168.1.11
2021-09-09 10:42:07 INFO (SyncWorker_6) [custom_components.gree2.climate] socket send data {'cid': 'app', 'i': 0, 't': 'pack', 'uid': 14225773, 'pack': 'YIePJYaJL+huIkNO24CZxyjZ8dDY2nXoEOre63zRnrWx/8Qwj0oKwJlczLFnm1B4ngi8jYEPelvh8OES33G6fRT47y+DmHMqoLxWrZA9uPtHT5Cj1RTIiWBBqX3FlCJA87nhNqxHReMZQYOfpoP65ux7Vi1MYquAP8dDcMxbR4Q13JCeHRcoy44MLajW2AIM', 'tcid': '502cc6536f04'} to 192.168.1.11

@angus9487
Copy link
Author

这是1代正常接收的日志
2021-06-26 21:18:08 INFO (MainThread) [custom_components.gree2.climate] socket send pack {'cols': ['Pow', 'Mod', 'SetTem', 'WdSpd', 'Air', 'Blo', 'Health', 'SwhSlp', 'SwingLfRig', 'Quiet', 'SvSt'], 'mac': '5b9c251b000000', 't': 'status'} to 192.168.0.229
2021-06-26 21:18:08 INFO (MainThread) [custom_components.gree2.climate] socket send data {'cid': 'app', 'i': 0, 't': 'pack', 'uid': 0, 'pack': 'QzhAR/dN/lwgQtg/wN8nNo4Vz/eYkfJN1or55AMlYNC5yU8g39onDx5Uw4NnuZD8D32O9ZF9lKyqqAobACYgIFMxLnOVefuiGd5HMB2/NHcQwIi65AjD5eDjxoqUrEDtUU0pffep3xW6YgCL6htJY+DqIITxmelAMI/wcyWmTPjQodRJjyPYfZWNurRSRKRR'} to 192.168.0.229
2021-06-26 21:18:09 INFO (Thread-3) [custom_components.gree2.climate] socket received from ('192.168.0.229', 7000):{"t":"pack","i":0,"uid":0,"cid":"","tcid":"app","pack":"8LmrtQ9QVDamidJ6tBvKvgRr3PsrkDlKmjD31L27MCAIzsU6l/ahu5yVrrj1aSzspcCrfk47/DwW/wobphjdigeoCz581huZLWcMJ7ZdzOFZ7Po8e54DtPdPLX4xy5DNVYzJPnmIoSYQhPbWCGb8adwaA44ovuyP6bCF+HP7rqtB1RJpPZ5063R3qbTfJqYKhmxLNQQdoX/mKR0zwNJyQGIi972Ign3eOgeMRXC9mXbjjOvPeuHlIMtUgWox9MoN"}
2021-06-26 21:18:09 INFO (Thread-3) [custom_components.gree2.climate] Server received pack {'t': 'dat', 'r': 200, 'uid': 0, 'cid': 'app', 'mac': '5b9c251b000000', 'cols': ['Pow', 'Mod', 'SetTem', 'WdSpd', 'Air', 'Blo', 'Health', 'SwhSlp', 'SwingLfRig', 'Quiet', 'SvSt'], 'dat': [0, 1, 27, 1, 0, 0, 0, 0, 0, 0, 0]}
2021-06-26 21:18:09 INFO (Thread-3) [custom_components.gree2.climate] Climate 格力空调5b9c251b000000 status: {'Pow': 0, 'Mod': 1, 'WdSpd': 1, 'SetTem': 27, 'Air': 0, 'Blo': 0, 'Health': 0, 'SwhSlp': 0, 'SwingLfRig': 0, 'Quiet': 0, 'SvSt': 0}

@lelemka0
Copy link
Owner

我家还没装修完 暂时没法调试 这个靠猜猜不出问题在哪
之后我会更新的

@lelemka0
Copy link
Owner

lelemka0 commented Feb 7, 2022

@angus9487 试试这个仓库
https://github.com/lelemka0/HomeAssistant-GreeClimateComponent
在我的二代云控上测试通过

必要的配置如下

- platform: gree
  name: 格力空调
  host: 云控的ip地址
  port: 7000
  mac: 内机的mac地址
  tcid: 云控的mac地址
  target_temp_step: 1
  encryption_key: 密钥
  uid: 

其中uid可以在过去的日志中找到,也可以使用udp调试工具广播{"t": "scan"}获得。
获取encryption_key使用https://github.com/tomikaa87/gree-remote/blob/master/PythonCLI/gree.py
python .\gree.py -b 云控的ip地址 -command search

@angus9487
Copy link
Author

试了下,拿状态的时候还是超时拿不到,大佬方便看一下你这里的报文内容,还有你的云控固件版本?
2022-02-07 15:26:00 INFO (MainThread) [custom_components.gree.climate] name(): 格力空调
2022-02-07 15:26:00 INFO (MainThread) [custom_components.gree.climate] supported_features(): 41
2022-02-07 15:26:00 INFO (MainThread) [custom_components.gree.climate] Gree climate device added to hass()
2022-02-07 15:26:00 INFO (MainThread) [custom_components.gree.climate] Starting SyncState
2022-02-07 15:26:00 INFO (MainThread) [custom_components.gree.climate] Preparing pack: {"cols":["Pow", "Mod", "SetTem", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "Lig", "SwingLfRig", "SwUpDn", "Quiet", "Tur", "StHt", "TemUn", "HeatCoolType", "TemRec", "SvSt", "SlpMod"],"mac":"255f731a000000","t":"status"}
2022-02-07 15:26:00 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.1.11, 7000, 10, {"cid":"app","i":0,"pack":"VcTFwDGWzaWSlGlCD3VMGV71c7kGe5dPNG6OPLyfcGfoqOKbVo8S/RqiZQ4+ZTtqyRr9XemIK0S4n0J7e/FYQxgkHib8t0UwJneUpjj8paAlYPVgE8WG69rofKnIGjQoVzuyewGooUbMuN5Cl/3CspZ6pAq0sM1y2vkc7BoTN2cgUZNIdA14rA0zIE3LYn3XY5ARBkNVHmdzbb2M8alXU7/SclsbLdbHrgirjO7ao1DhCCFF4V5PYdnnQtqvw071VO+8znUORLFowSukPzGry3R6h0l1ANTWGcev4440aM0=","t":"pack","tcid":"502cc6536f04","uid":14225773})
2022-02-07 15:26:10 ERROR (MainThread) [homeassistant.components.climate] Error adding entities for domain climate with platform gree
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 747, in add_to_platform_finish
await self.async_added_to_hass()
File "/usr/local/lib/python3.9/asyncio/coroutines.py", line 124, in coro
res = func(*args, **kw)
File "/config/custom_components/gree/climate.py", line 821, in async_added_to_hass
self.SyncState()
File "/config/custom_components/gree/climate.py", line 448, in SyncState
currentValues = self.GreeGetValues(optionsToFetch)
File "/config/custom_components/gree/climate.py", line 265, in GreeGetValues
return self.FetchResult(self.CIPHER, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['dat']
File "/config/custom_components/gree/climate.py", line 244, in FetchResult
data, addr = clientSock.recvfrom(64000)
socket.timeout: timed out
IMG_37BEA9205DA9-1

@lelemka0
Copy link
Owner

lelemka0 commented Feb 7, 2022

我是wifi模块v6 云控v6

@maxmib
Copy link

maxmib commented Feb 28, 2022

对云控二代的支持后续会同步到这个项目,还是要使用上面提到的新插件

@ddkens
Copy link

ddkens commented Mar 22, 2022

同样的问题,二代云控,HA里可以控制空调,但是用空调面板控制之后,在ha里没有反馈

@maxmib
Copy link

maxmib commented Mar 28, 2022

云控二代升级到v9 后,这个插件好像可以正常同步空调状态了

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

No branches or pull requests

4 participants