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

红外空调不能打开/关闭 #1642

Closed
SodaWithoutSparkles opened this issue Apr 26, 2024 · 3 comments
Closed

红外空调不能打开/关闭 #1642

SodaWithoutSparkles opened this issue Apr 26, 2024 · 3 comments

Comments

@SodaWithoutSparkles
Copy link
Contributor

Device model / 设备型号

miir.aircondition.ir02 / chuangmi.remote.v2

Component version / 插件版本

0.7.17

HA core version / HA版本

2024.4.3

Integrated mode / 集成方式

Local (本地模式)

The problem / 问题详情

能够设置不同的模式,但是无法开关。米家应用没有问题。估计是和空调控制不是"发送这个信号代表开/关",而是"发送这个信号就把现在的状态反转"有关。

Entity attributes / 实体属性

hvac_modes:
  - "off"
  - auto
  - cool
  - heat
  - dry
  - fan_only
min_temp: 16
max_temp: 30
target_temp_step: 1
fan_modes:
  - Fan Speed Down
  - Fan Speed Up
current_temperature: null
temperature: 27
fan_mode: null
hvac_action: fan
model: miir.aircondition.ir02
lan_ip: ""
mac_address: ir.1783904586500030464
entity_class: MiirClimateEntity
miot_type: urn:miot-spec-v2:device:air-conditioner:0000A004:miir-ir02:1
friendly_name: Air Conditioner Remote Control IR Aircondition Control
supported_features: 393

Home Assistant Logs / 系统日志

This error originated from a custom integration.

Logger: custom_components.xiaomi_miot.select
Source: custom_components/xiaomi_miot/__init__.py:1915
integration: Xiaomi Miot Auto (documentation, issues)
First occurred: 1:49:50 AM (1 occurrences)
Last logged: 1:49:50 AM

Air Conditioner Remote Control(miir.aircondition.ir02): Set miot property {'did': 'ir.1783904586500030464', 'siid': 2, 'piid': 2, 'value': 22.0} failed, result: {'did': 'ir.1783904586500030464', 'iid': '0.2.2', 'siid': 2, 'piid': 2, 'code': -704013101, 'exe_time': 0}
Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:239
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 1:50:01 AM (6 occurrences)
Last logged: 1:59:51 AM

[125022992672448] 'NoneType' object has no attribute 'send'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 195, in async_handle_select_option
    await self.async_select_option(option)
  File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 203, in async_select_option
    await self.hass.async_add_executor_job(self.select_option, option)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_miot/select.py", line 87, in select_option
    if ret := self.call_action(act):
              ^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_miot/__init__.py", line 1944, in call_action
    return self.miot_action(siid, aiid, pms, did, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_miot/__init__.py", line 1974, in miot_action
    result = self.miot_device.send('action', pms)
             ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'send'
al-one added a commit that referenced this issue Apr 30, 2024
@al-one
Copy link
Owner

al-one commented Apr 30, 2024

{'did': 'ir.1783904586500030464', 'iid': '0.2.2', 'siid': 2, 'piid': 2, 'code': -704013101, 'exe_time': 0}

错误码-704013101表示: 红外设备不支持此操作

AttributeError: 'NoneType' object has no attribute 'send'

关于这个报错,尝试下master分支。

@SodaWithoutSparkles
Copy link
Contributor Author

好了,更新之后没有报NoneType了,但是仍然无法控制。之前还不知道怎样可以控制参数,现在连调整参数也不行了。

This error originated from a custom integration.

Logger: custom_components.xiaomi_miot.select
Source: custom_components/xiaomi_miot/__init__.py:1940
integration: Xiaomi Miot Auto (documentation, issues)
First occurred: 1:27:24 AM (4 occurrences)
Last logged: 3:45:07 AM

Air Conditioner Remote Control(miir.aircondition.ir02): Call miot action {'did': 'ir.1783904586500030464', 'siid': 2, 'aiid': 5, 'in': []} failed: {"code": -8, "message": "get udid error=ir.1783904586500030464", "result": null}
Air Conditioner Remote Control(miir.aircondition.ir02): Call miot action {'did': 'ir.1783904586500030464', 'siid': 2, 'aiid': 2, 'in': []} failed: {"code": -8, "message": "get udid error=ir.1783904586500030464", "result": null}
Air Conditioner Remote Control(miir.aircondition.ir02): Call miot action {'did': 'ir.1783904586500030464', 'siid': 2, 'aiid': 6, 'in': []} failed: {"code": -8, "message": "get udid error=ir.1783904586500030464", "result": null}

@SodaWithoutSparkles
Copy link
Contributor Author

我的问题已经通过另外的方法解决了

简单来说就送用另外的一只esp8266 刷esphome,之后加一个红外发射器还有解码器。判断红外协议之后,使用irremoteesp8266 库发射红外讯号。之后用米家门磁检测空调开关状态。

如果有人需要的话,可以在淘宝买红外发射模块和接收模块。注意发射模块需要5v供电,而且记得买2个红外灯珠的那款。使用3v逻辑讯号没问题。

接收模块同样5v供电3v逻辑。如果还是没反应的话,看看红外管有没有一只脚接地的。我的那个没有接地,自己飞了中间那只脚到地线接地。

https://github.com/SodaWithoutSparkles/esphome-daikin64

@SodaWithoutSparkles SodaWithoutSparkles closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2024
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

2 participants