zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

[New device support]: Aqara Ceiling Light T1 lumi.light.acn031 HCXDD12LM

Open banister4728 opened this issue 2 years ago • 25 comments

Link

https://homesmart.sg/product/aqara-ceiling-light-l1/

Database entry

{"id":13,"type":"Router","ieeeAddr":"0x54ef4410008f1023","nwkAddr":52696,"manufId":4447,"manufName":"Aqara","powerSource":"Mains (single phase)","modelId":"lumi.light.acn031","epList":[1,2],"endpoints":{"1":{"profId":260,"epId":1,"devId":258,"inClusterList":[5,4,3,0,768,8,6,64704],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"61440":1,"modelId":"lumi.light.acn031","manufacturerName":"Aqara","powerSource":4,"zclVersion":3,"appVersion":23,"stackVersion":27,"hwVersion":1,"dateCode":"20230525"}},"aqaraOpple":{"attributes":{"223":{"type":"Buffer","data":[22,33,0,0,23,33,0,0,12,33,0,0,24,33,0,0]},"229":{"type":"Buffer","data":[12,0,12,0,0,4,0,59,21,37,37,221,22,37,0,218,86,37,130,72,91,37,83,137,95,37,52,19,125,37,0,217,150,37,97,216,159,37,0,41,218,37,117,88,221,37,188,142,223,37,48]},"247":{"type":"Buffer","data":[117,32,254,115,35,153,153,204,76]}}},"lightingColorCtrl":{"attributes":{"245":13490258,"colorCapabilities":16,"colorTempPhysicalMin":153,"colorTempPhysicalMax":370,"colorTemperature":217,"colorMode":2}},"genOnOff":{"attributes":{"245":13490262,"onOff":0}},"genLevelCtrl":{"attributes":{"245":13490259,"currentLevel":254}}},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":260,"epId":2,"devId":258,"inClusterList":[5,4,3,768,8,6,64704],"outClusterList":[],"clusters":{"lightingColorCtrl":{"attributes":{"245":47044608,"currentX":19660,"currentY":39321,"colorCapabilities":24,"colorTempPhysicalMin":153,"colorTempPhysicalMax":370}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":23,"stackVersion":27,"hwVersion":1,"dateCode":"20230525","zclVersion":3,"interviewCompleted":true,"meta":{"configured":-1309948793},"lastSeen":1698378541893,"defaultSendRequestWhen":"immediate"}

Comments

Seems to be working mostly.

External definition

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;

module.exports = [
  {
    zigbeeModel: ['lumi.light.acn031'], // The model ID from: Device with modelID 'lumi.sens' is not supported.
    model: 'T1', // Vendor model number, look on the device for a model number
    vendor: 'Aqara', // Vendor of the device (only used for documentation and startup logging)
    description: 'Symphony Ceiling Light T1', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
    meta: { multiEndpoint: true },
    endpoint: () => ({ white: 1, rgb: 2 }), // Endpoints need to follow defined list of names.
    fromZigbee: [
      // fromZigbee seems to be generic across all preset profiles.
      fz.color_colortemp,
      fz.on_off,
      fz.brightness,
      fz.level_config,
      fz.ignore_basic_report,
      fz.power_on_behavior,
      fz.aqara_opple,
    ],
    toZigbee: [
      // [White light with color temperature]
      tz.light_colortemp,
      tz.light_colortemp_move,
      tz.light_colortemp_step,
      // tz.light_colortemp_startup, // Disabled as it's not supported by the device
      // [Notification light]
      tz.light_color,
      tz.light_hue_saturation_move,
      tz.light_hue_saturation_step,
      tz.light_color_options,
      tz.light_color_mode,
      // [Common]
      tz.light_onoff_brightness,
      tz.ignore_transition,
      tz.ignore_rate,
      tz.light_brightness_move,
      tz.light_brightness_step,
      tz.level_config,
      tz.effect,
      tz.power_on_behavior,
      tz.xiaomi_switch_power_outage_memory,
    ],
    exposes: [
      // [Generic aqara device attributes]
      e.power_outage_memory(),
      e.device_temperature(),
      e.power_outage_count(),

      // [White light with color temperature]
      e.light_brightness_colortemp([153, 370]).removeFeature('color_temp_startup').withEndpoint('white'), // White light: On/Off, brightness, color temperature, no color_temp_startup
      // e.effect().withEndpoint('white'), // Disabled as it's not supported by the device
      // e.power_on_behavior(['off', 'on', 'toggle', 'previous']).withEndpoint('white'), // Power on behavior: Off, On, Toggle, Previous (unknown if working)

      // [Notification Light]
      e.light_brightness_colorxy().withEndpoint('rgb'), // On/Off, brightness, color
      // e.effect().withEndpoint('rgb'), // Disabled as it's not supported by the device
      // e.power_on_behavior(['off', 'on', 'toggle', 'previous']).withEndpoint('rgb'), // Power on behavior: Off, On, Toggle, Previous (unknown if working)
    ],
    configure: extend.light_onoff_brightness_colortemp_color().configure, // Use common configure method from light_onoff_brightness_colortemp_color
    //  ota: ota.zigbeeOTA, // Disabled as we are not keeping track of firmware updates on Aqara side
  },
];

