logo elektroda
logo elektroda
X
logo elektroda

Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W

p.kaczmarek2 792 10
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .
    Today we are plugging another product into Home Assistant. This will be the gembird TSL-PS-F4U-01-W power strip offering four separately controlled 230V sockets and two USB sockets with a current capacity of up to 2.4A. I'll show the inside of it here, and then discuss modifying it to work locally with Home Assistant. We will upload OpenBeken onto it.
    The whole thing is available to buy in our country for around £150. Information from the seller:
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .
    Here is the box received:
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .

    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .
    Instructions:
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .

    ADVERTISEMENT



    Programming TSL-PS-F4U-01-W .
    This product normally works with Tuya, but you can change the firmware and run it with Home Assistant (without the cloud).
    For the strip, first remove the feet/rubbers and then remove the screws with a flathead screwdriver, parted in the middle, that is a spanner type.
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .
    This is how we get inside:
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .
    The board cannot be removed, but I guessed from the pads that there is a CB2S module inside:
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .
    Outputs, quoting documentation:
    . . 7. CSN
    Pin number Symbol I/O type Function
    1 3V3 P P Power supply 3V3
    2
    2 P6 I/O Support hardware PWM and correspond to P6 of the IC
    3 GND P Power supply reference ground
    4 P7 . I/O Support hardware PWM and correspond to P7 of the IC
    5 RX1 I/O UART_RX1, which is used for receiving user data and corresponds to P10 of the IC. Do not pull it up. By default, the MCU serial port should be in low-level or high-impedance state.
    6 P8 I/O Support hardware PWM and correspond to P8 of the IC
    7 TX1 I/O UART_TX1, which is used for transmitting user data and corresponds to P11 of the IC. Do not pull it up. By default, the MCU serial port should be in low-level or high-impedance state.
    8 ADC I/O ADC, which corresponds to P23 of the IC
    9 P24 I/O Support hardware PWM and correspond to P24 of the IC
    10 CEN I/O Reset pin
    11 P26 I/O Support hardware PWM and correspond to P26 of the IC
    Test point Test point RX2 I/O UART_RX2, which corresponds to P1 of the IC. This pin is not allowed to use.
    Test point TX2 I/O UART_TX2, which is used for outputting logs and corresponds to P0 of the IC
    Test point point I/O Mode selection pin. If it is connected to the ground before being powered on, enter the firmware test mode. If it is not connected or connected to VCC before being powered on, enter the firmware application mode. It corresponds to P21 of the IC.
    .
    This module is compatible with OpenBeken .
    Firmware can be changed with our flasher:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    You can also take a look at the tutorial from YT:


    .
    Here it is possible to program in the circuit, no need to solder out the CB2S. Just important that the product is disconnected from the mains:
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .
    The aforementioned flasher discovers GPIO roles on its own:
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W
    JSON Tuya:
    Code: JSON
    Log in, to see the code

    Verbal description:
    
    Device seems to be using CB2S module, which is BK7231N chip.
    - Relay (channel 1) on P6
    - Relay (channel 2) on P7
    - Relay (channel 3) on P8
    - Relay (channel 4) on P26
    - Relay (channel 5) on P24
    - WiFi LED on P10
    - Pair/Toggle All Pin on P23
    
    .
    Channel five here is USB, both ports are on one transistor.
    Template OBK:
    Code: JSON
    Log in, to see the code
    .
    Instructions for uploading the template:


    .
    Pairing with Home Assistant:


    Pairing with Home Assistant.
    You can also set up separate single click, double click, triple click, etc. events here by setting the button to the Btn_ScriptOnly role, this will allow each relay to be controlled separately. Details (search: OnClick):
    https://www.elektroda.com/rtvforum/topic3946427.html
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md


    USB current capacity test .
    It is indeed possible to draw some current, even over 3A (16W):
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .
    Unfortunately there is no QC here, just still 5V:
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .


    Summary .
    Probably a bit pricey for the non-QC version, but apart from that I have no major complaints. There is a problem with further disassembly (after removing the cover), but it's not needed to change the firmware, so I can't complain about that here. Once the firmware has been changed, the product works with Home Assistant and does its job well.
    Do you see any use for such a programmable (automation) and remotely controlled (Home Assistant) strip? I remind you, each 230V socket has a separate relay..
    PS: Manufacturer's copy of firmware:
    https://github.com/openshwprojects/FlashDumps/commit/513afdc8cbc0663fec15591d997f6f56e300f96b

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 12894 posts with rating 10708, helped 599 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 21579505
    krzbor
    Level 28  
    It can be useful to restart devices that have crashed. If you have a problem with WOL then you can do a computer wake-up - you need to set in the BIOS that the computer should turn on when the voltage returns. If we are doing something remotely and the computer crashes then just cut the voltage for a while and then restore it. It's just a pity that someone on this power strip hasn't thought of control buttons for individual sockets (preferably illuminated buttons).
  • ADVERTISEMENT
  • #3 21579536
    p.kaczmarek2
    Moderator Smart Home
    The vast majority of this type of product has a single button that works on an 'off/on all' basis in the app. I would love to see a strip with separate buttons.

    In OBK, you can script click, double click, triple click, quadruple click events and control devices individually. You can also script pinging and reboot e.g. a router when the internet escapes. You can supposedly also add these buttons manually, as long as there are enough pins, or you can use an ADC (there is an ADCButtons driver for this). Then, multiple buttons can be placed on a single pin.

    You can only remotely control the strip after changing the firmware if you have HA or MQTT access to the Internet, as no one is likely to issue the firmware panel themselves, although.... I am still thinking about whether to make a presentation of simple "remote" control via NAT working on the principle of querying the HTTP server by the device. That's how I used to control the lights at my place a long time ago with the PIC18F67J60.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 21579549
    krzbor
    Level 28  
    p.kaczmarek2 wrote:
    Remote the strip after a firmware change you only post if you have HA or MQTT exposed to the internet
    .
    I definitely recommend a VPN. The better routers have it built in. I put OpenVPN on the RPi, which also supports HA. There is also an OpenVPN client for mobiles. So all you need to do is run the VPN client on your mobile phone and you have HA support as in the local network.
    VPN means not only access to HA, but the whole internal network - we can work on our computer wherever we are.
    If we don't care about very high speeds, with the price of RPi 3B at 175PLN we can set ourselves a dedicated OpenVPN.
  • #5 21579581
    p.kaczmarek2
    Moderator Smart Home
    Can you write a little more about this solution? It seemed to me that in order to set up a VPN tunnel, though, you need some kind of paid service - an intermediary - or an external IP (forwarded ports). I remember with @DeDaMrAz we tested a similar solution and the middleman was paid. Although. I also used Hamachi a lot and it was free....

    Personally, I've had a public IP for a few years now and I decide myself on the router what ports I forward, so my knowledge of other solutions is not the most recent.

    It's possible that one day on Elektroda I'll describe my experiences with an external IP (how secure my hardware is, whether I've been hacked, what bots are "knocking" on my HTTP hosted services).
    Helpful post? Buy me a coffee.
  • #6 21579621
    krzbor
    Level 28  
    If we have a public IP and access to a router, all we have to do is forward the OpenVPN port on the router (UDP 1194 by default) to the machine with OpenVPN. If we have a floating IP we still need to take care of DDNS to find our network. DDNS is usually available on the router. You can also look for a DDNS client on the RPi. I'm not an OpenVPN expert - I used material from the internet for the configuration, although ChatGPT will also easily provide such help :) .
    With a bit of jamming, you can also operate HA from a SIM-connected network - i.e. not accessible from the outside. All we need is to have access to any computer with an externally accessible IP.
    The idea is this:
    - HA with internet on SIM connects to a computer with a fixed IP (OpenVPN)
    - the mobile connects to the same computer. The VPN then creates a network of three machines (actually three networks)
    OpenVPN will take care of resuming the connection on failures and disconnections - this works completely automatically.
    All the 'fun' is proper routing, because with this configuration the computer we are connecting to is the 'server', and we want our HA computer to play that role. Physically, however, the network exists (packets and with decent encryption go through) and the whole problem is routing.
  • #7 21579826
    @GUTEK@
    Level 31  
    I myself have been using OpenVPN for years for access to my home network and, among other things, also for HA, although I recently let that one go out via reverse proxy. Also recommended.
    If you don't have a public IP address you can use some free VPS server, e.g. Oracle has something like this and set up a redirect to ours on it. I haven't used it, but I know they do it that way. Link: https://www.oracle.com/pl/cloud/free/

    And as for the button strip, this one is interesting: https://melink.eu/produkty-lista/wi-fi-smart-power-strip/
  • #8 21579833
    p.kaczmarek2
    Moderator Smart Home
    As there is a public IP (port forwarding) the matter is straightforward, this is not what I was asking, although I think it will be worth discussing on the forum as well. Maybe I will devote a topic to this.

    It's more interesting when there's no public IP - I've now checked what such was I was testing with my colleague @DeDaMrAz and as far as I can see it was based on FRP:
    https://computingforgeeks.com/expose-local-server-to-internet-using-frp-proxy/

    @GUTEK@ wrote:
    .
    As for the pushbutton strip, this one is interesting: https://melink.eu/produkty-lista/wi-fi-smart-power-strip/

    I don't see any mention of Bluetooth, so it could still be on an ESP8266, from that angle it's worth a look. Other than that I don't think it stands out for anything. Also one button. I wonder how about the current capacity of these USB ports, won't there be a situation again that there are a lot of ports and the current capacity is low....
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #9 21579899
    krzbor
    Level 28  
    p.kaczmarek2 wrote:
    If there is a public IP (port forwarding) then the matter is simple, that's not what I was asking, although I think it will be worth discussing on the forum as well. Maybe I'll devote a topic to that.
    .
    It's certainly worthwhile, as OpenVPN requires certificates, and there's a bit of fun to be had with generating them. You need to explain why you are generating CA ROOT and then descendant certificates.

    Added after 1 [minute]:

    p.kaczmarek2 wrote:
    It's more interesting when there's no public IP - I've now checked what such was testing with my colleague @DeDaMrAz and from what I can see it was based on FRP
    .
    As far as I can see FRP requires a computer with a known and accessible external IP anyway. If we have such a computer, as I wrote you can put OpenVPN on it anyway.

    Added after 3 [hours] 56 [minutes]:

    I would also add that for about 20PLN/month we can have our own VPS on OVH (100Mb/s unlimited). If someone doesn't have an IP available externally, this seems like a good offer to me. This computer can not only be an OpenVPN server, but also our website. The most important thing is that we will decide ourselves about the services and how they are provided.
  • #10 21583662
    blekis
    Level 27  
    p.kaczmarek2 wrote:
    The vast majority of these types of products have a single button that works on an "off/on all" basis in the app. I'd love to see a strip with separate buttons.

    But there you go. Exactly the strip the author writes about. You can manage individual sockets and set schedules.
    Four-slot strip with USB compatible with Home Assistant? TSL-PS-F4U-01-W .
  • #11 21583678
    p.kaczmarek2
    Moderator Smart Home
    In that message, it refers to physical buttons, on the body of the device.

    In the application for this type of strip there is always a control for separate sockets and this is not new.
    Helpful post? Buy me a coffee.
📢 Listen (AI):

Topic summary

The discussion centers on integrating the Gembird TSL-PS-F4U-01-W four-slot power strip with USB ports into Home Assistant (HA) by flashing it with OpenBeken firmware for local control. The strip features four individually controllable 230V sockets and two USB ports rated up to 2.4A. Users highlight the limitation of having only a single physical on/off button controlling all sockets simultaneously and express interest in adding separate illuminated buttons for each outlet, potentially using ADC inputs or scripting multi-click events in OpenBeken. Remote control solutions emphasize the importance of secure network access, recommending VPN setups such as OpenVPN on Raspberry Pi or VPS servers to enable safe external access to HA without exposing ports directly. Alternatives like FRP proxy are mentioned but require an accessible external IP. The conversation also touches on managing devices remotely by power cycling via the strip, Wake-on-LAN BIOS settings, and scripting automated reboots for network devices. A comparable Wi-Fi smart power strip with individual socket control and scheduling is referenced. Overall, the thread provides insights into firmware modification, network security via VPN, and hardware control enhancements for smart power strips compatible with Home Assistant.
Summary generated by the language model.
ADVERTISEMENT