Skip to content

Commit

Permalink
added transition and total energy in kwh
Browse files Browse the repository at this point in the history
  • Loading branch information
sbp committed Sep 5, 2022
1 parent e6110d2 commit c81e53c
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions lib/devices/gen1/shellycolorbulb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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
}
}
}

Expand Down

0 comments on commit c81e53c

Please sign in to comment.