Skip to content

Commit

Permalink
added power metering
Browse files Browse the repository at this point in the history
  • Loading branch information
heroprint authored Sep 5, 2022
1 parent 8ca0095 commit 4250c31
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions lib/devices/gen1/shellycolorbulb.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,42 @@ const shellycolorbulb = {
'read': false,
'write': true
}
},
},
'metering.power': {
coap: {
coap_publish: '4101',
coap_publish_funct: (value) => { return value },
},
mqtt: {
http_publish: '/status',
http_publish_funct: (value) => { return value ? JSON.parse(value).meters[0].power : undefined; },
},
common: {
'name': 'Device Power status',
'type': 'number',
'role': 'value',
'unit': 'W',
'read': true,
'write': false
}
},
'metering.energy': {
coap: {
coap_publish: '4103',
coap_publish_funct: (value) => { return value },
},
mqtt: {
http_publish: '/status',
http_publish_funct: (value) => { return value ? JSON.parse(value).meters[0].energy : undefined; },
},
common: {
'name': 'Device Energy status',
'type': 'number',
'role': 'value',
'unit': 'Wmin',
'read': true,
'write': false
}
};

Expand Down

0 comments on commit 4250c31

Please sign in to comment.