All Projects → mdopp → Simple Sonoff Server

mdopp / Simple Sonoff Server

Licence: bsd-2-clause
Emulates the original sonoff-cloud-servers within your local network.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Simple Sonoff Server

Sonoff-ESP8266-HomeKit
Firmware to control your Sonoff natively and directly through HomeKit.
Stars: ✭ 58 (-57.35%)
Mutual labels:  sonoff
Open Home Automation
Open Home Automation with Home Assistant, ESP8266/ESP32 and MQTT
Stars: ✭ 820 (+502.94%)
Mutual labels:  sonoff
Home Assistant Configuration
My Home Assistant Config. For more Information visit ->
Stars: ✭ 102 (-25%)
Mutual labels:  sonoff
Kmansonoff
Firmware for ESP8266 based itead Sonoff switches for use with HomeAssistant / mqtt
Stars: ✭ 282 (+107.35%)
Mutual labels:  sonoff
Hass Sonoff Ewelink
Home Assistant component to control Sonoff/eWeLink devices with original firmware
Stars: ✭ 699 (+413.97%)
Mutual labels:  sonoff
Sonoff Hack
Custom firmware for Sonoff GK-200MP2B camera
Stars: ✭ 41 (-69.85%)
Mutual labels:  sonoff
Tasmota-on-WEMOS
Install Tasmota software on a WeMos D1 mini (pro) with PlatformIO
Stars: ✭ 24 (-82.35%)
Mutual labels:  sonoff
Ewelink Api
eWeLink API for JavaScript
Stars: ✭ 128 (-5.88%)
Mutual labels:  sonoff
Sonoff Homekit
Make your Sonoff Switch compatible with Apple Homekit! 🎉
Stars: ✭ 722 (+430.88%)
Mutual labels:  sonoff
Esp Homekit Devices
Project to add native Apple HomeKit support to any device with an ESP8266 chip
Stars: ✭ 1,153 (+747.79%)
Mutual labels:  sonoff
Sonoff Homeassistant
Firmware for ESP8266 based itead Sonoff switches for use with HomeAssistant
Stars: ✭ 354 (+160.29%)
Mutual labels:  sonoff
Tasmoadmin
Website to manage Sonoff Devices flashed with Tasmota
Stars: ✭ 560 (+311.76%)
Mutual labels:  sonoff
Sonofflan
Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
Stars: ✭ 1,016 (+647.06%)
Mutual labels:  sonoff
home
Monorepo for all home automation related development, including integrated firmware, PCBs, configuration, and bridges
Stars: ✭ 104 (-23.53%)
Mutual labels:  sonoff
Esparto
Esparto v3.3 is a rapid development framework, synchronous task queue and GPIO manager with web UI for ESP8266 devices
Stars: ✭ 108 (-20.59%)
Mutual labels:  sonoff
node-red-contrib-tasmota
Tasmota devices for NodeRed
Stars: ✭ 16 (-88.24%)
Mutual labels:  sonoff
Sonoffsocket
Switching Sonoff Basic and Sonoff S20 (Webserver or MQTT).
Stars: ✭ 28 (-79.41%)
Mutual labels:  sonoff
Addon Tasmoadmin
TasmoAdmin - Home Assistant Community Add-ons
Stars: ✭ 130 (-4.41%)
Mutual labels:  sonoff
Itead sonoff
Alternative firmware for Itead Sonoff switches, based on the MQTT protocol and a TLS connection
Stars: ✭ 115 (-15.44%)
Mutual labels:  sonoff
Tasmota Connect
Add your Tasmota devices as SmartThings devices
Stars: ✭ 51 (-62.5%)
Mutual labels:  sonoff

Simple SONOFF Server

DISCONTINUED due to certification problems on newer firmwares. See this issue for details.

Current State => Not finished yet, but works most of the time.

A lot of this code is based on the findings in this blog http://blog.nanl.de/2017/05/sonota-flashing-itead-sonoff-devices-via-original-ota-mechanism/ and https://blog.ipsumdomus.com/sonoff-switch-complete-hack-without-firmware-upgrade-1b2d6632c01

The idea was to have an Openhab Binding. And this is the concept implementation, that works good enough for me to start with. It can be used in combination with the HTTP Binding.

Configuration

I suggest to use => https://github.com/saryn/node-red-contrib-sonoff-server It solves a lot of problems like taking care of starting/stoping the server or keeping it running.

If you still want to use this directly:

Change the sonoff.config.json to fit your environment.

The "server" is the device, which should stay in contact with the SONOFF devices. In my case it was the Raspverry Pi, which also runs Openhab.

  • "httpsPort" can be any port.
  • "websocketPort" can be any port.

But make sure, that your router is allowing communication between devices.

{
    "router": {
        "SSID": "##########",
        "password": "###########"
    },
    "server": {
        "IP": "0.0.0.0",
        "httpPort": 1080,
        "httpsPort": 1081,
        "websocketPort": 443
    }
}

Setup a new device

There are two ways of setting up the devices. Either with the sonoff.setupdevice.js script, or with wget (or anything else that can post an http request to a specific server).

sonoff.setupdevice.js

Start sonoff.setupdevice.js on a computer you like. It will connect to the SONOFF device, so you will lose internet connection. When the scripts runs, you must long-click the black button on the device, and it will be configured to use the "server" as its cloud. Which now runs in your own network.

To run this on a linux device, the network manager must be installed. On an raspberry pi I would suggest to do the setup process manually with wget.

wget

(thanks @andrewerrington)

  1. Put the SonOff/Wemos device in AP mode (press and hold button for 5s)
  2. Find the device and connect to it (SSID: ITEAD-10000xxxxx Password: 12345678)
  3. Add route if necessary sudo route change 0.0.0.0 mask 0.0.0.0 10.10.7.1
  4. (optional) use wget to read device info wget -O- 10.10.7.1/device
  5. use wget to send local WiFi settings to device wget -O- --post-data='{"version":4,"ssid":"yourSSID","password":"yourSSID_PASSWORD","serverName":"n.n.n.n","port":1081}' --header=Content-Type:application/json "http://10.10.7.1/ap"

The device will automatically drop out of AP mode and tries to connect to WiFi and server.

running the server

Start sonoff.server.js This Server keeps the connection to the sonoff devices, and must run permanently.

  • /devices => list off all devices that are currently known to the server.
  • /devices/:deviceId/status => shows the status of the device
  • /devices/:deviceId/on => turns the device "on"
  • /devices/:deviceId/off => turns the device "off"
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].