All Projects → peterbuga → Hass Sonoff Ewelink

peterbuga / Hass Sonoff Ewelink

Licence: mit
Home Assistant component to control Sonoff/eWeLink devices with original firmware

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Hass Sonoff Ewelink

Espurna
Home automation firmware for ESP8266-based devices
Stars: ✭ 2,650 (+279.11%)
Mutual labels:  sonoff
sonoff-basic-openhab
A Sonoff Basic firmware to work with openHAB
Stars: ✭ 21 (-97%)
Mutual labels:  sonoff
home
Monorepo for all home automation related development, including integrated firmware, PCBs, configuration, and bridges
Stars: ✭ 104 (-85.12%)
Mutual labels:  sonoff
Sonoff-HomeKit
Эта прошивка делает Sonoff Basic совместимым с Apple Homekit
Stars: ✭ 24 (-96.57%)
Mutual labels:  sonoff
Open-Home-Automation
Open Home Automation with Home Assistant, ESP8266/ESP32 and MQTT
Stars: ✭ 905 (+29.47%)
Mutual labels:  sonoff
esphome-devices
ESPHome Device Configurations Repository - A database of user submitted configurations for a variety of devices which can be flashed to run ESPHome.io firmware.
Stars: ✭ 71 (-89.84%)
Mutual labels:  sonoff
Home Assistant Config Fr
🏠Configuration de Home Assistant en français. 👨🏻‍💻 N'hésitez pas à ⭐ mon repo et à copier les bonnes idées ! 🇨🇵
Stars: ✭ 175 (-74.96%)
Mutual labels:  sonoff
Tdm
GUI application to discover and monitor devices flashed with https://github.com/arendst/Sonoff-Tasmota
Stars: ✭ 385 (-44.92%)
Mutual labels:  sonoff
sonoff-homie
Homie based software for Sonoff module
Stars: ✭ 25 (-96.42%)
Mutual labels:  sonoff
Sonoff-ESP8266-HomeKit
Firmware to control your Sonoff natively and directly through HomeKit.
Stars: ✭ 58 (-91.7%)
Mutual labels:  sonoff
Neon.HomeControl
Home Automation System, similar to HomeAssistant but made with .net core and ❤️
Stars: ✭ 46 (-93.42%)
Mutual labels:  sonoff
EspBuddy
Wrapper to easily upload (OTA or Serial), backup, batch query, monitor ESP8266 boards using Esptool.py, Espota.py and Platformio
Stars: ✭ 47 (-93.28%)
Mutual labels:  sonoff
Tasmota-on-WEMOS
Install Tasmota software on a WeMos D1 mini (pro) with PlatformIO
Stars: ✭ 24 (-96.57%)
Mutual labels:  sonoff
Tasmota
Alternative firmware for ESP8266 with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
Stars: ✭ 16,624 (+2278.25%)
Mutual labels:  sonoff
Kmansonoff
Firmware for ESP8266 based itead Sonoff switches for use with HomeAssistant / mqtt
Stars: ✭ 282 (-59.66%)
Mutual labels:  sonoff
Homebridge Ewelink
Homebridge plugin to control eWeLink devices with original firmware.
Stars: ✭ 208 (-70.24%)
Mutual labels:  sonoff
ioBroker.sonoff
Control Sonoff-Tasmota devices via ioBroker
Stars: ✭ 34 (-95.14%)
Mutual labels:  sonoff
Tasmoadmin
Website to manage Sonoff Devices flashed with Tasmota
Stars: ✭ 560 (-19.89%)
Mutual labels:  sonoff
Sonoff Homeassistant
Firmware for ESP8266 based itead Sonoff switches for use with HomeAssistant
Stars: ✭ 354 (-49.36%)
Mutual labels:  sonoff
node-red-contrib-tasmota
Tasmota devices for NodeRed
Stars: ✭ 16 (-97.71%)
Mutual labels:  sonoff

Home Assistant component for original firmware Sonoff / eWeLink smart devices

Simple Home Assistant component to add/control Sonoff/eWeLink smart devices using the stock firmware and retaining the cloud capabilities.


WARNING: completely deactivate the sonoff component from HA while doing a firmware update, due to auto-relogin function you might be kicked out of the app before the process is completed. I would not be held liable for any problems occuring if not following this steps!


CHECK COMPATIBILITY LIST BELOW (not everyday updated)! TRY THE COMPONENT FIRST AND IF IT DOESN'T WORK FOR YOUR DEVICE DON'T COMPLAIN AND OPEN A PROPER ISSUE

