Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Sonoff Basic is an affordable device that provides users with smart home control. It is a WiFi-based wireless switch that can connect to a wide range of appliances.

Using original firmware

This integration allows you to explore new capabilities of this device, connecting it to the OpenDevice platform (without changing the original firmware), allowing it to be controlled through an open server, and using the APIs to develop solutions with that device.

Integration is provided by the extension: sonoff-bridge

Info

At present support for extensions is only allowed in private clouds / raspberry or raspberry or you can replace the firmware

ATTENTION: It does not work with devices running firmware version >= 1.6! you need replace need replace the firmware  firmware  (or check status of this)


Tested Devices:

  • Sonoff Dual (firmware 1.3)
  • Sonoff Single (firmware 1.3) 

Setup Wizard

Download the setup tool (***-standalone.zip), it will prepare the sonoff to connect to the opendevice server. It takes advantage of protocol security "failures", to configure the device and integrates it into OpenDevice

TIPs: It may be necessary to repeat this process more than once.

Settings:

  • ApiKey: Get API Key
  • Server: For local local installations use your LAN IP (Ex.: 192.168.2.121)
  • Default port: 8989



Installation 
Status
colourBlue
titlePrivate Cloud

Restart OpenDevice server: ./bin/opendevice restart

Run Wizard to configure Device

After successful setup, you must see on Devices Page:

Configuration 
Status
colourBlue
titlePrivate Cloud

The extension uses a separate ssl certificate for communication with SonOff, by default an embedded certificate is used. If necessary you can specify your certificate by editing odev.conf and adding:

sonoff.ssl.certificateFile=conf/sonoff.cert.pem
sonoff.ssl.certificateKey=conf/sonoff.key.pem

Replace Firmware

Another option if you want to use the official server (cloud.opendevice.io), is to flash a firmware using the arduino library. Basically SonOff is an ESP8266 !!

See guide: Device Setup

Guides for Sonoff flashing : 

https://medium.com/@jeffreyroshan/flashing-a-custom-firmware-to-sonoff-wifi-switch-with-arduino-ide-402e5a2f77b

Info
titleALERT

Select Device: Generic Esp8266, Flash Mode: DOUT

After flash: The USB port does not have enough current to power the module, you need plug it main power

GPIO Locations:

Basic GPIOs

Voice Control

An interesting application is to control this device through voice commands, see this guide for more details: