Wi-Fi switch full documentation

Related product

Table of contents:

1. Installation
   1.1. Wi-Fi switch only
   1.2. Wi-Fi switch with a physical switch
   1.3. Wi-Fi with a physical 2-way switch
2. Software configuration
   2.1 First-time start
3. Standard integration
   3.1 Web UI

1. Installation

There are 3 possible ways to install the Wi-Fi switch: Wi-Fi switch only, Wi-Fi with a physical switch, Wi-Fi with a physical 2-way switch.
You can choose one of those methods based on your needs.

Important:
 - You should never connect S1 or S2 cables to electricity otherwise the switch will be damaged
 - It is essential to respect line and neutral wires during assembly
 - Please, follow one of the diagrams below for the assembly

1.1. Wi-Fi switch only installation

Legend:

L-in: line-in
N-in: neutral-in

L-out: line-out
N-out: neutral-out

S1: Switch wire 1
S2: switch wire 2

: line cables
: neutral cables

1.2. Wi-Fi switch with a physical switch installation

Wifi switch with a single rocker switch
Legend:

L-in: line-in
N-in: neutral-in

L-out: line-out
N-out: neutral-out

S1: Switch wire 1
S2: switch wire 2

: line cables
: neutral cables
—: switch cables

1.3. Wi-Fi with a physical 2-way switch installation


Legend:

L-in: line-in
N-in: neutral-in

L-out: line-out
N-out: neutral-out

S1: Switch wire 1
S2: switch wire 2

: line cables
: neutral cables
—: switch cables

2. Software configuration

2.1 First-time start

When your Wi-Fi switch is powered for the first time, a Wi-Fi network named like tasmota-XXXXXX-XXXX will appear.
ex:
 
Once connected to this network a configuration popup will appear:
cms plugin media image
The popup will ask you to select and enter the credentials of your home Wi-Fi network.
Once connected to your own Wi-Fi network, Tasmota will show its' new IP address:
cms plugin media image

3.Standard integration

3.1 Web UI

