『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 319|回复: 2

[求助] 尝试解决热水器温度的问题

[复制链接]

9

主题

65

帖子

428

积分

中级会员

Rank: 3Rank: 3

积分
428
金钱
363
HASS币
0
发表于 2024-10-8 18:06:23 | 显示全部楼层 |阅读模式
本帖最后由 gaming 于 2024-10-8 18:13 编辑

使用al-one大佬的hass-xiaomi-miot插件接入了米家的所有设备,很好用
用几年了,热水器的温度大佬帮忙解决过,后面又不行了,提交了issue还没解决。。
自己尝试了一下,是云米的问题,
viomi.waterheater.e1的
target-temperature、temperature、water-level不支持读,只有通知前面issue#375有解决过,试着调整代码,也没解决,直接报错开不了
https://github.com/al-one/hass-xiaomi-miot/issues/375


热水器属性如下:
min_temp: 30
max_temp: 75
operation_list: Normal, Heat, Delay
current_temperature: 0
temperature: 0
target_temp_high: 75
target_temp_low: 30
operation_mode: Normal
model: viomi.waterheater.e1
lan_ip: 192.168.2.55
mac_address: 5C:E5:0C:09:8A:EE
entity_class: MiotWaterHeaterEntity
home_room: 默认家庭 浴室
miot_type: urn:miot-spec-v2:device:water-heater:0000A02A:viomi-e1:1
water_heater.temperature: 0
water_heater.status: 0
water_heater.on: false
water_heater.water_level: 0
water_heater.mode: 0
state_updater: lan
friendly_name: 热水器 状态
supported_features: 3


对应的target-temperature、temperature、water-level都是0


试着service: xiaomi_miot.send_command
data:
entity_id: water_heater.viomi_e1_8aee_water_heater
method: get_prop
params: [water_heater.temperature]
返回结果是
Miio command result
[2, 0, 43, 50, 0, 40, 0, 1, 20, 23]
第3位49是水温,第4位50是目标温度

试着用定时自动化调用服务,又在怎么赋值给设备的属性卡住了

大佬帮忙看看,有没有办法

另外怎么悬赏啊
只找到了主题售价
回复

使用道具 举报

9

主题

65

帖子

428

积分

中级会员

Rank: 3Rank: 3

积分
428
金钱
363
HASS币
0
 楼主| 发表于 2024-10-8 22:43:14 | 显示全部楼层
  - action: xiaomi_miot.set_miot_property
    data:
      siid: 2
      piid: 2
      entity_id: water_heater.viomi_e1_8aee_water_heater
      value: 5
使用此方法出现日志,应该是不能写
热水器(viomi.waterheater.e1): Set miot property {'did': '241625390', 'siid': 2, 'piid': 2, 'value': 5} failed, result: {'did': '241625390', 'iid': '0.2.2', 'siid': 2, 'piid': 2, 'code': -704030023, 'exe_time': 0}
回复

使用道具 举报

9

主题

65

帖子

428

积分

中级会员

Rank: 3Rank: 3

积分
428
金钱
363
HASS币
0
 楼主| 发表于 2024-10-9 20:43:53 | 显示全部楼层
本帖最后由 gaming 于 2024-10-9 21:10 编辑

根据
action: xiaomi_miot.send_command
data:
  entity_id: water_heater.viomi_e1_8aee_water_heater
  method: get_prop
  params: target-temperature
得到的结果
result:
  - 1  #开关
  - 0  #?
  - 45  #水温
  - 50  #设置温度
  - 0  #?
  - 10  #热水量
  - 0  #?
  - 1   #?
  - 20  #?
  - 23   #?


更改miio2miot_specs.py 1535
```
    'viomi.waterheater.e1': {
        'chunk_properties': 1,
        'miio_specs': {
            'prop.2.1': {'prop': 'targetTemp', 'setter': 'set_temp', 'set_template': '{{ [value|int] }}'},
            'prop.2.2': {'prop': 'waterTemp'},
            'prop.2.3': {'prop': 'washStatus'},
            'prop.2.4': {
                'prop': 'washStatus',
                'setter': 'set_power',
                'template': '{{ value != 0 }}',
                'set_template': '{{ [value|int(1)] }}',
            },
            'prop.2.5': {'prop': 'hotWater'},  # water-level
            'prop.2.6': {'prop': 'modeType', 'setter': 'set_mode'},
        },
    },
```
改成
```
    'viomi.waterheater.e1': {
        'chunk_properties': 1,
        'miio_specs': {
            'prop.2.4': {'prop': 'target-temperature', 'setter': 'set_temp', 'set_template': '{{ [value|int] }}'},
            'prop.2.3': {'prop': 'temperature'},
            'prop.2.1': {'prop': 'status'},
            'prop.2.2': {
                'prop': 'washStatus',
                'setter': 'set_power',
                'template': '{{ value != 0 }}',
                'set_template': '{{ [value|int(1)] }}',
            },
            'prop.2.6': {'prop': 'water-level'},  # water-level
            'prop.2.5': {'prop': 'mode', 'setter': 'set_mode'},
        },
    },
```

