I am also looking for a solution to get data from the plug. I tried to decompile the official application and look for a way to get this kind of data. If there is a possibility to get data using GET or POST request, then it is not used in the official application. Instead, the power data are collected by the provisioning server where the plug sends data in regular periods. How to setup the plug to own provisioning server is very nicely described in the article.
There is no need to use hostname, you can provide ip address of your rendezvous server.
The plug connects to the ntp server and synchronizes the time. At this point I have no idea what would happen if the plug did not have access to the internet.
If does have acces, every hour on the hour (eg 8:00, 9:00 ), plug sends the overall consumption data to the provisioning server. Actual power draw and partial consumption (past hour) is provided on request. Actual power consumption is provided on every single request, partial consuption data are availible each circa 5 minutes and more frequent request are rejected.
response for actual power draw
{"resp_code":0,"data":{"power":84.481}}'
response for partial consumption
{"energy":["1666809547,2370,0.060,2315,2","1666809547,2370,0.060,2315,3"]}'
response for partial consumption on the request in the first minutes on the hour (eq 8:05, 9:05) - also contains data from the previous hour
{"energy":["1666735585,362,0.000,0,2","1666735585,4048,0.010,1109,3"]}'
overall consumption data - no request
{"ver":3,"energy":["1666810806,203902,1.920,129354,0"]}
I haven’t completely decoded these energy data frames yet because they are slightly different from time to time but i believe:
1666809547
epoch time
2370
time in seconds for which energy consuption is counted
0.060
energy consumed in kwh
2315
time in seconds for which power was actualy drowned
2
I don’t understand the meaning yet
I extended the code from lui_gough by adding reading and requesting of energy data (POC only), to capturing data for afterward “decoding”. Download from here
I am familiarizing myself with the development of integration for Home Assistant which is my main aim. I’ve just started work on the integration, so far nothing to share.