banister4728 avatar Mar 01 '24 08:03 banister4728

I can confirm this appears to work for Aqara Ceiling Light T1M (lumi.light.acn032) as well.

mattipt avatar Mar 01 '24 22:03 mattipt

I can confirm this appears to work for Aqara Ceiling Light T1M (lumi.light.acn032) as well.

@mattipt How did you do it? I am unable to get it running.

TooBri avatar Mar 02 '24 21:03 TooBri

@mattipt How did you do it? I am unable to get it running.

@TooBri this is probably the wrong venue to try debugging specific issues; I will say though that I had to change zigbeeModel and comment out a few lines which I assume have to do with specific software versions (running on Home Assistant): fz.aqara_opple, tz.xiaomi_switch_power_outage_memory, e.power_outage_memory(), e.device_temperature(), e.power_outage_count().

mattipt avatar Mar 02 '24 21:03 mattipt

@mattipt How did you do it? I am unable to get it running.

@TooBri this is probably the wrong venue to try debugging specific issues; I will say though that I had to change zigbeeModel and comment out a few lines which I assume have to do with specific software versions (running on Home Assistant): fz.aqara_opple, tz.xiaomi_switch_power_outage_memory, e.power_outage_memory(), e.device_temperature(), e.power_outage_count().

@mattipt Thanks! one step closer. the only strange thing now is that i can't change the color from Zigbee2MQTT out, but it is posible within the HA entity.

TooBri avatar Mar 02 '24 22:03 TooBri

@mattipt How did you do it? I am unable to get it running.

@TooBri this is probably the wrong venue to try debugging specific issues; I will say though that I had to change zigbeeModel and comment out a few lines which I assume have to do with specific software versions (running on Home Assistant): fz.aqara_opple, tz.xiaomi_switch_power_outage_memory, e.power_outage_memory(), e.device_temperature(), e.power_outage_count().

@mattipt Thanks! one step closer. the only strange thing now is that i can't change the color from Zigbee2MQTT out, but it is posible within the HA entity.

Thanks for this info, can also confirm this worked with the T1M. I am also seeing the issue where the colour can't be changed within Zigbee2MQTT but works fine in HA.

Pel1can111 avatar Mar 03 '24 02:03 Pel1can111

@mattipt How did you do it? I am unable to get it running.

@TooBri this is probably the wrong venue to try debugging specific issues; I will say though that I had to change zigbeeModel and comment out a few lines which I assume have to do with specific software versions (running on Home Assistant): fz.aqara_opple, tz.xiaomi_switch_power_outage_memory, e.power_outage_memory(), e.device_temperature(), e.power_outage_count().

