bwp91 / homebridge-ewelink

Homebridge plugin to integrate eWeLink devices into HomeKit.
MIT License
384 stars 127 forks source link

SmartWise RF Bridge Pro shows first remote only #165

Closed drummingdemon closed 3 years ago

drummingdemon commented 3 years ago

What issue do you have? Please be as thorough and explicit as possible.

I have set up two 3-button remote controllers in the eWeLink app for the device. The first remote contoller (room2) is properly synced and can be used without a problem in the Home app through Homebridge. However, the second remote controller (room1) does not sync. I can use it in the eWeLink app without a problem.

Turning on debug mode shows the logs below.

Details of your setup.

Please paste any relevant logs below.

[15/12/2020, 18:18:00] [eWeLink] Sending HTTP login() request. This text is yellow for clarity.
{
  "countryCode": "+36",
  "password": "**hidden**",
  "email": "**hidden**"
}
[15/12/2020, 18:18:01] [eWeLink] Web socket host received [eu-pconnect1.coolkit.cc].
[15/12/2020, 18:18:02] [eWeLink] Sending WS login request. This text is yellow for clarity.
{
  "action": "userOnline",
  "apikey": "**hidden**",
  "appid": "oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq",
  "at": "**hidden**",
  "nonce": "9pcmu1sj",
  "sequence": "1608052682527",
  "ts": 1608052682,
  "userAgent": "app",
  "version": 8
}
[15/12/2020, 18:18:05] [eWeLink] [1] eWeLink devices loaded from the Homebridge cache.
[15/12/2020, 18:18:05] [eWeLink] [1] primary devices loaded from your eWeLink account.
[15/12/2020, 18:18:05] [eWeLink]  → [room2] was removed from Homebridge.
[15/12/2020, 18:18:05] [eWeLink]  → [room2] has been added to Homebridge.
[15/12/2020, 18:18:05] [eWeLink]  → [Devicee758ee] could not be initialised as TypeError: Cannot read property 'name' of undefined
    at eWeLinkPlatform.addAccessory (/usr/lib/node_modules/homebridge-ewelink/lib/index.js:577:84)
    at /usr/lib/node_modules/homebridge-ewelink/lib/index.js:464:20
    at Array.forEach (<anonymous>)
    at eWeLinkPlatform.initialiseDevice (/usr/lib/node_modules/homebridge-ewelink/lib/index.js:429:15)
    at /usr/lib/node_modules/homebridge-ewelink/lib/index.js:103:47
    at Map.forEach (<anonymous>)
    at eWeLinkPlatform.eWeLinkSetup (/usr/lib/node_modules/homebridge-ewelink/lib/index.js:103:24)
    at processTicksAndRejections (internal/process/task_queues.js:93:5).
[15/12/2020, 18:18:05] [eWeLink] eWeLink sync complete. Don't forget to ⭐️  this plugin on GitHub if you're finding it useful!
bwp91 commented 3 years ago

Hi, I’ll have a look into this as this brand of RF bridge might “behave” slightly differently to the standard Sonoff RF bridge. Will get back to you

bwp91 commented 3 years ago

@drummingdemon would you be able to update to a beta version v3.18.1-1? You can do this through homebridge-config-ui. It should fix the error you receive, but there may be a couple more things I need to look into. Let me know how you get on. Thanks

drummingdemon commented 3 years ago

Awesome, thanks for the quick reply - it seems to have done the trick! I'm not sure if the local IP gets used to send the commands - I assume due to the unknown nature of the device, the WS is used to actually send the commands, right?

Also, I dug a little deeper and have found that SmartWise is essentially a rebrand of EACHEN, so this device is also known as EACHEN RF Bridge Pro

Running nmap gives:

Nmap scan report for 192.168.1.92
Host is up (1.8s latency).
Not shown: 999 closed ports
PORT     STATE SERVICE
8081/tcp open  blackice-icecap

Nmap done: 1 IP address (1 host up) scanned in 1183.90 seconds

Here's the debug log after the update:

