Sonoff and Home Assistant (Best $5 light automation)

[et_pb_section fb_built=”1″ fullwidth=”on” _builder_version=”3.22.3″][et_pb_fullwidth_post_title comments=”off” featured_image=”off” text_background=”on” _builder_version=”3.2″ meta_text_color=”#000000″ background_image=”https://smarthome.university/wp-content/uploads/2018/02/Sonoff-home-assistant.png” custom_margin=”0px|0px|0px|0px” custom_padding=”200px|0px|20px|0px”][/et_pb_fullwidth_post_title][/et_pb_section][et_pb_section fb_built=”1″ _builder_version=”3.22.3″ custom_margin=”0px|0px|0px|0px” custom_padding=”0px|0px|0px|0px”][et_pb_row custom_padding=”|0px|20px|0px” custom_margin=”||0px|” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”|700|||||||” text_font_size=”16px” custom_margin=”20px|20px|20px|20px” saved_tabs=”all”]Sonoff and Home Assistant are made for each other – both practical and reliable. Especially if you use customer firmware. This is a detailed guide how to make them work together.
[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”0px||0px|” _builder_version=”3.22.3″][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_orientation=”center” custom_margin=”0px||0px|” custom_padding=”0px||0px|”]

Sonoff in itself is a great outlet and can be use independently with the useful app. But to unlock its true potential, you can flash custom firmware and connect it to your Home Assistant configuration.

Hardware Prerequisites:

  1. Sonoff outlet itself (£5 – £8)
  2. FTDI to upload firmware – this is to upload firmware
  3. Mini usb cable – to connect to FTDI
  4. Extension lead – you can use existing lead if you have it around
  5. Connectors – to connect FTDI to Sonoff
  6. Windows PC

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”0px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat”]

1. Install and configure Arduino IDE

  • Arduino IDE is a tool that will allow you to modify and upload firmware to Sonoff

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”0px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]a) Download and install the latest version of Arduino IDE. (v. 1.8.5 as of 11/02/18)

b) Go to Arduino IDE folder and create “portable” folder
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/1b.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]c) Launch Arduino IDE by opening “arduino.exe” file, go to preferences and paste the link below to “board manager url”

http://arduino.esp8266.com/versions/2.4.0/package_esp8266com_index.json
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/1c.gif” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]d) Now we need to install board manager. Go to “Tools” and board manager and type “esp82″. This will give you just one option which you need to install
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/2esp82.gif” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]e) Next, select the options as per image on the right in “Tools” menu for Board, Flash Mode, Flash Size, Debug port, Debug Level, IwIP Variant, Reset Method, Crystal Frequency, Flash Frequency, CPU Frequency, Upload Speed.
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/1e.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]f) Replace in Arduino IDE folder portable\packages\esp8266\hardware\esp8266\2.3.0 file platform.txt with the Tasmota Source code file arduino\version 2.4.0\platform.txt
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/1e1.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]g) Copy all files from the Tasmota release Source code folder lib into your sketchbook\libraries folder
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/1f1.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”0px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat”]

2. Download and customise Sonoff Firmware

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]a) Download Sonoff-Tasmota firmware

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]b) In Arduino IDE go to File > Open and open “sonoff.ino” file in “sonoff” folder of the firmware files you just extracted
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/2b.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]c) Open tab “user_config.h” and enter your wifi network name and password
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/2c.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]c) Configure MQTT Server

  • This is how your Sonoff will communicate with Home Assistant. If you don’t have this installed (it takes 5 min) follow this guide from Ben
  • In the same “user_config.h” file enter the IP address, port, username and password for MQTT server

 
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/mqtt.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]c) Then you can disable some of the features so you have more space in your Sonoff (can be pain sometimes). In my case I disabled DOMOTICZ, USE_WS2812 and USE_IR_HVAC
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/disable.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]c) Check if it works by pressing a checkmark on the top left corner in Arduino IDE
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/check.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]c) You should see “Done compiling” in your screen below. Do not worry if any error messages, just check that you have done all the steps above
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/5done.gif” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”0px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat”]

2. Time to flash!

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]Now focus! This might not be very easy to start with, but once done you will be very proud of yourself.
[/et_pb_text][et_pb_cta title=”Disconnect from Mains!” _builder_version=”3.16″ header_text_color=”#e02b20″ background_color=”#ffffff” border_width_all=”2px” border_color_all=”#e02b20″ background_layout=”light” custom_margin=”20px|30px|0px|30px” custom_padding=”0px|0px|0px|0px” button_text_size__hover_enabled=”off” button_one_text_size__hover_enabled=”off” button_two_text_size__hover_enabled=”off” button_text_color__hover_enabled=”off” button_one_text_color__hover_enabled=”off” button_two_text_color__hover_enabled=”off” button_border_width__hover_enabled=”off” button_one_border_width__hover_enabled=”off” button_two_border_width__hover_enabled=”off” button_border_color__hover_enabled=”off” button_one_border_color__hover_enabled=”off” button_two_border_color__hover_enabled=”off” button_border_radius__hover_enabled=”off” button_one_border_radius__hover_enabled=”off” button_two_border_radius__hover_enabled=”off” button_letter_spacing__hover_enabled=”off” button_one_letter_spacing__hover_enabled=”off” button_two_letter_spacing__hover_enabled=”off” button_bg_color__hover_enabled=”off” button_one_bg_color__hover_enabled=”off” button_two_bg_color__hover_enabled=”off”]It is very important that you disconnect your Sonoff from main. It can shock you if you did not do that!
[/et_pb_cta][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]a) Unpack your Sonoff and open up the box to expose for connection with FDTI
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_video src=”https://smarthome.university/wp-content/uploads/2018/02/20180211_153445.mp4″ _builder_version=”3.0.92″][/et_pb_video][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]a) Connect the wiring between your programmer (FTDI) and Sonoff with your connectors

  • See picture on the right of how to find the hole in Sonoff and connection with FTDI
  • On FTDI the correct holes will be annotated
  • Notice that you need to cross connect TX and RX cables

[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/connect.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]a) Holding the button pressed, connect the USB cable. If all done correct, there should be a quick LED light blink in FTDI.
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_video src=”https://smarthome.university/wp-content/uploads/2018/02/20180211_154107.mp4″ _builder_version=”3.0.92″][/et_pb_video][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]d) Make sure that you selected the correct COM port (it should be appearing and disappearing once you insert the FTDI from your PC)
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/1e.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]a) Press Upload button in Arduino IDE
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/flash.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]a) Now enjoy as the LED will be blinking on FDTI and at the bottom of Arduino IDE you will see Upload Complete message
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/5done-1.gif” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]a) Once flashed, the LED on Sonoff should flash green once like in my video. Big respects if you managed to do it in the first go (took me at least 10 attempts)
[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_video src=”https://smarthome.university/wp-content/uploads/2018/02/20180211_161215.mp4″ _builder_version=”3.0.92″][/et_pb_video][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”0px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat”]

3. Customise Shit out of it!

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]Well done on following all the steps! The last part left – you need to connect it to wifi and integrate with your Home Assistant configuration.
[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]a) Connecting to wifi

  • If you entered your correct Wifi SSID and Password your sonoff will connect automatically
  • Alternatively, you can use WPS to connect to wifi. To do it, press “WPS” on your router and press the button on outlet 5 times after you plugged it in. That is it.

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]b) Find sonoff IP address

  • This is only needed if you want to change any config for your Sonoff
  • Go to your router admin panel (usually 192.168.1.1) and go to attached devices or something similar.
  • You will see one of the new devices which will have sonoff in its description
  • Alternatively you can use any of the ip scanners in your phone.

[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/router.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]b) Access Sonoff Web-interface

  • Go to your favourite browser and enter the IP address you just identified
  • You will see the web interface where you can change settings including MQTT server details

[/et_pb_text][/et_pb_column][et_pb_column type=”1_2″ _builder_version=”3.0.47″][et_pb_image src=”https://smarthome.university/wp-content/uploads/2018/02/webinterface.png” show_in_lightbox=”on” align_tablet=”center” align_last_edited=”on|desktop” _builder_version=”3.23″][/et_pb_image][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]b) Connect to Home assistant

  • Go to your configuration.yaml file and enter the following code:

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_color=”#474350″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” border_radii=”on|5px|5px|5px|5px” background_layout=”dark” custom_margin=”20px|20px|50px|50px” custom_padding=”20px|20px|20px|20px”]

switch: 
  - platform: mqtt
    name: "OneExtra"
    icon: mdi:camera
    command_topic: "cmnd/sonoff8/power"
    state_topic: "stat/sonoff8/POWER"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    retain: trueextra

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_margin=”|||30px”]Now you have a new switch which you can turn on and off
[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_text _builder_version=”3.0.92″ text_font=”Open Sans||||||||” background_color=”#474350″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” border_radii=”on|5px|5px|5px|5px” background_layout=”dark” max_width=”100%” custom_margin=”20px|50px|20px|50px” custom_padding=”20px|20px|20px|20px” global_module=”27678″ saved_tabs=”all”]

zwave:
  usb_path: /dev/ttyUSB0

zha:
  usb_path: /dev/ttyUSB1
  database_path: /config/zigbee.db

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”10px|20px|0px|20px” custom_margin=”|||” padding_right_1=”20px” padding_left_2=”10px” module_class=” et_pb_row_fullwidth” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” width=”100%” width_tablet=”100%” width_last_edited=”on|desktop” max_width=”100%” max_width_tablet=”100%” max_width_last_edited=”on|desktop” make_fullwidth=”on”][et_pb_column type=”4_4″ _builder_version=”3.0.47″][et_pb_cta title=”Was it helpful? ” admin_label=”Was it helpful?” _builder_version=”3.16″ header_text_color=”#474350″ border_radii=”on|5px|5px|5px|5px” border_width_all=”2px” border_color_all=”#038fc7″ custom_margin=”30px|20px|10px|30px” custom_padding=”20px|20px|20px|0px” saved_tabs=”all” button_text_size__hover_enabled=”off” button_one_text_size__hover_enabled=”off” button_two_text_size__hover_enabled=”off” button_text_color__hover_enabled=”off” button_one_text_color__hover_enabled=”off” button_two_text_color__hover_enabled=”off” button_border_width__hover_enabled=”off” button_one_border_width__hover_enabled=”off” button_two_border_width__hover_enabled=”off” button_border_color__hover_enabled=”off” button_one_border_color__hover_enabled=”off” button_two_border_color__hover_enabled=”off” button_border_radius__hover_enabled=”off” button_one_border_radius__hover_enabled=”off” button_two_border_radius__hover_enabled=”off” button_letter_spacing__hover_enabled=”off” button_one_letter_spacing__hover_enabled=”off” button_two_letter_spacing__hover_enabled=”off” button_bg_color__hover_enabled=”off” button_one_bg_color__hover_enabled=”off” button_two_bg_color__hover_enabled=”off”]Did you use the tutorial? Have you noticed any errors? Can we improve?

Please add your comments below so we can help you further or improve the content.
[/et_pb_cta][/et_pb_column][/et_pb_row][/et_pb_section]

0 0 votes
Article Rating
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Scroll to Top