You can use the web UI to control and test your Wi-Fi switch.
Just enter the IP address in a web browser address bar (or the IP address prefixed by 'http://' ex: http://192.168.1.71)
 
The interface must be displayed like:
If you have an electrical appliance connected to the switch, click on the "Toggle" button. The information regarding power should appear as demonstrated below:

3.2. MQTT

3.2.1 Introduction

The MQTT protocol is the optimal solution if you are using a home automation system.

When using this protocol, you prevent overloading your home automation system if multiple objects are connected to the system.
 
First of all, you need to have a MQTT broker running at your home's network.
We recommend the Mosquitto broker for your home automation system.

You can install and configure MQTT on all open-source home automation systems (Domoticz/Jeedom/Home Assistant/...).

3.2.2 Sample configuration

To connect your Wi-Fi switch to your MQTT broker, go to the Tasmota's "Main menu" > "Configuration" > "Configure MQTT".
A sample configuration could be done as in the image below:
If your configuration is done as per the example (Topic: mini-switch and Full Topic: home/salon/%topic%/),
your Wi-Fi switch will send messages (status/power consumtion/...) to the topic: home/salon/mini-switch
 
Example of messages sent by the Wi-Fi switch :
Topic Value
home/salon/mini-switch/POWER ON
home/salon/mini-switch/SENSOR {
  "Time":"2023-10-31T16:37:07",
  "Switch1":"ON",
  "Switch2":"ON",
  "ENERGY":{
    "TotalStartTime":"2023-09-22T13:38:46",
    "Total":0.030,
    "Yesterday":0.018,
    "Today":0.007,
    "Period":1,
    "Power":12,
    "ApparentPower":25,
    "ReactivePower":22,
    "Factor":0.47,
    "Voltage":248,
    "Current":0.101
  }
}

3.2.3 Change switch status with MQTT messages

If your main topic configuration is home/salon/mini-switch

To switch on the Wi-Fi switch you need to send the message ON in the topic home/salon/mini-switch/cmnd/POWER1 to your broker
To switch off the Wi-Fi switch you need to send the message OFF in the topic home/salon/mini-switch/cmnd/POWER1 to your broker

Action Topic Value
Switch ON {MAIN TOPIC}/cmnd/POWER1

(ex: home/salon/mini-switch/cmnd/POWER1)
ON
Switch OFF {MAIN TOPIC}/cmnd/POWER1

(ex: home/salon/mini-switch/cmnd/POWER1)
OFF
 

3.2.4 Anonymous login


Usually we connect to a MQTT broker using a login and password.
If you have not configured any user, and your MQTT broker accepts anonymous connections, you can use a specific command, because the Tasmota Web UI interface will not allow you to connect without any credentials.

From the "Main Menu" > "Console", "Enter Command" text field:

backlog mqttuser 0; mqttpassword 0; restart 1

And the press the "Enter" keyboard key:
Tasmota MQTT anonymous connection

The full MQTT configuration with Tasmota can be found on the official Tasmota Github page: https://tasmota.github.io/docs/MQTT/

3.3 HTTP calls (URLs)

You can control the Wi-Fi switch by calling HTTP URLs:
Action Command
Power ON http:///cm?cmnd=Power%20On
Power OFF http:///cm?cmnd=Power%20Off
Toggle power http:///cm?cmnd=Power%20Toggle
(where corresponds to your Wi-Fi switch IP address)

If you need to be authenticated on your HTTP requests, you will find this information on the official Tasmota page: https://tasmota.github.io/docs/Commands/#with-web-requests

4. Voice assistants integrations

4.1 Alexa

The Wi-Fi switch works quite well with Alexa, here is the configuration:

1/ Enable emulation in the Tasmota admin interface.
In the "Main menu" > "Configuration" > "Configure Other"
  • select an easy-to-say name for your switch (ex: living room light)
  • activate the Belkin WeMo emultation
  • click on the Save button:
Tasmota Alexa integration
2/ Open you Alexa mobile application
Click on the "Devices" tab:
Alexa > Devices
Then on the "+" symbol and select "Add a device":
Alexa add a device
The Wi-Fi switch is detected by Alexa as a smart oultlet, just select an element in the list and let Alexa find your Wi-Fi switch.
 
Once detected you can ask: "Alexa, switch on the living room light ".
 
The official Tasmota integration for Alexa can be found at: https://tasmota.github.io/docs/Alexa/#connecting-to-alexa

4.2 Google Home

The Tomotics Wi-Fi switch does not have a standalone integration with Google Home.
To be able to communicate with a Google Home, the Wi-Fi switch needs to connected and configured with a home automation system such as Home Assistant/Jeedom/Domoticz/...
Once the connection is established you can configure a new Google Home switch in your home automation system.

5. Open home automation systems integrations

5.1 Jeedom

We recommend to use the MQTT protocol for the communication between Jeedom and your Wi-Fi switch.
We will explain the integration with the Jeedom plugin jMQTT:
 
1/ Be sure to have the plugin jMQTT installed and everything running smoothly in the jMQTT configuration dashboard:
  - the plugin must be active
  - the dependencies and deamon must have the OK status
  - the broker must be active and running
2/ Configure your MQTT topic on your Wi-Fi switch in the Tasmota admin (cf. MQTT sample configuration)
3/ In the jMQTT plugin click on "add a new equipment", and give a name to your equipement.
On the next page:
 - choose a parent object (if necessary)
 - uncheck "Add commands automatically"
 - "Registered on topic" must be your Wi-Fi switch topic configured in Tasmota and ending by /#
    ex: home/salon/mini-switch/#
4/ On the commands configuration dashboard add these commands:
Name Type Topic Parameters Options
STATUS Info / Other home/salon/mini-switch/POWER   Display
POWER Info / Numeric home/salon/mini-switch/SENSOR
JSON path: [ENERGY][Power]
Unit: w Display
Historize
ON Action / Default home/salon/mini-switch/cmnd/POWER1   Display
OFF Action / Default home/salon/mini-switch/cmnd/POWER1   Display
Today Info / Other home/salon/mini-switch/SENSOR
JSON path: [ENERGY][Today]
Unit: w Display
Yesterday Info / Other home/salon/mini-switch/SENSOR
JSON path: [ENERGY][Yesterday]
Unit: w Display
Total Info / Other home/salon/mini-switch/SENSOR
JSON path: [ENERGY][Total]
Unit: w Display
and save your modifications.
 
The configuration should look like this:
 
5/ Return to the main dashboard, and you will see the new element:

5.2 Domoticz

Prerequisite: you need to have a MQTT broker installed on your home automation platform.
Mosquitto is the most recommanded for Domoticz and can be installed on all platorms (Linux, Windows, MacOS, Docker, ...).
 
1/ (optional) only if you don't have any MQTT broker configured in Domoticz:

Add a MQTT interface.
In the menu "Setup" > "Hardware" add a "MQTT Client Gateway with LAN interface"
You should provide:
  • a name
  • the remote address (or IP address) of your MQTT broker
  • the port (usually 1883)
  • a username/password if necessary
Domoticz add MQTT interface
Once created, your MQTT interface will appear on top of the page:
2/ Add a hardware dummy switch:
in the menu "Setup" > "Hardware" add a "Dummy (Does nothing, use for virtual switched only)" and give a proper name:
Domoticz add dummy switch
Once the button "Add" is clicked, your dummy switch will appear on top of the page:
Domoticz dummy switch added
3/ Now create 2 virtual sensors on you hardware dummy switch by clicking on "Create Virtual Sensors":
Domoticz create virtual sensors
  • The first virtual sensor must have a "Sensor type": Switch
  • The second virtual sensor must have a "Sensor type": Electric (Instant+Counter)
Domoticz create virtual sensor switch and Domoticz create virtual sensor electric
4/ Check your virtual sensors creation in the menu "Setup" > "Devices" and memorize/record their "Idx" values:
Domoticz setup devices
5/ Set up the MQTT configuration on your Wi-Fi switch in the Tasmota admin
(cf. MQTT sample configuration)
 
6/ Set up the Domoticz configuration on your Wi-Fi switch in the Tasmota admin
In the "Main menu" > "Configuration" > "Configure Domoticz"
- In the text box "Idx 1" set the Idx value of your Domoticz switch device
- In the text box "Sensor Idx 4 Power,Energy"  set the Idx value of your Domoticz sensor device
 
Then, save your modifications:
Tomotics switch v1 set Domoticz configuration
 
7/ Test the implementation
 
If everything if well configured:
  • In the menu "Switches" you must see you Wi-Fi switch,
    if you click on the light bulb, it must change your switch status from on to off:
  • In the menu "Utility" you must see your switch current power consumption,
    (if the Wi-Fi switch is "Off" the power consumption must be equal to "0 Watt")
Domoticz switch power info

5.3 Home assistant

The Wi-Fi switch is compatible with Home Assistant using the MQTT protocol.

1/ (optional) Install a MQTT broker.
Home Assistant recommends to intall the Mosquitto MQTT broker add-on
The Home Assistant official documentation for the MQTT configuration can be found here.
 
2/ You need to configure your MQTT topic on your Wi-Fi switch as explained in the MQTT sample configuration

3/ Then follow the official Tasmota devices integration documentation, which can be found here: https://www.home-assistant.io/integrations/tasmota/
Sections: Documentation