homebridge-mi-aqara icon indicating copy to clipboard operation
homebridge-mi-aqara copied to clipboard

Who can help me?

Open flipmoo opened this issue 5 years ago • 113 comments

I want wo connect my gateway, doorsensors and motion sensors to homekit. I think i managed to connect my gateway to homebridge. But can't see it in my home kit. And don't even get close in to connecting the sensors.

Hope there is someone who can assist me.

Thanks!

flipmoo avatar Nov 03 '18 08:11 flipmoo

I got it (almost working) Gateway is connected, en sensors give a signal as well. In homebridge terminal they all react. But i can;t see them in homekit! Any idea what i;m doing wrong?

Terminal now (for example says: [2018-11-3 20:48:39] [MiAqaraPlatform] [DEBUG][Revc]{"cmd":"report","model":"gateway","sid":"7c49exxxxxx","short_id":0,"data":"{"rgb":0,"illumination":374}"}

This happen after i change the bulb in teh gateway via the mihome app.

flipmoo avatar Nov 03 '18 19:11 flipmoo

Hey Flipmoo -

Can you let me know what you did to get it recognised by Homekit? I too can connect it (I think) to Homebridge) but just can't get it to be recognised by HK...

Looks like you're having more success!

iainsimons avatar Nov 04 '18 14:11 iainsimons

Hi, I got it working. In the end used capitals in the gateway macadres. Changed it and it worked!

flipmoo avatar Nov 06 '18 09:11 flipmoo

Hmmmm I still can't get that to work :( You're still stripping out the colons though?

I have...

 "platforms": [
        {
            "platform": "MiAqaraPlatform",
            "Gateways": {
                "7C49EB18CA32": {
                    "password": "qjcsgkjvc4i7q0hh",
                    "ip": "192.168.1.63"
                }
            }
        }
    ]

iainsimons avatar Nov 09 '18 18:11 iainsimons

What if you try this:

"platforms": [ { "platform": "MiAqaraPlatform", "bindAddress": "192.168.1.63" "Gateways": { "7c49eb18ca41": "QJCSGKJVC4I7Q0HH", } } ]

On Fri, Nov 9, 2018 at 7:01 PM Iain Simons [email protected] wrote:

Hmmmm I still can't get that to work :( You're still stripping out the colons though?

I have...

"platforms": [ { "platform": "MiAqaraPlatform", "Gateways": { "7C49EB18CA41": { "password": "qjcsgkjvc4i7q0hh", "ip": "192.168.1.63" } } } ]

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/YinHangCode/homebridge-mi-aqara/issues/241#issuecomment-437443272, or mute the thread https://github.com/notifications/unsubscribe-auth/AI7u-8QIc5k0Emuh-W-Ua4JZ7QUwmWNzks5utcL5gaJpZM4YMsp3 .

flipmoo avatar Nov 11 '18 15:11 flipmoo

Trying this :

"platforms": [
      {
          "platform": "MiAqaraPlatform",
          "bindAddress": "192.168.1.63",
          "gateways": {
              "7c49eb18ca41": "QJCSGKJVC4I7Q0HH"
          }
      }
  ]

Gives valid JSON, but generates this set of errors :

