logo elektroda
logo elektroda
X
logo elektroda

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

p.kaczmarek2 1863 1
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • 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 11833 posts with rating 9930, helped 566 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 20323736
    krzbor
    Level 27  
    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 :) .
ADVERTISEMENT