zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

[New device support]: HZC T11_ZG / Namron 4512783 Thermostat

Open ohagane opened this issue 1 year ago β€’ 5 comments

Link

https://www.hzc-electric.com/pro_view-119.html

Database entry

{"id":36,"type":"Router","ieeeAddr":"0x385cfbfffec805fe","nwkAddr":45190,"manufId":4714,"manufName":"Namron AS","powerSource":"Unknown","modelId":"4512783","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":769,"inClusterList":[0,3,4,5,6,513,516,1029,1794,2820,4096],"outClusterList":[3,25,1030],"clusters":{"hvacUserInterfaceCfg":{"attributes":{"tempDisplayMode":0}},"genOnOff":{"attributes":{"onOff":1}},"hvacThermostat":{"attributes":{"32768":1,"32770":0,"32772":0,"32773":60,"32774":0,"32778":1,"32787":500,"32797":0,"32799":0,"32800":10957,"32801":10957,"32802":1,"32803":0,"32804":0,"pICoolingDemand":0,"pIHeatingDemand":0,"runningState":0,"systemMode":4,"programingOperMode":1,"occupiedHeatingSetpoint":1850,"localTemp":2350}},"msRelativeHumidity":{"attributes":{"measuredValue":5900}},"genBasic":{"attributes":{"appVersion":0,"stackVersion":0,"hwVersion":0}},"haElectricalMeasurement":{"attributes":{"acPowerDivisor":1,"acPowerMultiplier":1,"acCurrentDivisor":1,"acCurrentMultiplier":1,"rmsCurrent":0,"activePower":0}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0xbc026efffefe0022","endpointID":1},{"cluster":1029,"type":"endpoint","deviceIeeeAddress":"0xbc026efffefe0022","endpointID":1}],"configuredReportings":[{"cluster":6,"attrId":0,"minRepIntval":0,"maxRepIntval":65000,"repChange":1},{"cluster":1029,"attrId":0,"minRepIntval":10,"maxRepIntval":3600,"repChange":100}],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":0,"stackVersion":0,"hwVersion":0,"dateCode":"20240117","swBuildId":"1.11","zclVersion":8,"interviewCompleted":true,"meta":{},"lastSeen":1726917047875}

Zigbee2MQTT version

1.40.1

Comments

Other links: https://www.elektroimportoren.no/namron-zigbee-edge-termostat-hvit/4512783/Product.html https://www.elektroimportoren.no/namron//4512783-84-Zigbee-User-Guide.pdf

External definition

const {onOff, humidity, electricityMeter} = require('zigbee-herdsman-converters/lib/modernExtend');

const definition = {
    zigbeeModel: ['4512783'],
    model: '4512783',
    vendor: 'Namron AS',
    description: 'Automatically generated definition',
    extend: [onOff({"powerOnBehavior":false}), humidity(), electricityMeter()],
    meta: {},
};

module.exports = definition;

What does/doesn't work with the external definition?

The only thing that works is On/Off and humidity. After adding external definition i get this error in the log.

z2m: Failed to configure '0x385cfbfffec7f1fd', attempt 3 (Error: ZCL command 0x385cfbfffec7f1fd/1 haElectricalMeasurement.read(["acVoltageDivisor","acVoltageMultiplier"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE') at Endpoint.checkStatus (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:347:28) at Endpoint.zclCommand (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:916:26) at Endpoint.read (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:443:29) at result.configure (/app/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:1772:33) at Object.configure (/app/node_modules/zigbee-herdsman-converters/src/index.ts:193:21) at Configure.configure (/app/lib/extension/configure.ts:125:13) at EventEmitter.wrappedCallback (/app/lib/eventBus.ts:174:17))

ohagane avatar Sep 21 '24 11:09 ohagane

I hope support for this thermostat comes fast πŸ₯°

stave1989 avatar Sep 26 '24 14:09 stave1989

Just got myself two of this also, hoping for support πŸ€“πŸ‘Œ

Teeseeone avatar Oct 03 '24 12:10 Teeseeone

4512783-84-Zigbee-User-Guide.pdf Attached is the user guide which contains all the data commands/addresses, so at least all the communication protocols internally seems straight forward, not sure how that translates trough zigbee comms wirelessly.

I was looking to see if i could disregard the thermostat functionality and just have it trigger as a rotary dial and scene switches or triggers, but looks to maybe be a bit far fetched.

Hoeydal avatar Oct 04 '24 09:10 Hoeydal

Have been playing around with the setup file and got some of the functions working. Now working as a thermostat in HA.

Follow the guide for adding External converters. Save this file as 4812783.js in your zigbee2mqtt folder and add the external converter to your config file. https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html#_2-1-extending-the-external-definition

4512783.txt

ohagane avatar Oct 05 '24 06:10 ohagane

Thank you for the work. I can see that current and energy sensor does not work yet. And in HA it say off when not idling. Hope you share the external converter again if you tweek even more 😊

stave1989 avatar Oct 05 '24 07:10 stave1989

A correction, it is rapporting energy, but only in whole numbers, 12,13,14 nothing in between.

stave1989 avatar Oct 06 '24 09:10 stave1989

4512783.txt

Energy is reporting KWH every 5 min, according to config.

Have made some updates to the config and it should now read states from thermostat at startup. But sill only have basic functions of the thermostat, since I'm not able to read the "Private Thermostat" cluster.

I'm not a programmer, so just copy and pasting from other configs. But trying to get my thermostats to work and decided to share my findings.

Remember to hit Reconfigure on the device after changing the config.

ohagane avatar Oct 06 '24 13:10 ohagane

Really appreciate your work. see it reports energy but is there any way to get it to show more decimals? now it only shows integers. Screenshot_20241006_152545_Home Assistant

stave1989 avatar Oct 06 '24 13:10 stave1989

Don't think so. The value is only pulled every 5 min. so its not the config that creates the number. I see on my other Namron thermostat that I have 2 decimals. But that thermostat is manufactured by another vendor (Tuya).

ohagane avatar Oct 06 '24 18:10 ohagane

I thought the same, but had to ask. strange that it only reports whole numbers when there are several decimal places on the thermostat.

stave1989 avatar Oct 06 '24 18:10 stave1989

Any news when this will be offically supported?

Teeseeone avatar Nov 03 '24 23:11 Teeseeone

I tried to add the converter, but can you control the thermostat, change temp etc?

Teeseeone avatar Nov 15 '24 21:11 Teeseeone

Any news when this will be offically supported?

trikinov avatar Nov 28 '24 13:11 trikinov

Just started to look into this device after I purchased 3 of them. Not gotten very much done, this file however can be useful to someone digging into this device possibly:

https://www.elektroimportoren.no/namron/4512783-84-Zigbee-User-Guide.pdf EDIT: and now I see it was referenced in the initial post :-)

Mine was referenced in its idientifaction as 4512784, possibly this is cause its the black model, without functionality being any different.

Possibly it has a lot in common with this termostat being added https://github.com/Koenkk/zigbee2mqtt/issues/20216

erazor666 avatar Nov 30 '24 00:11 erazor666

Also have one of these. I'm a complete zigbee n00b however but might try to look into this.

The configs posted in the thread seems to work decently with basic funtionality dialed in somewhat but getting quite a bit of red warning/error popups. Also e.g voltage is missing (or maybe voltage is not even sent over zigbee only displayed on screen)

Masssssy avatar Dec 10 '24 23:12 Masssssy

How long will it take to get this device to be offically supported?

Teeseeone avatar Jan 09 '25 20:01 Teeseeone

How long will it take to get this device to be offically supported?

You could give it a try yourself 😜 . From what i see the behaviour is all over the place, and its the first time I'm actually getting somewhere, thanks to the schema. Since i haven't seen anyone opening a PR/MR on it, i started myself. image Current progress. Screen timeout is not in the schema either, so I'm playing around with my device. Rip powerbill Edit: To make it stop yelling about voltage, add the electricityMeter part

    extend: [
        electricityMeter({ voltage: false }),
        onOff({ powerOnBehavior: false }),
    ],

bskjon avatar Jan 15 '25 00:01 bskjon

Image Hmm, mine does show decimals now πŸ€” Goint to test it for a bit before converting the converter to typescript and adding it to a MR

bskjon avatar Jan 16 '25 20:01 bskjon

@bskjon Can you send me the external converter you currently are using? :)

stave1989 avatar Jan 17 '25 12:01 stave1989

@bskjon Can you send me the external converter you currently are using? :)

const {} = require('zigbee-herdsman-converters/lib/modernExtend');
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 ota = require('zigbee-herdsman-converters/lib/ota');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['4512784'],
    model: '4512784',
    vendor: 'Namron',
    description: 'Edge Thermostat',
    extend: [

    ],
    fromZigbee: [
        fz.humidity,
        fz.thermostat,
        fz.hvac_user_interface,
        fz.metering, 
        fz.electrical_measurement,
        fz.namron_hvac_user_interface,
    ], 
    toZigbee: [
        tz.thermostat_occupied_heating_setpoint,
        tz.thermostat_local_temperature_calibration,
        tz.thermostat_system_mode,
        tz.thermostat_temperature_display_mode,
        tz.thermostat_programming_operation_mode,
        tz.namron_thermostat_child_lock,
    ], 
    exposes: [
        e.climate()
            .withSetpoint('occupied_heating_setpoint', 5, 35, 0.5)
            .withLocalTemperature()
            .withLocalTemperatureCalibration(-3, 3, 0.1)
            .withSystemMode(['off', 'cool', 'heat'])
            .withRunningState(['cool', 'heat', 'idle']), 
        e.humidity(),
        e.enum('temperature_display_mode', ea.ALL, ['celsius', 'fahrenheit'])
            .withDescription('The temperature format displayed on the thermostat screen'),
        e.binary('child_lock', ea.ALL, 'LOCK', 'UNLOCK')
            .withDescription('Enables/disables physical input on the device'),
        e.enum('programming_operation_mode', ea.ALL, ['setpoint', 'schedule', 'schedule_with_preheat', 'eco'])
            .withDescription('Controls how programming affects the thermostat. Possible values: setpoint (only use specified setpoint), schedule (follow programmed setpoint schedule), schedule_with_preheat (follow programmed setpoint schedule with pre-heating). Changing this value does not clear programmed schedules.'),
        e.power(),
        e.current(),
        e.energy(),
        ], 

    configure: async (device, coordinatorEndpoint) => {
        const endpoint = device.getEndpoint(1);
        const binds = [
            'genBasic',
            'genIdentify',
            'hvacThermostat',
            'seMetering',
            'haElectricalMeasurement',
            'genAlarms',
            'msOccupancySensing',
            'genTime',
            'hvacUserInterfaceCfg',
        ];
        await reporting.bind(endpoint, coordinatorEndpoint, binds);
        // standard ZCL attributes
        await reporting.thermostatTemperature(endpoint, {min: 0, change: 50});
        await reporting.thermostatOccupiedHeatingSetpoint(endpoint);
        await reporting.thermostatKeypadLockMode(endpoint);

        //Metering
        await endpoint.read('haElectricalMeasurement', ['acCurrentDivisor', 'rmsCurrent', 'activePower']);
        await endpoint.read('seMetering', ['currentSummDelivered']);
        await reporting.rmsCurrent(endpoint, {min: 10, change: 10}); // A - z2m displays only the first decimals, so change of 10 (0,01)
        await reporting.activePower(endpoint, {min: 10, change: 15}); // W - Min change of 1,5W
        await reporting.currentSummDelivered(endpoint, {min: 300}); // Report KWH every 5min
        await reporting.readMeteringMultiplierDivisor(endpoint);


        // Trigger initial read
        await endpoint.read('hvacThermostat', ['systemMode', 'runningState', 'occupiedHeatingSetpoint', 'programingOperMode', 'localTemperatureCalibration']);
        await endpoint.read('hvacUserInterfaceCfg', ['tempDisplayMode', 'keypadLockout']);
        

    },
    ota: ota.zigbeeOTA,
};

module.exports = definition;

erazor666 avatar Jan 17 '25 14:01 erazor666

@bskjon Can you send me the external converter you currently are using? :)

Will publish it on a gist when I get off work. There are some edits I probably want to do later. Small tweaks I think. The only thing that is not supported at all is idle backlight. I've asked namron about this

bskjon avatar Jan 17 '25 14:01 bskjon

NamronEdge.txt

Have made a new config that uses most of the values coming from this device. Some attributes does not give any useful information. Try it and see if there is anything missing.

Under Exposes there is a few things slashed out, but can be activated if needed.

ohagane avatar Jan 17 '25 15:01 ohagane

NamronEdge.txt

Have made a new config that uses most of the values coming from this device. Some attributes does not give any useful information. Try it and see if there is anything missing.

Under Exposes there is a few things slashed out, but can be activated if needed.

Funny enough, 0-2/3 is manual on mine, while the rest to 5 is eco mode πŸ™ƒ (programming_operation_mode)

bskjon avatar Jan 17 '25 15:01 bskjon

@ohagane I'm trying to reconfigure my thermostat with your code and z2m logs just throws this error.

 
info 2025-01-17 18:33:24z2m: Configuring 'Termostat'
info 2025-01-17 18:33:25z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Termostat', payload '{"current":3,"energy":0,"humidity":32,"linkquality":140,"power":757,"state":"ON","voltage":null}'
error 2025-01-17 18:33:26z2m: Failed to configure 'Termostat', attempt 2 (Error: ZCL command 0x385cfbfffec80846/1 haElectricalMeasurement.read(["acVoltageDivisor","acVoltageMultiplier"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE') at Endpoint.checkStatus (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:349:28) at Endpoint.zclCommand (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:954:26) at processTicksAndRejections (node:internal/process/task_queues:105:5) at runNextTicks (node:internal/process/task_queues:69:3) at processImmediate (node:internal/timers:459:9) at Endpoint.read (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:445:29) at result.configure (/app/node_modules/.pnpm/[email protected]/node_modules/src/lib/modernExtend.ts:1924:37) at Object.configure (/app/node_modules/.pnpm/[email protected]/node_modules/src/index.ts:257:21) at Configure.configure (/app/lib/extension/configure.ts:124:13) at Immediate.<anonymous> (/app/lib/extension/configure.ts:69:17))

z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/configure', payload '{"data":{},"error":"Failed to configure (ZCL command 0x385cfbfffec80846/1 haElectricalMeasurement.read([\"acVoltageDivisor\",\"acVoltageMultiplier\"], {\"timeout\":10000,\"disableResponse\":false,\"disableRecovery\":false,\"disableDefaultResponse\":true,\"direction\":0,\"reservedBits\":0,\"writeUndiv\":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE'))","status":"error","transaction":"z9eni-1"}'


I've put the NamronEdge.js in the z2m folder and added it under external converters in the configuration.yaml. Then I restarted z2m, but no dice.

Have I done something wrong somewhere?

magnus-siv avatar Jan 17 '25 17:01 magnus-siv

@bskjon I'm trying to reconfigure my thermostat with your code and z2m logs just throws this error.



Show onlyalldebuginfowarningerror

Filter by text

Log levelerrorwarninginfodebugwarn

Logging level

Logs limit1002005001000

Β 

infoΒ 2025-01-17 18:33:24z2m: Configuring 'Termostat'

infoΒ 2025-01-17 18:33:25z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Termostat', payload '{"current":3,"energy":0,"humidity":32,"linkquality":140,"power":757,"state":"ON","voltage":null}'

errorΒ 2025-01-17 18:33:26z2m: Failed to configure 'Termostat', attempt 2 (Error: ZCL command 0x385cfbfffec80846/1 haElectricalMeasurement.read(["acVoltageDivisor","acVoltageMultiplier"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE') at Endpoint.checkStatus (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:349:28) at Endpoint.zclCommand (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:954:26) at processTicksAndRejections (node:internal/process/task_queues:105:5) at runNextTicks (node:internal/process/task_queues:69:3) at processImmediate (node:internal/timers:459:9) at Endpoint.read (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:445:29) at result.configure (/app/node_modules/.pnpm/[email protected]/node_modules/src/lib/modernExtend.ts:1924:37) at Object.configure (/app/node_modules/.pnpm/[email protected]/node_modules/src/index.ts:257:21) at Configure.configure (/app/lib/extension/configure.ts:124:13) at Immediate.<anonymous> (/app/lib/extension/configure.ts:69:17))

I've put the NamronEdge.js in the z2m folder and added it under external converters in the configuration.yaml. Then I restarted z2m, but no dice.

Have I done something wrong somewhere?

Well, yes and no. From i believe z2m 2.x.x, there are no configuration.yaml changes. Simply in the same data directory, create a folder called: "external_converters" Put the file there, and proceed to restart or reload z2m

Also, not my code :P, havent published it yet. I see that both of our codes are missing some parts, so I'm attempting to introduce the stuff i skipped or didn't get around to do

bskjon avatar Jan 17 '25 17:01 bskjon

NamronEdge.txt Have made a new config that uses most of the values coming from this device. Some attributes does not give any useful information. Try it and see if there is anything missing. Under Exposes there is a few things slashed out, but can be activated if needed.

Funny enough, 0-2/3 is manual on mine, while the rest to 5 is eco mode πŸ™ƒ (programming_operation_mode)

Yes I see the same issue. Not sure how to get around it. No matter what I try. I cant get both Manual and Program to work correctly. Eco mode always seems to work. ;)

ohagane avatar Jan 17 '25 23:01 ohagane

NamronEdge.txt Have made a new config that uses most of the values coming from this device. Some attributes does not give any useful information. Try it and see if there is anything missing. Under Exposes there is a few things slashed out, but can be activated if needed.

Funny enough, 0-2/3 is manual on mine, while the rest to 5 is eco mode πŸ™ƒ (programming_operation_mode)

Yes I see the same issue. Not sure how to get around it. No matter what I try. I cant get both Manual and Program to work correctly. Eco mode always seems to work. ;)

I see that you have made some nice work with the time n stuff. I'll "merge" some of the stuff you made into mine, test it a bit, and then probably add it to the converters if you dont beat me to it

Edit: One thing I would love to get done, is merging the other modes into one using enums, so it doesnt become a mess in homeassistant

Edit 2: Strangely enough, setting or changing the current_operating_mode (0x0025) requires BITMAP8 πŸ™ƒ

Edit 3: system_mode on mine returns "1" which is the default, but not present in the zigbee table for what it corresponds to, so i set mine to "auto"

bskjon avatar Jan 17 '25 23:01 bskjon

NamronEdge.txt Have made a new config that uses most of the values coming from this device. Some attributes does not give any useful information. Try it and see if there is anything missing. Under Exposes there is a few things slashed out, but can be activated if needed.

Funny enough, 0-2/3 is manual on mine, while the rest to 5 is eco mode πŸ™ƒ (programming_operation_mode)

Yes I see the same issue. Not sure how to get around it. No matter what I try. I cant get both Manual and Program to work correctly. Eco mode always seems to work. ;)

I see that you have made some nice work with the time n stuff. I'll "merge" some of the stuff you made into mine, test it a bit, and then probably add it to the converters if you dont beat me to it

Edit: One thing I would love to get done, is merging the other modes into one using enums, so it doesnt become a mess in homeassistant

Edit 2: Strangely enough, setting or changing the current_operating_mode (0x0025) requires BITMAP8 πŸ™ƒ

Edit 3: system_mode on mine returns "1" which is the default, but not present in the zigbee table for what it corresponds to, so i set mine to "auto"

I had the same idea. To have all the modes under one. But found it hard since holiday and boost have prerequisites for starting. So even if you are able to trigger Boost it will only run for 5 min(default). And Holiday mode need dates to be set first. But you are probably better at programming, cause I have spent hours looking at different configs, and just tried a bunch of shit ;)

ohagane avatar Jan 18 '25 00:01 ohagane

NamronEdge.txt Have made a new config that uses most of the values coming from this device. Some attributes does not give any useful information. Try it and see if there is anything missing. Under Exposes there is a few things slashed out, but can be activated if needed.

Funny enough, 0-2/3 is manual on mine, while the rest to 5 is eco mode πŸ™ƒ (programming_operation_mode)

Yes I see the same issue. Not sure how to get around it. No matter what I try. I cant get both Manual and Program to work correctly. Eco mode always seems to work. ;)

I see that you have made some nice work with the time n stuff. I'll "merge" some of the stuff you made into mine, test it a bit, and then probably add it to the converters if you dont beat me to it Edit: One thing I would love to get done, is merging the other modes into one using enums, so it doesnt become a mess in homeassistant Edit 2: Strangely enough, setting or changing the current_operating_mode (0x0025) requires BITMAP8 πŸ™ƒ Edit 3: system_mode on mine returns "1" which is the default, but not present in the zigbee table for what it corresponds to, so i set mine to "auto"

I had the same idea. To have all the modes under one. But found it hard since holiday and boost have prerequisites for starting. So even if you are able to trigger Boost it will only run for 5 min(default). And Holiday mode need dates to be set first. But you are probably better at programming, cause I have spent hours looking at different configs, and just tried a bunch of shit ;)

Tried a bunch of shit myself ;P Some stuff never triggered on my device to logging πŸ™ƒ This is the stuff I've set towards mine. https://gist.github.com/bskjon/f12069aa4fec4633527342b44a8eba03 Consulted the manual for fault status, hope the value is correct though. Dropped the regulator stuff and sensor mode, cuz they did never do the thing consistency..

If this looks good, i can move it towards the z2m converters

bskjon avatar Jan 19 '25 18:01 bskjon

Very nice work, but missing Humidity......

ohagane avatar Jan 23 '25 12:01 ohagane