@mattipt Thanks! one step closer. the only strange thing now is that i can't change the color from Zigbee2MQTT out, but it is posible within the HA entity.

Thanks for this info, can also confirm this worked with the T1M. I am also seeing the issue where the colour can't be changed within Zigbee2MQTT but works fine in HA.

Yes. I have the same issue where the colour can't be changed within Zigbee2MQTT but works fine in HA.

banister4728 avatar Mar 03 '24 14:03 banister4728

I can confirm same for T1M acn032. Below configuration (based on 031 with disabling some lines) allows control of both lights in Home Assistance. But no RGB control in Zigbee2Mqtt Dashboard. Besides additional options missing and also no effects. But anyhow its a first draft to use the Light. In case somebody has good idea to improve the converter, let me know. I can also test with my device.

converter draft:

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;

module.exports = [
  {
    zigbeeModel: ['lumi.light.acn032'], // The model ID from: Device with modelID 'lumi.sens' is not supported.
    model: 'T1M', // Vendor model number, look on the device for a model number
    vendor: 'Aqara', // Vendor of the device (only used for documentation and startup logging)
    description: 'Ceiling Light T1M', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
    meta: { multiEndpoint: true },
    endpoint: () => ({ white: 1, rgb: 2 }), // Endpoints need to follow defined list of names.
    fromZigbee: [
      // fromZigbee seems to be generic across all preset profiles.
      fz.color_colortemp,
      fz.on_off,
      fz.brightness,
      fz.level_config,
      fz.ignore_basic_report,
      fz.power_on_behavior,
      // fz.aqara_opple,
    ],
    toZigbee: [
      // [White light with color temperature]
      tz.light_colortemp,
      tz.light_colortemp_move,
      tz.light_colortemp_step,
      // tz.light_colortemp_startup, // Disabled as it's not supported by the device
      // [Notification light]
      tz.light_color,
      tz.light_hue_saturation_move,
      tz.light_hue_saturation_step,
      tz.light_color_options,
      tz.light_color_mode,
      // [Common]
      tz.light_onoff_brightness,
      tz.ignore_transition,
      tz.ignore_rate,
      tz.light_brightness_move,
      tz.light_brightness_step,
      tz.level_config,
      tz.effect,
      tz.power_on_behavior,
      // tz.xiaomi_switch_power_outage_memory,
    ],
    exposes: [
      // [Generic aqara device attributes]
      // e.power_outage_memory(),
      // e.device_temperature(),
      // e.power_outage_count(),

      // [White light with color temperature]
      e.light_brightness_colortemp([153, 370]).removeFeature('color_temp_startup').withEndpoint('white'), // White light: On/Off, brightness, color temperature, no color_temp_startup
      // e.effect().withEndpoint('white'), // Disabled as it's not supported by the device
      // e.power_on_behavior(['off', 'on', 'toggle', 'previous']).withEndpoint('white'), // Power on behavior: Off, On, Toggle, Previous (unknown if working)

      // [Notification Light]
      e.light_brightness_colorxy().withEndpoint('rgb'), // On/Off, brightness, color
      // e.effect().withEndpoint('rgb'), // Disabled as it's not supported by the device
      // e.power_on_behavior(['off', 'on', 'toggle', 'previous']).withEndpoint('rgb'), // Power on behavior: Off, On, Toggle, Previous (unknown if working)
    ],
    configure: extend.light_onoff_brightness_colortemp_color().configure, // Use common configure method from light_onoff_brightness_colortemp_color
    //  ota: ota.zigbeeOTA, // Disabled as we are not keeping track of firmware updates on Aqara side
  },
];

tomknocke avatar Mar 06 '24 17:03 tomknocke

@tomknocke Thanks! Seems that On/Off is also not working with a hue wall switch.

to0b avatar Mar 07 '24 13:03 to0b

Does anyone know what else needs to be done to get it updated into the official release?