Setup

To setup add to your configuration.yaml:

sonoff:
  username: [email or phone number]
  password: [password]
  scan_interval: 60 #(optional, lower values than 60 won't work anymore!)
  grace_period: 600 #(optional)
  api_region: 'eu' #(optional)
  entity_prefix: True #(optional)
  debug: False #(optional)

And copy the *.py files in custom_components folder using the same structure like defined here:

 custom_components
    └── sonoff
        └── __init__.py
        └── switch.py
        └── sensor.py

email [Deprecated] used only for compatibility, may be eliminated in future.

username the username that you registered for ewelink account be it an email or a phone number (the phone number should lead with region number, '+8612345678901' for example).

scan_interval you can define how fast the state of devices is refreshed (by default every 60sec). for example if you change the switch from an external source like Alexa or Google Home the change will show up in HA in maximum less than specified period, while changing it using HA interface/actions/etc it's instantly

grace_period eWeLink app allows only one active session at a time, therefore this will temporarily block HA refreshes for the specified amount (in seconds) to allow (or better said after) you to login in the app and do required changes to your devices. following that sonoff component does an internal re-login invalidating the mobile session and the process restarts. (as a workaround for this, you can create a 2nd account and share the devices from main one, therefore one will be used in HA another one in mobile app)

api_region this component tries to find, login & connect to the proper region assigned to you. specifying a proper region will help the component to load faster and reconnect after the expired grace period explained above, possible values: eu (default), us, as or cn

entity_prefix this option removes the sonoff_ prefix from entities name (it's more or a less a compatibility mode between previous master vs websocket branch implementations)

debug log generation / new device / new features requests

debug if enabled this will give you the ability to generate a log of messages from ewelink that can be easily posted here to debug/implement new devices.

steps and how it works:

  • this option creates a pseudo switch entity switch.sonoff_debug (notice it won't show up automatically in frontend in lovelace you have to manually add it or toggle it from Developer tools > Services section).
  • to generate a sonoff debug log toggle the pseudo-switch ON and the capture of messages will silently start in the background. now pick up the phone -> open eWeLink app and start changing settings of your Sonoff device but not faster than 10+ seconds between each change.
  • when you finish toggle the pseudo-switch OFF and a new (very long) persistent notification will show up.
  • go to Developer tools > States section and look for a persistent_notification.notification entity (impossible to miss due to its extremely long attribute text) and copy the message from there (to remove this notifications and others just push the button Dismiss them from main HA notifications area and you can restart the process and generate a new log if needed).

INFORMATION: it'll be better if you share the device-to-debugged to a 2nd eWeLink account and use this in HA and main account in mobile app, this way you won't be logged out of the app anymore and the generated log will be restricted to only 1 device

NOTICE: you should NOT leave debug-mode enabled for everyday use, please please just don't!

This is just a proof of concept because I searched for it and there was no implementation to use Sonoff/eWeLink devices without flashing them. (althought I know how to do it, I don't have a real extensive usage for now and I prefer to keep them on stock firmware).

Compatibility list

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 Basic R3 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 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 yes yes yes yes yes
3 Gang Generic Wall Switch yes yes yes Manfufacturer: pro-sw, Model: PS-15-ES (according to ewelink app)
1 Gang Generic Wall Switch 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 yes
Geekcreit 2 Channel AC 85V-250V yes yes
Smart Wi-Fi Outlet yes
Sonoff Mini yes yes yes

yes = confirmed version, [empty] = unknown for sure

Updates

  • 2019.04.08
    • HA0.88+ new component structure
    • added basic rules to create the same number of switches as presented by the physical device
  • 2019.02.++ alternate faster version with state updates over websocket developed
  • 2019.01.06 create sensors for devices that have support for power/current/voltage/temperature/humidity
  • 2018.12.05
    • mandarin phone number login support
    • removed entity_name option, the entities will have a fixed structure from now on
  • 2018.12.01
    • ability to control devices with multiple switches
    • added mobile app specified device-name as default to be listed in HA entity, added entity_name option and removed the default sonoff_ prefix
    • fixed bug that will show device as unavailable in the grace period
  • 2018.11.29 shared devices from another account can be used also
  • 2018.11.28
    • mobile app-like login to the closest region
    • added scan_interval option
    • added grace_period option

Requests / Bugs

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) / report bugs / request features / fork (& pull request) and I'll try to see what I can do.

Credits

awesome ❤️ & support 🙌!

Donate

Feel free to help me invest in more devices to test and add faster new features to this component! paypal

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].