Skip to content

Commit

Permalink
Fix incorrect power values for Develco SPLZB-131. Koenkk/zigbee2mqtt#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk authored and Mephistofeles committed Dec 13, 2022
1 parent cc6c631 commit a05dbd0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions devices/develco.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ const e = exposes.presets;
const ea = exposes.access;

const fzLocal = {
// SPLZB-134 reports strange values sometimes
// SPLZB-134 and SPLZB-131 reports strange values sometimes
// https://github.com/Koenkk/zigbee2mqtt/issues/13329
SPLZB134_electrical_measurement: {
develco_electrical_measurement: {
...fz.electrical_measurement,
convert: (model, msg, publish, options, meta) => {
if (msg.data.rmsVoltage !== 0xFFFF && msg.data.rmsCurrent !== 0xFFFF && msg.data.activePower !== -0x8000) {
return fz.electrical_measurement.convert(model, msg, publish, options, meta);
}
},
},
SPLZB134_device_temperature: {
develco_device_temperature: {
...fz.device_temperature,
convert: (model, msg, publish, options, meta) => {
if (msg.data.currentTemperature !== -0x8000) {
return fz.device_temperature.convert(model, msg, publish, options, meta);
}
},
},
SPLZB134_metering: {
develco_metering: {
...fz.metering,
convert: (model, msg, publish, options, meta) => {
if (msg.data.instantaneousDemand !== -0x800000) {
Expand All @@ -43,7 +43,7 @@ module.exports = [
model: 'SPLZB-131',
vendor: 'Develco',
description: 'Power plug',
fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering],
fromZigbee: [fz.on_off, fz.develco_electrical_measurement, fz.develco_metering],
toZigbee: [tz.on_off],
exposes: [e.switch(), e.power(), e.current(), e.voltage(), e.energy()],
configure: async (device, coordinatorEndpoint, logger) => {
Expand Down Expand Up @@ -94,7 +94,7 @@ module.exports = [
model: 'SPLZB-134',
vendor: 'Develco',
description: 'Power plug (type G)',
fromZigbee: [fz.on_off, fzLocal.SPLZB134_electrical_measurement, fzLocal.SPLZB134_metering, fzLocal.SPLZB134_device_temperature],
fromZigbee: [fz.on_off, fzLocal.develco_electrical_measurement, fzLocal.develco_metering, fzLocal.develco_device_temperature],
toZigbee: [tz.on_off],
exposes: [e.switch(), e.power(), e.current(), e.voltage(), e.energy(), e.device_temperature()],
configure: async (device, coordinatorEndpoint, logger) => {
Expand Down

0 comments on commit a05dbd0

Please sign in to comment.