banister4728 avatar Mar 08 '24 07:03 banister4728

@tomknocke Added this to my z2m config and it worked properly. Thanks a bunch.

@banister4728 a pull request has to be made to /zigbee-herdsman-converters/. The code for this should be inserted into the lumi.ts file here: https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/devices/lumi.ts

You can see the instructions at the bottom here: https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html#_2-2-adding-converter-s-for-your-device

coniferous1 avatar Mar 08 '24 20:03 coniferous1

@coniferous1 Thanks. Let me try. I've not done that before, and I won't be able to test it so hopefully I copy and paste it in correctly.

banister4728 avatar Mar 09 '24 03:03 banister4728

@coniferous1 Thanks. Let me try. I've not done that before, and I won't be able to test it so hopefully I copy and paste it in correctly.

Are you planning to create a PR for lumi.light.acn031 or lumi.light.acn032? The lumi.light.acn032 does not seem to be fully fleshed out as RGB control is not working within Zigbee2MQTT. I've been attempting to resolve that issue, but haven't had any luck. I will update here if I solve it.

burgoyne avatar Mar 09 '24 04:03 burgoyne

@burgoyne acn032 seems to work for me, and while not fully featured it can be improved upon. I'd say for now partial support is better then no support.

coniferous1 avatar Mar 09 '24 05:03 coniferous1

@burgoyne acn032 seems to work for me, and while not fully featured it can be improved upon. I'd say for now partial support is better then no support.

Aside from not having the ability to set Aqara's scenes, this does allow full control of both lights through HA. If this repo allows PR's for partial support, then may as well push it through!

burgoyne avatar Mar 09 '24 05:03 burgoyne

@banister4728 If you have trouble please let me know. I didn't want to contribute your code as I wanted to be sure that you got credit.

Also putting @tomknocke here as he has worked on it.

coniferous1 avatar Mar 09 '24 06:03 coniferous1

@coniferous1 Actually it's fine if you do it. I don't have time to do the PR. Also, i realised my external converter for acn031 doesn't fully work with latest version (1.36.0-1), I'm still on 1.33.1-1. Seems like the RGB lights is controlled the same as the main light.

banister4728 avatar Mar 09 '24 15:03 banister4728

@coniferous1 Actually it's fine if you do it. I don't have time to do the PR. Also, i realised my external converter for acn031 doesn't fully work with latest version (1.36.0-1), I'm still on 1.33.1-1. Seems like the RGB lights is controlled the same as the main light.

I have acn02 (T1M) and 1.36.0-1 and can't control the RGB lights too. Is it meant to appear as a separate entity in HA or do I control it from the one light entity?

The one light entity in HA has power, brightness, RGB, and color temp controls. Power turns the main light on/off, brightness adjusts the brightness of the main light, RGB changes the colour of the brightness slider (but the notification light doesn't change colour), colour temperature changes the colour of the main light. The notification light is stuck green at the moment.

I also get this error when turning the main light on and off. Exception while calling fromZigbee converter: definition.endpoint is not a function}

veryboringname avatar Mar 11 '24 08:03 veryboringname

@coniferous1 I tried doing a PR at https://github.com/Koenkk/zigbee-herdsman-converters/pull/7203 but seems like there's problem with the line configure: extend.light_onoff_brightness_colortemp_color().configure,

banister4728 avatar Mar 12 '24 09:03 banister4728

Merged in https://github.com/Koenkk/zigbee-herdsman-converters/pull/7216

banister4728 avatar Mar 15 '24 05:03 banister4728

For RGB led stripe, i have some idea, has anyone tried to mix support from T1 LED strip to this lamp? Don't aquare use same control logic for led strip effect's ? It seams https://github.com/Koenkk/zigbee2mqtt/issues/18471#issuecomment-1873575860 allready have effect's enabled, maybe same control logic should be and for this lamp?

geduxas avatar Apr 22 '24 09:04 geduxas