Error: setMulticastInterface EADDRNOTAVAIL at Socket.setMulticastInterface (dgram.js:566:11) at Socket.serverAqaraLANProtocolSocket.on (/homebridge/node_modules/homebridge-mi-aqara/index.js:189:42) at Socket.emit (events.js:187:15) at startListening (dgram.js:128:10) at state.handle.lookup (dgram.js:249:7) at process._tickCallback (internal/process/next_tick.js:63:19) at Function.Module.runMain (internal/modules/cjs/loader.js:744:11) at startup (internal/bootstrap/node.js:285:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

iainsimons avatar Nov 11 '18 15:11 iainsimons

Actually, just to check...

Having added the platform here, as you have, should it be the case that sensors added within the mihome app should just appear in iOS 'home'? I don't have to add anything else to the config in order to make them visible?

The thought just crossed my mind that it might actually already be working!

iainsimons avatar Nov 11 '18 15:11 iainsimons

iainsimons have u solved? Same issue 😞

Salsalove avatar Nov 13 '18 08:11 Salsalove

bindAddress is write network gateway ip, it is network gateway! In general, it is the router's IP, such as 192.168.1.1, it is not device ip which is running homebridge, and is not xiaomi gateway ip. If multicast is not found xiaomi gateway, that's best to fill in xiaomi gateway ip in every xiaomi gateway config items.

YinHangCode avatar Nov 13 '18 15:11 YinHangCode

If i set the ruoter’s IP, homebridge give me this error

throw errnoException(err, 'setMulticastInterface'); ^

Error: setMulticastInterface EADDRNOTAVAIL at _errnoException (util.js:992:11) at Socket.setMulticastInterface (dgram.js:601:11) at Socket.serverAqaraLANProtocolSocket.on (/usr/local/lib/node_modules/homebridge-mi-aqara/index.js:189:42) at emitNone (events.js:111:20) at Socket.emit (events.js:208:7) at startListening (dgram.js:156:10) at _handle.lookup (dgram.js:273:7) at _combinedTickCallback (internal/process/next_tick.js:141:11) at process._tickCallback (internal/process/next_tick.js:180:9) at Function.Module.runMain (module.js:695:11) at startup (bootstrap_node.js:191:16) at bootstrap_node.js:612:3

Salsalove avatar Nov 13 '18 16:11 Salsalove

@Salsalove show me ur network ip and device ip.

ifconfig

YinHangCode avatar Nov 13 '18 16:11 YinHangCode

"platforms": [
	{
	"platform": "MiAqaraPlatform",
	"bindAddress": "192.168.1.254",
	"gateways": {
								"7c49eb18d46d": "FE63CF4F77184FB1",
								"ip": "192.168.1.101"

							}

Salsalove avatar Nov 13 '18 16:11 Salsalove

enter ifconfig, not config.

YinHangCode avatar Nov 13 '18 16:11 YinHangCode

ifconfig -aLast login: Thu Nov 8 18:16:13 on ttys001

iMac-di-Salsalove:~ Salsalove$ ifconfig -a lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP> inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 nd6 options=201<PERFORMNUD,DAD> gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280 stf0: flags=0<> mtu 1280 en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=27<RXCSUM,TXCSUM,VLAN_MTU,TSO4> ether 00:26:08:0c:87:2e nd6 options=201<PERFORMNUD,DAD> media: autoselect status: inactive en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ether 00:26:08:f6:d9:58 inet6 fe80::462:c840:8be8:2abb%en1 prefixlen 64 secured scopeid 0x5 inet 192.168.1.240 netmask 0xffffff00 broadcast 192.168.1.255 nd6 options=201<PERFORMNUD,DAD> media: autoselect status: active fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078 lladdr 00:26:08:ff:fe:0c:87:2e nd6 options=201<PERFORMNUD,DAD> media: autoselect status: inactive p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304 ether 02:26:08:f6:d9:58 media: autoselect status: inactive utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000 inet6 fe80::13b8:c12c:1e12:dfe6%utun0 prefixlen 64 scopeid 0x8 nd6 options=201<PERFORMNUD,DAD> iMac-di-Salsalove:~ Salsalove$

Salsalove avatar Nov 13 '18 16:11 Salsalove

Yeah, I am getting the same error as Salsalove...

So, the device that's running home bridge for me is 192.168.1.57

The gateway is : 192.168.1.63

and the router is 192.168.1.1

I'm not sure which IP should go where.... sorry!!

iainsimons avatar Nov 13 '18 16:11 iainsimons

@iainsimons i'm waiting @YinHangCode

Salsalove avatar Nov 13 '18 16:11 Salsalove

@iainsimons bindAddress use 192.168.1.1, gateways config item "gateway sid": { "ip": "here use 192.168.1.63"}

YinHangCode avatar Nov 13 '18 16:11 YinHangCode

@YinHangCode can u help me?

My config is { "platform": "MiAqaraPlatform", "bindAddress": "192.168.1.240", "gateways": { "7c49eb18d46d": "FE63CF4F77184FB1", "ip": "192.168.1.101" } },

img_1134

Salsalove avatar Nov 13 '18 16:11 Salsalove

@Salsalove I think your IP is wrong, with the help of ifconfig and route -u make sure ur network gateway ip.

YinHangCode avatar Nov 13 '18 16:11 YinHangCode

@YinHangCode like this?

{
    "bridge": {
        "name": "HomeBridge",
        "username": "CC:22:3D:E3:CE:37",
        "port": 51826,
        "pin": "031-45-154"
    },
    "accessories": [],
    "platforms": [
        {
            "platform": "MiAqaraPlatform",
            "bindAddress": "192.168.1.1",
            "gateways": {
                "7c49eb18ca41": "90964570DD174368",
                "ip": "192.168.1.63"
            }
        }
    ]
}

That is still throwing up the error :

Error: setMulticastInterface EADDRNOTAVAIL
    at Socket.setMulticastInterface (dgram.js:566:11)
    at Socket.serverAqaraLANProtocolSocket.on (/homebridge/node_modules/homebridge-mi-aqara/index.js:189:42)
    at Socket.emit (events.js:187:15)
    at startListening (dgram.js:128:10)
    at state.handle.lookup (dgram.js:249:7)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

Thank you so much for your help with this! I have been trying to fix for a few weeks..

iainsimons avatar Nov 13 '18 16:11 iainsimons

@Salsalove bindAddress填的是网络的网关ip,不是小米网关的ip,一般情况下就是你路由器的ip。gateways里面每个gateway的配置后面的ip,填的是小米网关的ip,对应前面网关的sid。

YinHangCode avatar Nov 13 '18 16:11 YinHangCode

@Salsalove I think your IP is wrong, with the help of ifconfig and route -u make sure ur network gateway ip.

@YinHangCode can u help me? i don't know how to use route -u...and what ip is wrong?

Salsalove avatar Nov 13 '18 16:11 Salsalove

@Salsalove bindAddress填的是网络的网关ip,不是小米网关的ip,一般情况下就是你路由器的ip。gateways里面每个gateway的配置后面的ip,填的是小米网关的ip,对应前面网关的sid。

i'm italian not chinese :)

Salsalove avatar Nov 13 '18 16:11 Salsalove

@iainsimons Maybe I remember it wrong. try bindAddress is 192.168.1.57

YinHangCode avatar Nov 13 '18 16:11 YinHangCode

@YinHangCode so that boots home bridge fine :

{ "bridge": { "name": "HomeBridge", "username": "CC:22:3D:E3:CE:37", "port": 51826, "pin": "031-45-154" }, "accessories": [], "platforms": [ { "platform": "MiAqaraPlatform", "bindAddress": "192.168.1.57", "gateways": { "7c49eb18ca41": "90964570DD174368", "ip": "192.168.1.63" }, "gateway sid": { "ip": "192.168.1.63" } } ] }

This is the output :


Loading 1 platforms...
[11/13/2018, 8:30:40 AM] [MiAqaraPlatform] Initializing MiAqaraPlatform platform...
[11/13/2018, 8:30:40 AM] [MiAqaraPlatform] [INFO]**************************************************************
[11/13/2018, 8:30:40 AM] [MiAqaraPlatform] [INFO]           MiAqaraPlatform v0.7.3 By YinHang
[11/13/2018, 8:30:40 AM] [MiAqaraPlatform] [INFO]  GitHub: https://github.com/YinHangCode/homebridge-mi-aqara
[11/13/2018, 8:30:40 AM] [MiAqaraPlatform] [INFO]                                         QQ Group: 107927710
[11/13/2018, 8:30:40 AM] [MiAqaraPlatform] [INFO]**************************************************************
[11/13/2018, 8:30:40 AM] [MiAqaraPlatform] [INFO]start success...
[11/13/2018, 8:30:40 AM] [MiAqaraPlatform] [INFO]config gateways: 7c49eb18ca41, ip
[11/13/2018, 8:30:40 AM] [MiAqaraPlatform] [INFO]bind address is: 192.168.1.57
[11/13/2018, 8:30:40 AM] Loading 0 accessories...
Setup Payload:
X-HM://0023ISYWY3597
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:

Should it now be the case that the sensors should be revealed on iOS home? All I can see the is the homebridge bridge...

iainsimons avatar Nov 13 '18 16:11 iainsimons

@Salsalove Well, I see that chinese in your screenshot, and I think you are Chinese. You try to fill in the IP of the device which is running homebridge. Maybe I remember it wrong.

YinHangCode avatar Nov 13 '18 16:11 YinHangCode

Well, I see that chinese in your screenshot, and I think you are Chinese. You try to fill in the IP of the device which is running homebridge. Maybe I remember it wrong.

in bindAndress or "ip" gateways

Salsalove avatar Nov 13 '18 16:11 Salsalove

@iainsimons not right, as follows:

"gateways": {
    "7c49eb18ca41": {
        "password": "90964570DD174368",
        "ip": "192.168.1.63"
    }
}

and add -D to run command:

homebridge -D

YinHangCode avatar Nov 13 '18 16:11 YinHangCode

@iainsimons have you tried to use small characters for MAC Address?

Salsalove avatar Nov 13 '18 16:11 Salsalove

@Salsalove bindAddress

YinHangCode avatar Nov 13 '18 16:11 YinHangCode