mirror of
https://github.com/thejeffreystone/home-assistant-configuration.git
synced 2025-08-21 05:03:39 +00:00
Adding External Converters
This commit is contained in:
27
config/zigbee2mqtt/smartwings.js
Executable file
27
config/zigbee2mqtt/smartwings.js
Executable file
@@ -0,0 +1,27 @@
|
||||
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 e = exposes.presets;
|
||||
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
zigbeeModel: ['WM25/L-Z'],
|
||||
model: 'WM25L-Z',
|
||||
vendor: 'Smartwings',
|
||||
description: 'Roller Shade',
|
||||
fromZigbee: [fz.cover_position_tilt, fz.battery],
|
||||
toZigbee: [tz.cover_state, tz.cover_position_tilt],
|
||||
meta: {battery: {dontDividePercentage: true}},
|
||||
configure: async (device, coordinatorEndpoint, logger) => {
|
||||
const endpoint = device.getEndpoint(1);
|
||||
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'closuresWindowCovering']);
|
||||
await reporting.batteryPercentageRemaining(endpoint);
|
||||
await reporting.currentPositionLiftPercentage(endpoint);
|
||||
device.powerSource = 'Battery';
|
||||
device.save();
|
||||
},
|
||||
exposes: [e.cover_position(), e.battery()],
|
||||
},
|
||||
];
|
Reference in New Issue
Block a user