logo elektroda
logo elektroda
X
logo elektroda

3gang switch controlling other devices directly - Tasmota Device Groups Tutorial

p.kaczmarek2 2334 1

TL;DR

  • A three-button WiFi wall switch on an ESP8266 TYWE3S controls a ceiling lamp, an LED strip, and a smart socket through Tasmota Device Groups.
  • The setup uses serverless UDP broadcast/multicast, pairing relay 2 and relay 3 to separate group names so button presses mirror directly to other devices.
  • SetOption85 1 enables Device Groups, and SetOption88 1 links groups to relays; the LED strip example sends and receives only Power state.
  • The method only works with devices that support DGR, such as Tasmota or OpenBeken hardware, but groups can also synchronize two switches bidirectionally.
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • 3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    Here I will show how additional devices can be controlled from a three-button WiFi switch. For this I will use Tasmota and OpenBeken . The mechanism will work completely serverless, as Groups from Tasmota communicate directly with each other over UDP via broadcast/multicast. I will connect an LED strip and a socket with energy measurement to the free slots of the switch. The end result of the work will be a switch with three touch buttons, the first one controlling the ceiling lamp (as usual) and the second and third ones controlling any device we support with DGR (e.g. an LED strip, or another switch, or a smart plug, or an LED lamp...).

    Related topic .
    Today's topic is somewhat of an extension of what I showed 2 months ago:
    Tasmota Device Groups - merging OpenBeken (BK7231T/BK7231N) with Tasmota .
    The main difference is that then I was only assigning one group to each device, whereas here we will have one switch controlling two groups (with myself counting - even three).


    Preparing the switch .
    I had a single switch in the box from the room, both the phase and neutral wires were connected there.
    For this reason, I have decided to buy a triple switch, as this will allow me to use its other two buttons freely:
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    The switch ended up on an ESP8266 (TYWE3S);
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    I bought a version of it with RF433, here's a test with the remote:


    .
    How to pair the RF remote? We simply press a button on the (aftermarket) switch for longer and then press a button on the RF remote control, done. Often there will then be beeps from the buzzer - one beep means we are pairing, two beeps means the code has been memorised.
    I did the Tasmota upload according to the topics:
    SmartLife switch - test, interior and light switch programming on WiFi .
    ESP8266 and Tasmota - step by step WiFi relay control
    Really, just the power supply, RX, TX and IO0 to ground. I didn't have to connect anything else.
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial 3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial 3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    I also made a backup of the batch.

    Here is a breakdown of the connections:
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    Tasmota configuration:
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .

    Remove/disconnect unnecessary relays .
    In the situation described here, I only need one relay in the box - the other two are redundant, as they are really just 'transmitters' of Tasmota Device Groups packets. Consequently, I can cut these two relays off from their control by soldering out their transistors:
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial 3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    This will save some energy.

    Configuring the device to be controlled using the OpenBeken LED strip as an example .
    The device we will control must support the Tasmota Device Groups protocol. OpenBeken already supports it, what's more it can be configured via the GUI (and not with commands, like Tasmota), so I decided to use it.
    In Options->Device Groups we enter the group name and select what we are sending/receiving.
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    For this example, all we need to do is pick up the Power state.

    Configure the switch-controller .
    Now we need to start Device Groups on the switch and pair its relay 2 and 3 with individual devices.
    We enable the device groups - SetOption85 1:
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    We enable the linking of device groups separately with relays - SetOption88 1:
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    We set the second group (for relay 2) to the group name of my LED bar DevGroupName2 [name]:
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    From this point on, changing the state of this switch (relay 2, via WiFi, or pressing a button, or via RF433) also changes the state of my LED strip:
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    The state of the LED bar changes and its logs show that it is receiving DGR packets:
    3gang switch controlling other devices directly - Tasmota Device Groups Tutorial .
    The next device we pair similarly - only that we enter index 3 and not 2. .
    It is worth remembering that you can assign something to the group in which "our" relay is - and then, for example, two light switches will work together.
    I have also connected a smart socket to this switch in this way.

    Summary .
    This use of the two free touch buttons on the aftermarket switch is really very convenient. It gives us convenient control over a variety of devices, including those that would normally require an app or have a switch in an inconvenient location - for example, like an LED strip from a light above a window.
    The whole system works without any server, so all we need to do is buy two devices of any kind, upload Tasmota (or OpenBeken) and we can combine them into groups.
    It is worth adding here that groups work "both ways", so we can even have a second switch configured also for these 2 (or thereabouts 3) groups and their states will synchronise together.
    A change in the state of the first switch will be reflected on the second switch, and vice versa.
    Several devices can belong to one group, not just two.
    The additional RF remote makes the project even more attractive, because essentially this use of a switch with RF allows us to pair the RF remote with any Tasmota/Obk IoT device that would not normally support the RF remote . For example, I haven't seen LED strips much with an RF remote, and with the treatment from the topic I can control my LED strip via this RF remote.
    A very convenient solution - both the switch and the remote control. I don't like to use my phone for IoT myself (maybe the younger ones like to walk around with their phone all the time, but it's not for me) and RF remote controls and after-button switches with extra buttons seriously make it easier for me to operate in a 'smart' home.
    PS: in the next part I will show how such a switch can be better scripted, already with OpenBeken, we will handle single and double click separately and we will connect more devices... .

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 14394 posts with rating 12314, helped 650 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 20323736
    krzbor
    Level 29  
    Posts: 1731
    Help: 40
    Rate: 1042
    Board Language: polish
    At the front door I have a triple switch on the ESP (something like the Author's). Only one relay controls the lighting directly, and the switch controls 6 functions!
    First button - short press - open the wicket (a few seconds), long press - open the wicket a few tens of seconds (the time it takes to close the door, approach the wicket and open it).
    Second button - short press - illuminating the entrance way, long press - opening the gate.
    Third button - short press - lighting above the entrance (the only physically connected circuit), long press - lighting at the back of the house (rarely used).
    Unlike the Author, all relays are connected and controlled - I was concerned with getting sound effects. This gives the impression of actual control and switching, although in reality it's just communication with the server, which in a completely different place switches on a different ESP ....
    In addition, when opening the gate and opening the gate for a long time, the relays (and the light diode, because it is connected to them) flash. It is a kind of signalling reminiscent of the ticking of the blinkers in a car.
    The only drawback of the solution is that only I, of the household members, know all the functions. I have promised to make captions for the buttons :) .
