WiFi Scene Controller with MQTT


Skip to the nonsense and just buy the thing here on Amazon: https://amzn.to/2S9MFpX

In my weirdo tech geek cruising of FCC certifications I stumbled upon an interesting 8 button scene controller by TopGreener.  It fits in a standard decora face plate, flexible to fit in whatever gang size box you choose with standard face plates. The ESP8266 based Tuya module in the internal pictures caught my attention.  I searched the stores for it but alas it wasn't for sell yet. Then the Jedi mind wipe of the holiday season happened, fast forward to January and a viewer, Buckyfan reminded me about this switch and had one in hand!  I found the switch on Amazon and ordered mine immediately.  




So what is this thing and what can I do with it?  It is designed to replace an existing light switch in your home and then add 7 other buttons with single and double tap actions.  Of course following our motto of "Get your shhhzzz... out of the cloud!" we flashed ours with Tasmota using Tuya-Convert.  It doesn't require any special template or anything, simply choose the TuyaMCU module in the Configure Module section and its practically done.  You don't even need to follow my TuyaMCU setup video as the relay/button for the standard light switch is ready to roll.



But what about the other 7 buttons?  Well first that's up to you to come up with 14 actions that you can remember what they all do.  As someone suggested in the live stream showing this switch, it would be mind boggling to put 4 of these side by side.  Just make sure you leave a book for the other household members!  The technical side of things is pretty easy.  There are two methods we will use to tackle this switch/scene controller; Tasmota Rules and NodeRed.

To do all the processing of the buttons with NodeRed, apply this rule in the Tasmota console:

Rule1 on TuyaReceived#Data do publish Scene1/data %value% endon

Then apply the following command to turn the rule on:

Rule1 1

This will make all of the serial messages from the TuyaMCU that interacts with the button presses to be sent to a custom MQTT topic of Scene1/data , you can change this topic in the rule if you want something different.

Then utilize a flow such as the following:



In the Switch Node I have 7 of the 14 buttons as logic branches to call various functions in Home Assistant or whatever you choose to do.  You could also do the same thing inside of Home Assistant automations if you are more comfortable with those.


Serial Message to Button Translations
#1 55AA00070005650400010075   Double Tap - 55AA000700056C040001007C
#2 55AA00070005660400010076   Double Tap - 55AA000700056D040001007D
#3 55AA00070005670400010077   Double Tap - 55AA000700056E040001007E
#4 55AA00070005680400010078   Double Tap - 55AA000700056F040001007F
#5 55AA00070005690400010079   Double Tap - 55AA00070005700400010080
#6 55AA000700056A040001007A  Double Tap - 55AA00070005710400010081
#7 55AA000700056B040001007B  Double Tap - 55AA00070005720400010082

An alternate look, you can move all the translations to Tasmota rules and have it push the various topics/payloads by using these rules.

rule1 on TuyaReceived#Data=55AA00070005650400010075 do publish scene/button1 toggle endon
on TuyaReceived#Data=55AA00070005660400010076 do publish scene/button2 toggle endon
on TuyaReceived#Data=55AA00070005670400010077 do publish scene/button3 toggle endon
on TuyaReceived#Data=55AA00070005680400010078 do publish scene/button4 toggle endon
on TuyaReceived#Data=55AA00070005690400010079 do publish scene/button5 toggle endon
on TuyaReceived#Data=55AA000700056A040001007A do publish scene/button6 toggle endon

rule2 on TuyaReceived#Data=55AA000700056B040001007B do publish scene/button7 toggle endon
on TuyaReceived#Data=55AA000700056C040001007C do publish scene/button1b toggle endon
on TuyaReceived#Data=55AA000700056D040001007D do publish scene/button2b toggle endon
on TuyaReceived#Data=55AA000700056E040001007E do publish scene/button3b toggle endon
on TuyaReceived#Data=55AA000700056F040001007F do publish scene/button4b toggle endon

rule3 on TuyaReceived#Data=55AA00070005700400010080 do publish scene/button5b toggle endon
on TuyaReceived#Data=55AA00070005710400010081 do publish scene/button6b toggle endon
on TuyaReceived#Data=55AA00070005720400010082 do publish scene/button7b toggle endon

Don't forget to turn on your rules with:
Rule1 1
Rule2 1
Rule3 1

Let us know what you plan to use this switch for in Discord and share
some ideas with us!






Comments

  1. Thanks for this. I bought one of these and was having a hard time integrating with HA until I saw your tasmota rules.

    Do you know if there is a way to control the LEDs next to each of the buttons? I'm trying to use this to control some input booleans, and would love if the LEDs could show the state of them. I've tried commands like TuyaSend4 101,1 but haven't figured out a way to control the LEDs.

    ReplyDelete
    Replies
    1. I tried a few sends but haven't been able to figure out how to trigger the lights. Not 100% sure if you can though as they only light when pressed and I don't see anything about that in the manual.

      Delete
    2. Does the 3-way switch work with a conventional 3 way switch? I bought one to work across 2 attached houses - dont ask, 1 is 1860s vintage being remodeled and the other was built onto that.

      Delete
    3. I haven't used it in a 3 way configuration only a 2 way.

      Delete
  2. This is prefect to work with Shelly so I can use one keypad to control four lights in my home in stead of need switches everywhere

    ReplyDelete
  3. I have one of these controllers and some RGBW LED tape lights that run off the Magic Home app. Is there any way to map the scenes from the Magic Home app to the buttons on this controller. I have not done any flashing of smart/wifi control devices. If that is the only way I guess I will get to learning:) But if there is a method I am missing without flashing that would be great.

    ReplyDelete
    Replies
    1. I should and I am using the Smart Life app for the 8 button controller.

      Delete
  4. I got one of these and am having trouble getting Tuya Convert to work. Is there anything special you have to do to get it into the right mode for tuya convert to work?

    ReplyDelete
    Replies
    1. No error. The switch is blinking fast, when I start tuya convert it stops blinking but tuya converts keep trying over and over but never connects. I am using my phone as the donor device it connects to vtrust-flash fine so I was thinking the problem was not on the tuya-convert side but the switch side.

      Delete
    2. Is this your first Tuya convert?

      Delete
    3. no, I have done 8 or 10 of them already. I had a few that did not work and soldered on the leads. But I saw this one could work with tuya-convert but I am wondering if I am not getting it into the correct mode. When I first power it up it blinks fast. I have tried with that fast blinking. If I hold button it blinks fast for a couple of seconds and stops. When it is blinking fast green, when I start Tuya-convert it stops blinking.

      Delete
    4. You check the logs for the decryption error?

      Delete
    5. I did not see any log files in the tuya-convert directory. I looked in the system logs and the only file I find "tuya" in is the auth log when it sudos.

      Delete
    6. TuyaConvert not working? Check the log files in the scripts folder: smarthack-web.log for any warnings of a non-ESP82xx device. smarthack-psk.log for "DECRYPTION_FAILED_OR_BAD_RECORD_MAC"

      Delete
  5. I just bought one of these on Amazon (US). Used tuya-convert with no issues. Now running the latest Tasmota on it. On the back of the device it said 2006Ver.1.1.2. Maybe that might help determine when they start putting the new Tuya Firmware on it.

    ReplyDelete

Post a Comment

Popular posts from this blog

Tuya Convert 2.3 Update | Flash Tuya Smartlife Devices | No Soldering! | Remove the cloud | Custom Firmware

How to use the Sonoff Zigbee Bridge with Home Assistant

Tuya Convert 2 - Flash Tuya Smartlife Devices - No Soldering - Remove the cloud with Tasmota ESPHome