Get Voltage and current on POWR2 device
nowsmart opened this issue · 2 comments
nowsmart commented
There is no method to get device wattage, Voltage and current.
baugp commented
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 baugp@411e403 - 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);