Skip to content

Commit

Permalink
🔌 add energy sensors for qmi.plug.psv3 (#1464)
Browse files Browse the repository at this point in the history
  • Loading branch information
MBRjun authored Jan 4, 2024
1 parent 2e94dfc commit 0fe22b9
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
39 changes: 36 additions & 3 deletions custom_components/xiaomi_miot/core/device_customizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,39 @@
'cloud_delay_update': 8,
'miot_type': 'urn:miot-spec-v2:device:air-conditioner:0000A004:qdhkl-b23:2',
},
'qmi.plug.psv3': {
'main_miot_services': 'switch-2',
'sensor_attributes': 'power_cost_today,power_cost_month',
'sensor_properties': 'switch.temperature',
'stat_power_cost_key': '3.1',
'exclude_miot_services': 'simulation',
},
'qmi.plug.psv3:electric_current': {
'value_ratio': 0.001,
'unit_of_measurement': 'A',
},
'qmi.plug.psv3:voltage': {
'value_ratio': 0.001,
'unit_of_measurement': 'V',
},
'qmi.plug.psv3:power_consumption': {
'value_ratio': 1,
'state_class': 'total_increasing',
'device_class': 'energy',
'unit_of_measurement': 'kWh',
},
'qmi.plug.psv3:power_cost_today': {
'value_ratio': 1,
'state_class': 'total_increasing',
'device_class': 'energy',
'unit_of_measurement': 'kWh',
},
'qmi.plug.psv3:power_cost_month': {
'value_ratio': 1,
'state_class': 'total_increasing',
'device_class': 'energy',
'unit_of_measurement': 'kWh',
},
'qmi.plug.tw02': {
'main_miot_services': 'switch-2',
'sensor_attributes': 'power_cost_today,power_cost_month',
Expand All @@ -970,9 +1003,9 @@
},
'qmi.plug.tw02:power_consumption': {
'value_ratio': 1,
'state_class': "total_increasing",
'device_class': "energy",
'unit_of_measurement': "kWh",
'state_class': 'total_increasing',
'device_class': 'energy',
'unit_of_measurement': 'kWh',
},
'qmi.plug.tw02:power_cost_today': {
'value_ratio': 1,
Expand Down
9 changes: 9 additions & 0 deletions custom_components/xiaomi_miot/core/translation_languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
},

'environment': {
'environment air quality': '空气质量',
'environment temperature': '温度',
'environment relative humidity': '湿度',
'environment pm2.5 density': 'PM2.5 浓度',
Expand All @@ -109,6 +110,12 @@
'circular wind': '循环风',
},

'filter': {
'filter left time': '滤芯剩余时间',
'filter used time': '滤芯已用时间',
'filter life level': '滤芯剩余寿命',
},

'intelligent_speaker': {
'wake up': '唤醒',
'play music': '播放音乐',
Expand Down Expand Up @@ -181,6 +188,7 @@

'magnet_sensor': {
'magnet sensor': '门窗传感器',
'magnet sensor illumination': '光照度',
},

'motion_sensor': {
Expand Down Expand Up @@ -210,6 +218,7 @@
'power consumption electric power': '功率',
'power consumption electric current': '电流',
'power consumption electric voltage': '电压',
'power consumption voltage': '电压',
},

'ptc_bath_heater': {
Expand Down

0 comments on commit 0fe22b9

Please sign in to comment.