根据
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