Good news!
I managed to improve my previous configuration. Now I can read the room temperature, the setpoint (desire temperature) and the operation mode (anti-freezing, auto or manual).
The device is now published to home-assistant using the “climate” class.
Still no luck on changing the config remotely via mqtt. I managed to make the radiator valve move but the screen change to 73.8 celsius and since then the values were total nonsense. I had to restart the device (the config clears just by removing the batteries).
converters/fromZigbee.js
tuya_temperature: {
cluster: 'manuSpecificTuyaDimmer',
type: 'commandGetData',
convert: (model, msg, publish, options, meta) => {
const key = msg.data.dp;
const val = msg.data.data;
if (key === 515 && val[2] === 0) {
const temp_raw = val[3] || 0;
const temperature = (temp_raw / 10).toFixed(1);
return { local_temperature: temperature };
} else if (key === 514 && val[2] === 0) {
const temp_raw = val[3] || 0;
const temperature = (temp_raw / 10).toFixed(1);
return { current_heating_setpoint: temperature };
} else if (key === 1028) {
const mode_code = val[0];
switch (mode_code) {
case 0: return { system_mode: "antifreezing" };
case 1: return { system_mode: "auto" };
case 2: return { system_mode: "manual" };
default: return { system_mode: "unknown" };
}
} else {
console.log(`NOT RECOGNIZED dp code "${key}" with data: ${JSON.stringify(val)}`)
}
},
},
homeassistant.js
const cfg = {
//... line 471
'thermostat': (
minTemp = 7,
maxTemp = 30,
temperatureStateProperty = 'occupied_heating_setpoint',
tempStep = 1,
modes = ['off', 'auto', 'heat']
) => {
return {
type: 'climate',
object_id: 'climate',
discovery_payload: {
state_topic: false,
min_temp: `${minTemp}`,
max_temp: `${maxTemp}`,
modes,
mode_state_topic: true,
mode_state_template: '{{ value_json.system_mode }}',
mode_command_topic: true,
current_temperature_topic: true,
current_temperature_template: '{{ value_json.local_temperature }}',
temperature_state_topic: true,
temperature_state_template: `{{ value_json.${temperatureStateProperty} }}`,
temperature_command_topic: temperatureStateProperty,
temp_step: tempStep,
action_topic: true,
action_template: '{{ value_json.operation }}',
},
};
},
// ...
};
const mapping = {
//... line 1258
'GS361A-H04': [cfg.thermostat(5, 30, 'current_heating_setpoint', 0.5, ['antifreezing', 'auto', 'manual'])],
};
Note: If you were using the previous config, don’t forget to remove the former properties of the devices from
states.json
or just deletestates.json
to start zigbee2mqtt from scratch.