Smart WiFi meter data
See original GitHub issueHello,
I’m trying to retrieve the data from a Smart WiFi meter and switch. I’ve successfully connected to the device using TuyAPI, but I don’t get to understand the data I’m getting.
Using a simple script based in the asynchronous one in README.md, I get the following information:
Connected to device!
Data from device: { dps: { '1': 5407, '10': 0, '16': true, '18': '111111111111' } }
Data from device: { dps: { '1': 5408 }, t: 1613651565 }
Data from device: { dps: { '6': 'CNEAJ5AACOw=' }, t: 1613651573 }
Data from device: { dps: { '1': 5409 }, t: 1613651581 }
Data from device: { dps: { '6': 'CM8AJ3YACOQ=' }, t: 1613651588 }
Data from device: { dps: { '1': 5410 }, t: 1613651597 }
Disconnected from device.
Data from dps
1 (absolute current consumption), 10, 16 and 18 is irrelevant. I’m guessing that the string in dps[6]
contains the rest of the data I was expecting (current, active power and voltage), but I’m not sure. I’ve tried to decode it using the data shown in the app (decoding each string to binary and then grouping to see if I could find the numbers), but this has been unhelpful. Also, I’m not sure if there are any other dps
not being shown (2, 3, 4, 5, 7, 8, 9…).
I also haven’t found any specific information about the device online.
Any suggestions?
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (8 by maintainers)
I was copying the code for the examples but you were right, there is no change depending on the source character set. I was confused because of that website.
Thank you.
FYI, the current function that I am using is this one:
For the string,
COEAA8MAAMo=
, the result is00001000 11100001 00000000 00000011 11000011 00000000 00000000 11001010
, just as you said.Hi @Chanete. I’m using the API with the example in the README.md file. As you see in the first comment, sometimes I get a
data
event with the data you mention, and then the device sends the data that is useful for me.@codetheweb, maybe this should be moved to a different/new issue?