No announcement yet.

WiFi Controlled USB and Mains Power Strip

  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by Michael McSharry View Post
    rcrules, you need to distinguish publish and subscribe topics....
    YOWZA! I have added all of the entries for the Power Strip as you stated. Everything works and each "POWER" status updates as it should. Thanks for all of the explanation. Now I will have to go back and fix all of the other things I added less correctly (zigbee, ESP8266, etc).

    Thanks again!!!



      What is the purpose of Relay1 / "POWER1"? Is see that it lights up the power button LED, is that all that it does?



        Out of the box it is only a LED. If you want it to do more then I suggest using Tasmota rules. For example, you can setup a rule that when relay1 is OFF then all mains power is OFF or all mains and USB is OFF, depending upon your use case. Rules have memory variables too so that you should be able to save and restore the state of individuals relays when relays goes from OFF to ON. That was my intention, but I have not done it yet. I will post my rule after I give it try.


          Here is a rule definition that will have relay1 act as a master for the four main relays. Each line can be entered from the Tasmota console or mcsMQTT Publist tab. The Publist puts the commands in a file so they can be executed again in the future easily if desired.

          There are two rules. Rule1 is what happens when relay1 is ON. Rule2 is what happens when relay1 is OFF.

          The first line (poweronstate 3) restores the power at each relay to the same state it was after a reboot.

          During Rule1 as each relay is changed it remembers the state of the relay. For example for relay2 "on power2#state do mem2 %value% endon". When relay1 goes OFF then a one-second timer is set and the rules are toggled so Rule2 becomes active and Rule1 is no longer active.

          During Rule2 when the 1 second timer expires it turns the four main relays OFF. When relay1 goes ON it restores the mains relays to their prior state and toggles the rules

          If you also want to control the USB with relay1 then in Rule2 add "power6 %mem1%;" before the "rule1 1;" directive.

          The fourth and fifth line initializes Rule2 to OFF and Rule1 to ON

          poweronstate 3
          rule1 on power2#state do mem2 %value% endon  on power3#state do mem3 %value% endon on power4#state do mem4 %value% endon on power5#state do mem5 %value% endon on power6#state do mem1 %value% endon on power1#state=0 do backlog ruletimer1 1; rule2 1; rule1 0 endon
          rule2 on rules#timer=1 do backlog power2 0; power3 0; power4 0; power5 0 endon on power1#state=1 do backlog power2 %mem2%; power3 %mem3%; power4 %mem4%; power5 %mem5%; rule1 1; rule2 0 endon
          rule2 0
          rule1 1
          Relay1 can be commanded via MQTT/HTTP/Console and via the button on the power strip to cause the rules to be executed. After power cycles the relays will be restored and then the rules will be set per the relay1 state.


            Michael, This worked great and makes the strip even more useful. Now I wish I had ordered more when they were $20. Thanks!!


              I never got around to cracking open the Wheswell ZLD-44USA-W, and my son loaned me a RPI, so I loaded up the software. I can't get the power strip to join the AP SSID, no changes from the .... display. Is there some trick to get it into pairing mode? It seems there is a "fast led flash" mode and "slow led flash" mode. The slow mode shows a SSID broadcast from the power strip with the last digits of it's ID. Neither appears to connect to the vtrust-flash SSID. Any help?


                It has been awhile since I did it so I do not have memory of exactly what I did. I do not remember any difficulty using TuyaConvert. The plug's manual indicates to use the power button for 3-5 seconds with the LED then blinking quickly.

                One never actually has it explicitly join the AP when using TuyaConvert. It is all handled by the application. You need to use something else such as smartphone to connect to vtrust-flash SSID and then the exploit can be exercised. I have a shorthand description of the process in Section 14.12.


                  Thanks Michael. Yes, I was able to follow the instructions and join my phone to the SSID, got a 10.42.42.x address and "no internet connection" on my phone, which was expected. I'll give it another shot, and if that fails get out the soldering iron.


                    Just to follow up, I fired up the RPI today and the conversion went as smooth as butter. Go figure, maybe I was tired last night. All working now in HS3, thanks for the great info, support, and plugin!