homebridge-plugins / homebridge-ewelink

Homebridge plugin to integrate eWeLink devices into HomeKit.
MIT License
386 stars 126 forks source link

Charles does not work #1

Closed Kohle81 closed 6 years ago

Kohle81 commented 6 years ago

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

quetim commented 6 years ago

Make sure that you have everything set up on your iPhone:

go to settings-->wifi-->click on the (i) on the side of your wifi name-->configure proxy-->Manual-->put your Mac IP (the same one where you have charles running) and the port 8888.

Then on Charles, make sure that you go to:

Proxy-->SSL Proxy settings-->check the box of "Enable SSL Proxying-->click add-->In host put: us-api.coolkit.cc, in port put: 8080-->click ok-->restart charles and try again.

Hope it helps.

Kohle81 commented 6 years ago

Hello,

thanks for this tipps. Charles shows me the url eu-api.coolkit.cc, but when I want to start my ewelink-app no devices were found.

In charles it shows me „unknown“ under http://eu-ota.coolkit.cc:8080

Von meinem iPhone gesendet

Am 20.12.2017 um 23:22 schrieb quetim notifications@github.com:

Make sure that you have everything set up on your iPhone:

go to settings-->wifi-->click on the (i) on the side of your wifi name-->configure proxy-->Manual-->put your Mac IP (the same one where you have charles running) and the port 8888.

Then on Charles, make sure that you go to:

Proxy-->SSL Proxy settings-->check the box of "Enable SSL Proxying-->click add-->In host put: us-api.coolkit.cc, in port put: 8080-->click ok-->restart charles and try again.

Hope it helps.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

gbro115 commented 6 years ago

@Kohle81 had you already set up your eWeLink app with your devices?

You need to ensure that the eWeLink app is configured & working on its own before you attempt the homebridge part.

There are some instructions here that cover how to set up the app and pair your devices https://www.itead.cc/wiki/EWeLink_Introduction

Hope that this helps

Kohle81 commented 6 years ago

@George

Thx, my ewelink with devices works. But I only have one Switch included without the sonoff bridge.....

Von meinem iPhone gesendet

Am 21.12.2017 um 17:51 schrieb George notifications@github.com:

@Kohle81 had you already set up your eWeLink app with your devices?

You need to ensure that the eWeLink app is configured & working on its own before you attempt the homebridge part.

There are some instructions here that cover how to set up the app and pair your devices https://www.itead.cc/wiki/EWeLink_Introduction

Hope that this helps

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

gbro115 commented 6 years ago

@Kohle81 This plugin doesn't need any bridge (in fact, it was never tested with one).

Are you able to control your devices from the eWeLink app?

Kohle81 commented 6 years ago

Yes, I use the ewelink app since 6 months with the device....

Von meinem iPhone gesendet

Am 21.12.2017 um 19:09 schrieb George notifications@github.com:

@Kohle81 This plugin doesn't need any bridge (in fact, it was never tested with one).

Are you able to control your devices from the eWeLink app?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

funnytwister commented 6 years ago

Hey there, I have the same problem like @Kohle81.

Configure the iPhone like you Said. Without hosts in Proxy SSL Settings i can Control The device. But cannot see the Package content in Charles. When i added the hosts to the SSL Proxy i cannot Control the device Anymore an get the unknown messages in Charles.

Tived commented 6 years ago

After adding the Proxy and Install the certificate go to Settings > General > Certificate Trust Settings and Trust the Charles Proxy CA. After that Charles work fine.

YaqoobKayam commented 6 years ago

Hi

I'm also having the same issue like @funnytwister and @Kohle81 screen shot 2017-12-22 at 5 01 34 pm

Kohle81 commented 6 years ago

