Skip to content

Commit

Permalink
Add Securifi Peanut Smart Plug
Browse files Browse the repository at this point in the history
Measurements not supported/tested as they require a firmware upgrade (?). Switch works though.

See Koenkk/zigbee2mqtt#809
  • Loading branch information
roger- authored Mar 10, 2019
1 parent 0620f64 commit b6d0d9f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -3069,6 +3069,33 @@ const devices = [
execute(device, actions, callback);
},
},

// Securifi
{
zigbeeModel: ['PP-WHT-US'],
model: 'PP-WHT-US',
vendor: 'Securifi',
description: 'Peanut Smart Plug',
supports: 'on/off, power measurement',
fromZigbee: [fz.ignore_electrical_change, fz.generic_state, fz.ignore_onoff_change],
toZigbee: [tz.on_off],
configure: (ieeeAddr, shepherd, coordinator, callback) => {
const device = shepherd.find(ieeeAddr, 1);
const onOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0};
const rmsCurrent = {
direction: 0, attrId: 1288, dataType: 33, minRepIntval: 0, maxRepIntval: 3, repChange: 0,
};
const electricalCfg = [rmsCurrent];
const actions = [
(cb) => device.foundation('genOnOff', 'configReport', [onOff], foundationCfg, cb),
(cb) => device.bind('genOnOff', coordinator, cb),
(cb) => device.foundation('haElectricalMeasurement', 'configReport', electricalCfg, foundationCfg, cb),
(cb) => device.bind('haElectricalMeasurement', coordinator, cb),
];

execute(device, actions, callback);
},
},
];

module.exports = devices.map((device) =>
Expand Down

0 comments on commit b6d0d9f

Please sign in to comment.