Inexpensive, hubless, wifi RGBW bulb

Hoping to help get this device working with HA:


It is a wifi-based, hubless RGBW bulb which retails for $9. Based on my initial testing, it is based on an Expressif wifi SoC and uses MQTT for control. I have a few packet captures of the bulb in operation. The manufacturer’s recommended control app is “AI-Home” from AI-Thinker but it also works with “Tuya Smart.”

After the initial, smartphone-based setup, the bulb subscribes using unencrypted MQTT to mq.gw.tuyaus.com. It also seems to send a UDP broadcast to port 6666 which I’m hoping means it is designed for local, non-internet control as well.

Have you tried this component: https://home-assistant.io/components/light.flux_led/ ?

I bought the bulb hoping it would be compatible with that HA component, but I think it is just mislabeled in the eBay description as it doesn’t seem to be based on that chipset. Will give it a shot though.

Confirmed not working with flux_led component.

Here is a link on the OpenHAB forums about the same device. Seems they are working on it too. https://community.openhab.org/t/tuya-smart-bulb-binding/13423/2

What phone app is being used to control it?

Might also be worth trying

Definitely not LimitlessLED compatible.

More research: these bulbs connect in to the TUYA Smart IoT network. It seems like developers are able to custom brand the apps that control the bulbs, but all connect back to the same network. (My product recommended using “AI-Home” app, but the standard “TUYA Smart” app also works and looks very similar.)

Hence, if HA can be made compatible with this TUYA network, lots and lots of devices would be supported.

The bulbs themselves subscribe to a region-dependent MQTT server. For US, this is mq.gw.tuyaus.com. This traffic is unencrypted. Each bulb has a unique identifier which it uses as the MQTT username. The password for the MQTT connection is visible in a packet capture - and likely just an calculation based on the unique id.

The bulb also contacts a different “debug” server (a.gw.tuyaus.com) that seems to report status and possibly check for firmware updates via several HTTP POSTs of JSON data. The HTTP header indicates “ESP8266SDK” is the agent used by the bulb.

The app’s connection is encrypted so less details available. I see an HTTP POST during a light control operation though.

I’m hoping to disconnect ISP so I can check to see if app has direct control functionality (possibly related to the UDP6666 broadcasts I keep seeing). If so, that would seem to be a better pathway to get HA compatibility rather than relay on external MQTT control. Post back soon.

Confirmed. Bulb can be controlled without Internet access. This would imply there is a local lan communication method suggesting that HA could control bulb without utilizing external MQTT. Unfortunately, my current packet capture setup cannot grab packets between two wifi devices so cannot see this traffic.

Damn. Any chance you could grab an APK and run it in Chrome or BlueStacks or something?

Update: The glass bulb of these devices easily pops off allowing access to the pins of the esp8266 below. See this page for flashing instructions.

2 Likes

An ESP based bulb, and for this price :green_heart: a pity that they only deliver in the US. Does someone have a link to this on Aliexpress, or to a shop selling it in Europe?

Should be available globally. The trick is figuring out which products are actually this bulb and not just copying the description form another posting.

Tinkerman cites this page as his source on AliExpress.

I found an SDK that shows it would be possible to integrate Tuya devices. Unfortunately, to gain access to their API, you must register and be approved as a device developer. It does not look they have a way for end-users to obtain access to the API - but I’m going to request access anyway and report back with results.

For reference, check out:

http://api.tuya.com
https://docs.tuya.com/en/cloudapi/cloud_access/
https://github.com/TuyaInc/TuyaDemo/tree/master/cloud-sdk

Quick update:

Manufacturer firmware has serial output at 74880 baud. In initial test, firmware just spits out “scandone” every few seconds. Bulb had not been configured for wifi access before testing.

I was able to flash ESPurna to 10 of these bulbs tonight with no issues using the ai-light-debug target. Now I have full API, Alexa, Google Home and MQTT support. :smiley:

I’m now using AiLight firmware on 7 bulbs. Very easy to setup and use with HA.

Is there instructions on how to flash firmware to these bulbs?

Are these bulbs no longer available? Source?

Looks like an alternate to the sonoff B1? Better color, cheaper?

any updates on this subject?

Not sure of a current source on these bulbs. The AiLight firmware still works but hasn’t been updated recently. Personally, I don’t use many of these bulbs I’ve purchased since their color temperature settings aren’t great - hard to mimic a warm white color for normal lighting.