Thanks @Koenkk for this great work. I am in the middle of trying to add a new device and need some help. I think I have followed all the info here: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html#hassio-addon and I have the device working but only one way. The device I am adding is here: https://www.amazon.com.au/Approved-Smart-ZigBee-Switch-Automation/dp/B08D7BRS2Q/ref=pd_rhf_sc_p_img_3
I have modelled it on the existing device here: https://www.zigbee2mqtt.io/devices/HGZB-44.html as this device presents as four different switches.
Thus my devices.js entry is here:
{
zigbeeModel: ['LXN56-1S27LX1.2'],
model: 'NUE-ZBFLB',
vendor: 'Nue / 3A',
description: 'Smart Fan Light Switch',
supports: 'on/off',
fromZigbee: [fz.on_off],
toZigbee: [tz.on_off],
endpoint: (device) => {
return {'light': 1, 'fan_high': 2, 'fan_med': 3, 'fan_low': 4};
},
meta: {configureKey: 1, multiEndpoint: true},
configure: async (device, coordinatorEndpoint) => {
await bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
await bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
await bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
await bind(device.getEndpoint(4), coordinatorEndpoint, ['genOnOff']);
}
},
My homeassistant.js entry is:
'NUE-ZBFLB': [
switchEndpoint('light'), switchEndpoint('fan_high'), switchEndpoint('fan_med'),
switchEndpoint('fan_low'),
],
I now see four entities in HA:
- entity: switch.hannah_light_fan_switch_switch_light
- entity: switch.hannah_light_fan_switch_switch_fan_low
- entity: switch.hannah_light_fan_switch_switch_fan_med
- entity: switch.hannah_light_fan_switch_switch_fan_high
The problem is when I press a button on the wall HA correctly changes state but when I change one of the switches in HA nothing happens and I see an error in the MQTT logs.
Zigbee2MQTT:debug 2020-09-01 16:03:51: Received Zigbee message from 'Hannah Light Fan Switch', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
Zigbee2MQTT:info 2020-09-01 16:03:51: MQTT publish: topic 'zigbee2mqtt/Hannah Light Fan Switch', payload '{"state_light":"ON","linkquality":39,"state_fan_high":"OFF","state_fan_med":"OFF","state_fan_low":"OFF"}'
Zigbee2MQTT:debug 2020-09-01 16:03:51: Received Zigbee message from 'Hannah Light Fan Switch', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
Zigbee2MQTT:info 2020-09-01 16:03:51: MQTT publish: topic 'zigbee2mqtt/Hannah Light Fan Switch', payload '{"state_light":"ON","linkquality":39,"state_fan_high":"OFF","state_fan_med":"OFF","state_fan_low":"OFF"}'
Zigbee2MQTT:debug 2020-09-01 16:04:03: Received Zigbee message from 'Hannah Light Fan Switch', type 'attributeReport', cluster 'genOnOff', data '{"onOff":0}' from endpoint 1 with groupID 0
Zigbee2MQTT:info 2020-09-01 16:04:03: MQTT publish: topic 'zigbee2mqtt/Hannah Light Fan Switch', payload '{"state_light":"OFF","linkquality":42,"state_fan_high":"OFF","state_fan_med":"OFF","state_fan_low":"OFF"}'
Zigbee2MQTT:debug 2020-09-01 16:04:03: Received Zigbee message from 'Hannah Light Fan Switch', type 'attributeReport', cluster 'genOnOff', data '{"onOff":0}' from endpoint 1 with groupID 0
Zigbee2MQTT:info 2020-09-01 16:04:03: MQTT publish: topic 'zigbee2mqtt/Hannah Light Fan Switch', payload '{"state_light":"OFF","linkquality":39,"state_fan_high":"OFF","state_fan_med":"OFF","state_fan_low":"OFF"}'
Zigbee2MQTT:debug 2020-09-01 16:04:44: Received MQTT message on 'zigbee2mqtt/Hannah Light Fan Switch/light/set' with data 'ON'
Zigbee2MQTT:info 2020-09-01 16:04:44: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"entity_not_found","message":{"friendly_name":"Hannah Light Fan Switch/light"}}'
Zigbee2MQTT:error 2020-09-01 16:04:44: Entity 'Hannah Light Fan Switch/light' is unknown
Can anyone shed any light on what I am doing wrong / what else I need to do to get this working?