Philips Mi Wi-Fi dimmable mains LED bulb - offline use, no phone/tablet - Page 1
Forum section: electronics / beginners

author: RoGeorge
author_rank: Super Contributor
timestamp: December 20, 2022, 07:27:48 pm
content: The light bulb (warm white, 9W) has inside a Wi-Fi module ESP-WROOM-02D (ESP8266 based w 2MB flash). From searching online, it seems to need a Xiaomi Mi cloud application to work. Though I'm not sure about that, never used Wi-Fi lights before.I have ESP-01 Wi-Fi modules (ESP8266, 512kB flash) and can attach one to a microcontroller, but I do not have an Internet connection, and do not want to install any proprietary app on a mobile phone.Is it possible to control such a Wi-Fi LED bulb locally, from another ESP8266?

author: JustMeHere
author_rank: Frequent Contributor
timestamp: December 20, 2022, 07:34:03 pm
content: It's possible to do it from anything that does WiFi, but you will need to do some programming and possibly reprogramming.

author: SmallCog
author_rank: Frequent Contributor
timestamp: December 20, 2022, 08:52:11 pm
content: If you were super keen you may be able to write your own code for it.The ESP family is well supported in the Arduino ecosystem and I doubt it's actually doing anything too fancy.You could then set it up in Access Point mode whereby the ESP module hosts its own WiFi network and you connect your phone to it to use a webpage hosted on the ESP module to control the light without needing an app.This may provide some inspiration, but it all hinges on you figuring out what the ESP module is doing to dim the bulb and then emulating the same thing in your own code.\https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/example-sketch-ap-web-server

author: RoGeorge
author_rank: Super Contributor
timestamp: December 21, 2022, 08:47:41 am
content: Yes but how? What is the protocol used? Any link to a working project that controls a Philips Mi WiFi LED bulb?I've searched a lot yesterday and couldn't find much. Seems that there were more protocols, some ZigBee, some BlueTooth, this light bulb most probably uses UDP Wi-Fi. Older ones were unencrypted, newer ones use some encryption (AES/SSID?).The proprietary cloud application needs a token (ID specific to each light bulb?) the WiFi SSID and an account (to Philips or Xiaomi?). There are some open source alternatives for home automation servers that have Xiaomi Mi plugins, which I'm not very sure how to setup or use, never did that before.At the light bulb hardware level, I've found some examples (from other WiFi LED bulb brands) where the LEDs were controlled by a dedicated IC with a PWM input pin to set the light intensity. The PWM input pin was driven by a standard Wi-Fi module, often an ESP8266 or alike. This Philips bulb (E27 socket) has inside an ESP-WROOM-02D, which is a standard ESP8266 WiFi that can be bought separately, but I can not see the rest of the components (don't know how to remove the control PCB from the E27 light bulb's socket, seems soldered/glued inside).If it were to need just a PWM from a WROOM Wi-Fi that would be easy, I would just reflash the WROOM with a standard open source firmware and cobble my own solution to set a PWM over Wi-Fi. I would prefer the cobbled improvisation, instead of keeping a Wi-Fi module with proprietary Philips firmware + a big stack of Home Automation + Xiaomi Mi protocol plugin only to send a PWM value, just that I'm not sure yet if the power module is controlled by a simple PWM pin.The control PCB is sited inside an aluminium bell-shaped radiator that help dissipating the heat from the top/flat radiator whith LEDs. The control PCB is perpendicular on the LEDs PCB and goes deep inside the E27 bulb's socket. Then, the Al bell is covered in something like a ceramic or hard plastic. Doesn't look like it was designed to service or to dismantle without breaking it.Anybody knows how to extract the PCB from the E27 socket without breaking/cutting its housing, please?

author: SmallCog
author_rank: Frequent Contributor
timestamp: December 21, 2022, 10:23:06 pm
content: Sorry but I don't have the time to search out specific examples for youThe basic steps are to figure out how the ESP module is controlling the dimming, is it PWM or something else?The next step is to write some code that has an ESP do the same thing as their code is making it do, but controllable in another way (such as an internally hosted webpage)Then you need to get your code onto the ESP module in the lampIt's not an impossible project, but if it's too daunting shelve it for a while and work your skills up to being comfortable with it.

author: james_s
author_rank: Super Contributor
timestamp: December 21, 2022, 10:45:31 pm
content: If it's based on ESP8266 you can flash it with Tasmota.

author: RoGeorge
author_rank: Super Contributor
timestamp: December 21, 2022, 11:17:23 pm
content: Quote from: SmallCog on December 21, 2022, 10:23:06 pmNot asking anybody to do that. I've searched for hours an MCU project that can talk Xiaomi Mi over Wi-FI, and couldn't find any, that's why I was asking if anybody already knows a good a link.Eventually I'll roll my own solution, just that in order to do that I'll have to break/cut the enclosure to get the PCB out and reflash the WROOM with some open source firmware. Will see, thanks for the help.

author: james_s
author_rank: Super Contributor
timestamp: December 22, 2022, 01:18:45 am
content: There are tools that for some lamps at least will simulate an update server and let you flash Tasmota or other firmware OTA. The name escapes me at the moment but I did that with a handful of bulbs a couple years ago before I settled on zigbee bulbs.