Killing the Token Treadmill

How I migrated my smart home from Samsung SmartThings to Tuya β€” and fired my AI from her daily token-fetching job.

Updated October 21, 2026

Smart HomeTuyaSmartThingsAutomation
← Back to home
πŸ“– Chapters The original story Chapter 1 Β· Oct 21 β€” the migration gets tested

The Problem: A Token That Dies Daily

I had three smart plugs and a power strip running through Samsung SmartThings. It worked β€” until I learned that Samsung's personal access tokens expire every 24 hours.

So every single day, my AI assistant had to manually fetch a fresh token: open a browser, log into Samsung, generate a new PAT with the right scopes, and swap it into the config. It was a daily chore that never ended. A treadmill.

There had to be a better way.

Dead End 1: The Bardi Bridge That Wasn't

My plugs were Bardi-branded (an Indonesian Tuya OEM). My first idea: link Bardi to SmartThings through the official integration. I opened the linked-services page in SmartThings… and the power strip wasn't even listed. No device picker, no option. Dead end.

I also tried the reverse β€” linking Smart Life to SmartThings. Samsung's Tuya OAuth is hardcoded to the US data center, and my account lived elsewhere. "Authorization Failed." Another dead end.

Dead End 2: The Bardi App Won't Talk to Tuya

Bardi devices are Tuya under the hood, so I tried linking my Bardi app account to a Tuya IoT Platform project. The platform's "Link App Account" QR code is hard-locked to the SmartLife app. Scanning it with Bardi just says: "Please use the designated APP to scan the code."

Bardi wouldn't talk to Tuya. Period.

The Breakthrough: Two Identities, One Email

Here's where it got interesting. I discovered I had two separate Tuya identities under the same email address:

Tuya isolates user data per data center and per app. Same email, two walled gardens. My "10 devices" in the SmartLife app turned out to be a Google Home mirror, not real Tuya devices.

The fix was obvious once I saw it: move the devices to SmartLife. Re-pair each one, and they'd land in the identity my IoT project could actually see.

The AP Mode Trick

Re-pairing a Tuya device gives you two modes:

The trick to switch: reset once for rapid blink, then reset again while it's blinking to flip to slow blink. AP mode worked on the first try for every device after that.

Lesson: skip EZ mode. Go straight to AP mode and save yourself the headache.

The Migration

One by one, I moved all four devices:

  1. Smart Socket 2 (5-gang power strip) β€” the guinea pig. EZ failed, AP worked.
  2. Air Conditioning (smart plug) β€” paired in seconds once I knew the trick.
  3. Bed light (metering smart plug) β€” same drill. Bonus: it reports voltage, current, and power draw.
  4. Bola merah (Bluetooth color bulb) β€” just removing it from the Bardi app threw it into pairing mode instantly. No button-mashing needed.

Each one appeared in my Tuya IoT project within seconds. I built a small Python connector using the official tuya-connector-python library β€” no more hand-rolled API signing (I tried; the signatures never matched).

Firing the Token Treadmill

With everything on Tuya, SmartThings had nothing left to do. I deleted the daily token-renewal cron. No more browser automation, no more 24-hour expiry, no more manual fetching.

My AI went from "fetch a Samsung token every day" to "just control the devices." The Tuya cloud tokens are managed by the SDK β€” I never think about them.

The New Setup

What I control now, all through a single Tuya connector:

Automation runs on cron: bed light on in the evening (when the main WiZ bulb goes off), off in the early hours. If a device is unreachable, the automation retries and reports β€” no silent failures like a buried device schedule.

The Bluetooth bulb stays manual β€” I adjust its color in the SmartLife app when the mood strikes. Some things don't need automating.

Lessons

1. Go Straight, Fallback Only If It Fails

We wasted time on redundant paths (SmartThings and Tuya, EZ and AP). The right approach: try the direct way first, fall back only when it fails.

2. OEM Apps Are Walled Gardens

Bardi, SmartLife β€” same Tuya guts, but the app you pair with determines which cloud identity owns your devices. Choose the one with the open API.

3. AP Mode > EZ Mode

Every time. The 30 extra seconds of joining a hotspot beats 10 minutes of failed auto-pairing.

4. Kill the Treadmill

If your automation requires a human (or AI) to do daily maintenance, it's not automation. Fix the dependency, don't feed it.


Migrated in one afternoon. No more tokens. No more Bardi app. Just devices that listen.

Chapter 1 Β· October 21, 2026: the migration gets tested

β—€ new here? read from the start

Declaring a migration done is easy. The grid β€” and a dusty strip β€” had other plans.

Migrations don't get tested in articles. They get tested at the next power outage β€” and mine came the day after this one was published. When the power returned, I had my assistant check the fleet: all three controllable devices β€” the strip, the AC plug, the bed-light plug β€” answered on the first query, minutes after the lights came back. No re-pairing, no manual reconnection; they had found their way back to the cloud on their own. And the schedules couldn't be lost, because they were never on the plugs to begin with β€” they live in her cron system, which no outage can wipe. (The WiZ bulb's side of that same outage went considerably worse.)

The strip, though, had quietly become furniture β€” migrated, controllable, and mostly unemployed. That changed on October 20, when I put my charger setup back on it. The strip is now a charging station:

One numbering quirk for anyone wiring the same strip: in the system, the USB group is switch 5 β€” yet physically it sits at the very start of the strip, up by the controller. Walk along the hardware and the order runs 5, 1, 2, 3, 4. The numbers follow the firmware; the names follow the plugs.

The house rule for it: saying a charger's name starts a two-hour session. My assistant switches the outlet on and sets a two-hour countdown inside the strip itself β€” the strip cuts the power when the countdown ends, no cloud involved mid-session, so a session survives an internet drop.

The first scheduled run put that rule to the test β€” and found the crack. I'd asked late at night for the universal charger to run before dawn; back then it lived on outlet 4. The session started fine, but the auto-off never fired: outlet 4's countdown silently doesn't engage. The cloud API returns success, the device ignores it β€” verified twice, while the other outlets' countdowns work on the very same strip. A fallback timed job cut the power instead, and I confirmed the charger was really off.

The fix was physical, the way the honest ones often are: the next morning I swapped the plugs. The universal charger moved to outlet 1, whose countdown works; the little micro charger took outlet 4. Names remapped to match the plugs, everything verified.

One more strip quirk worth writing down: unlike the single plugs, it has no power-restore setting at all. After a power cut, every outlet simply stays off until told otherwise. For a charger station, honestly, that's the safe default.

And my assistant has one idea still on the bench: a powerbank living on the strip, topped up by a daily automatic session so it's always ready to grab. I said "not for now" β€” she still needs me to pick an outlet and a start time first. The bench is patient.

Lesson: a migration isn't finished when the last device pairs. It's finished when the new setup survives its first bad day β€” and the dustiest piece of it finds a new job.

πŸ“ Story so far

The token treadmill is dead: four devices escaped Bardi and SmartThings for Tuya, and the daily token cron is gone. The new setup passed its first outage without any help, and the once-idle strip now runs a charger station β€” with one outlet whose countdown can't be trusted, and a powerbank idea still waiting on the bench.

← Back to home