Git Product home page Git Product logo

homebridge-ewelink's Introduction

Hey 👋

For more information about me, please visit my sponsor page.

homebridge-ewelink's People

Contributors

bwp91 avatar dependabot[bot] avatar fabianoflnsp avatar gbro115 avatar levibuzolic avatar ronnieroberts avatar tomzt avatar vadimpronin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-ewelink's Issues

Change Type "Switch" to Door? Siri only responds to "Turn on Garage"

Hey all,

Thanks so much for this plugin, it works so much faster and better than running a request through IFTTT.

I have a Noulins NLWF01-RF WiFi Smart Switch, similar to this: https://www.chinahao.com/product/552905262828/

It doesn't save if it's state is on or off - it simply triggers the garage through a voltage, this is a limitation of my garage itself as it doesn't send the state of the door. This isn't so much an issue (but if there is a way to gather this info, that'd be awesome).

I would like to trigger this switch using Siri but with more natural language like "open the garage", rather than "turn on the garage" which it is set to at the moment.

On HomeKit, this particular accessory is set to a Switch.
It only gives me the options: Light, Switch or Fan when clicking on the settings of this particular accessory - is there a way to define that it's a door?

Thanks!

Charles App Auth Token not Displayed

Hi gbro115,
Can you give us a full walkthrough through de Charles App, and iPhone Config.
I Tried it for about 10 Times, with different Configs, but de Auth Token is not shown up in Charles.

Thx a lot if you do so

Here are my Screenshots:
bildschirmfoto 2018-03-18 um 22 15 15
bildschirmfoto 2018-03-18 um 22 15 07
bildschirmfoto 1
bildschirmfoto 2

EweLink Homebridge error

Hello,
I just installed ewelink homebridge plugin but I keep getting the error "the requested platform " + name +" was not registered by any plugin".
Jsonconfig says its ok, with no errors but the homebridge just stops.
I already tried to reinstall everything but keep getting same error.
Thank you

No response in Home-app, can read status however

So I installed the plugin and trying to make it work...however, no response in the Home-app.
Peculiar, however, is the fact that I can see the status (on/off). Can anyone help me out by also making the switch work in the Home-app? It now only works in the eWelink app.

Now i read the solved topic on the 2-gang switch where @aremishevsky made it work by adding case 'model' to line 350 of index.js, however, that was four months ago and things changed...does anyone have an idea how to fix this in the current index.js file?

I also changed the index.js file to the one @MrTomAsh wrote, however, the same problem still occurs.
When I change status (on/off) in eWelink the Home app can see the stataus but still says no response...I am not able to use the switch.

I hope there is anyone who can help me out or is having the same struggle so we can elaborate on this. I'm not an experienced programmer and, therefore, do not want to fiddle in the files myself.

Need to stablish connection with EWeLink before on/off commands?

It works nicely to me in general (thanks!). Only thing is that the first time I action it after a while (or on off) it does not work. Then the second it works and keeps working nicely during that “season”. It’s like if the first “click” were just to connect to the device.

3 Gang Switch only showing as one switch

Hi there. I recently got a 3 gang Sonoff touch switch and it is only showing as one switch and will not control anything once configured with Homebridge/homekit

An error was encountered while requesting a list of devices. Response was [{"error":402}]

Can someone help me, when i start homebridge it fails to request list of devices.

[2018-4-23 16:11:52] [eWeLink] A total of [0] accessories were loaded from the local cache
[2018-4-23 16:11:52] [eWeLink] Requesting a list of devices from eWeLink HTTPS API at [https://eu-api.coolkit.cc:8080]
[2018-4-23 16:11:52] Homebridge is running on port 51826.
[2018-4-23 16:11:53] [eWeLink] An error was encountered while requesting a list of devices. Response was [{"error":402}]

this is my config

{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "111-11-111"
},

"description": "boom",

"accessories": [
    
],

"platforms": [
    {
    "platform" : "eWeLink",
    "name" : "eWeLink",
    "authenticationToken" : "xxxxxxxx",
    "apiHost" : "eu-api.coolkit.cc:8080",
    "webSocketApi" : "eu-long.coolkit.cc"
    }
]

}

Support for 3 gang switch

Hi guys,

I've recently picked up three gang switches and was wondering if these can be supported also.

Currently, the switches are showing up as 2 gang (with one missing.

Here is some information displayed within HomeKit:

  • Manufacturer: T1 3C
  • Model: PSF-B04-GL (seems to be the same model as the 2 gang?)
  • Firmware: 2.0.1

Hoping someone could help with this please!

Thanks
Kevin

Cant figure out webSocketAPI

I cant seem to find my websocket api so i can only see the status of my lights not actually control them..

WebSocketClient: reconnecting... WebSocketClient: error { '0': Error: unexpected server response (200) at ClientRequest._req.on (/usr/local/lib/node_modules/homebridge-ewelink/node_modules/ws/lib/WebSocket.js:653:21) at emitOne (events.js:116:13) at ClientRequest.emit (events.js:211:7) at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:551:21) at HTTPParser.parserOnHeadersComplete (_http_common.js:117:23) at TLSSocket.socketOnData (_http_client.js:440:20) at emitOne (events.js:116:13) at TLSSocket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) } WebSocketClient: retry in 5000ms 1006 [2018-8-31 17:38:50] [eWeLink] WebSocket was closed. Reason [1006]

