Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Cannot turn on P110 from different network #46

Open
tomasj opened this issue Jul 27, 2024 · 2 comments
Open

Cannot turn on P110 from different network #46

tomasj opened this issue Jul 27, 2024 · 2 comments

Comments

@tomasj
Copy link

tomasj commented Jul 27, 2024

My code is following, and works ok as long, as it gets executed from the same network as the P110 is connected to.

// get the device - works ok regardless the network
const cloudApi = await cloudLogin(TAPO_USERNAME, TAPO_PASSWORD);
const devicesByType = await cloudApi.listDevicesByType('SMART.TAPOPLUG');
const deviceTarget = devicesByType.filter(device => device.deviceMac === TAPO_DEVICE_MAC)[0];
const device = await loginDevice(TAPO_USERNAME, .TAPO_PASSWORD, deviceTarget);

// turn on the power socket - fails when executed outside device's network
await device.turnOn();

The error is: TypeError: Cannot read properties of undefined (reading 'status').

The same error is returned when I call await device.getDeviceInfo();.

Can I do something in my code to fix that? Or the lib is intended to be used in the same network as the device?

@dickydoouk
Copy link
Owner

Hi @tomasj unfortunately the library only works on the same network at the moment. However the official Tapo app does turn on/off devices remotely however I'm not sure how that works or is passed through the cloud API. It is something I'd like to get working though.

@roland-vachter
Copy link

I would be very much interested in controlling devices remotely as well, are there any updates on this?

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

No branches or pull requests

3 participants