- 9Timing Task
- 10Scene
Search for a Wi-Fi AP named tasmotaXXXXXX-#### (where XXXXXX is a string derived from the device's MAC address and #### is a number) and connect to it. In this example the Wi-Fi AP is named tasmota3D5E26-7718. When it connects to the network, you may get a warning that there is no Internet connection and be prompted to connect to a different. Sep 07, 2017 It is quite easy to get sonoff MAC address via http, just tap on information ( or type ipaddress/in? ) as example here's one of my sonoff.
Overview
Loop timer supported devices (updating):all 1 gang switch/socket(required firmware ver. 1.5.0 and higher, G1 is excluded from the list), including S20 smart socket, Sonoff Touch EU/US, Sonoff Basic, Sonoff SV, Sonoff TH10/TH16, Sonoff RF, Slampher, Sonoff Pow (required firmware ver. 2.0.3 and higher), Motor Clockwise/ Anticlockwise Running WiFi. Mar 21, 2017 Long click on manage button (let will start blinking fast). Look for wifi access point starting with “ITEAD-10000”. Connect to it with password “12345678”. Take into account, ITLead smart switch has time out in AP mode. Esptool readmac. Esptool flashid Which should provide the MAC address, and information on the flash memory chip. If those work, try flashing the firmware. Esptool -baud 921600 writeflash 0x0 sonoff.ino.generic.bin This often failed, way more often without the additional 3.3v power. If download progress stalls, try again.
eWeLink is a smart home control APP that can control all ITEAD home automation devices and cooperated products. It allows you to remote control and manage your favorite smart devices of different brands in a single App. The smart home devices connect to home appliances and electronic devices via WiFi, allowing you to remote control through the APP eWeLink. There isn't a limit to the number of devices you can add to eWeLink, although we usually say 150.
eWeLink Basic Functions:
Remote on/off
Countdown/schedule timer
Share control
Group/scene management
Scene/smart scene
By adding the smart home devices to the eWeLink account, users can control the devices by following and accessing to Coolkit's WeChat subscription account, or by adding a widget to mobile desktop later on.
Users can download latest iOS eWeLink from Apple APP Store and Android eWeLink from Google Play. Please scan below QR code. If you are using a lower version, please uninstall and then scan and download the latest version.
Now we will explain how to use eWeLink.
Registration and Log in
eWeLink supports multiple languages. It currently includes simplified Chinese, traditional Chinese, English, Danish, Russian, Italian, Polish, France, Spanish, German, Turkish, Slovakia, Greece, Bulgaria, Czech, Slovenian, Portuguese(Brazil), etc. It will support more languages in the future.
It supports registration by email or mobile phone number. We suggest you update your app to the latest version.Users from Asian countries should register with mobile phone number. While users outside Asian area should register with email address. Turkey users also need to register with phone number.But sometimes the app will judge which server is more stable in your location, then it will auto judge whether to let you connect with Asian servers (register with phone number) or other servers(register with email).
Select your country/region code, input a valid mobile phone number, then your phone will receive an SMS containing a verification code on the phone number you provided. If you do not receive the SMS, please disable SMS blocking. If registered by email address, you'll also need to select a random country code, you’ll receive an email containing a verification code. Fill in the verification code and password, confirm password and submit. For safety, the password should be no less than 8 characters. If you failed to receive any code, please submit a feedback on the App.
One account can only log in to one mobile phone. If you have logged in with phone A, later you log in with phone B, your device will auto-exit from phone A.
Reset Password
If you forget your password, please log out, go to the login interface. Click 'Forget Password' to reset.
WiFi Pairing and Device Addition
eWeLink obtains device status and controls devices by sending commands through the cloud server. This means all devices must first connect to the WiFi router and connect to our Amazon AWS server. So every new device must be paired with user's home WiFi and added to eWeLink account.
Before adding a device, Android phone must allow WiFi. Please make sure the WiFi your phone connects is the same as the one you select in eWeLink device pairing WiFi option. Please note that all eWeLink products should be paired via the WiFi router, starting from 3.1.0, LAN is not allowed any more.
Instructions are given below on how to pair with WiFi and add a new device:
Step 1. Long press your device WiFi pairing button until it begins fast blinking.
Step 2. Open eWeLink. Click '+' to add the device. For Android, please select the pairing icon according to how the LED blinks. Click NEXT.
For iOS, please go to phone Setting>WiFi>connect to the WiFi that begins with ITEAD-*****, enter default password 12345678. Then go back to eWeLink, select the pairing icon (TOUCH or AP) according to how the LED blinks. Tap on NEXT.
A reminder here: if the phone asks a similar question like 'eWeLink wants to locate your position, accept or reject?' Then please always click ACCEPT. Otherwise, it may cause a failed pairing.
Step 3. Enter your home WiFi SSID and password. You must make sure the WiFi your are entering with is the same with the one your phone connecting. If different, it will cause offline problem. If no password, keep it blank. For the present, eWeLink only supports 2.4G wifi communication protocol. 5G band Wi-Fi network is not supported. Tap on NEXT.
Step 4. eWeLink will auto-search and connect to your device. After this process, you can name the device and submit. That's all!
After successfully added, make sure you don't change the WiFi the product connects. Once you change the WiFi, you must delete and re-add it to your account via the new WiFi.
Device List
After successfully added, all devices will be seen in the device list. Users can see which devices are online which are not. Users can also see WiFi signal strength, and whether there is new firmware to update, etc. Users can directly turn on/off the device by tapping the small switch icon. Besides, users can delete devices by tapping on the delete icon. Tap on the clock icon to see all timing schedules.
If you have too many devices, you may group them. Tap on the top 'All Device' option to expand the group information. Click 'Manage Group' to set up different group for your devices.
Device Details
Tap on a specified device to enter into device control interface. Different devices will have different functions and layout. Take some devices for example.
For Sonoff TH, users can see real time temperature and humidity. It also provides the capability to set manual/auto control mode. For dimming LED, users can adjust light color and brightness. For iFan, users can adjust among natural/sleep/normal mode, and in normal mode, users can adjust the wind level from 1-3.
Although different device types will have a different interface, they still have some icons in common.
Setting: change device name, chec the firmware version, enable/disable vibration switch.
Product info.: check manufacturer and model.
Share: the owner can share the device to other eWeLink users.
Timer: add new single/repeat schedules to turn on/off the device.
Countdown: add countdown timers to turn on/off the device.
Device Settings
In the upper right corner, there's a button contains device 'Setting' and 'Delete'. In 'Setting', you can change the name of device and channel. Check firmware version and update to latest firmware. You can enable or disable touch vibration. And most importantly, you can set power on state for your device. Usually, when the electricity is cut off, when it comes again, your switch stays in off. Now by setting power on state, your device will automatically in ON, OFF or KEEP when power on. KEEP: your device will be in the same state as it is before electricity cut off.
Update: all the 1 gang devices support to push notification message once device status change.
After enabling the notification, the phone/tablet that you are using the App with will receive device's latest status changes messages. Click the message, you'll enter the App and see the operation records.
And you can check for these devices' operation records.
Share Control
Device owner can share control of the devices to others, and thus others can turn on/off the device on eWeLink. Or you can create multiple accounts, add all device to one account, then share the devices with the other accounts. In sharing devices, the owner can authorize timer permissions to let the other users create, modify, edit and delete timers. This functionality is great for the family as it will be great to invite them to control together. The latest version supports to write a note in the sharing message, you can write down your name so that the other user know who you are. There isn't a limit to the number of users you can share with.
While sharing devices, both should stay on eWeLink. Because if the account you want to share is not online, he/she will not receive the invitation message.
How to make it? Firstly click Share, enter the eWeLink account info.(select country code, enter the phone number or email address) you want to share, tick the timer permissions you want to give, then click OK. Remember do not enter the country code ahead of your phone number. The other account will receive an invitation message. When he/she click Accept, the device will be shared successfully. The other user has access to turn on/off the device and to change the timers.
Once the device has been deleted by the owner, it will also disappear from the others' shared list.
Note:
1.Only when the two accounts are registered with the servers of the same continent can be shared with, no cross-continent accounts can be shared. If you use VPN to create accounts, they may connect to the server of different continents. If you are located at the junction of two continents, for example, Asian-European junction, the two accounts may connect to different servers. It's impossible to share from a phone number based account to an email account or vice versa, because the phone number based account is connecting to Asian servers, while the email based account doesn't.
2. The other users you share with can't access to scene, group or device power on status.
Timing Task
Timing task is a basic feature of all devices. The timing setting allows you to set a specified time to turn on/off the device. Please note that deal to chip capacity limit, it only supports totally 8 enabled timing tasks each device(including scheduled/countdown/loop timer). Currently, we provide three timing types: scheduled timing, countdown timing and loop timing.
Schedule Timing
In schedule timer, you can set to turn on or off the device at the specified time for once or repeat dates.
Countdown Timing
Countdown timer allows users to turn on/off the device after a preset time.
![Mac Mac](https://smartlifeautomated.files.wordpress.com/2016/08/sonoff_web4.png)
Loop Timing
Loop timer can be auto-executed every preset time(say 1hr), and continue for a shorter preset time(say 20min). You can also choose not to tick the continuous cycle. For example, use loop timer to control oxygen pump for the fish tank. You can use loop timer to turn on oxygen pump every hour and keep it running for 20min and then auto-turn off each time.
The screenshot below is set the device to turn on every 10min and keep it working for 5min each time.
Loop timer supported devices (updating):all 1 gang switch/socket(required firmware ver. 1.5.0 and higher, G1 is excluded from the list), including S20 smart socket, Sonoff Touch EU/US, Sonoff Basic, Sonoff SV, Sonoff TH10/TH16, Sonoff RF, Slampher, Sonoff Pow (required firmware ver. 2.0.3 and higher), Motor Clockwise/ Anticlockwise Running WiFi Wireless Switch, 1 Channel Inching /Self-Locking WiFi Wireless Switch 5V/12V, S30 Smart Socket, Sonoff T1 UK/EU/US 1 Gang, RF Bridge 433-the added RF Remote, Sonoff Pow.
Scene
A scene is set up to auto-execute an action for all devices in the same scene. There are three kinds of scenes, they are different in the trigger condition. The first one is triggered by a click, the second one is triggered by some data of a device, such as temperature, humidity, light, air quality and noise level, the third one is triggered by status from another device. Note that only device owner can create scenes, and the system can save max 21 scenes(this limit was added at the end of 2017). Scenes can't be shared to other users.
IFTTT doesn't support to use one applet to trigger another applet, so as our scene feature.
For example, you created two scenes: when device A is turned on, then turn on device B.When device B is turned on, then turn on device C.The result is: When your device A is turned on, only device B can be turned on, while device C won't be turned on.
Click to execute
By creating a scene like this, users can turn on/off a group of devices simultaneously. For example, create a scene “Leave”, add all the devices to be set on or off to the scene, save it. Once you shut the door, take out your phone and enter into the scene, go to scene “Leave”, tap on “Run”, all devices will be turned off immediately.
Users should select “Click to execute” in the condition, add different existing devices, name the scene and save it. The 2 channel and multi-channel devices can even set power on state: on, off or keep.
If you don't find your device on the list, please check if your app version is too low. You should always update to the latest version, which supports most features.
Triggered by device data range
This kind of scene is usually called smart scene. Users can set a data range as a condition to trigger ON/OFF other devices. You may set a specified temperature/humidity/light intensity/sound level range from Sonoff SC, Sonoff TH, S22, At Home/Away status from Nest or RF Bridge's alarm as a condition to trigger on/off one or more smart devices under your account.
Supported Devices(updating):
Trigger devices: Sonoff SC, Sonoff TH (old version), Sonoff TH10, Sonoff TH16, S22, Nest Thermostat, RF Bridge 433 (Android 3.1.0 and higher)-the added Alarms.
Execute devices: except the trigger devices, all ITEAD smart devices are included, RF Bridge 433 (Android 3.1.0 and higher)-the added RF Remote controller.
Triggered by device status
We have supported a new type of scene that triggered by device's status. If device A status get changed, then the status of selected device will change to preset status.
For example, you can set when Sonoff SV is ON, then execute turn on 4ch light one and turn off B1.
Works with Google Nest
eWeLink is compatible with Nest now! Check out how to use Nest to create smart scenes to control Sonoff devices here.
Supported Devices(updating):
Trigger devices: all devices except Sonoff SC, Sonoff TH (old version), Sonoff TH10, Sonoff TH16, S22, Nest Thermostat, RF Bridge 433
Execute devices: all devices except Sonoff SC, Sonoff TH (old version), Sonoff TH10, Sonoff TH16, S22, Nest Thermostat, RF Bridge 433
User Center
In user center, users can see some settings and information.
On the top, users can see how many groups and scenes they have created.
Feedback: Users can submit your feedback on Feedback. Our IT support will follow up the feedback and reply in workdays.
You can also submit feedback on the login interface, as shown below:
Switch Language: Users can switch between different languages.
Users can change nickname and password here. Also, they can check APP version and update to the latest one.
In 'About eWeLink', you will see the QR code, which is our WeChat subscription account. By following our account, you can control your devices on WeChat page. We will post articles introducing our new smart home devices, and user guide there.
We will develop more functions for WeChat control in the future.
LAN Control
iOS & Android eWeLink V3.5.0 and higher have supported LAN control function! When your WiFi can't access the Internet or if our server is down, don't worry your devices will go offline, simply enable the LAN control, you can still turn on/off the devices on app. Remember to keep your WiFi connection with our app.
The below 1-gang Sonoff devices with simple on/off feature support control via LAN (require firmware 1.8.0 and higher):
Sonoff S20, Sonoff S26, Sonoff S85, Sonoff S30, Sonoff Basic, Sonoff RF, Sonoff Slampher, Sonoff SV, S31 Lite, Sonoff T1 UK/US/EU-1 Gang, Sonoff Touch EU/US, 1 Channel Inching /Self-lockIing Mode WiFi Wireless Switch 5V/12V, Inching /self-locking WiFi Wireless Switch 5V.
eWeLink devices from other brands can also support LAN control, note that only the 1 gang devices that only have simple on/off feature are supported. Currently, other devices like the power measuring device, temperature measuring device don't support LAN control function.
Demonstration video:https://www.youtube.com/watch?v=5ImBehZO46I&feature=share
Desktop Widget
eWeLink android version supports to add device widget to phone desktop. By adding the devices widget to the desktop, users can directly see device's real-time state and directly tap to turn on/off. Note: all 1 gang switches and sockets and 4 gang switches support widget. For Sonoff TH10/TH16, ver 2.3.3 and higher support widget.
These products don't support to set widget (updating): Sonoff B1, Sonoff Dual, Sonoff TH10/TH16(Versions lower than 2.3.3), S22, Sonoff SC, Sonoff Hum, Sonoff T1 (2-3 gang), RF Bridge 433, iFan, all eWeLink supported 2-3 gang products(include other brands).
Retrieved from 'https://www.itead.cc/wiki/index.php?title=EWeLink_Introduction&oldid=6393'
Normally the Sonoff switches don’t support MQTT but you can buy flashed devices that run the Tasmota firmware that does.
The Sonoff-Tasmota firmware provides three interfaces: MQTT, web and serial that can be used for controlling the switch.
In this tutorial I will cover basic setup of the Sonoff Tasmota MQTT Basic Switch and how to use MQTT to control and configure the switch.
Control Button
There is just a single button that is used to control the switch.
It can be used to manually toggle the switch on/off or to place into various configuration mode depending on how often it is pressed.
This link here has an overview of the button options.
Switch Configuration
There are two steps to the configuration:
- Wi-fi Setup
- MQTT Client configuration
Wi-Fi Setup
To configure the Tasmota switch you need to connect it to a Wi-Fi network.
The switch connects to a Wi-Fi network just like you mobile does and so s you will need to configure the SSID and password of that network.
There are several ways of doing this and the configuration methods are covered here under button usage
The easiest method is to use WPS followed by the android App.
If you use the manual method 4 short presses then note the following:
With this option the switch starts as a Wireless Access point. The SSID on mine was sonoffbasic-1122.
You then need to connect a computer to this access point and go to the IP address 192.168.4.1.
Note corrected from 192.168.1.4
You can then enter the SSID and password of the Wi-Fi network you will be connecting the device to.
When you enter this information into the webpage the switch will restart, connect to the Wi-Fi network and acquire an IP address.
Now in order to configure it further you will need to know the IP address it has acquired.
This isn’t as easy as it sounds but the device name on the network seems to be set to the same as the access point.
So you could try to ping this network name which should give you the IP address.
On my network the BT Home Hub displays all connected devices and was able to find the device IP address there. (screenshot below).
Configuring MQTT
The switch will start as an MQTT client and also a web server.
Initial device configuration is done via the web server. To access the configuration page go to
http://Device-IP/cn e.g
Click on configure MQTT button and you should see the screen similar to the one below:
You need to enter:
- The IP address or domain name of the MQTT broker
- The Port (default 1883)
- Client – This is used as the client -id and needs to be unique
- Username – Optional
- Password – Optional
- Topic – The client will publish and subscribe on this topic. The name should be meaningful.
- Full Topic -Defaults to topic/prefix -prefix is stat,cmnd or tele see below under MQTT default topics.
Note: You can use an external broker like test.mosquitto.org but it is better to use a local one. See installing mosquitto or installing mosca on node-red
When finished save the configuration and the switch should restart.
Sonoff MQTT Topics
Sonoff will subscribe to topics to receive control commands . It will also publish status information to topics.
Deciding on the topic structure is an important part of the configuration.
Each Sonoff device has a unique name which you configure in the topic section ( shown above).
This name will reflect the use of the device and should be meaningful e.g
main-light, outside-light etc
The prefix is either cmnd, stat or tele and the choice is usually
prefix +topic (%prefix%/%topic%/) or topic+prefix (%topic%/%prefix%/).
examples:
tele/main-light/ or main-light/tele
Using the prefix as the first part of the topic makes it easier to subscribe to multiple sonoff devices using:
tele/#, stat/# and cmnd/# options
Another option and my preferred option is to add your own prefix.
So if all the Sonoffs were used in your house you could use the topic hierarchy
house/prefix/topic or house/topic/prefix
now you can subscribe to all Sonoff devices using house/#
In this case I prefer house/topic/prefix.
To configure that use:
house/%topic%/%prefix%/
Starting Sonoff
On start the Sonoff device will subscribe to several topics. The exact topics depend on how you have structured the topic hierarchy. Here we are using the structure house/topic/prefix:
- house/main-light/cmnd/#
- house/main-light-1/cmnd/#
- house/sonoffs/cmnd/#
where
- main-light=topic name
- main-light-1= the client name or fallback topic
- sonoffs is the group name.
It also publishes its status and a Last will Wic reset key. message wth the retained message flag set.
- house/main-light/stat/POWER ON
- house/main-light/tele/LWT online
Below is a screen shot showing the messages sent by a sonoff device starting up.
Controlling the Switch
You can control the switch i.e turn it on/off using either http or MQTT.
This is important to note as some systems may require http and if you have an existing control system that uses http then it might be easier to use that rather than going to MQTT.
This tutorial will mainly cover MQTT but I will also be covering http in another tutorial.
Turning on/off using mqtt
To turn it on/off you publish to the cmnd topic
The exact topic will depend on how you have set the topic structure. Below I use topic/prefix structure so to turn the device sonoff-light on and off I use the topic:
sonoff-light/cmnd/POWER1
With message on or off (case insensitive)
In the example below show how to so it using the mosquitto_pub client.
Turning on/off using http
You can use the curl command or easier still a web browser.
Enter the following
http://sonoff ip address/cm?cmnd=Power%20On
my ip address is 192.168.1.134 so I enter
http://192.168.1.134/cm?cmnd=Power%20On
Note: %20 is a space.
MQTT Default Topic Prefixes
The switch publishes and receives information on several topic prefixes, they are:
Topic | Sent by | Use |
---|---|---|
cmnd | PC,Smart Phone using an MQTT client | To control the Sonoff,set configuration and get status information |
stat | Sent by the Sonoff | Sent in response to a command |
tele | Status information | Report status information at set intervals |
The above topics are prefixed with the switch topic e.g.
topicbase/stat/
MQTT Commands and Responses
Besides turning the switch on and off, commands can be used to set various settings like the MQTT broker, port retain flag etc and the get information about the switch.
The switch uses a command response structure. Each command is acknowledged with a response.
MQTT commands use the topic structure:
topicbase/cmnd/COMMAND
the result of the command uses the topic
topicbase/stat/RESULT
The result is contained in the message payload.
The screen shot below shows the command response messages for setting the MQTT retain flag on the mqtt client.
The screen shot below show the status messages that the Sonoff sends at regular intervals,
Setting the Group Topic
A collection of devices can be controlled by setting them to use the same group topic.
If our devices used the group topic housesonoffs for example we could turn a device on or off using:
How To Get The Mac Address For Sonoff Free
house/housesonoffs/cmnd/POWER1 with message on or off
To set the group topic for a device use:
How To Get The Mac Address For Sonoff X
topic house/sonoff-light/cmnd/grouptopic with message group name. As shown below:
You should note that setting a group topic causes the switch to restart as it needs to subscribe to the new topic.
Controlling Using Python Demo Script
How To Get The Mac Address For Sonoff Driver
If you use python I have written a short demo script that you might find useful. You can download it below
Notes
Because changing certain parameters results in a reboot you can change several parameters in one command using the backlog topic see MQTT Features for more details.
Resources
Mac Address Lookup
- Good video on flashing Sonoff and setup
Related Tutorials:
Ip Address
[Total: 9 Average: 5]