Devices are looping on and off after activating

Anybody else have problems with their devices looping through on and off? I've had it for the last week now. reinstalled but can't get to the bottom of it. it's definitely something to with homebridge-ewelink and is triggered by a turning the device on. Doesn't happen immediately. starts happing after about 10 minutes of launching homebridge.

Logs output:
[2019-1-21 07:21:03] [eWeLink] Updating recorded Characteristic.On for [Garage Door] to [false]. No request will be sent to the device.
[2019-1-21 07:21:03] [eWeLink] Setting power state to [off] for device [Garage Door]
[2019-1-21 07:21:03] [eWeLink] WebSocket messge received: {"error":0,"deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","sequence":"1548015663372"}
[2019-1-21 07:21:04] [eWeLink] Requesting power state for [Garage Door]
[2019-1-21 07:21:04] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","userAgent":"app","sequence":"1548015663966","ts":0,"params":{"switch":"off"}}
[2019-1-21 07:21:04] [eWeLink] Update message received for device [10005e6bbf]
[2019-1-21 07:21:04] [eWeLink] Updating recorded Characteristic.On for [Garage Door] to [false]. No request will be sent to the device.
[2019-1-21 07:21:04] [eWeLink] Setting power state to [off] for device [Garage Door]
[2019-1-21 07:21:05] [eWeLink] API reported that [Garage Door] is Off
[2019-1-21 07:21:05] [eWeLink] WebSocket messge received: {"error":0,"deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","sequence":"1548015664552"}
[2019-1-21 07:21:05] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","userAgent":"app","sequence":"1548015665156","ts":0,"params":{"switch":"off"}}
[2019-1-21 07:21:05] [eWeLink] Update message received for device [10005e6bbf]
[2019-1-21 07:21:05] [eWeLink] Updating recorded Characteristic.On for [Garage Door] to [false]. No request will be sent to the device.
[2019-1-21 07:21:05] [eWeLink] Setting power state to [off] for device [Garage Door]
[2019-1-21 07:21:06] [eWeLink] WebSocket messge received: {"error":0,"deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","sequence":"1548015665745"}
[2019-1-21 07:21:06] [eWeLink] Setting power state to [on] for device [Garage Door]
[2019-1-21 07:21:06] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","userAgent":"app","sequence":"1548015666347","ts":0,"params":{"switch":"off"}}
[2019-1-21 07:21:06] [eWeLink] Update message received for device [10005e6bbf]
[2019-1-21 07:21:06] [eWeLink] Updating recorded Characteristic.On for [Garage Door] to [false]. No request will be sent to the device.
[2019-1-21 07:21:06] [eWeLink] Setting power state to [off] for device [Garage Door]
[2019-1-21 07:21:07] [eWeLink] WebSocket messge received: {"error":0,"deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","sequence":"1548015666633"}
[2019-1-21 07:21:07] [eWeLink] WebSocket messge received: {"error":0,"deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","sequence":"1548015666927"}
[2019-1-21 07:21:07] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","userAgent":"app","sequence":"1548015667243","ts":0,"params":{"switch":"on"}}
[2019-1-21 07:21:07] [eWeLink] Update message received for device [10005e6bbf]
[2019-1-21 07:21:07] [eWeLink] Updating recorded Characteristic.On for [Garage Door] to [true]. No request will be sent to the device.
[2019-1-21 07:21:07] [eWeLink] Setting power state to [on] for device [Garage Door]
[2019-1-21 07:21:08] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","userAgent":"app","sequence":"1548015667534","ts":0,"params":{"switch":"off"}}
[2019-1-21 07:21:08] [eWeLink] Update message received for device [10005e6bbf]
[2019-1-21 07:21:08] [eWeLink] Updating recorded Characteristic.On for [Garage Door] to [false]. No request will be sent to the device.
[2019-1-21 07:21:08] [eWeLink] Setting power state to [off] for device [Garage Door]
[2019-1-21 07:21:08] [eWeLink] WebSocket messge received: {"error":0,"deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","sequence":"1548015667824"}
[2019-1-21 07:21:08] [eWeLink] WebSocket messge received: {"error":0,"deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","sequence":"1548015668117"}
[2019-1-21 07:21:09] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","userAgent":"app","sequence":"1548015668432","ts":0,"params":{"switch":"on"}}
[2019-1-21 07:21:09] [eWeLink] Update message received for device [10005e6bbf]
[2019-1-21 07:21:09] [eWeLink] Updating recorded Characteristic.On for [Garage Door] to [true]. No request will be sent to the device.
[2019-1-21 07:21:09] [eWeLink] Setting power state to [on] for device [Garage Door]
[2019-1-21 07:21:09] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","userAgent":"app","sequence":"1548015668729","ts":0,"params":{"switch":"off"}}
[2019-1-21 07:21:09] [eWeLink] Update message received for device [10005e6bbf]
[2019-1-21 07:21:09] [eWeLink] Updating recorded Characteristic.On for [Garage Door] to [false]. No request will be sent to the device.
[2019-1-21 07:21:09] [eWeLink] Setting power state to [off] for device [Garage Door]
[2019-1-21 07:21:09] [eWeLink] WebSocket messge received: {"error":0,"deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","sequence":"1548015669312"}
[2019-1-21 07:21:10] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","userAgent":"device","ts":0,"params":{"switch":"off"},"from":"device"}
[2019-1-21 07:21:10] [eWeLink] Update message received for device [10005e6bbf]
[2019-1-21 07:21:10] [eWeLink] Updating recorded Characteristic.On for [Garage Door] to [false]. No request will be sent to the device.
[2019-1-21 07:21:10] [eWeLink] Setting power state to [off] for device [Garage Door]
[2019-1-21 07:21:10] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","userAgent":"app","sequence":"1548015669927","ts":0,"params":{"switch":"off"}}
[2019-1-21 07:21:10] [eWeLink] Update message received for device [10005e6bbf]
[2019-1-21 07:21:10] [eWeLink] Updating recorded Characteristic.On for [Garage Door] to [false]. No request will be sent to the device.
[2019-1-21 07:21:10] [eWeLink] Setting power state to [off] for device [Garage Door]
[2019-1-21 07:21:11] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10005e6bbf","apikey":"ce23cda3-10e5-4cd9-8985-b72301fe8fcc","userAgent":"app","sequence":"1548015670714","ts":0,"params":{"switch":"off"}}
[2019-1-21 07:21:11] [eWeLink] Update message received for device [10005e6bbf]
[2019-1-21 07:21:11] [eWeLink] Updating recorded Characteristic.On for [Garage Door] to [false]. No request will be sent to the device.
[2019-1-21 07:21:11] [eWeLink] Setting power state to [off] for device [Garage Door]

Error: getaddrinfo ENOTFOUND eu-long.coolkit.cc eu-long.coolkit.cc:8080

Hi,

As of today I started getting these errors:

Apr 18 11:15:57 raspberrypi homebridge[574]: { Error: getaddrinfo ENOTFOUND eu-long.coolkit.cc eu-long.coolkit.cc:8080
Apr 18 11:15:57 raspberrypi homebridge[574]: at errnoException (dns.js:28:10)
Apr 18 11:15:57 raspberrypi homebridge[574]: at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:73:26)
Apr 18 11:15:57 raspberrypi homebridge[574]: code: 'ENOTFOUND',
Apr 18 11:15:57 raspberrypi homebridge[574]: errno: 'ENOTFOUND',
Apr 18 11:15:57 raspberrypi homebridge[574]: syscall: 'getaddrinfo',
Apr 18 11:15:57 raspberrypi homebridge[574]: hostname: 'eu-long.coolkit.cc',
Apr 18 11:15:57 raspberrypi homebridge[574]: host: 'eu-long.coolkit.cc',
Apr 18 11:15:57 raspberrypi homebridge[574]: port: '8080' } }
Apr 18 11:15:57 raspberrypi homebridge[574]: WebSocketClient: retry in 5000ms 1006
Apr 18 11:15:57 raspberrypi homebridge[574]: [4/18/2018, 11:15:57 AM] [eWeLink] WebSocket was closed. Reason [1006]

What is causing this?
Was something changed on the ITEAD servers?
P.S: My Authorization Bearer did not change

authenticationToken is not recognized

I have the issue that mý authToken is not being recognized...

Tried several different methodes, checked the code but somewhere the linking between the plugin and the config seems to fail.

Here is the Failure message:

Load homebridge-eWeLink.eWeLink
[2017-12-26 05:58:12] [homebridge-eWeLink.eWeLink] Intialising eWeLink
/usr/local/lib/node_modules/homebridge-ewelink/index.js:42
    this.authenticationToken = config['authenticationToken'];
                                     ^

TypeError: Cannot read property 'authenticationToken' of null
    at new eWeLink (/usr/local/lib/node_modules/homebridge-ewelink/index.js:42:3             8)
    at Server._loadDynamicPlatforms (/usr/local/lib/node_modules/homebridge/lib/             server.js:325:30)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:87:8)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge             :17:22)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

and here is my config:

	"platforms": [{
			
		"platform": "eWeLink",
		"name": "eWeLink",
		"autheticationToken": "authToken is in here!",
		"apiHost": "eu-api.coolkit.cc:8080/api/group?apikey=apikeygoeshere&appid=xyz&nonce=eto149q7&ts=1514263532&version=6",
		"webSocketApi": "eu-api.coolkit.cc:8080/api/group?apikey=apikeygoeshere&appid=xyz&ts=1514263532&version=6"
		},
			]
}

greetings from Germany

Kevin

ERROR LOADING PLUGIN homebridge-ewelink:

