diff --git a/lib/devices/gen1/shellytrv.js b/lib/devices/gen1/shellytrv.js index 1509d928..d624dedd 100644 --- a/lib/devices/gen1/shellytrv.js +++ b/lib/devices/gen1/shellytrv.js @@ -263,21 +263,49 @@ const shellytrv = { max: 9, }, }, + 'tmp.automaticTemperatureControl': { + coap: { + http_publish: '/settings', + http_publish_funct: (value) => { return value ? JSON.parse(value).thermostats[0].t_auto.enabled : undefined; }, + http_cmd: '/settings/thermostat/0', + http_cmd_funct: (value) => { return { t_auto_enabled: value }; }, + }, + mqtt: { + http_publish: '/settings', + http_publish_funct: (value) => { return value ? JSON.parse(value).thermostats[0].t_auto.enabled : undefined; }, + http_cmd: '/settings/thermostat/0', + http_cmd_funct: (value) => { return { t_auto_enabled: value }; }, + }, + common: { + name: 'Enable Temperature controlled Valve (t_auto)', + type: 'boolean', + role: 'switch', + read: true, + write: true, + }, + }, 'tmp.valvePosition': { coap: { coap_publish: '3121', + coap_publish_funct: (value) => { return value ? JSON.parse(value).thermostats[0].pos : undefined; }, + http_cmd: '/thermostat/0', + http_cmd_funct: (value) => { return { pos: value }; }, }, mqtt: { http_publish: '/status', http_publish_funct: value => value ? JSON.parse(value).thermostats[0].pos : undefined, + http_cmd: '/thermostat/0', + http_cmd_funct: (value) => { return { pos: value }; }, }, common: { name: 'Valve position', type: 'number', role: 'value.valve', read: true, - write: false, + write: true, unit: '%', + min: 0, + max: 100, }, }, 'tmp.calibrate': {