Skip to content

Commit

Permalink
Add USM-300ZB, SBM-300-ZB1, SBM-300-ZB2, SBM-300-ZB3, SBM-300-ZB4, SB…
Browse files Browse the repository at this point in the history
…M-300-ZB5, SBM-300-ZB6 (Koenkk#3204)

* Sihas multipurpose sensor

sihas multipurpose sensor
temperatrue, humidity, illuminance, occupancy

https://smartstore.naver.com/sihas/products/5928899987

* sihas 1~6 gang switch

1~6 gang switch
https://smartstore.naver.com/sihas/products/5944843369

* fix lux value

return 'lux value' from device

* fix lint

* fix tap
  • Loading branch information
nukusinji authored Oct 22, 2021
1 parent 44f2d8c commit c36c99d
Showing 1 changed file with 147 additions and 0 deletions.
147 changes: 147 additions & 0 deletions devices/shinasystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const exposes = require('../lib/exposes');
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const tz = require('../converters/toZigbee');
const reporting = require('../lib/reporting');
const extend = require('../lib/extend');
const e = exposes.presets;
const ea = exposes.access;

Expand All @@ -25,4 +26,150 @@ module.exports = [
exposes: [e.battery(), e.battery_voltage(),
exposes.numeric('people', ea.ALL).withValueMin(0).withValueMax(50).withDescription('People count')],
},
{
zigbeeModel: ['USM-300Z'],
model: 'USM-300ZB',
vendor: 'ShinaSystem',
description: 'Sihas multipurpose sensor',
meta: {battery: {voltageToPercentage: '3V_2100'}},
fromZigbee: [fz.battery, fz.temperature, fz.humidity, fz.occupancy, fz.illuminance],
toZigbee: [],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
const binds = ['genPowerCfg', 'msIlluminanceMeasurement', 'msTemperatureMeasurement', 'msOccupancySensing'];
await reporting.bind(endpoint, coordinatorEndpoint, binds);
await reporting.batteryVoltage(endpoint, {min: 30, max: 21600, change: 1});
await reporting.occupancy(endpoint, {min: 1, max: 600, change: 1});
await reporting.temperature(endpoint, {min: 20, max: 300, change: 10});
await reporting.humidity(endpoint, {min: 20, max: 300, change: 40});
await reporting.illuminance(endpoint, {min: 20, max: 3600, change: 10});
},
exposes: [e.battery(), e.battery_voltage(), e.temperature(), e.humidity(), e.occupancy(),
e.illuminance_lux().withProperty('illuminance')],
},
{
zigbeeModel: ['SBM300Z1'],
model: 'SBM-300-ZB1',
vendor: 'ShinaSystem',
description: 'IOT smart switch 1 gang',
extend: extend.switch(),
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint);
},
},
{
zigbeeModel: ['SBM300Z2'],
model: 'SBM-300-ZB2',
vendor: 'ShinaSystem',
description: 'IOT smart switch 2 gang',
extend: extend.switch(),
exposes: [e.switch().withEndpoint('top'), e.switch().withEndpoint('bottom')],
endpoint: (device) => {
return {top: 1, bottom: 2};
},
meta: {multiEndpoint: true},
configure: async (device, coordinatorEndpoint, logger) => {
await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(device.getEndpoint(1));
await reporting.onOff(device.getEndpoint(2));
},
},
{
zigbeeModel: ['SBM300Z3'],
model: 'SBM-300-ZB3',
vendor: 'ShinaSystem',
description: 'IOT smart switch 3 gang',
extend: extend.switch(),
exposes: [e.switch().withEndpoint('top'), e.switch().withEndpoint('center'), e.switch().withEndpoint('bottom')],
endpoint: (device) => {
return {top: 1, center: 2, bottom: 3};
},
meta: {multiEndpoint: true},
configure: async (device, coordinatorEndpoint, logger) => {
await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(device.getEndpoint(1));
await reporting.onOff(device.getEndpoint(2));
await reporting.onOff(device.getEndpoint(3));
},
},
{
zigbeeModel: ['SBM300Z4'],
model: 'SBM-300-ZB4',
vendor: 'ShinaSystem',
description: 'IOT smart switch 4 gang',
extend: extend.switch(),
exposes: [e.switch().withEndpoint('top_left'), e.switch().withEndpoint('bottom_left'),
e.switch().withEndpoint('top_right'), e.switch().withEndpoint('bottom_right')],
endpoint: (device) => {
return {'top_left': 1, 'bottom_left': 2, 'top_right': 3, 'bottom_right': 4};
},
meta: {multiEndpoint: true},
configure: async (device, coordinatorEndpoint, logger) => {
await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(4), coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(device.getEndpoint(1));
await reporting.onOff(device.getEndpoint(2));
await reporting.onOff(device.getEndpoint(3));
await reporting.onOff(device.getEndpoint(4));
},
},
{
zigbeeModel: ['SBM300Z5'],
model: 'SBM-300-ZB5',
vendor: 'ShinaSystem',
description: 'IOT smart switch 5 gang',
extend: extend.switch(),
exposes: [e.switch().withEndpoint('top_left'), e.switch().withEndpoint('top_right'), e.switch().withEndpoint('center_left'),
e.switch().withEndpoint('bottom_left'), e.switch().withEndpoint('bottom_right')],
endpoint: (device) => {
return {'top_left': 1, 'center_left': 2, 'bottom_left': 3, 'top_right': 4, 'bottom_right': 5};
},
meta: {multiEndpoint: true},
configure: async (device, coordinatorEndpoint, logger) => {
await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(4), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(5), coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(device.getEndpoint(1));
await reporting.onOff(device.getEndpoint(2));
await reporting.onOff(device.getEndpoint(3));
await reporting.onOff(device.getEndpoint(4));
await reporting.onOff(device.getEndpoint(5));
},
},
{
zigbeeModel: ['SBM300Z6'],
model: 'SBM-300-ZB6',
vendor: 'ShinaSystem',
description: 'IOT smart switch 6 gang',
extend: extend.switch(),
exposes: [e.switch().withEndpoint('top_left'), e.switch().withEndpoint('bottom_left'), e.switch().withEndpoint('center_left'),
e.switch().withEndpoint('center_right'), e.switch().withEndpoint('top_right'), e.switch().withEndpoint('bottom_right')],
endpoint: (device) => {
return {'top_left': 1, 'center_left': 2, 'bottom_left': 3, 'top_right': 4, 'center_right': 5, 'bottom_right': 6};
},
meta: {multiEndpoint: true},
configure: async (device, coordinatorEndpoint, logger) => {
await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(4), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(5), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(6), coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(device.getEndpoint(1));
await reporting.onOff(device.getEndpoint(2));
await reporting.onOff(device.getEndpoint(3));
await reporting.onOff(device.getEndpoint(4));
await reporting.onOff(device.getEndpoint(5));
await reporting.onOff(device.getEndpoint(6));
},
},
];

0 comments on commit c36c99d

Please sign in to comment.