Sonoff Home Assistant Integration

Sonoff Home Assistant Integration with Sonoff LAN

Connecting Sonoff devices to Home Assistant just keeps getting easier and easier! Right now, using the Sonoff LAN integration is the easiest and quickest way to set your Sonoff devices up in Home Assistant. The integration is possible thanks to a custom component called Sonoff LAN created by AlexxIT.

Install HACS (Home Assistant Community Store)

In order to set up this component, you will first need to install HACS; the Home Assistant Community Store. This allows you to install custom components created by the Home Assistant community, that are not found in the Add-on Store. The process to install HACS changes occasionally, and can by found at https://hacs.xyz.

Navigate to the Add-on Store and download Terminal & SSH. You can search SSH in the store to find it.
Install and Start the add-on when it finishes downloading.
Open the web UI using the link in the bottom corner of the screen.
  1. Navigate to the Add-on Store and download Terminal & SSH. You can search SSH in the store to find it.
  2. Install and Start the add-on when it finishes downloading.
  3. Open the web UI using the link in the bottom corner of the screen.
Enter the HACS install script.
When the install is finished, restart Home Assistant and clear your browser's cookies.
  1. Here you’ll find the Home Assistant command line. Enter the HACS install script from here: https://hacs.xyz/docs/installation/installation#home-assistant-os
  2. When the install is finished, restart Home Assistant and clear your browser’s cookies.
After restarting Home Assistant, go to the Integrations section of the Configuration tab.
Search for HACS.
  1. After restarting Home Assistant, go to the Integrations section of the Configuration tab.
  2. Search for HACS.
Let the integration install, this can take a few minutes, be patient.
HACS is now installed! You can access it from the sidebar.
  1. Let the integration install, this can take a few minutes, be patient.
  2. HACS is now installed! You can access it from the sidebar.

Install the Sonoff LAN Component

From the Home Assistant Community Store tab, click or tap on Integrations.
On the HACS Integrations page, click Explore & Add Repositories.
Search from AlexxIT/SonoffLAN and click the integration to go to the info screen.
  1. From the Home Assistant Community Store tab, click or tap on Integrations.
  2. On the HACS Integrations page, click Explore & Add Repositories.
  3. Search for AlexxIT/SonoffLAN and click the integration to go to the info screen.
Read through the info screen and click Install this Repository in HACS.
Install Sonoff LAN.
Restart Home Assistant again to finish the installation process.
  1. Read through the info screen and click Install this Repository in HACS.
  2. Install Sonoff LAN.
  3. Restart Home Assistant again to finish the installation process.

Configure the Sonoff Component

The basic integration requirements are just your eWeLink login credentials. This example adds the power, current, and voltage sensors for the S31.
sonoff:
  username: [email or phone number]
  password: [password]
sonoff:
  username: [email or phone number]
  password: [password]
  sensors: [power, current, voltage]
  mode: local
  reload: always 
  1. The basic integration requirements are just your eWeLink login credentials. Learn more about configuration options here.
    • This example adds the power, current, and voltage sensors for the S31.
After you finish configuring the Sonoff LAN component, save your changes.
Check that your configuration is valid, and restart Home Assistant.
  1. After you finish configuring the Sonoff LAN component, save your changes.
  2. Check that your configuration is valid, and restart Home Assistant.
On successful integration, you will now have access to most if not all of the Sonoff devices you connected to your eWeLink account!
  1. On successful integration, you will now have access to most, if not all of the Sonoff devices you connected to your eWeLink account!

Conclusion

Sonoff devices have gotten much easier to integrate with Home Assistant recently and makes a locally controled smart home much easier to attain.

Leave a Reply