Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add OSRAM Smart+ Mini Switch AC0251700NJ blue device #768

Merged
merged 4 commits into from
Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,13 @@ const converters = {
return {click: 'long_middle'};
},
},
AC0251700NJ_long_middle: {
cluster: 'lightingColorCtrl',
type: 'commandMoveHue',
convert: (model, msg, publish, options) => {
return {click: 'long_middle'};
},
},
AV2010_34_click: {
cluster: 'genScenes',
type: 'commandRecall',
Expand Down Expand Up @@ -2459,20 +2466,41 @@ const converters = {
return {action: 'up'};
},
},
AC0251700NJ_cmdOn: {
cluster: 'genOnOff',
type: 'commandOn',
convert: (model, msg, publish, options) => {
return {action: 'up'};
},
},
AC0251100NJ_cmdOff: {
cluster: 'genOnOff',
type: 'commandOff',
convert: (model, msg, publish, options) => {
return {action: 'down'};
},
},
AC0251700NJ_cmdOff: {
cluster: 'genOnOff',
type: 'commandOff',
convert: (model, msg, publish, options) => {
return {action: 'down'};
},
},
AC0251100NJ_cmdMoveWithOnOff: {
cluster: 'genLevelCtrl',
type: 'commandMoveWithOnOff',
convert: (model, msg, publish, options) => {
return {action: 'up_hold'};
},
},
AC0251700NJ_cmdMoveWithOnOff: {
cluster: 'genLevelCtrl',
type: 'commandMoveWithOnOff',
convert: (model, msg, publish, options) => {
return {action: 'up_hold'};
},
},
AC0251100NJ_cmdStop: {
cluster: 'genLevelCtrl',
type: 'commandStop',
Expand All @@ -2485,13 +2513,32 @@ const converters = {
return {action: map[msg.endpoint.ID]};
},
},
AC0251700NJ_cmdStop: {
cluster: 'genLevelCtrl',
type: 'commandStop',
convert: (model, msg, publish, options) => {
const map = {
1: 'up_release',
2: 'down_release',
};

return {action: map[msg.endpoint.ID]};
},
},
AC0251100NJ_cmdMove: {
cluster: 'genLevelCtrl',
type: 'commandMove',
convert: (model, msg, publish, options) => {
return {action: 'down_hold'};
},
},
AC0251700NJ_cmdMove: {
cluster: 'genLevelCtrl',
type: 'commandMove',
convert: (model, msg, publish, options) => {
return {action: 'down_hold'};
},
},
AC0251100NJ_cmdMoveHue: {
cluster: 'lightingColorCtrl',
type: 'commandMoveHue',
Expand All @@ -2501,25 +2548,53 @@ const converters = {
}
},
},
AC0251700NJ_cmdMoveHue: {
cluster: 'lightingColorCtrl',
type: 'commandMoveHue',
convert: (model, msg, publish, options) => {
if (msg.data.movemode === 0) {
return {action: 'circle_release'};
}
},
},
AC0251100NJ_cmdMoveToSaturation: {
cluster: 'lightingColorCtrl',
type: 'commandMoveToSaturation',
convert: (model, msg, publish, options) => {
return {action: 'circle_hold'};
},
},
AC0251700NJ_cmdMoveToSaturation: {
cluster: 'lightingColorCtrl',
type: 'commandMoveToSaturation',
convert: (model, msg, publish, options) => {
return {action: 'circle_hold'};
},
},
AC0251100NJ_cmdMoveToLevelWithOnOff: {
cluster: 'genLevelCtrl',
type: 'commandMoveToLevelWithOnOff',
convert: (model, msg, publish, options) => {
return {action: 'circle_click'};
},
},
AC0251700NJ_cmdMoveToLevelWithOnOff: {
cluster: 'genLevelCtrl',
type: 'commandMoveToLevelWithOnOff',
convert: (model, msg, publish, options) => {
return {action: 'circle_click'};
},
},
AC0251100NJ_cmdMoveToColorTemp: {
cluster: 'lightingColorCtrl',
type: 'commandMoveToColorTemp',
convert: (model, msg, publish, options) => null,
},
AC0251700NJ_cmdMoveToColorTemp: {
cluster: 'lightingColorCtrl',
type: 'commandMoveToColorTemp',
convert: (model, msg, publish, options) => null,
},
OJBCR701YZ_statuschange: {
cluster: 'ssIasZone',
type: 'commandStatusChangeNotification',
Expand Down
24 changes: 24 additions & 0 deletions devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -2014,6 +2014,30 @@ const devices = [
await configureReporting.batteryVoltage(endpoint1);
},
},
{
zigbeeModel: ['Lightify Switch Mini blue'],
Copy link
Owner

@Koenkk Koenkk Nov 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is identical to the AC0251100NJ I think we should merge it with that one, can you change https://github.com/Koenkk/zigbee-herdsman-converters/pull/768/files#diff-6c9a6acf22f90d1c6e524d9f3c5c1745R1994 to zigbeeModel: ['Lightify Switch Mini', 'Lightify Switch Mini blue'],

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model: 'AC0251700NJ',
vendor: 'OSRAM',
description: 'Smart+ switch mini blue',
supports: 'circle, up, down and hold/release',
fromZigbee: [
fz.AC0251700NJ_cmdOn, fz.AC0251700NJ_cmdMoveWithOnOff, fz.AC0251700NJ_cmdStop,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think extra converters are needed anymore, can you remove them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fz.AC0251700NJ_cmdMoveToColorTemp, fz.AC0251700NJ_cmdMoveHue, fz.AC0251700NJ_cmdMoveToSaturation,
fz.AC0251700NJ_cmdOff, fz.AC0251700NJ_cmdMove, fz.battery_3V,
fz.AC0251700NJ_cmdMoveToLevelWithOnOff,
],
toZigbee: [],
meta: {configureKey: 1},
configure: async (device, coordinatorEndpoint) => {
const endpoint1 = device.getEndpoint(1);
const endpoint2 = device.getEndpoint(2);
const endpoint3 = device.getEndpoint(3);
await bind(endpoint1, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'genPowerCfg']);
await bind(endpoint2, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
await bind(endpoint3, coordinatorEndpoint, ['genLevelCtrl', 'lightingColorCtrl']);
await configureReporting.batteryVoltage(endpoint1);
},
},
{
zigbeeModel: ['SubstiTube'],
model: 'ST8AU-CON',
Expand Down