Open robert777robert777 opened 4 years ago
Hello @robert777robert777
I'm able to get device information, here is my code:
const connection = new ewelink({
email: 'email',
password: 'password',
});
await connection.getCredentials();
const socket = await connection.openWebSocket(async data => {
console.log(data);
});
and this is the result:
{
action: 'update',
deviceid: 'DEVICE ID',
apikey: 'API KEY',
userAgent: 'device',
ts: 0,
params: { power: '0.00', voltage: '230.52', current: '0.00' },
from: 'device'
}
My POW2 model is PSC-B67-GL
I've tried the same code, my model is the same, firmware version is 3.4.0 but i get similar results only if during the last minute i did 1 of the following:
My device is on version 3.3.1
Will try to update to 3.4.0 and test again ...
Hey @robert777robert777
I've upgraded my POW2 to version 3.4.0 and was my previous code still works.
Hi,
I send
{"uiActive":60}
Over the websocket every 60 min with a crib.
The data is now non stop.
@Foulek57, I also want to encourage the sonoffPow to update. I have the websocket open but get nothing unless i open the app. I cannot find out how to send this {"uiActive":60} with a crib. over the websocket. So how exactly do i do that?
Hi @robert777robert777 If i understand it correctly you found a way to get up-to-date data from the sonoffPow from inside your lan. For me that is good enough. Would you be so kind to explain more in detail how you solved it.
works both by retransmitting the same encrypted packet, as well as by creating the request with known methods
How can i retransmit the encrypted package and / or create the request. T.i.a
It works only for few seconds, then just responds 'pong'. If I start ewelink app on phone again then is starts to spit data again, and after closing app after minute or so again no data...
Trying to pull data to influxdb from this devices is pain in the ass...
Did anyone solve that problem? I know that Tuyapi has a refresh method to force devices to send the data.
Yes - I switched to Tasmota firmware in Sonoff devices to not use ewelink ever again.
Hi, any updates about this issue?
Hi @foulek57
Can you give me an example of how to send the {"uiActive":60}??
I have the same problem. Does anyone have the solution?
Sonoff POW R2 sensor data not updating. Connecting a websocket gives no results for this model (TH does send updates). The data obtained from getDevice also contains not up to date data (requesting again after the current changes sends again the old data).
This data DOES get updated only while the ewelink app is open. By packetsniffing i've found that on LAN the app sends requests to
http://device_ip:8081/zeroconf/monitor
with an encrypted request. The decrypted contents of the request are :{"uiActive":60}
Retransmitting the same request every 60 seconds does help the sensor data flowing (works both by retransmitting the same encrypted packet, as well as by creating the request with known methods).But if my server (for logging sensor data) isn't in the same lan my way doesn't work (So i try to use the websocket). I've tried to send the same {"uiActive":60} request with action:"update" to the websocket, but it doesn't help (there should be a way since the ewelink app does it even without LAN)