[16/12/2020, 10:55:27] [eWeLink] Plugin [v3.18.1-1] initialised. Syncing with eWeLink...
[16/12/2020, 10:55:28] [eWeLink] Sending HTTP getHost() request. This text is yellow for clarity.
{
  "appid": "oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq",
  "country_code": "+36",
  "nonce": "jkxme1jp",
  "ts": 1608112528,
  "version": 8
}
Setup Payload:
X-HM://0024JB71MM7O0
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:                   
[16/12/2020, 10:55:28] Homebridge is running on port 51006.
[16/12/2020, 10:55:30] [eWeLink] HTTP API host received [eu-apia.coolkit.cc].
[16/12/2020, 10:55:30] [eWeLink] Sending HTTP login() request. This text is yellow for clarity.
{
  "countryCode": "+36",
  "password": "**hidden**",
  "email": "**hidden**"
}
[16/12/2020, 10:55:31] [eWeLink] Web socket host received [eu-pconnect3.coolkit.cc].
[16/12/2020, 10:55:43] [eWeLink] Sending WS login request. This text is yellow for clarity.
{
  "action": "userOnline",
  "apikey": "**hidden**",
  "appid": "oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq",
  "at": "**hidden**",
  "nonce": "lia1bte3",
  "sequence": "1608112543069",
  "ts": 1608112543,
  "userAgent": "app",
  "version": 8
}
[16/12/2020, 10:55:45] [eWeLink] [2] eWeLink devices loaded from the Homebridge cache.
[16/12/2020, 10:55:45] [eWeLink] [1] primary devices loaded from your eWeLink account.
[16/12/2020, 10:55:45] [eWeLink]  → [room2] was removed from Homebridge.
[16/12/2020, 10:55:45] [eWeLink]  → [room2] has been added to Homebridge.
[16/12/2020, 10:55:46] [eWeLink]  → [My Remote] was removed from Homebridge.
[16/12/2020, 10:55:46] [eWeLink]  → [My Remote] has been added to Homebridge.
[16/12/2020, 10:55:46] [eWeLink]  → [Devicee758ee] has an unsupported device type [5].
[16/12/2020, 10:55:46] [eWeLink]  → [Devicee758ee] has been added to Homebridge.
[16/12/2020, 10:55:46] [eWeLink]  → [Devicee758ee] initialised and found locally with IP [192.168.1.92].
[16/12/2020, 10:55:46] [eWeLink] eWeLink sync complete. Don't forget to ⭐️  this plugin on GitHub if you're finding it useful
bwp91 commented 3 years ago

the WS is used to actually send the commands, right?

Yes this is correct. There are a few devices (including the RF bridge) that I believe support LAN mode, but impossible for me to implement since I don't own the devices. I would need to physically have one connected to my own local network to be able to see how it works. So for these devices any requests are automatically reverted to the web socket.

I noticed a line in your log:

[16/12/2020, 10:55:46] [eWeLink]  → [Devicee758ee] has an unsupported device type [5].

How many subdevices do you have linked to your RF bridge? I can't remember what this device type 5 relates to, but I remember it being a certain remote type I haven't implemented yet

drummingdemon commented 3 years ago

I'm happy to tinker with it a bit if that helps - to the best of my knowledge this is a common port for MQTT, so let me know if I can be of any assistance.

The reason I bought it is to have it paired with two shutters - which it thankfully does perfectly. When adding a remote, there are six options in the eWeLink app as of writing:

The shutters I have use an up/stop/down remote and as far as I can tell, the Curtain type provides a similar layout (on/stop/off) - although I'm not really sure how well this would translate to the Home.app through Homebridge. I'm suspecting the unsupported device type must have been this Curtain remote as the *-button types get through fine - so for the time being I'll be using those.

bwp91 commented 3 years ago

Ah yes, 1-4 buttons and alarm are supported, curtain is the only one i haven’t gotten round to yet. Could you send me a screenshot of what the ewelink app ui looks like for the curtain?

drummingdemon commented 3 years ago

Sure, here it is:

image

bwp91 commented 3 years ago

Could I message you on my discord? https://discord.gg/cMGhNtZ3tW

github-actions[bot] commented 3 years ago

This issue has been marked as complete as I believe the original query has been fixed/answered or will not be actioned. The issue will be closed in three days. If you feel the issue requires further attention then please let me know. Thanks!

Log | Bot Usage
no-response[bot] commented 3 years ago

This issue has been automatically closed as it was marked as complete and has had no further responses within three days. If you are still experiencing problems related to the original issue then please reply to this message and the issue will be reopened if necessary. Thank you.