Live Chat
  • One stop service: solve all your problems
  • Orders Tracking and shipped out notification
  • More campaigns, even more discounts!
  • Need help before making an order?
  • Chat with us in real-time.
  • For Aftersale issues, just submit a ticket. We will reply within 24 hours.
  • Multi-language service
  • 24/7 support available
Hi! Log Out Log In SIGN UP
Home > How To > How to activate Sonoff basic 3 DIY mode and connect to Home assistant?
Lenovo-E1
How to activate Sonoff basic 3 DIY mode and connect to Home assistant?

How to activate Sonoff basic 3 DIY mode and connect to Home assistant?

By  Sigismondo Eisenhower 2019-08-27 3829 0

Sonoff Basic R3 IS AN DIY compatible WiFi smart switch. It can directly control household appliances via smartphones, or Amazon Alexa and Google Assistant. Today we will talk about how to activate its DIY mode and connect to the Home assistant.

How to activate Sonoff basic R3 DIY mode?

Step 1: To activate the DIY mode, you need to disassemble the unit's housing. Close the contact pair others board.

How to activate Sonoff basic 3 DIY mode and connect to Home assistant 

Step 2: Enter githnab ieaad sonoff

How to activate Sonoff basic 3 DIY mode and connect to Home assistant 

Step 3: Select tools folder

Step 4: In which there is a utility to work in DIY mode, I recommend the version with the word log in the name. There is an additional logging window, which will be useful when configuring. In the other folder, there is an instruction in pdf format, it will also be very useful. We save everything on our disk.

Step 5: The Sonoff basic R3 switched to DIY mod, enabled in the search mode of the access point with the name sonoffDiy and password 20170618sn as specified in the instruction.

How to activate Sonoff basic 3 DIY mode and connect to Home assistant 

Step 6: Create such an access point on your smartphone. Sonoff basic R3 will connect itself to it.  After that we connect the computer to the same network and start the utility DIY mode tool saved from github. Which automatically detects the relay located in the same local network.

Step 7: The most useful thing here is the device id, and its IP address, which can be seen in the logging window. With the help of this program it is possible to switch on and off, set the start mode, switch on the pulse mode, fill in the firmware and set up the wi-fi network parameters.

But it's all in theory, but in practice the program was always writing something like "not part" and did not affect the relay in any way, although the real status of the relay tracked.

Step 8: Using REST commands and used the Advanced Rest Client extension for Google Chrome. You can download any analogue.

How to activate Sonoff basic 3 DIY mode and connect to Home assistant 

Description of REST commands is available in the pdf file from the vendor's repository; for them we will need the device ID, which is visible in the application and its IP address - from the logging window.

For example, the path to /zeroconf/switch and the switch on or off command are used to enable or disable

And to change the wi-fi network path to /zeroconf/wifi and transfer the name and password of the network. All parameters can be changed in the same way - default status, pulse mode, etc.

In the Advanced Rest Client extension - at the top we specify the method - POST, IP address and path, in this example /zeroconf/switch, and in the request body - data. And the body of the request described in the instruction does not work.

We have examples of the correct drafting of requests - the key difference is the use of slashes in data transmission. A text example of one of the requests is

{"sequence": "${now}", "deviceid": "1000906b35", "encrypt":false, "selfapikey": "123", "data": "{\"switch\":\"on\"}"}

Example of a request on the way /zeroconf/startup - which sends relays to keep their current state when restarting on power supply

For convenience, in the body of the request, you can place the data in a column, moving the rows after each comma. This is data reception and wi-fi signal strength, the response from the relay under the query window.

And with this request, I was able to transfer the relay to the main wi-fi network and saved me from having to keep the phone in the access point mode.

How to connect Home Assistant?

After these manipulations, it is possible to integrate the relay into the Home Assistant system - so far at the level of command transmission for switching on and off, but still without status tracking. Although I am sure that integration for DIY mode sonoff will be created soon.

For control in the rest_command section - by default it is written in the configuration.yaml file, I have written commands to enable and disable it - using the same paths, POST method and request body.

How to activate Sonoff basic 3 DIY mode and connect to Home assistant​ 

My Home Assistant configuration can be found here .

After restarting the intanza to apply the changes, new commands appear in the service section.

When started up, the relay reacts instantly. The start can be tied to virtual switches, scripts and automation, with no need for any soldering iron intervention and the relay can be easily returned to standard operation mode.

Conclusion

Sonoff Basic R3 is one of the most affordable, controllable relays in terms of price. The manufacturer has taken serious steps towards integration with third-party systems and the DIY mode is already working. I think that full integration with Home Assistant, which will monitor the status of the relay, is not far off.


 You may also want to read:
 The new Huami Amazfit smart sports watch 3 (Amazfit Verge 3) will be unveiled at August 27
 OPPO Enco Q1 appearance leaked: three colors
 GoPro Hero 8: Does a mega leak show the new action camera?

Gearbest get it free

Extensive Product Selection

● Over 300,000 products

● 20 different categories

● 15 local warehosues

● Multiple top brands

Convenient Payment

● Global payment options: Visa, MasterCard, American Express

● PayPal, Western Union and bank transfer are accepted

● Boleto Bancario via Ebanx (for Brazil)

Prompt Shipping

● Unregistered air mail

● Registered air mail

● Priority line

● Expedited shipping

Dedicated After-sales Service

● 45 day money back guarantee

● 365 day free repair warranty

● 7 day Dead on Arrival guarantee (DOA)

Prev article:How to set Windows Link with Samsung Galaxy Note 10?

Next article:i12 TWS Earbuds Pairing Problem Fix Guide

You might also like: