Skip to content

Instantly share code, notes, and snippets.

@andrew-codechimp
Created November 16, 2022 10:05
Show Gist options
  • Save andrew-codechimp/344a4a099a3b9a581fa1970e2126e62c to your computer and use it in GitHub Desktop.
Save andrew-codechimp/344a4a099a3b9a581fa1970e2126e62c to your computer and use it in GitHub Desktop.
Zigbee2MQTT Convertor for Hue Centris Light
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 reporting = require('zigbee-herdsman-converters/lib/reporting');
const ota = require('zigbee-herdsman-converters/lib/ota');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const utils = require('zigbee-herdsman-converters/lib/utils');
const e = exposes.presets;
const ea = exposes.access;
// Make sure extend.light_* is not used (hueExtend should be used instead)
const extendDontUse = require('zigbee-herdsman-converters/lib/extend');
const extend = {switch: extendDontUse.switch};
const hueExtend = {
light_onoff_brightness: (options={}) => ({
...extendDontUse.light_onoff_brightness(options),
ota: ota.zigbeeOTA,
meta: {turnsOffAtBrightness1: true},
toZigbee: extendDontUse.light_onoff_brightness(options).toZigbee.concat([tz.hue_power_on_behavior, tz.hue_power_on_error]),
}),
light_onoff_brightness_colortemp: (options={}) => ({
...extendDontUse.light_onoff_brightness_colortemp(options),
ota: ota.zigbeeOTA,
meta: {turnsOffAtBrightness1: true},
toZigbee: extendDontUse.light_onoff_brightness_colortemp(options).toZigbee
.concat([tz.hue_power_on_behavior, tz.hue_power_on_error]),
}),
light_onoff_brightness_color: (options={}) => ({
...extendDontUse.light_onoff_brightness_color({supportsHS: true, ...options}),
ota: ota.zigbeeOTA,
meta: {turnsOffAtBrightness1: true},
toZigbee: extendDontUse.light_onoff_brightness_color({supportsHS: true, ...options}).toZigbee
.concat([tz.hue_power_on_behavior, tz.hue_power_on_error]),
}),
light_onoff_brightness_colortemp_color: (options={}) => ({
...extendDontUse.light_onoff_brightness_colortemp_color({supportsHS: true, ...options}),
ota: ota.zigbeeOTA,
meta: {turnsOffAtBrightness1: true},
toZigbee: extendDontUse.light_onoff_brightness_colortemp_color({supportsHS: true, ...options})
.toZigbee.concat([tz.hue_power_on_behavior, tz.hue_power_on_error]),
}),
};
const definition = {
zigbeeModel: ['5060831P7_01', '5060831P7_02', '5060831P7_03', '5060831P7_04'],
model: '5060831P7',
vendor: 'Philips',
description: 'Hue White & Color ambience Centris ceiling light (3 spots)',
extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
};
module.exports = definition;
homeassistant: true
permit_join: false
...
external_converters:
- 5060831P7.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment