Giter Club home page Giter Club logo

Comments (12)

aholstenson avatar aholstenson commented on September 15, 2024

I don't think there should be any conflict since 0.1.12 of homebridge-aqara. I'm unable to test this as I'm not a Homebridge or iOS user.

You can probably filter out devices in homebridge-miio somehow as that library controls which devices it connects to and which ones it keeps being connected to. miio in itself only provides the communication with the devices and doesn't provide any names.

Does removing the homebridge-miio plugin help? If the Aqara-devices are still removed it might be an issue with homebridge-aqara.

from miio.

Gromina avatar Gromina commented on September 15, 2024

From my experience, only one developer API connection can be established at given moment. Probably both pieces of software conflict since they both use developer connection

from miio.

fxdpz avatar fxdpz commented on September 15, 2024

@aholstenson thx for response. my suspicion cames from debug log. when i turn on debug, i found that miio library connect to gateway every five minutes. debug log is as followed:
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795 DEV <- {"cmd":"iam","port":"9898","sid":"286c077773d6","model":
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795 DEV -> {"cmd":"get_id_list"}
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795 DEV <- {"cmd":"get_id_list_ack","sid":"286c078883d6","token":"m
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795 DEV -> {"cmd":"read","sid":"286c078883d6"}
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795 DEV -> {"cmd":"read","sid":"158d00015618e0"}
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795 DEV -> {"cmd":"read","sid":"158d00015ae3d2"}
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795 DEV -> {"cmd":"read","sid":"158d00014cf5bf"}
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795 DEV <- {"cmd":"read_ack","model":"gateway","sid":"286c078883d6"
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795 DEV <- {"cmd":"read_ack","model":"sensor_ht","sid":"158d0001561
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795.158d00015618e0 Property temperature changed from undefined to 2
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795.158d00015618e0 Property humidity changed from undefined to 30.7
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795 DEV <- {"cmd":"read_ack","model":"motion","sid":"158d00015ae3d2
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795.158d00015ae3d2 Property voltage changed from undefined to 3035
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795 DEV <- {"cmd":"read_ack","model":"ctrl_neutral1","sid":"158d000
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795.158d00014cf5bf Property channel_0 changed from undefined to fal
May 08 04:04:11 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:11 GMT miio.device.52232795.158d00014cf5bf Property power changed from undefined to [ false
May 08 04:04:13 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:13 GMT miio.packet -> <Buffer 21 31 00 60 00 00 00 00 03 49 bd df 00 14 b8 13 5c 26 6b 6a 6
May 08 04:04:13 rpb1 homebridge[1509]: Sun, 07 May 2017 20:04:13 GMT miio.device.55164383 -> (3) {"id":2426,"method":"get_prop","params":["power"]}

about message repeated every about five minutes.

i comment out some line in file models.js and the device didn't go off:

/usr/local/lib/node_modules/homebridge-miio/node_modules/miio/lib/models.js

//const Gateway = require('./devices/gateway');
//'lumi.gateway.v2': Gateway,
//'lumi.gateway.v3': Gateway,

after one night, the sensor and the siwtch remains.

from miio.

aholstenson avatar aholstenson commented on September 15, 2024

Thanks for debug log! There are two issues here I think:

  1. That homebridge-miio connects to the gateway that often. Maybe @Bluebie has any ideas about what's happening there?

  2. That several instances can't talk with the gateway at the same time. I'll look into this and see what goes wrong with the local developer connection and if there is any way of having several instances talk to the API at the same time.

from miio.

fxdpz avatar fxdpz commented on September 15, 2024

Thx for response. after two nights, the devices didn't disappear from home app. maybe the problem is as @Gromina said that only one developer API connection can be established at given moment, and at a given point homebridge-aqara thinks that the devices is offline.

since miio library supports zigbee devices, it'll be great that if @Bluebie's homebridge-miio can support zigbee devices, and one plugin will cover all xiaomi devices.

from miio.

aholstenson avatar aholstenson commented on September 15, 2024

Good to hear! I'm currently looking at an alternative way to get the devices from the gateway so that I can avoid using most of the developer API.

For now I've found a call that will list the devices, but some more work is needed to figure out how to map those devices to proper implementations. Hoping to have something for testing soon though.

from miio.

fxdpz avatar fxdpz commented on September 15, 2024

since i have found the solution for the problem, i'll close the issue.
thx @aholstenson @Gromina.

from miio.

sangkooki avatar sangkooki commented on September 15, 2024

@fxdpz

What's your solution?

I'm wondering. I've been same problem.

from miio.

aholstenson avatar aholstenson commented on September 15, 2024

@sankooki I think @fxdpz removed a few lines from homebridge-miio/node_modules/miio/lib/models.js to disable the special handling of gateways in miio. Those lines are should be the ones starting with lumi.gateway.

If you are still having issues you should probably open an issue in the homebridge-miio repository so that it can be updated to avoid connecting to the gateway.

from miio.

aholstenson avatar aholstenson commented on September 15, 2024

I'm opening a new issue to track a new way to implement support for the Smart Home Gateway that should solve this issue in time. Please have a look at and follow #26 if you are interested in helping with that.

from miio.

fxdpz avatar fxdpz commented on September 15, 2024

@sankooki , what i did is as @aholstenson said.

from miio.

sangkooki avatar sangkooki commented on September 15, 2024

@aholstenson @fxdpz Thanks.

from miio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.