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;
const ea = exposes.access;
module.exports = [
{
zigbeeModel: ["4512759"],
model: "4512759",
vendor: "Namron",
description: "Zigbee thermostat 16A (variant of 4512758)",
fromZigbee: [
fz.thermostat,
fz.metering,
fz.electrical_measurement,
],
toZigbee: [
tz.thermostat_local_temperature,
tz.thermostat_occupied_heating_setpoint,
tz.thermostat_local_temperature_calibration,
tz.thermostat_system_mode,
tz.thermostat_running_mode,
tz.thermostat_control_sequence_of_operation,
],
exposes: [
e.climate()
.withLocalTemperature()
.withSetpoint('occupied_heating_setpoint', 0, 40, 0.5)
.withLocalTemperatureCalibration(-10, 10, 1)
.withSystemMode(['off', 'heat'])
.withRunningState(['idle', 'heat']),
e.binary('child_lock', ea.ALL, 'LOCK', 'UNLOCK')
.withDescription('Enables/disables physical input on the device'),
e.switch(),
e.power(),
e.current(),
e.energy(),
],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, [
'genBasic',
'genIdentify',
'hvacThermostat',
'seMetering',
'haElectricalMeasurement',
]);
await reporting.thermostatTemperature(endpoint, {min: 0, change: 50});
await reporting.thermostatOccupiedHeatingSetpoint(endpoint);
await reporting.thermostatKeypadLockMode(endpoint);
await reporting.currentSummDelivered(endpoint);
await reporting.activePower(endpoint);
await endpoint.read('hvacThermostat', [
'systemMode',
'runningMode',
'occupiedHeatingSetpoint',
]);
device.powerSource = 'Mains (single phase)';
device.save();
},
},
];
I den nyeste Z2M versjonen må filene med konvertere ligge i en mappe "external_converters" som ligger under "zigbee2mqtt" mappen.
Nå fungerer det å endre temperatur, samt å sett termostaten i off eller heat. Lenger har jeg ikke kommet. Om du finner ut mer, så oppdater gjerne i denne tråden 🙂