I have solved the problem. On iphone you have to „full trust“ the charles certificate. „Allgemein - Info - Zertifikate“.Dec 22 16:33:22 raspberrypi homebridge[9095]: [2017-12-22 16:33:22] [eWeLink] Deckenlicht Configure Accessory Dec 22 16:33:22 raspberrypi homebridge[9095]: [2017-12-22 16:33:22] [eWeLink] A total of [1] accessories were loaded from the local cache Dec 22 16:33:22 raspberrypi homebridge[9095]: [2017-12-22 16:33:22] [eWeLink] Requesting a list of devices from eWeLink HTTPS API at [https://eu-api.coolkit.cc:8080] Dec 22 16:33:22 raspberrypi homebridge[9095]: [2017-12-22 16:33:22] [MiAqaraPlatform] [INFO]server is listening on port 9898. Dec 22 16:33:22 raspberrypi homebridge[9095]: [2017-12-22 16:33:22] [CallMonitor] Connected to AVM Fritz!Box 6490 Dec 22 16:33:23 raspberrypi homebridge[9095]: [2017-12-22 16:33:23] [eWeLink] eWeLink HTTPS API reports that there are a total of [1] devices registered Dec 22 16:33:23 raspberrypi homebridge[9095]: [2017-12-22 16:33:23] [eWeLink] Evaluating if devices need to be removed... Dec 22 16:33:23 raspberrypi homebridge[9095]: [2017-12-22 16:33:23] [eWeLink] Verifying that all cached devices are still registered with the API. Devices that are no longer registered with the API will be removed. Dec 22 16:33:23 raspberrypi homebridge[9095]: [2017-12-22 16:33:23] [eWeLink] Device [Deckenlicht] is regeistered with API. Nothing to do. Dec 22 16:33:23 raspberrypi homebridge[9095]: [2017-12-22 16:33:23] [eWeLink] Evaluating if new devices need to be added... Dec 22 16:33:23 raspberrypi homebridge[9095]: [2017-12-22 16:33:23] [eWeLink] Device with ID [10000f1204] is already configured. Ensuring that the configuration is current. Dec 22 16:33:23 raspberrypi homebridge[9095]: [2017-12-22 16:33:23] [eWeLink] Updating recorded Characteristic.On for [Deckenlicht] to [false]. No request will be sent to the device. Dec 22 16:33:23 raspberrypi homebridge[9095]: [2017-12-22 16:33:23] [eWeLink] Setting power state to [off] for device [Deckenlicht] Dec 22 16:33:23 raspberrypi homebridge[9095]: [2017-12-22 16:33:23] [eWeLink] API key retrieved from web service is [5b3cd9e7-a0e2-4c9f-afc0-ced371486f1c] Dec 22 16:33:23 raspberrypi homebridge[9095]: [2017-12-22 16:33:23] [eWeLink] Connecting to the WebSocket API at [wss://eu-long.coolkit.cc:8080/api/ws] Dec 22 16:33:23 raspberrypi homebridge[9095]: [2017-12-22 16:33:23] [eWeLink] Sending login request [{"action":"userOnline","userAgent":"app","version":6,"nonce":"151395680342500","apkVesrion":"1.8","os":"ios","at":"xxxxxxxxxxxxxxxxxxxxxxx","apikey":"5b3cd9e7-a0e2-4c9f-afc0-ced371486f1c","ts":"1513956803","model":"iPhone10,6","romVersion":"11.1.2","sequence":1513956803425}] Dec 22 16:33:23 raspberrypi homebridge[9095]: [2017-12-22 16:33:23] [eWeLink] WebSocket messge received: {"error":0,"apikey":"5b3cd9e7-a0e2-4c9f-afc0-ced371486f1c","config":{"hb":1,"hbInterva

Now I could install the plugin, but I retrieve this log info:

YaqoobKayam commented 6 years ago

Thanks It was an ssl certificate problem Fixed now

And working

Very much appreciated

Kohle81 commented 6 years ago

I always have an error log:

log.com/e/2007 ] Dec 22 19:59:26 raspberrypi homebridge[11958]: [2017-12-22 19:59:26] [eWeLink] WebSocket was closed. Reason [1006] Dec 22 19:59:31 raspberrypi homebridge[11958]: WebSocketClient: reconnecting... Dec 22 19:59:31 raspberrypi homebridge[11958]: [2017-12-22 19:59:31] [eWeLink] Sending login request [{"action":"userOnline","userAgent":"app","version":6,"nonce":"151396917195500","apkVesrion":"1.8","os":"ios","at":"xxxxxxxxxxxxxxxxxxxxx","apikey":"5b3cd9e7-a0e2-4c9f-afc0-ced371486f1c","ts":"1513969171","model":"iPhone10,6","romVersion":"11.1.2","sequence":1513969171955}] Dec 22 19:59:32 raspberrypi homebridge[11958]: [2017-12-22 19:59:32] [eWeLink] WebSocket messge received: {"error":0,"apikey":"5b3cd9e7-a0e2-4c9f-afc0-ced371486f1c","config":{"hb":1,"hbInterval":145},"sequence":"1513969171955"} Dec 22 20:00:26 raspberrypi homebridge[11958]: [2017-12-22 20:00:26] [Hue] Flurlampeoben2: homekit power changed from 1 to

