I’m trying to integrate my aquara blind motor in to home assistant. It appears in zigbee2mqtt but no entities appear in home assistant. When I set the the external converter option zigbee2mqtt stops working and displays a 502: Bad Gateway error. I’m using a conbee II zigbee gateway.
I have entered ‘Xaiomi’ in the external converter option
I have created file called Xaiomi.js and saved it next to the zigbee2mqtt configuration.yaml file. Below is the content of the file which i copied from zigbee-herdsman-converters/xiaomi.js at 7a148842f0be231d09426faf62cac231587e0c64 · Koenkk/zigbee-herdsman-converters · GitHub
zigbeeModel: ['lumi.curtain.acn002'],
model: 'ZNJLBL01LM',
description: 'Aqara roller shade companion E1',
vendor: 'Xiaomi',
fromZigbee: [fz.xiaomi_curtain_position, fz.xiaomi_curtain_acn002_status, fz.ignore_basic_report, fz.aqara_opple],
toZigbee: [tz.xiaomi_curtain_position_state, tz.xiaomi_curtain_acn002_battery, tz.xiaomi_curtain_acn002_charging_status],
onEvent: async (type, data, device) => {
if (type === 'message' && data.type === 'attributeReport' && data.cluster === 'genMultistateOutput' &&
data.data.hasOwnProperty('presentValue') && data.data['presentValue'] > 1) {
// Try to read the position after the motor stops, the device occasionally report wrong data right after stopping
// Might need to add delay, seems to be working without one but needs more tests.
await device.getEndpoint(1).read('genAnalogOutput', ['presentValue']);
}
},
exposes: [e.cover_position().setAccess('state', ea.ALL), e.battery().withAccess(ea.STATE_GET), e.device_temperature(),
exposes.binary('charging_status', ea.STATE_GET, true, false)
.withDescription('The current charging status.'),
exposes.enum('motor_state', ea.STATE, ['declining', 'rising', 'pause', 'blocked'])
.withDescription('The current state of the motor.'),
exposes.binary('running', ea.STATE, true, false)
.withDescription('Whether the motor is moving or not')],
configure: async (device, coordinatorEndpoint, logger) => {
device.powerSource = 'Battery';
device.save();
const endpoint = device.getEndpoint(1);
await endpoint.read('aqaraOpple', [0x040a], {manufacturerCode: 0x115f});
},
ota: ota.zigbeeOTA,
},
The configuration.yaml is
{
"external_converters": [
"Xiaomi"
],
"devices": [
"devices.yaml"
],
"groups": [
"groups.yaml"
],
"homeassistant": true,
"permit_join": false,
"mqtt": {
"base_topic": "zigbee2mqtt",
"user": "my username",
"password": "my passwordd",
"server": "mqtt://core-mosquitto:1883"
},
"serial": {
"port": "/dev/ttyACM0",
"adapter": "deconz"
},
"advanced": {
"log_level": "debug",
"pan_id": 6754,
"channel": 11,
"network_key": [
1,
3,
5,
7,
9,
11,
13,
15,
0,
2,
4,
6,
8,
10,
12,
13
],
"availability_blocklist": [],
"availability_passlist": []
},
"device_options": {},
"blocklist": [],
"passlist": [],
"queue": {},
"frontend": {
"port": 8099
},
"experimental": {}