diff --git a/lib/devices/gen1/shellycolorbulb.js b/lib/devices/gen1/shellycolorbulb.js index 6ac9411f..73d63c71 100644 --- a/lib/devices/gen1/shellycolorbulb.js +++ b/lib/devices/gen1/shellycolorbulb.js @@ -357,6 +357,30 @@ const shellycolorbulb = { 'write': true } }, + 'lights.transiton': { + coap: { + http_publish: '/settings', + http_publish_funct: (value) => { return value ? JSON.parse(value).lights[0].transition : undefined; }, + http_cmd: '/settings/light/0', + http_cmd_funct: (value) => { return { transition: value }; } + }, + mqtt: { + http_publish: '/settings', + http_publish_funct: (value) => { return value ? JSON.parse(value).lights[0].transition : undefined; }, + http_cmd: '/settings/light/0', + http_cmd_funct: (value) => { return { transition: value }; } + }, + common: { + 'name': 'Transitions Time', + 'type': 'number', + 'role': 'state', + 'read': true, + 'write': false, + 'unit': 'ms', + 'min': 0, + 'max': 5000 + } + }, 'metering.power': { coap: { coap_publish: '4101', @@ -367,7 +391,7 @@ const shellycolorbulb = { http_publish_funct: (value) => { return value ? JSON.parse(value).meters[0].power : undefined; }, }, common: { - 'name': 'Device Power status', + 'name': 'Actual consumed power in Watt', 'type': 'number', 'role': 'value', 'unit': 'W', @@ -385,13 +409,31 @@ const shellycolorbulb = { http_publish_funct: (value) => { return value ? JSON.parse(value).meters[0].energy : undefined; }, }, common: { - 'name': 'Device Energy status', + 'name': 'Total energy consumed in Watt-minute', 'type': 'number', 'role': 'value', 'unit': 'Wmin', 'read': true, 'write': false } + }, + 'metering.energy2': { + coap: { + coap_publish: '4103', + coap_publish_funct: (value) => { return value * 0.000017 }, + }, + mqtt: { + http_publish: '/status', + http_publish_funct: (value) => { return value ? JSON.parse(value).meters[0].energy * 0.0000017 : undefined; }, + }, + common: { + 'name': 'Total energy consumed in kWh', + 'type': 'number', + 'role': 'value', + 'unit': 'kWh', + 'read': true, + 'write': false + } } }