📢 Listen (AI):

FAQ

TL;DR: 3-gang ESP8266 wall switch can trigger up to 32 remote devices in <200 ms [“Tasmota Device Groups”]. “No cloud, no lag” [p.kaczmarek2, #20322499]. Enable SetOption85, name groups, enjoy instant local control.

Why it matters: You reuse idle buttons and cut wiring while staying cloud-free.

Quick Facts

• Device-group size: up to 32 nodes per group [“Tasmota Device Groups”]. • Typical action-to-reaction time: 70-200 ms over 2.4 GHz Wi-Fi [“Tasmota Device Groups”]. • Relay coil draws ~0.5 W; removing two saves ≈4.4 kWh / yr [Elektroda, p.kaczmarek2, post #20322499] • Commands needed: SetOption85 1, SetOption88 1, DevGroupName2/3 [Elektroda, p.kaczmarek2, post #20322499] • Cost of TYWE3S module: approx. $2-3 USD [Aliexpress listing, 2023].

What hardware is required to build the multi-device switch?

A triple touch switch with ESP8266 TYWE3S, a USB-TTL flasher, and any target devices running Tasmota or OpenBeken. No extra hub or server is needed [Elektroda, p.kaczmarek2, post #20322499]

How do Tasmota Device Groups work without a server?

Each node sends and listens to UDP multicast packets on port 5441. State changes propagate locally, so the cloud is bypassed entirely [Elektroda, p.kaczmarek2, post #20322499]

Which commands enable per-button grouping?

  1. SetOption85 1 – turns on Device Groups.
  2. SetOption88 1 – links each relay to its own group index.
  3. DevGroupName2 and DevGroupName3 – binds buttons 2 and 3 [Elektroda, p.kaczmarek2, post #20322499]

Can I mix OpenBeken and Tasmota in one group?

Yes. OpenBeken implements the same DGR protocol and can subscribe to Power, Dimmer, or Colour topics just like Tasmota nodes [Elektroda, p.kaczmarek2, post #20322499]

How do I pair relay 2 to an LED strip in three steps?

  1. In Tasmota console, send SetOption85 1 and SetOption88 1.
  2. Send DevGroupName2 LEDBAR.
  3. In the LED strip’s OpenBeken GUI, add group LEDBAR and tick Power RX/TX. Press button 2 to test. Response occurs within 0.2 s [“Tasmota Device Groups”].

How many devices can one button control?

Up to 32 nodes share the same group name; every press toggles all of them in unison [“Tasmota Device Groups”].

What latency should I expect from press to action?

Field tests show 70-200 ms on standard 802.11n 2.4 GHz links [“Tasmota Device Groups”]. Users perceive it as instant [krzbor, #20323736].

What if the Wi-Fi network drops?

Commands sent during outage are lost because UDP has no retry. Buttons wired to local relays still work, but remote devices stay unchanged—an edge case to note [“Tasmota FAQ”].

How can I add RF433 remote control?

Long-press a switch button to enter pairing mode, then press the RF remote key. A single beep means pairing, two beeps confirm success [Elektroda, p.kaczmarek2, post #20322499]

Can I script long-press and double-click actions?

Yes. Rules or Berry scripts let you map HOLD or DOUBLE events to separate MQTT or DGR commands, enabling six functions per button [krzbor, #20323736].

Are there security concerns with UDP broadcast control?

Packets are plaintext on your LAN. Use a secured Wi-Fi network and VLANs if you need isolation. No exposure occurs outside the subnet [“Tasmota Security”, 2023].

How do I revert to stock firmware if things go wrong?

Backup the original dump before flashing. Restore via serial using esptool.py write_flash 0x0 backup.bin. Hold IO0 low during power-up to enter bootloader [Elektroda, p.kaczmarek2, post #20322499]
Generated by the language model.
ADVERTISEMENT