再更改 miot_specs_extend.json 961,从
```
  "viomi.waterheater.e1": [
    {
      "iid": 2,
      "properties": [
        {
          "iid": 2,
          "access": ["read", "notify"]
        },
        {
          "iid": 5,
          "access": ["read", "notify"]
        }
    }
  ],
```
改成
```
  "viomi.waterheater.e1": [
    {
      "iid": 2,
      "properties": [
        {
          "iid": 1,
          "access": ["read", "write", "notify"]
        },
        {
          "iid": 2,
          "access": ["read", "notify"]
        },
        {
          "iid": 5,
          "access": ["read", "notify"]
        }
    }
  ],
```

设备属性
min_temp: 30
max_temp: 75
operation_list: Normal, Heat, Delay
current_temperature: 1
temperature: 45
target_temp_high: 75
target_temp_low: 30
operation_mode: Normal
model: viomi.waterheater.e1
lan_ip: 192.168.2.55
mac_address: 5C:E5:0C:09:8A:EE
entity_class: MiotWaterHeaterEntity
home_room: 默认家庭 浴室
miot_type: urn:miot-spec-v2:device:water-heater:0000A02A:viomi-e1:1
water_heater.target_temperature: 45
water_heater.temperature: true
water_heater.status: 0
water_heater.on: true
water_heater.water_level: 40
water_heater.mode: 0
state_updater: lan
sub_entities: water_heater-2.on-4
friendly_name: 热水器 状态
supported_features: 3

属性中temperature正常,其他全乱了,好像不影响使用

