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 support for Mercator Ikuu Combination Sensor SSWM-PIR-ZB #7918

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
38 changes: 38 additions & 0 deletions src/devices/mercator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as reporting from '../lib/reporting';
import * as tuya from '../lib/tuya';
import {Definition} from '../lib/types';
const e = exposes.presets;
const ea = exposes.access;

const definitions: Definition[] = [
{
Expand Down Expand Up @@ -213,6 +214,43 @@ const definitions: Definition[] = [
device.save();
},
},
{
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_agumlajc'}],
model: 'SSWMPIR-ZB',
vendor: 'Mercator Ikuü',
description: 'Combination Sensor',
fromZigbee: [fz.occupancy, fz.temperature, fz.humidity, fz.illuminance, fz.on_off, tuya.fz.datapoints],
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
fromZigbee: [fz.occupancy, fz.temperature, fz.humidity, fz.illuminance, fz.on_off, tuya.fz.datapoints],
fromZigbee: [tuya.fz.datapoints],

Please test if it also works with just this

toZigbee: [tuya.tz.datapoints],
exposes: [
e.occupancy(), e.temperature(), e.humidity(), e.illuminance(), e.light(),
e.enum('state', ea.STATE_SET, ['ON', 'OFF', 'AUTO']).withDescription('Light Mode')
],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic', 'genOta', 'genTime', 'genGroups', 'genScenes']);
await reporting.bind(endpoint, coordinatorEndpoint, ['genIdentify', 'manuSpecificTuya']);
Copy link
Owner

Choose a reason for hiding this comment

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

Are these binds really needed? Can you check after removing them and re-pairing the device, the device still works?

},
meta: {
// All datapoints go in here
tuyaDatapoints: [
[1, 'temperature', tuya.valueConverter.divideBy10],
[2, 'humidity', tuya.valueConverter.raw],
//[10, ],
Copy link
Owner

Choose a reason for hiding this comment

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

Please remove all //[10, ],, it doesn't add any value

//[11, ],
//[12, ],
//[13, ],
[101, 'illuminance', tuya.valueConverter.raw ], //illuminance
//[102, ],
//[103, ],
[104, 'occupancy', tuya.valueConverter.trueFalse1],
[105, 'state', tuya.valueConverterBasic.lookup({'ON': tuya.enum(0), 'OFF': tuya.enum(1), 'AUTO': tuya.enum(2)}) ] //Light motion setting
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
[105, 'state', tuya.valueConverterBasic.lookup({'ON': tuya.enum(0), 'OFF': tuya.enum(1), 'AUTO': tuya.enum(2)}) ] //Light motion setting
[105, 'light_mode', tuya.valueConverterBasic.lookup({'ON': tuya.enum(0), 'OFF': tuya.enum(1), 'AUTO': tuya.enum(2)}) ] //Light motion setting

//[106, ],
//[107, ],
//[108, ],
//[109, ],
],
},
},
];

export default definitions;
Expand Down
Loading