hi, after two months of using this plugin, i suddenly started to getting this error when startin homebridge :(

4/22/2018, 10:14:48 PM] ERROR LOADING PLUGIN homebridge-ewelink:
[4/22/2018, 10:14:48 PM] /usr/local/lib/node_modules/homebridge-ewelink/node_modules/ws/lib/WebSocket.js:549
$ headers:`{
^^^^^^^
SyntaxError: Unexpected identifier
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/homebridge-ewelink/node_modules/ws/index.js:9:19)
at Module._compile (module.js:570:32)
[4/22/2018, 10:14:48 PM] ====================

Charles does not work

Hello,
Charles ist installed in application on my mac, but when I open the ewelink app on my iphone nothing happened.

sonoff B2 rgb light bulb NOT SUPPORTED

Hi, thank for this great product. i already tested with a simple RF switch and works great.
Recently bought a new sonoff B2 rgb light Bulb and it is not supported. in ewelik app works great. in homebrdge "API reported an unknown status for device [@name]" in home kit app: no response.

Please help!

Support for iFan02 [Solved]

I can get a single switch for iFan02 to show up in HomeKit, but shows unresponsive.
Really hoping for at least control of levels 1,2 and 3, if not the "Smart" function also which I believe is similar to breeze where the fan pulse up and down. Don't care if the light cannot be accessed.

If there's additional info I can provide that will help add support, please ask.

Domain webSocketApi

Hi, this domain no exist

Non-authoritative answer:
*** Can't find us-long.coolkit.cc: No answer

Login to ewelink

I have testet your great plugin, and it works fine.

Would it be possible to make your plugin do the login to https://api.coolkit.cc:8080. ?

I know that it will log the app out, but i rather use homekit than the app.. And if i need it, i can just login again.
Another workaround could be to create another account, and share the buttons to that, and use this account for the plugin.

Error 503

My sonoff basic is connected to a Wi-Fi router 2 meters away and after 3 or 4 turn on and off I get thar 503. Firmware version is 1.8.1 and it happens using homebridge, when using EWeLink App everything works fine.

Enhancement on the accessories service

I’m using Itead Sonoff S20 plug and it works like a charm. Thank you for your effort of this plugin. However, I wonder if you could have a modify on the HomeKit service which is to have a OUTLET power point icon for the S20 plug accessory rather than a switch icon.It will be easier to sort accessories on HomeKit.Thank you

eWeLink network connectivity issues will cause the homebridge to crash

If there are NW issues preventing the homebridge-ewelink from contacting the ITED servers the homebridge will crash with the following error:

Jan 11 00:02:16 raspberrypi homebridge[25602]: /usr/lib/node_modules/homebridge-ewelink/index.js:71
Jan 11 00:02:16 raspberrypi homebridge[25602]: if (body.hasOwnProperty('error')) {
Jan 11 00:02:16 raspberrypi homebridge[25602]: ^
Jan 11 00:02:16 raspberrypi homebridge[25602]: TypeError: Cannot read property 'hasOwnProperty' of undefined
Jan 11 00:02:16 raspberrypi homebridge[25602]: at /usr/lib/node_modules/homebridge-ewelink/index.js:71:25
Jan 11 00:02:16 raspberrypi homebridge[25602]: at Object.parseBody (/usr/lib/node_modules/homebridge-ewelink/node_modules/request-json/main.js:74:12)
Jan 11 00:02:16 raspberrypi homebridge[25602]: at Request._callback (/usr/lib/node_modules/homebridge-ewelink/node_modules/request-json/main.js:148:26)
Jan 11 00:02:16 raspberrypi homebridge[25602]: at self.callback (/usr/lib/node_modules/homebridge-ewelink/node_modules/request/request.js:187:22)
Jan 11 00:02:16 raspberrypi homebridge[25602]: at emitOne (events.js:96:13)
Jan 11 00:02:16 raspberrypi homebridge[25602]: at Request.emit (events.js:191:7)
Jan 11 00:02:16 raspberrypi homebridge[25602]: at Request.onRequestError (/usr/lib/node_modules/homebridge-ewelink/node_modules/request/request.js:813:8)
Jan 11 00:02:16 raspberrypi homebridge[25602]: at emitOne (events.js:96:13)
Jan 11 00:02:16 raspberrypi homebridge[25602]: at ClientRequest.emit (events.js:191:7)
Jan 11 00:02:16 raspberrypi homebridge[25602]: at TLSSocket.socketErrorListener (_http_client.js:358:9)
Jan 11 00:02:16 raspberrypi systemd[1]: homebridge.service: main process exited, code=exited, status=1/FAILURE
Jan 11 00:02:16 raspberrypi systemd[1]: Unit homebridge.service entered failed state.

Can this be prevented?

ISSUE with ewelink-max plugin (Sonoff TH16 with temp sensor)

Hi,

I'm making home automation system with sonoff switches. Every room has switch+sensor AM2301(temo+hum), and heating system, and door lock,itd…

I have a Homebridge running on Raspberry Pi3+, and im testing only one Sonoff switch with sensor connected. Im installed ewelink-max plugin, because is much beter then old ewelink plugin, no Charles, its all automatically. But I meaned, that when I run Ewelink plugin, that plugin get information from ewelink app(server) and use all switches and sensros I have on ewelink app, that must be on HomeApp. When I go to Home App, I have swtich, its perfectly working, but I have no widget for sensor, which is connected to Sonoff TH16 and activated in ewelink app. This plugin working in other way, I meaned that, plugin sending request from server(ewelink), and getting a list of devices(in debugger he saying that "getting list of devices"), but not, I only get a switch, no sensor in Home APP.

Can anyone help me with this, how to change a code in plugin, or you plaining to update the plugin. What if I connect 8 Sonoff switch, all with sensor. What devices I will get in Home APP accessories? Can I get 8 switches at least, or just coded for one switch.

Thank in advance!

An error was encountered while requesting a list of devices. Response was [{"error":401}]

Hi,

Nothing has changed but now I get this error:

An error was encountered while requesting a list of devices. Response was [{"error":401}]
Verify that you have the correct authenticationToken specified in your configuration. The currently-configured token is [916c85861b********************]

I have already tried to get a new token by Charles, but when I try to get a new token, I won't see the token:

Sent request. Waiting for response…

API Token

Is there another program to get the API token I’ve tried Charles but just cannot seem to get it to work.

HomeBridge crashed by "TypeError: body.filter is not a function"

Hi, this library is very useful and convenient for my Sonoff Basic but however I found that this library caused my HomeBridge to crash randomly after Home app on iPhone trying to refresh accessories status.

Here's the log

[2018-7-30 19:02:21] [eWeLink] WebSocket was closed. Reason [1006]
WebSocketClient: reconnecting...
[2018-7-30 19:02:28] [eWeLink] Sending login request [{"action":"userOnline","us                             erAgent":"app","version":6,"nonce":"153295214845100","apkVesrion":"1.8","os":"io                             s","at":"047e6b963a148e143401f5f373f040xxxxxxxxxx","apikey":"2817695a-3b73-4cd4-                             940a-19xxxxxxxxxx","ts":"1532952148","model":"iPhone10,6","romVersion":"11.1.2",                             "sequence":1532952148451}]
[2018-7-30 19:02:28] [eWeLink] WebSocket messge received:  {"error":0,"apikey":"                             2817695a-3b73-4cd4-940a-19xxxxxxxxxx","config":{"hb":1,"hbInterval":145},"sequen                             ce":"1532952148451"}
WebSocketClient: retry in 5000ms 1006
[2018-7-30 19:05:08] [eWeLink] WebSocket was closed. Reason [1006]
WebSocketClient: reconnecting...
[2018-7-30 19:05:14] [eWeLink] Sending login request [{"action":"userOnline","us                             erAgent":"app","version":6,"nonce":"153295231499200","apkVesrion":"1.8","os":"io                             s","at":"047e6b963a148e143401f5f373f040xxxxxxxxxx","apikey":"2817695a-3b73-4cd4-                             940a-19xxxxxxxxxx","ts":"1532952314","model":"iPhone10,6","romVersion":"11.1.2",                             "sequence":1532952314992}]
[2018-7-30 19:05:15] [eWeLink] WebSocket messge received:  {"error":0,"apikey":"                             2817695a-3b73-4cd4-940a-19xxxxxxxxxx","config":{"hb":1,"hbInterval":145},"sequen                             ce":"1532952314992"}
WebSocketClient: retry in 5000ms 1006
[2018-7-30 19:07:55] [eWeLink] WebSocket was closed. Reason [1006]
WebSocketClient: reconnecting...
[2018-7-30 19:08:01] [eWeLink] Sending login request [{"action":"userOnline","us                             erAgent":"app","version":6,"nonce":"153295248149300","apkVesrion":"1.8","os":"io                             s","at":"047e6b963a148e143401f5f373f040xxxxxxxxxx","apikey":"2817695a-3b73-4cd4-                             940a-19xxxxxxxxxx","ts":"1532952481","model":"iPhone10,6","romVersion":"11.1.2",                             "sequence":1532952481493}]
[2018-7-30 19:08:01] [eWeLink] WebSocket messge received:  {"error":0,"apikey":"                             2817695a-3b73-4cd4-940a-19xxxxxxxxxx","config":{"hb":1,"hbInterval":145},"sequen                             ce":"1532952481493"}
WebSocketClient: retry in 5000ms 1006
[2018-7-30 19:10:41] [eWeLink] WebSocket was closed. Reason [1006]
WebSocketClient: reconnecting...
[2018-7-30 19:10:47] [eWeLink] Sending login request [{"action":"userOnline","us                             erAgent":"app","version":6,"nonce":"153295264794300","apkVesrion":"1.8","os":"io                             s","at":"047e6b963a148e143401f5f373f040xxxxxxxxxx","apikey":"2817695a-3b73-4cd4-                             940a-19xxxxxxxxxx","ts":"1532952647","model":"iPhone10,6","romVersion":"11.1.2",                             "sequence":1532952647943}]
[2018-7-30 19:10:48] [eWeLink] WebSocket messge received:  {"error":0,"apikey":"                             2817695a-3b73-4cd4-940a-19xxxxxxxxxx","config":{"hb":1,"hbInterval":145},"sequen                             ce":"1532952647943"}
[2018-7-30 19:11:37] [eWeLink] Requesting power state for [Sonoff 1]
[2018-7-30 19:11:37] [eWeLink] Requesting power state for [Sonoff 1]
[2018-7-30 19:11:38] [eWeLink] Device [Sonoff 1] was reported to be offline by the API
[2018-7-30 19:11:38] [eWeLink] Requesting power state for [Sonoff 2]
[2018-7-30 19:11:39] [eWeLink] Device [Sonoff 2] was reported to be offline by the API
[2018-7-30 19:11:39] [eWeLink] Requesting power state for [Sonoff 1]
[2018-7-30 19:11:39] [eWeLink] Requesting power state for [Sonoff 2]
[2018-7-30 19:11:39] [eWeLink] Device [Sonoff 2] was reported to be offline by the API

/usr/lib/node_modules/homebridge-ewelink/node_modules/request-json/main.js:74
    return callback(error, response, parsed);
           ^
TypeError: body.filter is not a function
    at /usr/lib/node_modules/homebridge-ewelink/index.js:364:37
    at Object.parseBody (/usr/lib/node_modules/homebridge-ewelink/node_modules/request-json/main.js:74:12)
    at Request._callback (/usr/lib/node_modules/homebridge-ewelink/node_modules/request-json/main.js:148:26)
    at Request.self.callback (/usr/lib/node_modules/homebridge-ewelink/node_modules/request/request.js:186:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/usr/lib/node_modules/homebridge-ewelink/node_modules/request/request.js:1163:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/usr/lib/node_modules/homebridge-ewelink/node_modules/request/request.js:1085:12)

Sonoff iFan

Please add sonoff iFan support - HomeKit fan. Really?

Error on startup Homebridge eWeLink 'Error: unexpected server response (200)'

Hi,

I will explain shortly what the situation is, I installed the app Homebridge from Github on my Raspberry: https://github.com/nfarina/homebridge

Installation was successful, so, so far so good. But then I installed the plugin eWeLink for the Homebridge app: https://github.com/gbro115/homebridge-ewelink the installation went good as well, but when I try to start the application now, it gives the following output:

[2018-6-1 12:38:46] [eWeLink] A total of [0] accessories were loaded from the local cache
[2018-6-1 12:38:46] [eWeLink] Requesting a list of devices from eWeLink HTTPS API at [https://eu-ota.coolkit.cc:8080]
[2018-6-1 12:38:46] Homebridge is running on port 51826.
[2018-6-1 12:38:46] [eWeLink] eWeLink HTTPS API reports that there are a total of [108] devices registered
[2018-6-1 12:38:46] [eWeLink] Evaluating if devices need to be removed...
[2018-6-1 12:38:46] [eWeLink] Evaluating if new devices need to be added...
[2018-6-1 12:38:46] [eWeLink] Device [undefined], ID : [undefined] will be added
[2018-6-1 12:38:46] [eWeLink] A device with an unknown type was returned. It will be skipped. undefined
[2018-6-1 12:38:46] [eWeLink] API key retrieved from web service is [undefined]
[2018-6-1 12:38:46] [eWeLink] Connecting to the WebSocket API at [wss://eu-api.coolkit.cc:8080/api/ws]
WebSocketClient: error { '0': Error: unexpected server response (200)
at ClientRequest._req.on (/usr/lib/node_modules/homebridge-ewelink/node_modules/ws/lib/WebSocket.js:653:21)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:543:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:112:17)
at TLSSocket.socketOnData (_http_client.js:440:20)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11) }
WebSocketClient: retry in 5000ms 1006
[2018-6-1 12:38:46] [eWeLink] WebSocket was closed. Reason [1006]

Who can help me solve this?

EADDRINUSE and hrow er; // Unhandled 'error' event

Been having problems (after 2 months of flawless use) with the server (running on and imac)

It has been giving me the following issues...

Requesting a list of devices from eWeLink HTTPS API at [https://eu-api.coolkit.cc:8080]
events.js:173
throw er; // Unhandled 'error' event


and after that


Error: listen EADDRINUSE: address already in use :::51826
at Server.setupListenHandle [as _listen2] (net.js:1255:14)


from the HOME app, it does not see any devices any more...

tried restarting the imac and the server several times with no luck

any ideas?

Forked. Automatic login doesn't work.

Hi, @howanghk,

There is no option to create an issue specifically on your fork.

Please Go to the Settings page of your fork.
Check the box next to Issues.

Login on your fork doesn't work for me. I don't have phone number with this account. Just an email.
[eWeLink] WebSocket messge received: {"error":0,"apikey":"d90f485d-7015-4fb5-a814-195338a9bd03","config":{"hb":1,"hbInterval":145},"sequence":"1545808475935","socketid":"025f1ffffeb44eea-0000055d-0124dcbc-57655f1c5264569a-0cb80ec8"}

WebSocket close logs (Reason 1006) every 3 minutes

Hi, iam new to this project and want to thank you all for your efforts.
Had a little problem with ewelink on homebridge.
Getting error logs every 3 minutes regarding WebSocket closed abnormally (Reason 1006)
Is this a known issue in ewelink implementation or is this a acual error?

Here are the logs:

(.........)
Feb 10 21:41:04 HomebridgePi3 homebridge[18432]: [2018-2-10 21:41:04] [eWeLink] WebSocket was closed. Reason [1006]
Feb 10 21:41:09 HomebridgePi3 homebridge[18432]: WebSocketClient: reconnecting...
(.........)
Feb 10 21:43:50 HomebridgePi3 homebridge[18432]: WebSocketClient: retry in 5000ms 1006
Feb 10 21:43:50 HomebridgePi3 homebridge[18432]: [2018-2-10 21:43:50] [eWeLink] WebSocket was closed. Reason [1006]
(.........)
Feb 10 21:46:35 HomebridgePi3 homebridge[18432]: WebSocketClient: retry in 5000ms 1006
Feb 10 21:46:35 HomebridgePi3 homebridge[18432]: [2018-2-10 21:46:35] [eWeLink] WebSocket was closed. Reason [1006]
(.........)
Feb 10 21:49:20 HomebridgePi3 homebridge[18432]: WebSocketClient: retry in 5000ms 1006
Feb 10 21:49:20 HomebridgePi3 homebridge[18432]: [2018-2-10 21:49:20] [eWeLink] WebSocket was closed. Reason [1006]
(.........)

I should mention that everything works, but this logs make me think about some problems laying behind the scenes

Read temp TH10/6

Is-it possible to read temp and humidity with this plugin? If yes, than can you tell me how?

The relay work very well with HomeKit!!
Richard

API reported an unknown status for device

Please help me. Cant understand where is problem.i am using sonoff 4ch,which is set up to open my garage and door(all system is working on low voltage settings with build in remote from garage and door),and everything is working find in original program, but cant get it work in homebridge. please give me some help!

[eWeLink] A total of [1] accessories were loaded from the local cache
[2018-7-3 00:43:48] [eWeLink] Requesting a list of devices from eWeLink HTTPS API at [https://eu-api.coolkit.cc:8080]
[2018-7-3 00:43:48] Homebridge is running on port 51826.
[2018-7-3 00:43:48] [eWeLink] eWeLink HTTPS API reports that there are a total of [1] devices registered
[2018-7-3 00:43:48] [eWeLink] Evaluating if devices need to be removed...
[2018-7-3 00:43:48] [eWeLink] Verifying that all cached devices are still registered with the API. Devices that are no longer registered with the API will be removed.
[2018-7-3 00:43:48] [eWeLink] Device [Гараж/Ворота] is regeistered with API. Nothing to do.
[2018-7-3 00:43:48] [eWeLink] Evaluating if new devices need to be added...
[2018-7-3 00:43:48] [eWeLink] Device with ID [100032a58f] is already configured. Ensuring that the configuration is current.
[2018-7-3 00:43:48] [eWeLink] Updating recorded Characteristic.On for [Гараж/Ворота] to [false]. No request will be sent to the device.
[2018-7-3 00:43:48] [eWeLink] Setting power state to [off] for device [Гараж/Ворота]
[2018-7-3 00:43:48] [eWeLink] API key retrieved from web service is [----------]
[2018-7-3 00:43:48] [eWeLink] Connecting to the WebSocket API at [wss://eu-pconnect3.coolkit.cc:8080/api/ws]
[2018-7-3 00:43:48] [eWeLink] Sending login request [{"action":"userOnline","userAgent":"app","version":6,"nonce":"153056782866700","apkVesrion":"1.8","os":"ios","at":"2266269c506a9887e119401c04540e7c22912546","apikey":"========","ts":"1530567828","model":"iPhone10,6","romVersion":"11.1.2","sequence":1530567828667}]
[2018-7-3 00:43:48] [eWeLink] WebSocket messge received: {"error":0,"apikey":"-------","config":{"hb":1,"hbInterval":145},"sequence":"1530567828667"}
[2018-7-3 00:44:28] [eWeLink] Requesting power state for [Гараж/Ворота]
[2018-7-3 00:44:28] [eWeLink] API reported an unknown status for device [Гараж/Ворота]
[2018-7-3 00:44:39] [eWeLink] Requesting power state for [Гараж/Ворота]
[2018-7-3 00:44:39] [eWeLink] API reported an unknown status for device [Гараж/Ворота]
[2018-7-3 00:44:42] [eWeLink] Requesting power state for [Гараж/Ворота]
[2018-7-3 00:44:42] [eWeLink] API reported an unknown status for device [Гараж/Ворота]
[2018-7-3 00:46:20] [eWeLink] Requesting power state for [Гараж/Ворота]
[2018-7-3 00:46:21] [eWeLink] API reported an unknown status for device [Гараж/Ворота]
[2018-7-3 00:46:27] [eWeLink] Requesting power state for [Гараж/Ворота]
[2018-7-3 00:46:27] [eWeLink] API reported an unknown status for device [Гараж/Ворота]
WebSocketClient: retry in 5000ms 1006
[2018-7-3 00:46:28] [eWeLink] WebSocket was closed. Reason [1006]
[2018-7-3 00:46:29] [eWeLink] Requesting power state for [Гараж/Ворота]
[2018-7-3 00:46:29] [eWeLink] API reported an unknown status for device [Гараж/Ворота]
WebSocketClient: reconnecting...
[2018-7-3 00:46:34] [eWeLink] Sending login request [{"action":"userOnline","userAgent":"app","version":6,"nonce":"153056799424100","apkVesrion":"1.8","os":"ios","at":"---------","apikey":"=======","ts":"1530567994","model":"iPhone10,6","romVersion":"11.1.2","sequence":1530567994241}]
[2018-7-3 00:46:34] [eWeLink] WebSocket messge received: {"error":0,"apikey":"-------","config":{"hb":1,"hbInterval":145},"sequence":"1530567994241"}
[2018-7-3 00:46:43] [eWeLink] Requesting power state for [Гараж/Ворота]
[2018-7-3 00:46:43] [eWeLink] API reported an unknown status for device [Гараж/Ворота]
[2018-7-3 00:46:45] [eWeLink] Requesting power state for [Гараж/Ворота]
[2018-7-3 00:46:45] [eWeLink] API reported an unknown status for device [Гараж/Ворота]
[2018-7-3 00:47:02] [eWeLink] Requesting power state for [Гараж/Ворота]
[2018-7-3 00:47:02] [eWeLink] API reported an unknown status for device [Гараж/Ворота]
[2018-7-3 00:47:04] [eWeLink] Requesting power state for [Гараж/Ворота]
[2018-7-3 00:47:04] [eWeLink] API reported an unknown status for device [Гараж/Ворота]

Can not determine Token

Hi. How do you determine the Token? I do everything according to the description, the Certificates are on the iPhone and MacBook. Charles sees the connection but in the eu-ota string.coolkit.cc: 8080 says "unknown". Maybe in Russia it is impossible to do? Write, can I that do not so? Thanks.

Shortcut Intergrate?!

Nearly, Apple release ios 12 support Shortcut App.
And, i see Shortcut can send requests to input url. So can i send request to turn on or off sonoff?
Can you describe the communication between home assistant and ewelink app, so i can simulate it into shortcut app.

Thanks a lot for reading this issue.
Here is an example about sending a GET requests in Shortcut App.
img_0967

[eWeLink] WebSocket was closed. Reason [1006]

Hey guys,

This seems to have just started happening recently.

Whenever Homebridge is sending a command to eWeLink devices, the request seems to always timeout. Below is what the log reads and it keeps repeating on and on without resolve:

[2018-4-18 08:19:52] [eWeLink] Setting power state to [on] for device [Hall and Porch CH 1]

WebSocketClient: error { '0':

   { Error: getaddrinfo ENOTFOUND us-long.coolkit.cc us-long.coolkit.cc:8080

    at errnoException (dns.js:50:10)

    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)

     code: 'ENOTFOUND',

     errno: 'ENOTFOUND',

     syscall: 'getaddrinfo',

     hostname: 'us-long.coolkit.cc',

     host: 'us-long.coolkit.cc',

     port: '8080' } }

[2018-4-18 08:20:10] [eWeLink] WebSocket was closed. Reason [1006]

WebSocketClient: reconnecting...

My suspicion is that the individual Sonoff devices aren't connected to the internet (perhaps a Wi-Fi issue?) which is leading to this message.

If anyone has any insights on how to fix this, that would be greatly appreciated!

Error: connect ECONNREFUSED

Keep getting below error on connection, it connects some times and some time I keep getting this error

Please help

WebSocketClient: reconnecting...
WebSocketClient: retry in 5000ms { Error: connect ECONNREFUSED 52.8.47.125:8080
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '52.8.47.125',
port: 8080 }

Please add a switch that supports multiple buttons,thank you!

I do not speak English, is used to reproduce, I have completed a key switch access to homekit

But I have some 2 keys, 3 keys and 4 key switches on my hand. Changing homebridge can only identify a switch, and it can't be controlled. This is the state that I switch and trigger homebridge in ewelink APP. Please add a switch that supports multiple buttons.
[2018-1-16 17:18:51] [eWeLink] WebSocket messge received: {"error":0,"deviceid":"10000b02af","apikey":"fd2b60c0-3604-4aa3-bb88-cefd92442c8e","sequence":"1516094330914"}
[2018-1-16 17:19:00] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10002d5895","apikey":"fd2b60c0-3604-4aa3-bb88-cefd92442c8e","userAgent":"app","sequence":"1516094339883","ts":0,"params":{"switches":[{"switch":"on","outlet":0},{"switch":"off","outlet":1},{"switch":"off","outlet":2},{"switch":"on","outlet":3}]},"tempRec":"10002d5895"}
[2018-1-16 17:19:00] [eWeLink] Update message received for device [10002d5895]

[2018-1-16 17:19:01] [eWeLink] WebSocket messge received: {"error":0,"deviceid":"10000b02af","apikey":"fd2b60c0-3604-4aa3-bb88-cefd92442c8e","sequence":"1516094340494"}
[2018-1-16 17:19:04] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10002d5895","apikey":"fd2b60c0-3604-4aa3-bb88-cefd92442c8e","userAgent":"app","sequence":"1516094344353","ts":0,"params":{"switches":[{"outlet":0,"switch":"on"},{"outlet":1,"switch":"on"},{"outlet":2,"switch":"off"},{"outlet":3,"switch":"on"}]},"tempRec":"10002d5895"}
[2018-1-16 17:19:04] [eWeLink] Update message received for device [10002d5895]

error 401

My plugin just stopped working, it displays the following error message.

[eWeLink] An error was encountered while requesting a list of devices. Response was [{"error": 401}]

plus someone with the same problem
?

thanks

Sonoff POW logging

Hi,

I keep receiving this logs every 2 minutes

[eWeLink] WebSocket messge received: {"action":"update","deviceid":"10001be297","apikey":"9ebb9ccc-6044-4d51-a404-d742bb063c64","userAgent":"device","ts":0,"params":{"rssi":-62,"power":"0","switch":"off"},"from":"device"}
[eWeLink] Update message received for device [10001be297]
[eWeLink] Updating recorded Characteristic.On for [Sonoff Pow 1] to [false]. No request will be sent to the device.
[eWeLink] Setting power state to [off] for device [Sonoff Pow 1]
[eWeLink] WebSocket messge received: {"error":0,"deviceid":"10001be297","apikey":"9ebb9ccc-6044-4d51-a404-d742bb063c64","sequence":"1515326993473"}

This is happening only for the Sonoff POW and not for the Basic
Any idea why?
How can I turn off this logging?

Thanks.

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.