arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.06k stars 4.78k forks source link

FYI Only - USB and 4 port power strip with Tasmota #3343

Closed digiblur closed 6 years ago

digiblur commented 6 years ago

Not a feature request unless the devs feel it is necessary to throw in a template for this power strip. Hats off to the developers for the generic template!

The power strip is a SM-SO301 with an FCC ID of 2AJ5F-SM-SO301. The ESP8266 module inside is a TYWE3S by Tuya. Take note if you use the docs to determine the pins, you will need to verify your VCC and GND pins! As you are looking at the back of the chip and the docs show it from the front, you'll need to flip flip the pins from side to side. Trace them out if ever in doubt!

Is the one I purchased, but I suspect there different model names and such for various voltages/plug types: https://www.amazon.com/gp/product/B073GQWHRP

img_20180726_165744 img_20180726_173236 img_20180726_184232 tywe3s_3 chip_wires tas_power1

Frogmore42 commented 6 years ago

You should put this information on the Wiki, so it won't get lost.

digiblur commented 6 years ago

Definitely will... Under the Other Devices? https://github.com/arendst/Sonoff-Tasmota/wiki/Other-Devices

Frogmore42 commented 6 years ago

Yes, that looks like a good spot.

Frogmore42 commented 6 years ago

Mark the pictures with the GPIO locations to make it even more helpful to the next person.

Frogmore42 commented 6 years ago

Good job figuring it out, too 👍

digiblur commented 6 years ago

Great idea on the GPIO pins on the chip. Seen some pictures like that before on here.

Making a note that I forgot to mention the button is a momentary switch(non-latching), need to correct my picture to be Button 1 (instead of Switch 1)as I was messing around with the HOLD function of the button.

digiblur commented 6 years ago

Added to the Wiki. https://github.com/arendst/Sonoff-Tasmota/wiki/SM-SO301

ascillato2 commented 6 years ago

Great! Thanks!

erwill2 commented 5 years ago

Just used tuya-convert to flash this power strip. This made setting it up a breeze. Thanks!

erwill2 commented 5 years ago

@digiblur can you help with turning all relays on and off with button. With the current settings the button only controls the usb.

digiblur commented 5 years ago

@erwill2 using a button or switch? And do you want all relays to cycle?

erwill2 commented 5 years ago

@digiblur What I'm looking for is when I click the button on the power strip it cycles all the relays on or off regardless of current state. So if one relay is on they will all turn off if all are off the button will turn every relay on. I believe this was the original functionality in the Tuya app. Thanks again for your help and videos on youtube.

wlatic commented 5 years ago

I did this using a rule:

ButtonTopic 0 SetOption1 1 SetOption32 20 Rule on button1#state=3 do backlog power1 0;power2 0;power3 0;power4 0;power5 0 endon on button1#state=2 do backlog power1 1;power2 1;power3 1;power4 1;power5 1 endon Rule 1

Placed this into the Console line by line and what it does is short press = all come on, long press = all go off. Put here in case it helps.

forast3r commented 5 years ago

Sorry for posting in a closed issue... I have tried your rule @wlatic , but I see that the on (or off) commands are delayed tenths of second between relays activations (power1 - delay - power2 - delay - power3 - delay - power4 - delay - power5) Is there some way to speed it up and have all relays on (or off) simultaneosly or at least speed up the process?

forast3r commented 5 years ago

Forget my comment, just seen there is a 50ms delay between backlog commands https://github.com/arendst/Sonoff-Tasmota/issues/4625#issuecomment-447394972

John2009R commented 5 years ago

Maybe not the best place to post this but thought I would share: I bought one like this on Amazon called Teckin SS30 and found the insides had changed. The ESP is not accessible with just taking the back panel off because it is on the other side of the pcb (but it just means 8 more screws). Fortunately I found tuya-convert which worked on it so I didn't have to solder anything. This thing was a great buy with all the control it gives.

meingraham commented 5 years ago

The template repository is the best location for this kind of information.

I created a PR to add this information to the template. It will take a day or two for the update to be merged.

John2009R commented 5 years ago

Ok. It wasn't clear how I could edit that page without forking it. Also, here is an alternative template that puts the 4 AC outlets first and then the USB. That order seems more logical to me: {"NAME":"SM-SO301","GPIO":[56,0,0,0,29,17,0,0,31,30,32,0,25],"FLAG":0,"BASE":18}

meingraham commented 5 years ago

Yes, it creates a fork allowing you to edit the entry. If the PR is accepted and merged, you can then delete your fork.

I'll probably leave the template as is for "backward" compatibility. I don't have one of these devices, but like you said, the order is personal preference and can be changed by each user as desired.

CyiDev commented 5 years ago

What image do I use for the ss30? Also is 1.0.4 firmware tuyaconvert compatible for this device?

John2009R commented 5 years ago

I used whatever the version of tuya-convert was in July 2019 and the embedded tasmota version. After that I was able to do an update over the air with the latest basic.

CyiDev commented 5 years ago

I was able to flash it today. Stuck using your config as the only power option available is Power / Power1 and it turns on the second power outlet. 2 and above return errors.

SAM26K commented 4 years ago

This looks exactly like the TONBUX smart strip. Mine stopped working with stock firmware but will try to flash it anyway. If it's not damaged it should work. Tonbux on Amazon.

SAM26K commented 4 years ago

Here is another one. Same power strip sold under a different brand: YAGALA

zeit0dn1 commented 4 years ago

