Skip to content

Commit 8302386

Browse files
committed
add Amp rating to power monitor input
1 parent 8064100 commit 8302386

File tree

1 file changed

+61
-7
lines changed

1 file changed

+61
-7
lines changed

mycodo/inputs/power_monitor_rpi_2.py

+61-7
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
'options_disabled': ['interface'],
6060

6161
'dependencies_module': [
62-
('pip-pypi', 'rpi_power_monitor', 'git+https://github.com/David00/rpi-power-monitor.git@192a99880bd576b2f3e7016b04d03f252ddaf99f')
62+
('pip-pypi', 'rpi_power_monitor', 'git+https://github.com/David00/rpi-power-monitor`.git@192a99880bd576b2f3e7016b04d03f252ddaf99f')
6363
],
6464

6565
'custom_commands': [
@@ -133,6 +133,14 @@
133133
'name': 'CT1 Calibration',
134134
'phrase': 'The calibration value for CT1'
135135
},
136+
{
137+
'id': 'ct1_rating',
138+
'type': 'float',
139+
'default_value': 1.0,
140+
'required': True,
141+
'name': 'CT1 Rating',
142+
'phrase': 'The Amp rating for the CT1 clamp'
143+
},
136144
{
137145
'id': 'ct2_accuracy_calibration',
138146
'type': 'float',
@@ -141,6 +149,14 @@
141149
'name': 'CT2 Calibration',
142150
'phrase': 'The calibration value for CT2'
143151
},
152+
{
153+
'id': 'ct2_rating',
154+
'type': 'float',
155+
'default_value': 100,
156+
'required': True,
157+
'name': 'CT2 Rating',
158+
'phrase': 'The Amp rating for the CT2 clamp'
159+
},
144160
{
145161
'id': 'ct3_accuracy_calibration',
146162
'type': 'float',
@@ -149,6 +165,14 @@
149165
'name': 'CT3 Calibration',
150166
'phrase': 'The calibration value for CT3'
151167
},
168+
{
169+
'id': 'ct3_rating',
170+
'type': 'float',
171+
'default_value': 100,
172+
'required': True,
173+
'name': 'CT3 Rating',
174+
'phrase': 'The Amp rating for the CT3 clamp'
175+
},
152176
{
153177
'id': 'ct4_accuracy_calibration',
154178
'type': 'float',
@@ -157,6 +181,14 @@
157181
'name': 'CT4 Calibration',
158182
'phrase': 'The calibration value for CT4'
159183
},
184+
{
185+
'id': 'ct4_rating',
186+
'type': 'float',
187+
'default_value': 100,
188+
'required': True,
189+
'name': 'CT4 Rating',
190+
'phrase': 'The Amp rating for the CT4 clamp'
191+
},
160192
{
161193
'id': 'ct5_accuracy_calibration',
162194
'type': 'float',
@@ -165,6 +197,14 @@
165197
'name': 'CT5 Calibration',
166198
'phrase': 'The calibration value for CT5'
167199
},
200+
{
201+
'id': 'ct5_rating',
202+
'type': 'float',
203+
'default_value': 100,
204+
'required': True,
205+
'name': 'CT5 Rating',
206+
'phrase': 'The Amp rating for the CT5 clamp'
207+
},
168208
{
169209
'id': 'ct6_accuracy_calibration',
170210
'type': 'float',
@@ -173,6 +213,14 @@
173213
'name': 'CT6 Calibration',
174214
'phrase': 'The calibration value for CT6'
175215
},
216+
{
217+
'id': 'ct6_rating',
218+
'type': 'float',
219+
'default_value': 100,
220+
'required': True,
221+
'name': 'CT6 Rating',
222+
'phrase': 'The Amp rating for the CT6 clamp'
223+
},
176224
{
177225
'id': 'ac_accuracy_calibration',
178226
'type': 'float',
@@ -202,6 +250,12 @@ def __init__(self, input_dev, testing=False):
202250
self.ct4_accuracy_calibration = None
203251
self.ct5_accuracy_calibration = None
204252
self.ct6_accuracy_calibration = None
253+
self.ct1_rating = None
254+
self.ct2_rating = None
255+
self.ct3_rating = None
256+
self.ct4_rating = None
257+
self.ct5_rating = None
258+
self.ct6_rating = None
205259
self.ac_accuracy_calibration = None
206260

207261
self.timer_kwh_measure = 0
@@ -261,7 +315,7 @@ def initialize(self):
261315
'current_transformers': {
262316
'channel_1': {
263317
'name': 'Channel 1',
264-
'rating': 100,
318+
'rating': self.ct1_rating,
265319
'type': 'consumption',
266320
'two_pole': False,
267321
'enabled': self.is_enabled(0),
@@ -272,7 +326,7 @@ def initialize(self):
272326
},
273327
'channel_2': {
274328
'name': 'Channel 2',
275-
'rating': 100,
329+
'rating': self.ct2_rating,
276330
'type': 'consumption',
277331
'two_pole': False,
278332
'enabled': self.is_enabled(1),
@@ -283,7 +337,7 @@ def initialize(self):
283337
},
284338
'channel_3': {
285339
'name': 'Channel 3',
286-
'rating': 100,
340+
'rating': self.ct3_rating,
287341
'type': 'consumption',
288342
'two_pole': False,
289343
'enabled': self.is_enabled(2),
@@ -294,7 +348,7 @@ def initialize(self):
294348
},
295349
'channel_4': {
296350
'name': 'Channel 4',
297-
'rating': 100,
351+
'rating': self.ct4_rating,
298352
'type': 'consumption',
299353
'two_pole': False,
300354
'enabled': self.is_enabled(3),
@@ -305,7 +359,7 @@ def initialize(self):
305359
},
306360
'channel_5': {
307361
'name': 'Channel 5',
308-
'rating': 100,
362+
'rating': self.ct5_rating,
309363
'type': 'consumption',
310364
'two_pole': False,
311365
'enabled': self.is_enabled(4),
@@ -316,7 +370,7 @@ def initialize(self):
316370
},
317371
'channel_6': {
318372
'name': 'Channel 6',
319-
'rating': 100,
373+
'rating': self.ct6_rating,
320374
'type': 'consumption',
321375
'two_pole': False,
322376
'enabled': self.is_enabled(5),

0 commit comments

Comments
 (0)