debug日志:
```
2024-10-09 20:21:23.155 DEBUG (MainThread) [custom_components.xiaomi_miot] Xiaomi cloud device: {'name': '热水器', 'host': '192.168.2.55', 'token': '****', 'model': 'viomi.waterheater.e1', 'miot_did': '241625390', 'miot_type': 'urn:miot-spec-v2:device:water-heater:0000A02A:viomi-e1:1', 'miio_info': {'ap': {'ssid': 'wifi', 'bssid': 'DC8:7C:57:99:CC', 'rssi': -56}, 'netif': {'localIp': '192.168.2.55', 'gw': '', 'mask': ''}, 'fw_ver': '2.1.3', 'hw_ver': '', 'mac': '5C:E5:0C:09:8A:EE', 'model': 'viomi.waterheater.e1', 'token': '9e82b00cb9931a217dacd62ccba92d14'}, 'conn_mode': 'auto', 'miot_local': False, 'miot_cloud': True, 'home_name': '默认家庭', 'room_name': '浴室', 'entry_id': '4dda237d11b6dee9f4017ce783f1c908', 'config_version': 0.3}
2024-10-09 20:21:26.784 INFO (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Initializing miot device with mapping: {'water_heater.target_temperature': {'siid': 2, 'piid': 1}, 'water_heater.temperature': {'siid': 2, 'piid': 2}, 'water_heater.status': {'siid': 2, 'piid': 3}, 'water_heater.on': {'siid': 2, 'piid': 4}, 'water_heater.water_level': {'siid': 2, 'piid': 5}, 'water_heater.mode': {'siid': 2, 'piid': 6}}
2024-10-09 20:21:33.450 INFO (SyncWorker_23) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 35, 'washStatus': 50, 'water-level': 0, 'mode': 10}
2024-10-09 20:21:33.477 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 35, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 10, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:21:33.478 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Added to hass: [{'sensor_properties': 'water_velocity,tds_in,tds_out', 'switch_properties': 'water_heater.on,preheating,cruise_press', 'extend_miot_specs': [{'iid': 2, 'properties': [{'iid': 1, 'access': ['read', 'write', 'notify']}, {'iid': 2, 'access': ['read', 'notify']}, {'iid': 5, 'access': ['read', 'notify']}]}]}]
2024-10-09 20:22:39.128 INFO (SyncWorker_57) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 35, 'washStatus': 50, 'water-level': 0, 'mode': 10}
2024-10-09 20:22:39.186 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Added sub entity switch: water_heater-2.on-4
2024-10-09 20:22:39.190 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 35, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 10, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:23:28.295 DEBUG (SyncWorker_3) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Send miio command: get_prop(['target-temperature'])
2024-10-09 20:23:40.040 INFO (SyncWorker_28) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 36, 'washStatus': 50, 'water-level': 0, 'mode': 10}
2024-10-09 20:23:40.064 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 36, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 10, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:24:39.519 INFO (SyncWorker_61) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 37, 'washStatus': 50, 'water-level': 0, 'mode': 20}
2024-10-09 20:24:39.550 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 37, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 20, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:25:41.007 INFO (SyncWorker_9) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 37, 'washStatus': 50, 'water-level': 0, 'mode': 20}
2024-10-09 20:25:41.036 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 37, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 20, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:26:39.860 INFO (SyncWorker_36) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 38, 'washStatus': 50, 'water-level': 0, 'mode': 20}
2024-10-09 20:26:39.895 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 38, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 20, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:27:51.941 INFO (SyncWorker_57) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 39, 'washStatus': 50, 'water-level': 0, 'mode': 20}
2024-10-09 20:27:51.970 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 39, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 20, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:28:39.695 INFO (SyncWorker_49) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 39, 'washStatus': 50, 'water-level': 0, 'mode': 20}
2024-10-09 20:28:39.727 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 39, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 20, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:29:44.254 INFO (SyncWorker_0) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 40, 'washStatus': 50, 'water-level': 0, 'mode': 30}
2024-10-09 20:29:44.282 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 40, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 30, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:30:39.368 INFO (SyncWorker_54) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 41, 'washStatus': 50, 'water-level': 0, 'mode': 30}
2024-10-09 20:30:39.403 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 41, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 30, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:31:43.517 ERROR (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got MiioException while fetching the state: Unable to discover the device 192.168.2.55, mapping: {'water_heater.target_temperature': {'siid': 2, 'piid': 1}, 'water_heater.temperature': {'siid': 2, 'piid': 2}, 'water_heater.status': {'siid': 2, 'piid': 3}, 'water_heater.on': {'siid': 2, 'piid': 4}, 'water_heater.water_level': {'siid': 2, 'piid': 5}, 'water_heater.mode': {'siid': 2, 'piid': 6}}, max_properties: 10/6
2024-10-09 20:32:39.730 INFO (SyncWorker_35) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 42, 'washStatus': 50, 'water-level': 0, 'mode': 30}
2024-10-09 20:32:39.757 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 42, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 30, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:33:39.517 INFO (SyncWorker_50) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 43, 'washStatus': 50, 'water-level': 0, 'mode': 30}
2024-10-09 20:33:39.546 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 43, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 30, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:34:39.248 INFO (SyncWorker_57) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 44, 'washStatus': 50, 'water-level': 0, 'mode': 30}
2024-10-09 20:34:39.303 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 44, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 30, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:35:39.207 INFO (SyncWorker_30) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 45, 'washStatus': 50, 'water-level': 0, 'mode': 40}
2024-10-09 20:35:39.358 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 45, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 40, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:36:44.618 INFO (SyncWorker_44) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 46, 'washStatus': 50, 'water-level': 0, 'mode': 40}
2024-10-09 20:36:44.657 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 46, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 40, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:37:39.346 INFO (SyncWorker_42) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 46, 'washStatus': 50, 'water-level': 0, 'mode': 40}
2024-10-09 20:37:39.371 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 46, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 40, 'water_heater.mode': 0, 'state_updater': 'lan'}
2024-10-09 20:38:38.848 INFO (SyncWorker_18) [custom_components.xiaomi_miot.core.miio2miot] viomi.waterheater.e1: Got miio props for miot: {'target-temperature': 1, 'temperature': 0, 'status': 47, 'washStatus': 50, 'water-level': 0, 'mode': 40}
2024-10-09 20:38:38.881 DEBUG (MainThread) [custom_components.xiaomi_miot.water_heater] 热水器(viomi.waterheater.e1): Got new state: {'water_heater.target_temperature': 47, 'water_heater.temperature': True, 'water_heater.status': 0, 'water_heater.on': True, 'water_heater.water_level': 40, 'water_heater.mode': 0, 'state_updater': 'lan'}
```

单独写个sensor提取温度暂时用
大佬有空帮忙看看 @al-one
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-21 20:06 , Processed in 0.806501 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表