Folks, I picked one of these up from amazon.ca this week that looks identical, but none of the templates worked. They actually caused it to reset and lose all its settings including wifi. It was advertised as a Teckin SS30, but there was literally nothing to identify it, not even a model number or safety certification number in the manual, on the box, or on the device itself.

This is what ended up working for me (after going through the manual identification process): {"NAME":"PowerBar","GPIO":[52,0,53,0,25,22,0,0,24,17,23,21,0],"FLAG":0,"BASE":18}

I also had to apply the rule posted previously, which worked awesome, thanks!

I now have it working using MQTT to Hassio/HA

Hopefully this can help someone who has the same problem.

BTW: I was able to flash this OTA using tuya-convert A tutorial can be found here (not my video): https://www.youtube.com/watch?v=dyUyewiKpRA

cd85233 commented 4 years ago

Just came to comment that I received this device a few weeks ago and it did not use an ESP chip instead it used a realtek. Here is the model that mine used.

https://docs.tuya.com/en/iot/device-development/module/wifi-module/wifiwr2module?id=K9605tko0juc3

posicat commented 2 years ago

I got 2 from Amazon and they both had the non-ESP chip, replaced the chip and it work s great with a real ESP8266.

iankaufmann commented 2 years ago

Tried to get one of these from Amazon recently and it came with a CB3S module. Kind of had a feeling that would happen but they were cheap on Prime Day so I gave it a shot.

@posicat Any more info on how you went about replacing the chip?

I have plenty of D1 minis around, but I'm not sure how it would fit or if the pins are even close.

PXL_20220731_212617951

PXL_20220731_212930465

digiblur commented 2 years ago

@iankaufmann swap it with a ESP12F or C3 module. https://youtu.be/d_HpkIiWC3Y

iankaufmann commented 2 years ago

@iankaufmann swap it with a ESP12F or C3 module. https://youtu.be/d_HpkIiWC3Y

RIght on man, thank you! I'm now realizing that a lot has changed since the last time I was dealing with all of this. Tuya-convert was always what worked for me, but then I just started ordering from CloudFree and haven't had to deal with it in a bit. However, this 4 plug + USB unit fit a specific need so I wanted to give it a shot.

I used your videos the first time around so this will be no different!

Bun-Bun commented 1 year ago

Thanks to the added POWER0 function to include all relays, to replicate the stock firmware behavior

SetOption73 1 Rule1 ON Button1#state DO POWER0 TOGGLE ENDON Rule1 1

Or what I personally find more useful, only toggle the power relays instead of including the USB (ie. USB is always on)

SetOption73 1 Rule1 ON Button1#state DO BACKLOG POWER2 TOGGLE; POWER3 TOGGLE; POWER4 TOGGLE; POWER5 TOGGLE ENDON Rule1 1

Thanks to everyone involved that makes all this possible!

barbudor commented 1 year ago

Just wondering if it is OK that this action will toggle each relay to the opposite independently of each other So that if 2, 3 are on and 4, 5 are off you will get 2, 3 off and 4, 5 on

Bun-Bun commented 1 year ago

It is OK in my usecase, but you're right if the the individual states get out of sync you'll end up flip flopping which would be awkward.

If that's the case for your situation, a modified version of @wlatic

ButtonTopic 0 SetOption73 0 SetOption1 1 SetOption32 20 Rule1 ON Button1#state=3 DO POWER0 0 ENDON ON Button1#state=2 DO POWER0 1 ENDON Rule1 1

This will do single press button simultaneously turns everything on and hold button will simultaneously turn everything off. This is probably the most intuitive configuration without going to external logic.

barbudor commented 1 year ago

I just wanted to be sure you were aware of this

Note that you latest rules seems to have some errors as Button#state is never 1, and you are using == which is for string compare (not recommended for that usage) Single press should be on Button1#state=10 do ...

Bun-Bun commented 1 year ago

That was actually a copy paste error, I had it as Button1#state=2 (for toggle state) in my testing. I've corrected it (including the string compare) in my post above.

What is Button1#state=10? I don't see it in the documentation.

sfromis commented 1 year ago

Button state 10 is explained here in the docs: https://tasmota.github.io/docs/Buttons-and-Switches/#multi-press-functions

sfromis commented 1 year ago

and you are using == which is for string compare

That's incorrect, @barbudor. == is specifically for numeric compare, while = is for string compare, which mostly works for numbers too, as the numbers then are converted to strings. But not great if numbers have decimals, like when it is a calculated variable and default CalcRes of 3. I'd say that using == is the pedantically "most correct" way for numbers, but usually not significant.

Bun-Bun commented 1 year ago

Button state 10 is explained here in the docs: https://tasmota.github.io/docs/Buttons-and-Switches/#multi-press-functions

Thank you for the link. So with SetOption73 1 you can use Button1#state=10 through 14 as multi press rules to toggle each relay specifically. Neat.

ON Button1#state=10 DO POWER1 TOGGLE ENDON ON Button1#state=11 DO POWER2 TOGGLE ENDON... and so on

EDIT:

With that new knowledge, here's my new rule:

SetOption73 1 SetOption1 1 SetOption32 20 Rule1 ON Button1#state=3 DO POWER0 0 ENDON ON Button1#state=10 DO POWER0 1 ENDON ON Button1#state=11 DO POWER2 TOGGLE ENDON ON Button1#state=12 DO POWER3 TOGGLE ENDON ON Button1#state=13 DO POWER4 TOGGLE ENDON ON Button1#state=14 DO POWER5 TOGGLE ENDON Rule1 1

single press - all on hold - all off double through penta press - outlet 1-4 toggle