User question
Hello.
I recently purchased some BSEED E series switches, and the 2-gang model has a T1-3S chip.
I flashed it with firmware 1.18.250 and configured it. Initially, I set each switch to Btn, and Button_OnLongPressHold appears in the log, just like my colleague Xtr33m, and searching the internet led me to this thread.
It turns out that even if I change that port to Btn_pd, the switch still doesn't work, although the log has disappeared.
Can you help me out?
Translated with DeepL.com (free version)
Artificial Intelligence Response
Direct answer to the question
- Your symptoms strongly indicate one of two root causes:
1) The front panel is driven by a secondary TuyaMCU and the T1‑3S pins you set to Btn/Btn_pd are not actually connected to the touch keys; or
2) The keys are direct‑GPIO but the idle/pull and polarity are mismatched and/or the touch IC needs a full power‑up calibration with the glass fitted.
- Fix path:
- First determine if the device is TuyaMCU. If yes, stop using Btn/Relay roles and map DP (datapoint) channels instead.
- If not TuyaMCU, identify the actual button and relay GPIOs with a quick scan (dInput + Relay test), then set each button to the correct pull and polarity (Btn or Btn_pd, possibly inverted) and explicitly link each button to its relay. Power‑cycle from mains with the glass plate installed to recalibrate the touch controller.
Detailed problem analysis
- Why Button_OnLongPressHold with Btn and “nothing” with Btn_pd?
- Btn enables an internal pull‑up and expects an active‑low press. Your log shows a constant hold ⇒ the input sits low at idle (or is shorted/noisy), so the firmware thinks the key is continuously pressed.
- Btn_pd enables an internal pull‑down and expects an active‑high press. The long‑press spam stops (idle is now a defined low), but you still see no presses because either:
- You are on the wrong GPIO; or
- The touch output is open‑drain (cannot drive high), so the transition never reaches a valid high; or
- The panel is TuyaMCU and your GPIO is just floating, not tied to the touch key at all.
- Two hardware architectures you will meet in BSEED/Tuya panels:
- TuyaMCU front panel: T1‑3S talks UART to a small MCU that handles touch and relays. You will see Tuya packets (55 AA …) on the UART. In this case, setting any pin to Btn/Relay will never work reliably because nothing is wired that way.
- Direct‑GPIO: The touch IC (or discrete key circuit) drives T1‑3S GPIOs. Here the right combination of pull (up/down) and polarity (normal/inverted) plus proper calibration solves it.
- Touch calibration gotcha:
- Capacitive controllers calibrate their baseline on cold power‑up. If you rebooted while the glass was off or while touching the pad, the baseline can be wrong, causing stuck long‑press or no‑press. Only a true mains power cycle with the glass mounted gives a clean recalibration.
Current information and trends
- Many 2024–2026 Tuya wall switches moved to BK7238/T1‑3S modules and increasingly use TuyaMCU front panels. It is therefore more common that buttons/relays are not tied to module GPIOs. Plan to detect and configure TuyaMCU first before spending time on GPIO mapping.
- Recent community firmware builds added more button roles (pull‑down/inverted variants) and better debouncing. If you stay on direct‑GPIO, ensure you are on a build that includes Btn_pd and inverted options.
Supporting explanations and details
- Quick decision tree:
- See “55 AA …” packets on the UART after assigning two pins as TuyaMCU_RX/TuyaMCU_TX and starting the TuyaMCU driver? → Configure DP mapping, do not use Btn/Relay roles.
- No Tuya traffic and you can toggle relays by assigning candidate GPIOs as Relay and clicking them in UI? → It’s direct‑GPIO. Find the two button pins with dInput and set proper Btn variant.
- Interpreting dInput results (idle → press):
- 0 → 1 on press: Use Btn_pd; if press/release are flipped, use inverted.
- 1 → 0 on press: Use Btn; if flipped, use inverted.
- No change: Wrong pin or open‑drain output needs a pull‑up (try Btn) or pull‑down (Btn_pd) to bias the line, or it’s TuyaMCU.
Ethical and legal aspects
- This device is mains‑powered. Only work with power isolated, and re‑install the glass/insulation before any live power test. Using third‑party firmware may void product certification and local code compliance.
Practical guidelines
1) Identify architecture
- Temporarily set suspected UART pins (often labelled TX/RX on the module) to TuyaMCU_RX/TuyaMCU_TX, enable the TuyaMCU driver, reboot, and watch the log.
- If TuyaMCU is detected:
- Map the on/off datapoints (usually DP1/DP2 for 2‑gang) to channels.
- Verify that pressing the touch pads reports DP changes and that toggling channels sends correct DP commands to switch relays.
2) If direct‑GPIO, map relays first
- With power isolated, assign one candidate GPIO at a time as Relay, power up, and toggle in UI to hear/see the click/light. Note the two relay pins.
3) Find buttons with dInput
- Assign a candidate GPIO as dInput, watch its value while touching Gang 1 and Gang 2. Repeat until you find the two pins that change deterministically.
4) Apply the correct button role
- For each found button pin:
- If idle reads 0 and press reads 1 → Btn_pd (add “inverted” if your press/release sense is swapped).
- If idle reads 1 and press reads 0 → Btn (add “inverted” if needed).
5) Link button → relay
- In the UI, set each button’s channel to the matching relay (e.g., Btn1 → Channel 1/Relay1, Btn2 → Channel 2/Relay2). If your build uses event rules, add two short‑press → toggle mappings.
6) Calibrate touch properly
- Fit the glass plate, cut mains power for 10–15 s, restore power, wait ~10 s, then test. Repeat once if behavior is still sticky.
7) If a button never reaches a valid level
- The touch output may be open‑drain. Try the opposite pull (Btn vs Btn_pd) and/or add external 10–47 kΩ pull‑up to 3.3 V (or pull‑down to GND), only if you are comfortable with SMD work and have confirmed logic levels with a meter.
8) Debounce/hold timing
- If short presses are occasionally misread as holds, increase the long‑press threshold and debounce time in the button settings of your firmware.
Possible disclaimers or additional notes
- T1‑3S/BK7238 boards come in many PCB revisions; GPIO numbering/templates found online may not match your unit. Always verify by test, not by assumption.
- Some 2‑gang BSEED variants wire the LEDs in ways that interact with button GPIO biasing. If a key reads unstable, temporarily unassign the corresponding LED pin during diagnosis.
Suggestions for further research
- Look up “T1‑3S TuyaMCU mapping” and “BK7238 BSEED template” examples for similar 2‑gang panels to compare DP maps and common GPIO choices.
- Review your firmware’s release notes for recent button role additions (pull‑down/inverted) and TuyaMCU improvements; update to the latest stable if you’re on 1.18.250 and see input quirks.
Brief summary
- Continuous LongPress with Btn, then silence with Btn_pd, means your input bias/polarity and/or architecture is mismatched. First, determine whether the panel is TuyaMCU; if yes, configure DP channels and stop using Btn roles. If it’s direct‑GPIO, discover the actual pins with dInput, assign Btn or Btn_pd (with inversion as needed), link each button to its relay, and do a cold mains power cycle with the glass fitted to recalibrate touch.
If you can, please share:
- A boot log excerpt (first 30–60 seconds) after assigning TuyaMCU_RX/TX and enabling the driver.
- Which GPIOs toggle your two relays.
- dInput readings (idle and on touch) for the suspected button pins.
- A clear photo of the PCB around the T1‑3S module.
With those, I can give you an exact per‑pin configuration.
Disclaimer: The responses provided by artificial intelligence (language model) may be inaccurate and misleading. Elektroda is not responsible for the accuracy, reliability, or completeness of the presented information. All responses should be verified by the user.