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 18, 2026

Smart HomeTuyaSmartThingsAutomation
← Back to home

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.

← Back to home