Kohle81 commented 6 years ago

Or have I reinstall the plugin to homebridge?

Reinstall doesn‘t work, too.

Kohle81 commented 6 years ago

6bf22686-e25c-4428-956c-859b60a42dcc

Kohle81 commented 6 years ago

This is my device:

WiFi Smart Touch Schalter, Arbeit mit Alexa Kontroll LED Wandleuchte Per Telefon jederzeit überall (3-Gang) https://www.amazon.de/dp/B06Y58NB2Y/ref=cm_sw_r_cp_api_EYxpAb1XHFMGY

gbro115 commented 6 years ago

Sorry for the slow replies; I am travelling for the next month.

This plugin was developed for, and tested with, the Sonoff basic relays. It's quite possible that the commands required to control the switch you have are different.

That log snippet looks ok. The "WebSocket was closed." entry is normal.

Is there anything else in the log entry?

zsozso-1982 commented 6 years ago

Hi. I had the problem with the certificates, and here is the solution: To activate the root certificate in iOS to work with Charles: iOS devices Set your iOS device to use Charles as its HTTP proxy in the Settings app > Wifi settings. Open Safari and browse to https://chls.pro/ssl. Safari will prompt you to install the SSL certificate. If you are on iOS 10.3 or later, open the Settings.app and navigate to General > About > Certificate Trust Settings, and find the Charles Proxy certificate, and switch it on to enable full trust for it (More information about this change in iOS 10 https://support.apple.com/en-nz/HT204477 ). Now you should be able to access SSL websites with Charles using SSL Proxying. Charles supports App Transport Security (ATS) as of the 3.11.4 release.

It's Work like a charm with my Sonoff Basic, and Sonoff S20 to control my chirstmas lights 👍

Thank you for the great plugin!!! 🥇

Kohle81 commented 6 years ago

@zso

I have installed the certificates on mac and iphone. It doesn‘t work.

Von meinem iPhone gesendet

Am 26.12.2017 um 09:26 schrieb zsozso-1982 notifications@github.com:

Hi. I had the problem with the certificates, and here is the solution: To activate the root certificate in iOS to work with Charles: iOS devices Set your iOS device to use Charles as its HTTP proxy in the Settings app > Wifi settings. Open Safari and browse to https://chls.pro/ssl. Safari will prompt you to install the SSL certificate. If you are on iOS 10.3 or later, open the Settings.app and navigate to General > About > Certificate Trust Settings, and find the Charles Proxy certificate, and switch it on to enable full trust for it (More information about this change in iOS 10 https://support.apple.com/en-nz/HT204477 ). Now you should be able to access SSL websites with Charles using SSL Proxying. Charles supports App Transport Security (ATS) as of the 3.11.4 release.

It's Work like a charm with my Sonoff Basic, and Sonoff S20 to control my chirstmas lights 👍

Thank you for the great plugin!!! 🥇

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

zsozso-1982 commented 6 years ago

@Kohle81 Be sure, that in Charles setup the port correctly. Proxy/Proxy settings/ HTTP Proxy: Port:8080 (By default was the port 8888) Proxy/SSL Proxy settings/SSL Proxy tab: eu-api.coolkit.cc:8080 Proxy/SSL Proxy settings/Client Certificates tab: eu-api.coolkit.cc:8080 iPhone settings: Check after to install the Root certificate, in General/About/Certificate Trust Settings: Enable Full Trust for root certificates (There is a Charles Proxy CA and it is enabled.)

Maybe firewall or Anti Virus?

img_0216 img_0215

gbro115 commented 6 years ago

Could you please do the following:

1) A screenshot of the eWeLink app when it is working (I.e Proxy not configured).

2) Configure the Proxy in your iPhone’s network settings

3) Provide us with a screenshot of the Proxy setting page on your iPhone

4) Quit the eWeLink iOS app (double-press home button, swipe up). Load the eWeLink app again and screenshot.

5) Take a screenshot of the Charles application on your Mac

6) Provide is with all the eWeLink logs from Homebridge application, from the start of the ‘plugin loading’ part onwards.

Thanks

George

Sent from my mobile device


From: zsozso-1982 notifications@github.com Sent: Tuesday, December 26, 2017 10:06:12 PM To: gbro115/homebridge-ewelink Cc: George; Comment Subject: Re: [gbro115/homebridge-ewelink] Charles does not work (#1)

@Kohle81https://github.com/kohle81 Be sure, that in Charles setup the port correctly. Proxy/Proxy settings/ HTTP Proxy: Port:8080 (By default was the port 8888) Proxy/SSL Proxy settings/SSL Proxy tab: eu-api.coolkit.cc:8080 Proxy/SSL Proxy settings/Client Certificates tab: eu-api.coolkit.cc:8080 iPhone settings: Check after to install the Root certificate, in General/About/Certificate Trust Settings: Enable Full Trust for root certificates (There is a Charles Proxy CA and it is enabled.)

Maybe firewall or Anti Virus?

[img_0216]https://user-images.githubusercontent.com/34854730/34352648-240a9ada-ea24-11e7-8e4f-ec127bdc4abb.png [img_0215]https://user-images.githubusercontent.com/34854730/34352649-242422fc-ea24-11e7-9029-89ef82c9c087.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/gbro115/homebridge-ewelink/issues/1#issuecomment-353942519, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AStTS6CTXJPFloNsuCR3VVDUzt1toM3_ks5tELcEgaJpZM4RGHmx.

zsozso-1982 commented 6 years ago

@gbro115 Hi.

The ewelink app shows the same: img_0218

The proxy settings: img_0219

Charles: screenshot 2017-12-28 12 24 48 screenshot 2017-12-28 12 25 01 screenshot 2017-12-28 12 25 06

screenshot 2017-12-28 12 14 23

The homebridge.log: [12/28/2017, 12:06:12 PM] Loaded plugin: homebridge-ewelink homebridge API version: 2.2 [12/28/2017, 12:06:12 PM] Registering platform 'homebridge-eWeLink.eWeLink' [12/28/2017, 12:06:15 PM] [eWeLink] Initializing eWeLink platform... [12/28/2017, 12:06:15 PM] [eWeLink] Intialising eWeLink [12/28/2017, 12:06:15 PM] Loading 2 accessories... [12/28/2017, 12:06:15 PM] [eWeLink] Terasz hátsó Configure Accessory [12/28/2017, 12:06:15 PM] [eWeLink] Első világítás Configure Accessory [12/28/2017, 12:06:16 PM] [eWeLink] A total of [2] accessories were loaded from the local cache [12/28/2017, 12:06:16 PM] [eWeLink] Requesting a list of devices from eWeLink HTTPS API at [https://eu-api.coolkit.cc:8080]

[12/28/2017, 12:06:20 PM] [eWeLink] eWeLink HTTPS API reports that there are a total of [2] devices registered [12/28/2017, 12:06:20 PM] [eWeLink] Evaluating if devices need to be removed... [12/28/2017, 12:06:20 PM] [eWeLink] Verifying that all cached devices are still registered with the API. Devices that are no longer registered with the API will be removed. [12/28/2017, 12:06:20 PM] [eWeLink] Device [Terasz hátsó] is regeistered with API. Nothing to do. [12/28/2017, 12:06:20 PM] [eWeLink] Device [Első világítás] is regeistered with API. Nothing to do. [12/28/2017, 12:06:20 PM] [eWeLink] Evaluating if new devices need to be added... [12/28/2017, 12:06:20 PM] [eWeLink] Device with ID [100010f6d6] is already configured. Ensuring that the configuration is current. [12/28/2017, 12:06:20 PM] [eWeLink] Updating recorded Characteristic.On for [Terasz hátsó] to [false]. No request will be sent to the device. [12/28/2017, 12:06:20 PM] [eWeLink] Setting power state to [off] for device [Terasz hátsó] [12/28/2017, 12:06:20 PM] [eWeLink] Device with ID [10000d510d] is already configured. Ensuring that the configuration is current. [12/28/2017, 12:06:20 PM] [eWeLink] Updating recorded Characteristic.On for [Első világítás] to [false]. No request will be sent to the device. [12/28/2017, 12:06:20 PM] [eWeLink] Setting power state to [off] for device [Első világítás] [12/28/2017, 12:06:20 PM] [eWeLink] API key retrieved from web service is [API KEY] [12/28/2017, 12:06:20 PM] [eWeLink] Connecting to the WebSocket API at [wss://eu-long.coolkit.cc:8080/api/ws] [12/28/2017, 12:06:23 PM] [eWeLink] Sending login request [{"action":"userOnline","userAgent":"app","version":6,"nonce":"151445918335900","apkVesrion":"1.8","os":"ios","at":"95aced911560db117d56a91bb3b6ac21484737e8","apikey":"API KEY","ts":"1514459183","model":"iPhone10,6","romVersion":"11.1.2","sequence":1514459183359}] [12/28/2017, 12:06:23 PM] [eWeLink] WebSocket messge received: {"error":0,"apikey":"API KEY","config":{"hb":1,"hbInterval":145},"sequence":"1514459183359"}

[12/28/2017, 12:07:06 PM] [eWeLink] Requesting power state for [Terasz hátsó] [12/28/2017, 12:07:06 PM] [eWeLink] Requesting power state for [Első világítás] [12/28/2017, 12:07:07 PM] [eWeLink] API reported that [Terasz hátsó] is Off [12/28/2017, 12:07:07 PM] [eWeLink] API reported that [Első világítás] is Off

migabc commented 6 years ago

Hi, I did all of the above. When I start the eWeLink app it uses the charles proxy and I can control my device. However, on the Charles app on my iMac I do not see the Authentication Token and API URL I only see:

URL: http://eu-api.coolkit.cc:8080

Am I missing something?

YaqoobKayam commented 6 years ago

@migabc You need to install the ssl certificate for Charles proxy on your device and enable it under "trust certificate settings" (Make sure you have Charles proxy running before you install the ssl certificate)

migabc commented 6 years ago

Yes, I had done that as I have have indicated above The problem was that I had a typo in the address - I was using the us instead of the eu address eu-api.coolkit.cc

My bad :-( I fixed that and now it's working fine.

I do find however that the ITEAD servers are very unstable. It seems that when we use the eWelink app we have to rely on the ITEAD servers for everything (pairing, adding/removing new devices, controlling the devices, On/off, timers, etc). Today all of these actions were failing very often because the ITED servers were not responding Anybody else experiencing this?

gbro115 commented 6 years ago

@Kohle81 am I ok to close this issue?

Kohle81 commented 6 years ago

Hello,

yes it‘s ok. Thx for your help!

Von meinem iPhone gesendet

Am 07.01.2018 um 23:04 schrieb George notifications@github.com:

@Kohle81 am I ok to close this issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.