Replies: 1 comment
-
The energy reading from this integration is what the device is currently reporting. The Tuya cloud accumulates readings, and displays them in per day/week/month readings rather than showing the current device reading. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Reading from mobile app the energy is 16.06 KWh
From home assistant the energy is 31Wh
Not to mention the unit, the values are discrepancy
I used tuya api explorer to get the device spec.Get the specifications and properties of the device
{
"result": {
"category": "cz",
"functions": [
{
"code": "switch_1",
"desc": "{}",
"name": "开关1",
"type": "Boolean",
"values": "{}"
},
{
"code": "countdown_1",
"desc": "{"unit":"s","min":0,"max":86400,"scale":0,"step":1}",
"name": "开关1倒计时",
"type": "Integer",
"values": "{"unit":"s","min":0,"max":86400,"scale":0,"step":1}"
},
{
"code": "relay_status",
"desc": "{"range":["power_off","power_on","last"]}",
"name": "上电状态",
"type": "Enum",
"values": "{"range":["power_off","power_on","last"]}"
},
{
"code": "overcharge_switch",
"desc": "{}",
"name": "过充保护",
"type": "Boolean",
"values": "{}"
},
{
"code": "light_mode",
"desc": "{"range":["relay","pos","none"]}",
"name": "指示灯状态设置",
"type": "Enum",
"values": "{"range":["relay","pos","none"]}"
},
{
"code": "child_lock",
"desc": "{}",
"name": "童锁",
"type": "Boolean",
"values": "{}"
},
{
"code": "cycle_time",
"desc": "{}",
"name": "循环定时",
"type": "String",
"values": "{}"
},
{
"code": "random_time",
"desc": "{}",
"name": "随机定时",
"type": "String",
"values": "{}"
},
{
"code": "switch_inching",
"desc": "{}",
"name": "点动开关",
"type": "String",
"values": "{}"
}
],
"status": [
{
"code": "switch_1",
"name": "开关1",
"type": "Boolean",
"values": "{}"
},
{
"code": "countdown_1",
"name": "开关1倒计时",
"type": "Integer",
"values": "{"unit":"s","min":0,"max":86400,"scale":0,"step":1}"
},
{
"code": "add_ele",
"name": "增加电量",
"type": "Integer",
"values": "{"min":0,"max":50000,"scale":3,"step":100}"
},
{
"code": "cur_current",
"name": "当前电流",
"type": "Integer",
"values": "{"unit":"mA","min":0,"max":30000,"scale":0,"step":1}"
},
{
"code": "cur_power",
"name": "当前功率",
"type": "Integer",
"values": "{"unit":"W","min":0,"max":80000,"scale":1,"step":1}"
},
{
"code": "cur_voltage",
"name": "当前电压",
"type": "Integer",
"values": "{"unit":"V","min":0,"max":5000,"scale":1,"step":1}"
},
{
"code": "relay_status",
"name": "上电状态",
"type": "Enum",
"values": "{"range":["power_off","power_on","last"]}"
},
{
"code": "overcharge_switch",
"name": "过充保护",
"type": "Boolean",
"values": "{}"
},
{
"code": "light_mode",
"name": "指示灯状态设置",
"type": "Enum",
"values": "{"range":["relay","pos","none"]}"
},
{
"code": "child_lock",
"name": "童锁",
"type": "Boolean",
"values": "{}"
},
{
"code": "cycle_time",
"name": "循环定时",
"type": "String",
"values": "{}"
},
{
"code": "random_time",
"name": "随机定时",
"type": "String",
"values": "{}"
},
{
"code": "switch_inching",
"name": "点动开关",
"type": "String",
"values": "{}"
}
]
},
"success": true,
"t": 1681948038203,
"tid": "84f53f48df0c11edb4eaa23a6b3c3ad9"
}
Then, get the device status
Get the status of a single device
{
"result": [
{
"code": "switch_1",
"value": false
},
{
"code": "countdown_1",
"value": 0
},
{
"code": "add_ele",
"value": 31
},
{
"code": "cur_current",
"value": 0
},
{
"code": "cur_power",
"value": 0
},
{
"code": "cur_voltage",
"value": 2224
},
{
"code": "relay_status",
"value": "last"
},
{
"code": "overcharge_switch",
"value": false
},
{
"code": "light_mode",
"value": "relay"
},
{
"code": "child_lock",
"value": false
},
{
"code": "cycle_time",
"value": ""
},
{
"code": "random_time",
"value": ""
},
{
"code": "switch_inching",
"value": ""
}
],
"success": true,
"t": 1681949664674,
"tid": "4e64a644df1011ed9cb6ce3e721b5b55"
}
The energy value in home assistant retrieved from the attribute "add_ele"
The energy value 16.05 KWh in mobile app should correct.
Beta Was this translation helpful? Give feedback.
All reactions