Skip to content

Commit

Permalink
Update innr.ts
Browse files Browse the repository at this point in the history
added support for innr sp-240 device:

        zigbeeModel: ['SP 240'],
        model: 'SP 240',
        vendor: 'Innr',
  • Loading branch information
z647230 authored Dec 6, 2023
1 parent 7fafc43 commit 5d8be8b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/devices/innr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,31 @@ const definitions: Definition[] = [
}
},
},
{
zigbeeModel: ['SP 240'],
model: 'SP 240',
vendor: 'Innr',
description: 'Innr Smartplug with Powermetering',
fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering, fz.ignore_basic_report],
toZigbee: [tz.on_off],

Check failure on line 693 in src/devices/innr.ts

View workflow job for this annotation

GitHub Actions / ci

Cannot find name 'tz'.
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering']);
endpoint.saveClusterAttributeKeyValue('seMetering', {divisor: 100, multiplier: 1});
endpoint.saveClusterAttributeKeyValue('haElectricalMeasurement', { acVoltageMultiplier: 1, acVoltageDivisor: 1, acCurrentMultiplier: 1, acCurrentDivisor: 1000, acPowerMultiplier: 1, acPowerDivisor: 1, });
try {
await reporting.currentSummDelivered(endpoint);
await reporting.rmsVoltage(endpoint, {change: 5});
await reporting.rmsCurrent(endpoint, {change: 50});
await reporting.activePower(endpoint, {change: 10});
} catch (error) {}
await endpoint.read('genOnOff', ['onOff']);
},
options: [exposes.options.measurement_poll_interval()],

exposes: [e.switch(), e.power(), e.current(), e.voltage(), e.energy()],
onEvent: (type, data, device, options) => tuya.onEventMeasurementPoll(type, data, device, options, true, false),

Check failure on line 710 in src/devices/innr.ts

View workflow job for this annotation

GitHub Actions / ci

Cannot find name 'tuya'.
},
];

export default definitions;
Expand Down

0 comments on commit 5d8be8b

Please sign in to comment.