Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Get Voltage and current on POWR2 device #218

Open
nowsmart opened this issue Jul 2, 2023 · 2 comments
Open

Get Voltage and current on POWR2 device #218

nowsmart opened this issue Jul 2, 2023 · 2 comments

Comments

@nowsmart
Copy link

nowsmart commented Jul 2, 2023

There is no method to get device wattage, Voltage and current.

@baugp
Copy link

baugp commented Sep 13, 2023

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);

@tech9492
Copy link

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants