diff --git a/README.md b/README.md index 6ee27b7..e166e7a 100644 --- a/README.md +++ b/README.md @@ -60,37 +60,37 @@ This is just a proof of concept because I searched for it and there was no imple ## Compatibility list -| Model | Supported | 1.6 | 1.8.1 | 2.6 | 2.6.1 | 2.7.1 | 3.0.0 | 3.0.1 | 3.3.0 |Remarks | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------:|:---:|:-----:|:---:|-------|:-----:|:---:|:---:|:---:|--------------------------------------------------------------------------------------| -| Sonoff Basic | yes | yes | yes | yes | | | yes | | | | -| Sonoff Dual | yes | | | | | | | | | | -| Sonoff RF | yes | | | yes | yes | | yes | | | | -| Sonoff G1 | ? | | | | | | | | | | -| Sonoff 4CH Pro | yes | | | yes | | yes | | yes | | | -| Sonoff 4CH Pro R2 | yes | | | yes | | | yes | yes | | | -| Sonoff S20 | yes | | yes | | | | yes | | | | -| Sonoff S30 | yes | | | | | | yes | | | | -| Sonoff S31 | yes | | | | | | | | | + power/current/voltage sensors | -| [Sonoff S26](https://www.aliexpress.com/item/Sonoff-S26-WiFi-Smart-Socket-Wireless-Plug-Power-Socket-Smart-Home-Switch-Smart-Remote-Control-for/32956551752.html) | yes | | | yes | | | yes | | yes | version: Euro | -| Sonoff T1 1C | yes | | | yes | | | | | | | -| Sonoff T1 EU 2C | yes | | | | | yes | | | | | -| Sonoff T1 UK 3C | yes | | | yes | | yes | | | | | -| Sonoff T1 US 3C | yes | | | | | | | | | | -| Sonoff TX 1C | yes | | | | | | | | yes | | -| Sonoff Pow | yes | | | | | | | | | + power sensor | -| Sonoff Pow R2 | yes | | | | | | | | partial **NO sensors data!** | + power/current/voltage sensors | -| Sonoff TH10/TH16 | yes | | | | | | | | | + temp/humidity sensors | -| Sonoff iFan02 | yes | | | | | | | | | it creates 4 switches, 1 for the light and 3 for the various fan speeds | -| Sonoff iFan03 | yes | | | | | | | | | it creates 4 switches, 1 for the light and 3 for the various fan speeds | -| Sonoff HT-TH31 | ? | | | | | | | | | | -| [Sonoff Slampher RF](https://www.gearbest.com/smart-light-bulb/pp_1824903.html) | yes | | | | | yes | yes | yes | yes | | -| [3 Gang Generic Wall Switch](https://www.amazon.in/gp/product/B07FLY398G) | yes | | | yes | | | | | yes | Manfufacturer: pro-sw, Model: PS-15-ES (according to ewelink app) | -| [1 Gang Generic Wall Switch](https://www.aliexpress.com/item/1-Gang-US-EU-UK-Plug-Wall-Wifi-Light-Switch-Smart-Touch-LED-Lights-Switch-for/32934184095.html) | yes | | | yes | | | yes | | yes | manfufacturer: KingART, model: KING-N1 (according to ewelink app), Chip: PSF-B85 (ESP8285) | -| WHDTS WiFi Momentary Inching Relay | yes | | | | | | | | | displayed as a switch button | -| [MHCOZY WiFi Wireless 5V/12V](https://www.amazon.com/gp/product/B07CJ6DSQC/ref=oh_aui_search_detailpage?ie=UTF8&psc=1) | yes | | | | | | | | | | -| [Geekcreit 2 Channel AC 85V-250V](https://www.ebay.es/itm/Geekcreit-2-Channel-AC-85V-250V-APP-Remote-Control-WIFI-Wireless-Switch-Socket-F-/162844446103) | yes | | | | | yes | | | | | -| [Smart Wi-Fi Outlet](https://www.amazon.com/gp/product/B073VK9X49/ref=oh_aui_detailpage_o01_s01?ie=UTF8&psc=1) | yes | | | | | | | | | | - +| Model | Supported | 1.6 | 1.8.1 | 2.6 | 2.6.1 | 2.7.0 | 2.7.1 | 3.0.0 | 3.0.1 | 3.3.0 | Remarks | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------:|:---:|:-----:|:---:|-------|-------|:-----:|:-----:|:-----:|:----------------------------:|--------------------------------------------------------------------------------------------| +| Sonoff Basic | yes | yes | yes | yes | | | | yes | | | | +| Sonoff Dual | yes | | | | | | | | | | | +| Sonoff RF | yes | | | yes | yes | | | yes | | | | +| Sonoff SC (retired) | | | | | | yes | | | | | hum/temp/dust/light/noise sensors | +| Sonoff G1 | ? | | | | | | | | | | | +| Sonoff 4CH Pro | yes | | | yes | | | yes | | yes | | | +| Sonoff 4CH Pro R2 | yes | | | yes | | | | yes | yes | | | +| Sonoff S20 | yes | | yes | | | | | yes | | | | +| Sonoff S30 | yes | | | | | | | yes | | | | +| Sonoff S31 | yes | | | | | | | | | | + power/current/voltage sensors | +| [Sonoff S26](https://www.aliexpress.com/item/Sonoff-S26-WiFi-Smart-Socket-Wireless-Plug-Power-Socket-Smart-Home-Switch-Smart-Remote-Control-for/32956551752.html) | yes | | | yes | | | | yes | | yes | version: Euro | +| Sonoff T1 1C | yes | | | yes | | | | | | | | +| Sonoff T1 EU 2C | yes | | | | | | yes | | | | | +| Sonoff T1 UK 3C | yes | | | yes | | | yes | | | | | +| Sonoff T1 US 3C | yes | | | | | | | | | | | +| Sonoff TX 1C | yes | | | | | | | | | yes | | +| Sonoff Pow | yes | | | | | | | | | | + power sensor | +| Sonoff Pow R2 | yes | | | | | | | | | partial **NO sensors data!** | + power/current/voltage sensors | +| Sonoff TH10/TH16 | yes | | | | | | | | | | + temp/humidity sensors | +| Sonoff iFan02 | yes | | | | | | | | | | it creates 4 switches, 1 for the light and 3 for the various fan speeds | +| Sonoff iFan03 | yes | | | | | | | | | | it creates 4 switches, 1 for the light and 3 for the various fan speeds | +| Sonoff HT-TH31 | ? | | | | | | | | | | | +| [Sonoff Slampher RF](https://www.gearbest.com/smart-light-bulb/pp_1824903.html) | yes | | | | | | yes | yes | yes | yes | | +| [3 Gang Generic Wall Switch](https://www.amazon.in/gp/product/B07FLY398G) | yes | | | yes | | | | | | yes | Manfufacturer: pro-sw, Model: PS-15-ES (according to ewelink app) | +| [1 Gang Generic Wall Switch](https://www.aliexpress.com/item/1-Gang-US-EU-UK-Plug-Wall-Wifi-Light-Switch-Smart-Touch-LED-Lights-Switch-for/32934184095.html) | yes | | | yes | | | | yes | | yes | manfufacturer: KingART, model: KING-N1 (according to ewelink app), Chip: PSF-B85 (ESP8285) | +| WHDTS WiFi Momentary Inching Relay | yes | | | | | | | | | | displayed as a switch button | +| [MHCOZY WiFi Wireless 5V/12V](https://www.amazon.com/gp/product/B07CJ6DSQC/ref=oh_aui_search_detailpage?ie=UTF8&psc=1) | yes | | | | | | | | | | | +| [Geekcreit 2 Channel AC 85V-250V](https://www.ebay.es/itm/Geekcreit-2-Channel-AC-85V-250V-APP-Remote-Control-WIFI-Wireless-Switch-Socket-F-/162844446103) | yes | | | | | | yes | | | | | +| [Smart Wi-Fi Outlet](https://www.amazon.com/gp/product/B073VK9X49/ref=oh_aui_detailpage_o01_s01?ie=UTF8&psc=1) | yes | | | | | | | | | | | `yes` = confirmed version, [empty] = unknown for sure ## Updates @@ -117,11 +117,16 @@ This is just a proof of concept because I searched for it and there was no imple Feel free to properly ask support for new devices using the guidelines mentioned in the section above regarding the `debug` section (or [the older basic version](https://github.com/peterbuga/HASS-sonoff-ewelink/tree/master/sonoff-debug)) / report bugs / request features / fork (& pull request) and I'll try to see what I can do. ## Credits -- most of the logic & code was done (partialy) porting this awesome repo (+those that it extends itself) https://github.com/howanghk/homebridge-ewelink +- most of the logic & code was done (partially) porting this awesome repo (+those that it extends itself) https://github.com/howanghk/homebridge-ewelink - [@2016for](https://github.com/2016for) for assisting me with properly integrating the switches with multiple outlets - [@fireinice](https://github.com/fireinice) for providing the mandarin implementation -- [@SergeyAnokhin](https://github.com/SergeyAnokhin) for adding power metter info to entity attributes -- [@Michaelrch](https://community.home-assistant.io/u/michaelrch) for awesome support! +- [@SergeyAnokhin](https://github.com/SergeyAnokhin) for adding power meter info to entity attributes +- [@difelice](https://github.com/difelice) for debugging support + +#### awesome ❤️ & support 🙌! +- [@Michaelrch](https://community.home-assistant.io/u/michaelrch) +- [@daboshman](https://github.com/daboshman) +- [@primalnow](https://github.com/primalnow) ## Donate diff --git a/sonoff/__init__.py b/sonoff/__init__.py index 05c679e..8a5b227 100644 --- a/sonoff/__init__.py +++ b/sonoff/__init__.py @@ -80,7 +80,6 @@ def __init__(self, hass, config): self._password = config.get(DOMAIN, {}).get(CONF_PASSWORD,'') self._api_region = config.get(DOMAIN, {}).get(CONF_API_REGION,'') self._entity_prefix = config.get(DOMAIN, {}).get(CONF_ENTITY_PREFIX,'') - self._grace_period = timedelta(seconds=config.get(DOMAIN, {}).get(CONF_GRACE_PERIOD,'')) self._scan_interval = config.get(DOMAIN, {}).get(CONF_SCAN_INTERVAL) self._sonoff_debug = config.get(DOMAIN, {}).get(CONF_DEBUG, False) @@ -601,7 +600,7 @@ def on_open(self, *args): 'userAgent' : 'app', 'version' : 6, 'nonce' : ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8)), - 'apkVesrion': "1.8", + 'apkVersion': "1.8", 'os' : 'iOS', 'at' : self._sonoff.get_bearer_token(), 'apikey' : self._sonoff.get_user_apikey(),