-
-
Save Koenkk/34e60391471f8a6333176594dd80445d to your computer and use it in GitHub Desktop.
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 extend = require('zigbee-herdsman-converters/lib/extend'); | |
const utils = require('zigbee-herdsman-converters/lib/utils'); | |
const ota = require('zigbee-herdsman-converters/lib/ota'); | |
const tuya = require('zigbee-herdsman-converters/lib/tuya'); | |
const e = exposes.presets; | |
const ea = exposes.access; | |
const definition = { | |
fingerprint: tuya.fingerprint('TS0601', ['_TZE200_lsanae15', '_TZE200_bkkmqmyo', '_TZE200_eaac7dkw']), | |
model: 'TS0601_din_1', | |
vendor: 'TuYa', | |
description: 'Zigbee DIN energy meter', | |
fromZigbee: [tuya.fzDataPoints], | |
toZigbee: [tuya.tzDataPoints], | |
configure: tuya.configureMagicPacket, | |
exposes: [tuya.exposes.switch(), e.ac_frequency(), e.energy(), e.power(), e.power_factor(), e.voltage(), e.current(), | |
exposes.numeric('produced_energy', exposes.access.STATE).withUnit('kWh').withDescription('Sum of produced energy'),], | |
meta: { | |
tuyaDatapoints: [ | |
[1, 'energy', tuya.valueConverter.divideBy100], | |
[6, null, tuya.valueConverter.phaseA], // voltage and current | |
[16, 'state', tuya.valueConverter.onOff], | |
[103, 'power', tuya.valueConverter.raw], | |
[105, 'ac_frequency', tuya.valueConverter.divideBy100], | |
[111, 'power_factor', tuya.valueConverter.divideBy10], | |
// Ignored for now; we don't know what the values mean | |
[109, null, null], // reactive_power in VArh, ignored for now | |
[101, null, null], // total active power (translated from chinese) - same as energy dp 1?? | |
[102, 'produced_energy', tuya.valueConverter.divideBy100], | |
[9, null, null], // Fault - we don't know the possible values here | |
[110, null, null], // total reactive power (translated from chinese) - value is 0.03kvar, we already have kvarh on dp 109 | |
[17, null, null], // Alarm set1 - value seems garbage "AAAAAAAAAAAAAABkAAEOAACqAAAAAAAKAAAAAAAA" | |
[18, null, null], // 18 - Alarm set2 - value seems garbage "AAUAZAAFAB4APAAAAAAAAAA=" | |
], | |
}, | |
whiteLabel: [{vendor: 'Hiking', model: 'DDS238-2'}, {vendor: 'TuYa', model: 'RC-MCB'}], | |
}; | |
module.exports = definition; |
Hi, thanks for your great job, but i have a error with the code.
[18:09:33] INFO: Preparing to start...
[18:09:33] INFO: Socat not enabled
[18:09:34] INFO: Starting Zigbee2MQTT...
/app/dist/util/externally-loaded.js:20
exposes: [tuya.exposes.switch(), e.ac_frequency(), e.energy(), e.power(), e.power_factor(), e.voltage(), e.current(),
^
TypeError: tuya.exposes.switch is not a function
at /app/dist/util/externally-loaded.js:20:34
at Script.runInContext (node:vm:139:12)
at Script.runInNewContext (node:vm:144:17)
at Object.runInNewContext (node:vm:298:38)
at loadModuleFromText (/app/lib/util/utils.ts:148:8)
at loadModuleFromFile (/app/lib/util/utils.ts:155:12)
at Object.getExternalConvertersDefinitions (/app/lib/util/utils.ts:165:25)
at getExternalConvertersDefinitions.next ()
at new ExternalConverters (/app/lib/extension/externalConverters.ts:12:20)
at new Controller (/app/lib/controller.ts:84:58)
what can i do?
thanks
@raslr6 you are probably not using the latest dev https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html#linux
@Koenkk How can I look at it and if I don't have it, how is it updated, I don't have much skill even with all this, i have home assistant add-on thanks
@Koenkk I'm sorry, I didn't notice that edge was another version, it's already working, thank you very much
To be sure you are on the latest edge, uninstall and install the addon
Hello gentlemans,
Long time din't hear us. I hope you are doing fine.
I think I need your support again :| Apparently I buyed a second DDS238-2 zigbee, but apparently it's a different manufacture: TZE200_byzdayie, and again I can't see in zigbee2mqtt "produced energy" like in manufacture TZE200_bkkmqmyo. Can you give me some hints how to do it also for this device? It will be nice if I would get the same parameters for both of them, like in attached picture.
Thank you!
Hi,
I also observed that in TZE200_byzdayie the power is not give negative values, like power from TZE200_bkkmqmyo. Ca you please support me?
Thank you!
@Matriciel yes, or switch the the dev branch (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)