Support for Xiaomi Mijia 1S Light Bar [MJGJD02YL] in Xiaomi Miio integration

Hello there,

I got this lamp but also I find out that it is not supported, it’s a new product so I’m not that surprised

It appears in the configuration as

image

Mi Smart Computer Monitor Light Bar 1S - yeelink.light.lamp22

Model MJGJD02YL

Only accessible via cn AFAIK

I will gladly provide help, or welcome any tips how can I make it work with current integration, I can write code but I’m not strong with Python or HA code base

There is no way to integrate the desk lamp 1s into HA, as Xiaomi stopped the local api for xiaomi branded products.
You have to flash this lamp with esp home.
Have a look at here:

@Dielee thanks for that, I realized now that I made a mistake in the title, it is not “desk lamp” but model is correct

MJGJD02YL is a light bar, it looks different and I’m not sure if the same process of flashing can be applied in this case

PS. title corrected, thanks again

I find this: Installing Tasmota on the Xiaomi Desk Lamp - karl
But, the dissembling is not so easy…

@nechry Hey, thanks for that, actually I found a description of that process some time ago here Xiaomi Mi Computer Monitor Light Bar 1S Light (MJGJD02YL) Configuration for Tasmota might be also helpful for others

Unfortunately, the process will render your remote useless (shame, it’s a nice remote) but I still think it’s worth it.

And you are right, dissembling is messy, I scratch the paint off the ends of my tube while dissembling, it’s very easy to scratch paint, I ended up printing 2 plastic caps to cover those scratched ends, so, do yourself a favor and get those pliers with non-marring grips … or be prepared for some 3d printing :wink:

thank for the update, I just order my lamp today. Your 3D part are available somewhere to get it, in case of…

1 Like

No, I didn’t save those 3D files, it was an easy and fast print, basically, a cylinder printed in vase mode I did a few iterations on it to get a tighter fit, I think it wouldn’t print the same on the other printer.

I printed those in black PLA, I was worried that they will annoy me (the original look is awesome) but I stopped noticing them very quickly, and during nighttime, while the lamp is on you don’t notice them at all because of the light.

I finally perform it today on 2 Desk Lamp S1, without breaking anything. Very happy for this modification.
I use this SP10 probes to avoid solder on tests points.

I also tried to use ESPHome instead of tasmota, not as tasmota is not good, but just all my others boards are now with ESPHome.
But at the moment I didn’t success to run with ESPHome.
I guees didn’t set the right config for the ESP32solo1 board.
I tried this ESP32solo1 config.
SP10 was useful to flash every-time I break the boot…

1 Like

I have also include the zigbee Tuya Smart Knob - ERS-10TZBVK-AA as replacement for the origin remote control. Not as great than the original remote but it’s ok to toggle and dim/bright quickly

do you know if this 1s version work with alexa for on/off?

Sorry no idea, but if Alexa integrates with Xiaomi app then it should work

So there is no way to control this Light Bar with Home Assistant instead of opening and flashing it with another firmware? Or has this changed in the meantime? It would be no problem for me if the connection is made over the cloud.

Very unlikely, as it has been a year since I flashed it I never considered going back to the original firmware. I spend a lot of time researching different approaches and by that time it was the only option.

I have no idea if support for that device was added in HA Xiaomi plugin, and since those are not that popular. I can only imagine you are here because you spend your time browsing the internet for solutions.

However, maybe you can try Yeelight integration since nowadays there is a very similar lamp YLTD003 and this lamp is supported by HA, maybe, by some chance, it will also work with MJGJD02YL.

It’s a long shot, please come back with a result here, for sure it will help others in future

ok, I am back, got it sorted out. :sweat_smile:

I thought the custom component is not working anymore, because of the disabled local api, but it looks like it was something else.

Here is what I’ve done:

  • Added the device to Mi Home with vevs modded app (would probably also have worked with the stock app and a region change to China before adding it).
  • Installed the Xiaomi Miot For HomeAssistant custom component.
  • Retrieved the device token for the lamp with vevs modded Mi Home app, like mentioned here.
  • Added the device with “host/token” to Home Assistant. (This was my initial problem. With the “Mi Account” option it added the device, but it wasn’t controllable.)

Now I just need to find out how I get back the color temperature slider of the deprecated version of the custom component. The new one has a color picker (probably because of the Yeelight YLTD001/YLTD003).

Ok, sorted that out too, had to make this adjustment to the entity through the “customize.yaml”.

light.yeelink_lamp22_XXXX_light:
  color_mode: 'color_temp'

4 Likes

Thanks for your post! I have the Xiaomi 1S monitor light, and just added it (using the token). It works well :blush:

Do you know if it’s possible to add the remote? It apparently uses 2.4Ghz to communicate. I’m wondering if we can add the remote and then control it with events in HA. That would be amazing…

You might try setting up a Milight hub to read the RF signals and pass them to HA. I don’t have the Light Bar, but do use a few MiLight remotes as inputs to HA to control lights and automations.

Hello, how do you get the token if it’s not connected to wifi? And the IP?

I added the Light Bar 1S to my Xiaomi account with the Chinese region. I then retrieved the token using the Windows app I found: GitHub - Maxmudjon/Get_MiHome_devices_token: Get Mi Home devices token Windows/MacOS app.

This worked wonderfully. After that, I was able to set up the light bar in the Home Assistant with the Xioami Miot Auto integration of HACS. I selected the “Setup with host/token” mode. All the information I needed for this was made available to me via the Windows app.

1 Like

Thank you Walhalla! This worked like a charm :smiley:

I had to search a bit on how to modify the customize.yaml. I am running HA as a docker container, so I had to initially add a reference in the config/configuration.yaml and then create the config/customize.yaml.

I used the following commands:

# Copy configuration.yaml from container
docker cp <YOUR CONTAINER ID>:/config/configuration.yaml .
# Edit configuration.yaml:
nano configuration.yaml
# add the following
homeassistant:
  customize: !include customize.yaml
# copy back in
docker cp configuration.yaml <YOUR CONTAINER ID>:/config/configuration.yaml
# Create customize.yaml
printf "# CUSTOMIZE DEVICES\nlight.yeelink_lamp22_XXXX_light:\n  color_mode: 'color_temp'" > customize.yaml
# then copy in container
docker cp customize.yaml <YOUR CONTAINER ID>:/config/customize.yaml
# Delete files outside the container
rm customize.yaml
rm configuration.yaml

Lastly, you can now get the device IP and token from vevs’ Mi Home mod at:
My Light Bar > 3 dots top right corner > Additional Settings > Network Info

Ho can i add the Mi Computer Monitor Light Bar into xiaomi app??? I downloaded the mod app, but i not find the bar