Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New functions for Moes BRT-100_TRV '_TZE200_b6wax7g0' #2652

Merged
merged 48 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
06e8634
Update exposes.js
vladi1234 Jun 4, 2021
d11657d
Merge pull request #1 from vladi1234/vladi1234-patch-1
vladi1234 Jun 4, 2021
323f8f4
Update tuya.js
vladi1234 Jun 4, 2021
92cb0a2
Merge pull request #2 from vladi1234/vladi1234-New-functions-for-Moes…
vladi1234 Jun 4, 2021
695ff17
Update fromZigbee.js
vladi1234 Jun 4, 2021
8012a99
Merge pull request #3 from vladi1234/vladi1234-New-functions-for-Moes…
vladi1234 Jun 4, 2021
d07576d
Update toZigbee.js
vladi1234 Jun 4, 2021
1a0b177
Merge pull request #4 from vladi1234/vladi1234-New-functions-for-Moes…
vladi1234 Jun 4, 2021
6654020
Update tuya.js
vladi1234 Jun 4, 2021
912c710
Merge pull request #5 from vladi1234/vladi1234-New-functions-for-Moes…
vladi1234 Jun 4, 2021
cd7a985
Update exposes.js
vladi1234 Jun 5, 2021
87fcf63
Update tuya.js
vladi1234 Jun 5, 2021
25a8162
Update fromZigbee.js
vladi1234 Jun 5, 2021
68b7cbf
Update toZigbee.js
vladi1234 Jun 5, 2021
57d0432
Update tuya.js
vladi1234 Jun 6, 2021
867992c
Update moes.js
vladi1234 Jun 6, 2021
c2ee294
Update toZigbee.js
vladi1234 Jun 6, 2021
02bde94
Update fromZigbee.js
vladi1234 Jun 6, 2021
f9645e0
Update moes.js
vladi1234 Jun 6, 2021
e29050a
Merge branch 'Koenkk:master' into master
vladi1234 Jun 7, 2021
47d9a64
Update moes.js
vladi1234 Jun 7, 2021
1199635
Update moes.js
vladi1234 Jun 7, 2021
4b7d976
Update moes.js
vladi1234 Jun 7, 2021
7a985e9
Update moes.js
vladi1234 Jun 7, 2021
cc8e6a5
Update moes.js
vladi1234 Jun 7, 2021
22d7a36
Update fromZigbee.js
vladi1234 Jun 7, 2021
a142406
Update toZigbee.js
vladi1234 Jun 7, 2021
5a8d04d
Update moes.js
vladi1234 Jun 7, 2021
2ce572d
Update moes.js
vladi1234 Jun 7, 2021
6761a51
Update moes.js
vladi1234 Jun 8, 2021
56438ff
Update exposes.js
vladi1234 Jun 8, 2021
6bb933d
Update fromZigbee.js
vladi1234 Jun 8, 2021
3089438
Update toZigbee.js
vladi1234 Jun 8, 2021
6027690
Update fromZigbee.js
Koenkk Jun 8, 2021
841499b
Update toZigbee.js
Koenkk Jun 8, 2021
9f98a73
Update fromZigbee.js
vladi1234 Jun 10, 2021
b7eb350
Update toZigbee.js
vladi1234 Jun 10, 2021
105f0e5
Update moes.js
vladi1234 Jun 10, 2021
25795e5
Update fromZigbee.js
vladi1234 Jun 10, 2021
8f772eb
Update toZigbee.js
Koenkk Jun 10, 2021
f681cad
Update exposes.js
Koenkk Jun 10, 2021
f6889e6
Update moes.js
Koenkk Jun 10, 2021
533c157
Update exposes.js
Koenkk Jun 10, 2021
1aa06d7
Update moes.js
Koenkk Jun 10, 2021
8c69ad8
Update moes.js
Koenkk Jun 10, 2021
e58036f
Update moes.js
Koenkk Jun 10, 2021
a122d69
Update moes.js
Koenkk Jun 10, 2021
e97c430
Update fromZigbee.js
Koenkk Jun 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
90 changes: 90 additions & 0 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -3047,6 +3047,96 @@ const converters = {
}
},
},
// ############################## fromZigbee.js moesS #######################################
moesS_thermostat: {
cluster: 'manuSpecificTuya',
type: ['commandGetData', 'commandSetDataResponse'],
convert: (model, msg, publish, options, meta) => {
const dp = msg.data.dp; // First we get the data point ID
const value = tuya.getDataValue(msg.data.datatype, msg.data.data);
switch (dp) {
case tuya.dataPoints.moesSsystemMode:
switch (value) {
case 0:
return {mode_selection: 'programming'};
case 1:
return {mode_selection: 'manual'};
case 2:
return {mode_selection: 'temporary_manual'};
case 3:
return {mode_selection: 'holiday'};
}
break;
case tuya.dataPoints.moesSheatingSetpoint:
// return {current_heating_setpoint: (value / 10).toFixed(1)};
return {current_heating_setpoint: value};
case tuya.dataPoints.moesSlocalTemp:
return {local_temperature: (value / 10)};
case tuya.dataPoints.moesSboostHeating:
return {boost_heating: value ? 'ON' : 'OFF'};
case tuya.dataPoints.moesSboostHeatingCountdown:
return {boost_heating_countdown: value};
case tuya.dataPoints.moesSreset:
break;
case tuya.dataPoints.moesSwindowDetectionFunktion_A2:
return {window_detection: value ? 'ON' : 'OFF'};
case tuya.dataPoints.moesSwindowDetection:
return {window_detection: value ? 'ON' : 'OFF'};
case tuya.dataPoints.moesSchildLock:
return {child_lock: value ? 'LOCK' : 'UNLOCK'};
case tuya.dataPoints.moesSbattery:
// return {battery: (value).toFixed(1)}; // 00,0%
return {battery: value};

// if (value === 0 - 100){
// return {battery_low: true };
// payload.battery_low = true;
// }
// return payload;

// if (value !== 10 - 100){
// return {battery_low: 0 };
// return {battery_low: (value = 0).toFixed(1)};
// const msg.data.batteray === 0 - 100 ;

case tuya.dataPoints.moesSschedule:
return {
programming_mode: {
weekday: ' ' + value[0] + 'h:' + value[1] + 'm ' + value[2]/2 + '°C' +
', ' + value[3] + 'h:' + value[4] + 'm ' + value[5]/2 + '°C' +
', ' + value[6] + 'h:' + value[7] + 'm ' + value[8]/2 + '°C' +
', ' + value[9] + 'h:' + value[10] + 'm ' + value[11]/2 + '°C ',
saturday: '' + value[12] + 'h:' + value[13] + 'm ' + value[14]/2 + '°C' +
', ' + value[15] + 'h:' + value[16] + 'm ' + value[17]/2 + '°C' +
', ' + value[18] + 'h:' + value[19] + 'm ' + value[20]/2 + '°C' +
', ' + value[21] + 'h:' + value[22] + 'm ' + value[23]/2 + '°C ',
sunday: ' ' + value[24] + 'h:' + value[25] + 'm ' + value[26]/2 + '°C' +
', ' + value[27] + 'h:' + value[28] + 'm ' + value[29]/2 + '°C' +
', ' + value[30] + 'h:' + value[31] + 'm ' + value[32]/2 + '°C' +
', ' + value[33] + 'h:' + value[34] + 'm ' + value[35]/2 + '°C ',
},
};
case tuya.dataPoints.moesSboostHeatingCountdownTimeSet:
return {boost_time_set: (value)};
case tuya.dataPoints.moesSvalvePosition:
return {position: value};
case tuya.dataPoints.moesScompensationTempSet:
return {local_temperature_calibration: value};
case tuya.dataPoints.moesSecoMode:
return {eco_mode: value ? 'ON' : 'OFF'};
case tuya.dataPoints.moesSecoModeTempSet:
return {eco_temperature: value};
case tuya.dataPoints.moesSmaxTempSet:
return {max_temperature: value};
case tuya.dataPoints.moesSminTempSet:
return {min_temperature: value};
default:
meta.logger.warn(`zigbee-herdsman-converters:moesS_thermostat: NOT RECOGNIZED DP #${
dp} with data ${JSON.stringify(msg.data)}`);
}
},
},
// ########################### fromZigbee.js ende moesS #########################################
tuya_air_quality: {
cluster: 'manuSpecificTuya',
type: ['commandSetDataResponse', 'commandGetData'],
Expand Down
101 changes: 101 additions & 0 deletions converters/toZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -2218,6 +2218,107 @@ const converters = {
await tuya.sendDataPointBool(entity, tuya.dataPoints.state, value === 'heat');
},
},
// ############################### toZigbee.js moesS ############################################
moesS_thermostat_system_mode: {
key: ['mode_selection'],
convertSet: async (entity, key, value, meta) => {
await tuya.sendDataPointValue(entity, tuya.dataPoints.moesSsystemMode, value);
vladi1234 marked this conversation as resolved.
Show resolved Hide resolved
switch (value) {
case 'programming':
// return {system_mode: 'auto'};
await tuya.sendDataPointEnum(entity, tuya.dataPoints.moesSsystemMode, 0 /* PROGRAMMING */);
break;
case 'manual':
await tuya.sendDataPointEnum(entity, tuya.dataPoints.moesSsystemMode, 1 /* MANUAL */);
break;
case 'temporary_manual':
await tuya.sendDataPointEnum(entity, tuya.dataPoints.moesSsystemMode, 2 /* TEMPORARY_MANUAL */);
break;
case 'holiday':
await tuya.sendDataPointEnum(entity, tuya.dataPoints.moesSsystemMode, 3 /* HOLIDAY */);
break;
}
},
},
moesS_thermostat_current_heating_setpoint: {
key: ['current_heating_setpoint'],
convertSet: async (entity, key, value, meta) => {
// const temp = Math.round(value * 10);
await tuya.sendDataPointValue(entity, tuya.dataPoints.moesSheatingSetpoint, value);
},
},
moesS_thermostat_boost_heating: {
key: ['boost_heating'],
convertSet: async (entity, key, value, meta) => {
// await tuya.sendDataPointBool(entity, tuya.dataPoints.moesSchildLock, value);
// await tuya.sendDataPointBool(entity, tuya.dataPoints.moesSchildLock, value === 'LOCK');
await tuya.sendDataPointBool(entity, tuya.dataPoints.moesSboostHeating, value === 'OFF');
},
},
moesS_thermostat_boost_heating_countdown: {
key: ['boost_heating_countdown'],
convertSet: async (entity, key, value, meta) => {
// const temp = Math.round(value * 10);
await tuya.sendDataPointValue(entity, tuya.dataPoints.moesSboostHeatingCountdown, value);
},
},
moesS_thermostat_window_detection: {
key: ['window_detection'],
convertSet: async (entity, key, value, meta) => {
await tuya.sendDataPointRaw(entity, tuya.dataPoints.moesSwindowDetection, [value === 'ON' ? 1 : 0]);
},
},
moesS_thermostat_child_lock: {
key: ['child_lock'],
convertSet: async (entity, key, value, meta) => {
await tuya.sendDataPointBool(entity, tuya.dataPoints.moesSchildLock, value === 'LOCK');
},
},
moesS_thermostat_boostHeatingCountdownTimeSet: {
key: ['boost_time_set'],
convertSet: async (entity, key, value, meta) => {
// const temp = Math.round(value * 10);
await tuya.sendDataPointValue(entity, tuya.dataPoints.moesSboostHeatingCountdownTimeSet, value);
},
},
moesS_thermostat_temperature_calibration: {
key: ['local_temperature_calibration'],
convertSet: async (entity, key, value, meta) => {
let temp = Math.round(value * 1);
if (temp < 0) {
temp = 0xFFFFFFFF + temp + 1;
}
await tuya.sendDataPointValue(entity, tuya.dataPoints.moesScompensationTempSet, temp);
},
},
moesS_thermostat_moesSecoMode: {
key: ['eco_mode'],
convertSet: async (entity, key, value, meta) => {
await tuya.sendDataPointBool(entity, tuya.dataPoints.moesSecoMode, value === 'OFF');
},
},
moesS_thermostat_eco_temperature: {
key: ['eco_temperature'],
convertSet: async (entity, key, value, meta) => {
// const temp = Math.round(value * 10);
await tuya.sendDataPointEnum(entity, tuya.dataPoints.moesSecoModeTempSet, value);
},
},
moesS_thermostat_max_temperature: {
key: ['max_temperature'],
convertSet: async (entity, key, value, meta) => {
// const temp = Math.round(value * 10);
await tuya.sendDataPointValue(entity, tuya.dataPoints.moesSmaxTempSet, value);
},
},
moesS_thermostat_min_temperature: {
key: ['min_temperature'],
convertSet: async (entity, key, value, meta) => {
// const temp = Math.round(value * 10);
await tuya.sendDataPointValue(entity, tuya.dataPoints.moesSminTempSet, value);
},
},
// ########################### toZigbee.js ende moesS #########################################
hgkg_thermostat_standby: {
key: ['system_mode'],
convertSet: async (entity, key, value, meta) => {
Expand Down
43 changes: 43 additions & 0 deletions devices/moes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const exposes = require('../lib/exposes');
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const tz = require('../converters/toZigbee');
const globalStore = require('../lib/store');
const ota = require('../lib/ota');
const tuya = require('../lib/tuya');
const reporting = require('../lib/reporting');
const extend = require('../lib/extend');
Expand Down Expand Up @@ -151,4 +153,45 @@ module.exports = [
toZigbee: [],
exposes: [e.battery(), e.illuminance(), e.illuminance_lux().withUnit('lx'), e.humidity(), e.temperature()],
},
{
// zigbeeModel: ['b6wax7g0'],
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_b6wax7g0'}],
model: 'BRT-100-TRV',
vendor: 'Moes',
description: 'Thermostatic Radiator Valve',
whiteLabel: [{vendor: 'Moes', model: 'BRT-100-TRV'}],
ota: ota.zigbeeOTA,
onEvent: tuya.onEventSetLocalTime,
supports: 'thermostat, temperature',
fromZigbee: [fz.ignore_basic_report, fz.ignore_tuya_set_time, fz.moesS_thermostat],
toZigbee: [tz.moesS_thermostat_current_heating_setpoint, tz.moesS_thermostat_child_lock,
tz.moesS_thermostat_window_detection, tz.moesS_thermostat_temperature_calibration,
tz.moesS_thermostat_temperature_calibration, tz.moesS_thermostat_system_mode,
tz.moesS_thermostat_boost_heating, tz.moesS_thermostat_boostHeatingCountdownTimeSet,
tz.moesS_thermostat_eco_temperature, tz.moesS_thermostat_max_temperature,
tz.moesS_thermostat_min_temperature, tz.moesS_thermostat_schedule,
tz.moesS_thermostat_moesSecoMode, tz.moesS_thermostat_boost_heating_countdown],
exposes: [
e.battery(), e.child_lock(),
exposes.climate()
.withLocalTemperature(ea.STATE).withSetpoint('current_heating_setpoint', 5, 35, 0.5, ea.STATE_SET)
.withLocalTemperatureCalibration(ea.STATE_SET),
e.mode_selection('mode_selection', ea.STATE_SET, ['programming', 'manual', 'temporary_manual', 'holiday'])
.withDescription('MANUAL MODE ☝ - In this mode, the device executes manual temperature setting. '+
'When the set temperature is lower than the "minimum temperature", the valve is closed (forced closed). ' +
'PROGRAMMING MODE ⏱ -In this mode, the device executes a preset week programming temperature time and temperature. ' +
'HOLIDAY MODE ⛱ - In this mode, for example, the vacation mode is set for 10 days and the temperature is set' +
'to 15 degrees Celsius. After 10 days, the device will automatically switch to programming mode. ' +
'TEMPORARY MANUAL MODE - In this mode, ☝ icon will flash. At this time, the device executes the manually set ' +
'temperature and returns to the weekly programming mode in the next time period. '),
exposes.enum('programming_mode', ea.STATE).withDescription('PROGRAMMING MODE ⏱ -In this mode, the device executes a ' +
vladi1234 marked this conversation as resolved.
Show resolved Hide resolved
'preset week programming temperature time and temperature. '),
exposes.binary('boost_heating', ea.STATE).withDescription('Boost Heating: Press and hold "+" for 3 seconds, the device will' +
'enter the boost heating mode, and the ▷╵◁ will flash. The countdown will be displayed in the APP'),
exposes.numeric('boost_heating_countdown', ea.STATE).withUnit('min').withDescription('countdown in minutes'),
exposes.numeric('boost_time_set', ea.STATE_SET).withUnit('sec')
.withDescription('Boost Time Setting 100 sec - 900 sec, (default = 300 sec)'),
exposes.binary('eco_mode', ea.STATE).withDescription('ON/OFF state ECO MODE'),
e.eco_temperature(), e.max_temperature(), e.min_temperature(), e.window_detection(), e.position()],
},
];
19 changes: 19 additions & 0 deletions lib/tuya.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,25 @@ const dataPoints = {
moesSensor: 43,
moesSchedule: 101,
etopErrorStatus: 13,
// MoesS Thermostat
moesSsystemMode: 1,
moesSheatingSetpoint: 2,
moesSlocalTemp: 3,
moesSboostHeating: 4,
moesSboostHeatingCountdown: 5,
moesSreset: 7,
moesSwindowDetectionFunktion_A2: 8,
moesSwindowDetection: 9,
moesSchildLock: 13,
moesSbattery: 14,
moesSschedule: 101,
moesSvalvePosition: 104,
moesSboostHeatingCountdownTimeSet: 103,
moesScompensationTempSet: 105,
moesSecoMode: 106,
moesSecoModeTempSet: 107,
moesSmaxTempSet: 108,
moesSminTempSet: 109,
// Neo T&H
neoPowerType: 101,
neoMelody: 102,
Expand Down