aholstenson / miio

Control Mi Home devices, such as Mi Robot Vacuums, Mi Air Purifiers, Mi Smart Home Gateway (Aqara) and more
MIT License
1.87k stars 354 forks source link

Error connecting to device: Error: Call to device timed out #327

Open klosto opened 9 months ago

klosto commented 9 months ago

Hello, I am new in miio and I am trying to connect to my Xiaomi yeelight lightstrip v2 (Model: yeelink.light.strip2). But while connecting node returns me error code: 'timeout'.

My code:

const miio = require('miio');

miio.device({ address: "192.168.0.31", token: "d7ec9e44d59e7808b22a3334be864e0f" })
    .then(device => {
        console.log('Connected to device:');
        console.log(device);
        // You can now interact with the device
    })
    .catch(err => {
        console.error('Error connecting to device:', err);
    });