🇨🇿 cs

Aqara T2 RGB smart lightbulb and Home Assistant

My second Lifx bulb (model A60) had some power stability issues after five years of use, so it was time to say goodbye. Unfortunately, Lifx was bought out and completely withdrawn from the European market. You can only find them in the US, Canada, and Australia.

I accidentally discovered bulbs from Aqara, a company that makes a bunch of other useful devices for smart homes (I have their thermostatic valve heads for radiators). The full name of the bulb is Aqara T2 RGB CCT, and the E27 version (there is also a GU10 bayonet version) is available for around 25 EUR. In addition to the color version, there is also a version with only white light, which covers about 99% of our use. However, given the small price difference, I decided to go for the colored one. In RGB mode, the light output is not specified (but it is much lower, see below). In white mode, it is 1000-1100 lumens, depending on the light temperature. This is equivalent to a 75W bulb.

Aqara T2 is slightly smaller than Lifx A60

Comparison and installation

The main difference between Aqara and Lifx is the connection method.

Lifx connects to your Wi-Fi network, and you communicate with it locally using an app (or yourself via a protocol based on UDP packets, such as integration in Home Assistant). Or you can connect it to the “cloud” and then control it from anywhere in the world, either via the app or via the web API. This is an undeniable advantage when it is the only smart device in your home.

On the other hand, Aqara (similarly to Philips Hue/Ikea/Lidl products, for example) needs a hub with which it communicates. Either the Zigbee or Matter/Thread protocol is used for communication here.

Aqara T2 box

When unpacked from the box, the bulb is pre-set to Matter/Thread mode. To connect via Zigbee, it must be “switched”. This switch is basically the installation of different firmware directly from the Aqara app. So, at least at the beginning, you need to install their app (and register) if you want Zigbee mode. I don’t have any other option at the moment. I’m not planning on getting a radio for Thread yet, and unfortunately, Home Assistant SkyConnect didn’t deliver on its promised dual support.

The firmware replacement is done via Bluetooth and takes less than a minute. After switching, the Aqara app is useless unless you have their ecosystem. In any case, immediately after restarting the bulb, I was able to add it to Home Assistant using ZHA (Zigbee Home Automation) integration.

The box claims that Aqara T2 supports a wide range of smart home systems

The bulb is probably constructed a little differently than the Lifx one. The brightness in RGB mode is much lower than what the Lifx A60 bulb is capable of. This leads me to believe that Aqara has dedicated LEDs for white colors and does not have as many chips for color mode. In my opinion, Lifx mixes all colors with the same LEDs, so there is decent brightness even in color mode. But I haven’t taken it apart, so I don’t know.

On the other hand, colored light isn’t for reading anyway, but only for a colored background, for example, for the TV, so it doesn’t matter. Over time, I started using color only for notifications or when I needed to entertain the kids. The white light shines about the same, with Aqara perhaps winning slightly. But that may be due to wear and tear, as the Lifx A60 claims a luminous flux of up to 1200 lm.

Compared to Lifx, Aqara promises a higher Ra index (CRI) – 90 compared to 80 for Lifx. I haven’t noticed any differences yet :-)

The colors don't quite match the controls in Home Assistant, but they're still okay to look at

Control

The control of the bulb has not changed on the Home Assistant side. You use the same interface, except that the commands are sent via Zigbee instead of Wi-Fi.

You can set either the white color temperature Or any color And, of course, brightness

You can customize your favorite colors at the bottom; there are several white settings and a few colors by default. My list has already been customized.

There are several adjustable attributes in the bulb properties, mainly related to the delay when changing colors and turning on/off. The translation is a bit awkward, and the units are strange, so I haven’t fully explored the exact meaning of all of them yet. And it seems that the Zigbee implementation still lacks “Start-up behavior.” See issue on Github. So far, I have noticed that the bulb remembers the last setting when I turn it off and on with the lamp’s mains switch. This is a bit awkward if it was in the off state when I last disconnected it from the power supply :-)

Effects

The Aqara bulb or its integration in HA does not support built-in effects like Lifx (e.g., flashing, which is great for various notifications), or it cannot do so without an Aqara hub or via Zigbee (or both).

So the only solution seems to be a script that will send a sequence of commands to the bulb. My first attempt at a script looks something like this:

  1. The input is the number of repetitions and the color, so the script can be called differently each time. Another improvement would be to let you choose entities as well. But I only have one bulb, so this is enough :-)
  2. At the beginning, the state of the light bulb is saved; for me, it is the entity light.zarovka.
  3. Repeat as many times as the value of the count array.
    1. Set the selected color from the color variable,
    2. Wait 500ms,
    3. Set the previously saved scene,
    4. Wait 500ms.
  4. Delete the temporarily created scene scene.tmp_zarovka.

The result is flashing from any state, and after the sequence ends, the bulb resets. The biggest “trick” is to create a temporary scene so that the bulb’s state is fully saved before the sequence starts. Otherwise, it’s just a sequence of commands and a loop.

The definition of the script in YAML is as follows:

sequence:
  - action: scene.create
    data:
      scene_id: tmp_zarovka
      snapshot_entities:
        - light.zarovka
  - repeat:
      count: "{{ count }}"
      sequence:
        - sequence:
            - action: light.turn_on
              data:
                transition: 0
                rgb_color: "{{ color }}"
                brightness_pct: 100
              target:
                entity_id: light.zarovka
            - delay:
                milliseconds: 500
            - action: scene.turn_on
              data:
                transition: 0
              target:
                entity_id: scene.tmp_zarovka
            - delay:
                milliseconds: 500
  - action: scene.delete
    target:
      entity_id: scene.tmp_zarovka
alias: Lightbulb flashing
description: Flashes the specified number of cycles with the selected color and returns the lightbulb to its original state.
fields:
  color:
    selector:
      color_rgb: {}
    name: Color
    description: Flashing color
    default:
      - 255
      - 0
      - 0
    required: true
  count:
    selector:
      number:
        min: 1
        max: 10
    name: Repetition
    default: 3
    required: true

The disadvantage of this solution is the need for a stable connection, because you need to send N commands in a row, with ideal timing. So far, I’ve been able to do this at home in my room. I dug around a bit in the source code Lifx integration and it seems that the effects are done the same way, except that there are ready-made functions that you just need to call (or rather, they are provided by the aiolifx_effects library). Apparently, similar software effects are available as part of the Zigbee2MQTT integration.

Conclusion

My Lifx bulb has always lasted me about 5 years, but unfortunately, it is now difficult to buy it through official channels. On the other hand, the Original model (from the original Kickstarter campaign) cost me 2,000 CZK 10 years ago, and the A60 model cost me about 1,600 CZK five years later. However, it included a usable application and an internet API. I can’t judge the quality of the Aqara app, as it relies on their hub, which I don’t have. But I’m more or less satisfied with the current state of integration into Home Assistant. And at a third of the price, it may not even last 5 years, so we’ll see when I choose again.

Comments