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

针对“Commit 05d196d——add miio2miot for zhimi.aircondition.v1”的问题反馈:本地接入的智米空调模式不可调节 #2107

Closed
Hugh696 opened this issue Dec 19, 2024 · 3 comments · Fixed by #2185 or #2192

Comments

@Hugh696
Copy link
Contributor

Hugh696 commented Dec 19, 2024

Device model / 设备型号

zhimi.aircondition.v1

Component version / 插件版本

1.0.6

HA core version / HA版本

2024.12.3

Integrated mode / 集成方式

Local (本地模式)

The problem / 问题详情

  1. 空调只能开关,不能选择模式,无法执行动作“climate/set_hvac_mode” 。 'NoneType' object has no attribute 'is_success',详细日志见下文;
  2. 室外温湿度没了,原来云端有的现在也不可用了;
  3. 风速对应问题:低中高档对应123档,45档调不了,https://home.miot-spec.com/spec/ 中亦缺失45档;
  4. 显示屏亮度调节不可用,此问题一直都有,类型应为uint8,范围: 0 ~ 7 ,步长: 1;
  5. 可不可以加上音量调节和上下扫风的角度调节。

Entity attributes / 实体属性

1. 空调实体:climate.zhimi_v1_e2cd_air_conditioner_2
hvac_modes: cool, heat, dry, fan_only, auto, off
min_temp: 16
max_temp: 32
target_temp_step: 0.1
fan_modes: 自动, 低档, 中档, 高档
swing_modes: off, vertical, horizontal, both
current_temperature: 15.1
temperature: 20
current_humidity: 38
fan_mode: 自动
hvac_action: off
swing_mode: off
indicator_light.brightness: 3
alarm.volume: 71
environment.temperature: 15.1
outdoor_temperature-4-2: 15.1
environment.relative_humidity: 38
outdoor_relative_humidity-4-4: 38
fan_control.fan_level: 0
fan_control.horizontal_swing: false
fan_control.vertical_swing: false
fan_control.vertical_angle: 0
air_conditioner.on: false
air_conditioner.mode: 4
target_temperature-2-3: 20
air_conditioner.sleep_mode: false
air_conditioner.heater: false
state_updater: local
friendly_name: 智米空调 Air Conditioner
supported_features: 425

2. 室外温湿度实体:sensor.zhimi_v1_e2cd_outdoor_temperature
restored: true
state_class: measurement
device_class: temperature
friendly_name: 次卧空调 Environment Outdoor Temperature
supported_features: 0
unit_of_measurement: °C

sensor.zhimi_v1_e2cd_outdoor_relative_humidity
restored: true
state_class: measurement
device_class: humidity
friendly_name: 次卧空调 Environment Outdoor Relative Humidity
supported_features: 0
unit_of_measurement: %

3. 风速实体:select.zhimi_v1_e2cd_fan_level_2
options: 自动, 低档, 中档, 高档 //yaml中启用了翻译功能
friendly_name: 智米空调 Fan Control Fan Level
fan_control.fan_level: 0

4. 显示屏亮度实体:light.zhimi_v1_e2cd_brightness
supported_color_modes: brightness
friendly_name: 智米空调 Indicator Light Brightness
supported_features: 0
color_mode: brightness
brightness: 109.28571428571428
indicator_light.brightness: 3 //这里与米家中设置的亮度一致

Home Assistant Logs / 系统日志

日志记录器: homeassistant.components.websocket_api.http.connection
来源: components/websocket_api/commands.py:245
集成: Home Assistant WebSocket API (文档, 问题)
首次出现: 11:37:48 (10 次总计出现)
上次记录: 11:51:54

[548005098496] Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<7 lines>...
)
^
File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
hass, entity, func, data, call.context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 807, in async_handle_set_hvac_mode_service
await self.async_set_hvac_mode(hvac_mode)
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 815, in async_set_hvac_mode
await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode)
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/xiaomi_miot/climate.py", line 393, in set_hvac_mode
return self.set_preset_mode(mode)
~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/config/custom_components/xiaomi_miot/climate.py", line 453, in set_preset_mode
return self.set_property(self._prop_mode, val)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/xiaomi_miot/init.py", line 1191, in set_property
return self.device.set_property(field, value)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/config/custom_components/xiaomi_miot/core/device.py", line 971, in set_property
result = self.set_miot_property(siid, piid, value)
File "/config/custom_components/xiaomi_miot/core/device.py", line 1010, in set_miot_property
if not result.is_success:
^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'is_success'

@al-one
Copy link
Owner

al-one commented Dec 19, 2024

室外温湿度没了,原来云端有的现在也不可用了;

在米家 react 组件代码中未找到获取室外温湿度的相关代码,云端模式下,可能是米家服务器另外加的。

其他已修复。

@Hugh696
Copy link
Contributor Author

Hugh696 commented Dec 21, 2024

室外温湿度没了,原来云端有的现在也不可用了;

在米家 react 组件代码中未找到获取室外温湿度的相关代码,云端模式下,可能是米家服务器另外加的。

其他已修复。

'prop.5.1': {
'prop': 'volume',
'setter': 'set_volume',
'template': '{{ (value/10)|int }}',
'set_template': '{{ value|int }}',
}, //miio中音量输入的值是0-7的整数,输出的值是输入值的10倍,而且原来的setter不适用我这个空调,这个是可以的
'prop.6.1': {'prop': 'lcd_level', 'setter': 'set_lcd_level'}, //这个setter问题同上

我改了一下miio2miot_specs.py里的配置,现在空调音量和显示屏亮度的显示和控制都正常啦!但是还有一些问题我搞不定了。

  1. 音量的控制条应该是0-7,现在是0-100,找不到在哪改
  2. 风速控制在米家APP里是1-5和自动挡,对应miio里的0-4和5,但是ha的下拉列表里只有高中低和自动,没有quiet和turbo
  3. 导风板角度的控制条没有出现,米家app里是0-60的整数,步长1,miio中输出的值也相同,而且miio中这个空调导风板的setter也不是set_ver_pos,是什么我还没试出来

@Hugh696
Copy link
Contributor Author

Hugh696 commented Dec 21, 2024

室外温湿度没了,原来云端有的现在也不可用了;

在米家 react 组件代码中未找到获取室外温湿度的相关代码,云端模式下,可能是米家服务器另外加的。

其他已修复。

image image image

Hugh696 added a commit to Hugh696/hass-xiaomi-miot that referenced this issue Dec 22, 2024
1. 主要修改了提示音和显示屏亮度的Setter以适用这个型号特殊的空调
2. 扫风角度实体没有如期生成,而且'set_ver_pos'这个Setter也不适用该空调,暂时没有找到正确的Setter

还有一些问题,见issue al-one#2107 al-one#2107
希望大佬抽出时间,我们一起把这个空调完美搞定🤝
@al-one al-one closed this as completed Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment