ewelink-api
ewelink-api copied to clipboard
Get Voltage and current on POWR2 device
There is no method to get device wattage, Voltage and current.
const connection = new ewelink({
email: '',
password: '',
region: '',
});
const device = await connection.getDevice(deviceId);
if (device.online) {
console.log(`Power: ${device.params.power}W, Voltage: ${device.params.voltage}V, Current: ${device.params.current}A`)
}
You also need to "activate" the measurement by either
- open the Ewelink app and open the device page or
- send
{uiActive: 60}
message to Websocket connection once in a while - example here https://github.com/baugp/ewelink-api/commit/411e4031e9b17126b85a878a0bf48e72dad03de5 - just use my fork, it comes with this method
refreshDevice
npm uninstall ewelink-api
npm install https://github.com/baugp/ewelink-api
const status = await connection.refreshDevice(deviceId, 60);
Hi @baugp
Installing your fork npm install https://github.com/baugp/ewelink-api
would enable me to retrieve Power, Voltage & Current from POW ELITE? Or it requires other modifications as well?
Thank you.