stekker_zaptec 1.2.0 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +22 -0
- data/.rubocop.yml +202 -238
- data/Gemfile +1 -0
- data/Gemfile.lock +80 -72
- data/README.md +12 -0
- data/bin/release +28 -0
- data/data/constants.json +165 -16
- data/lib/stekker_zaptec.rb +0 -1
- data/lib/zaptec/client.rb +8 -6
- data/lib/zaptec/constants.rb +7 -0
- data/lib/zaptec/credentials.rb +1 -1
- data/lib/zaptec/errors.rb +1 -1
- data/lib/zaptec/meter_reading.rb +36 -0
- data/lib/zaptec/state.rb +4 -2
- data/lib/zaptec/version.rb +1 -1
- data/zaptec.gemspec +0 -1
- metadata +4 -16
data/data/constants.json
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"Languages": [
|
3
|
+
{
|
4
|
+
"Key": "dk",
|
5
|
+
"Name": "Danish"
|
6
|
+
},
|
3
7
|
{
|
4
8
|
"Key": "nl",
|
5
9
|
"Name": "Dutch"
|
@@ -50,11 +54,11 @@
|
|
50
54
|
}
|
51
55
|
],
|
52
56
|
"Countries": {
|
53
|
-
"
|
54
|
-
"Id": "
|
57
|
+
"d475da45-5b86-42ed-86e5-f30035e16da1": {
|
58
|
+
"Id": "d475da45-5b86-42ed-86e5-f30035e16da1",
|
55
59
|
"Code": "AUT",
|
56
60
|
"Name": "Austria",
|
57
|
-
"TimeZoneName": "(UTC+01:00) Central European Time (
|
61
|
+
"TimeZoneName": "(UTC+01:00) Central European Time (Vienna)"
|
58
62
|
},
|
59
63
|
"3073c0bd-9f5c-4f18-80dd-a7b163beb3fe": {
|
60
64
|
"Id": "3073c0bd-9f5c-4f18-80dd-a7b163beb3fe",
|
@@ -68,12 +72,24 @@
|
|
68
72
|
"Name": "Croatia",
|
69
73
|
"TimeZoneName": "(UTC+01:00) Central European Time (Warsaw)"
|
70
74
|
},
|
75
|
+
"06c1cbd3-66d3-48e3-8ca1-9d427400689c": {
|
76
|
+
"Id": "06c1cbd3-66d3-48e3-8ca1-9d427400689c",
|
77
|
+
"Code": "CZE",
|
78
|
+
"Name": "Czech Republic",
|
79
|
+
"TimeZoneName": "(UTC+01:00) Central European Time (Prague)"
|
80
|
+
},
|
71
81
|
"52f1e37e-f314-4d48-8a6a-82c74e4830a1": {
|
72
82
|
"Id": "52f1e37e-f314-4d48-8a6a-82c74e4830a1",
|
73
83
|
"Code": "DNK",
|
74
84
|
"Name": "Denmark",
|
75
85
|
"TimeZoneName": "(UTC+01:00) Central European Time (Berlin)"
|
76
86
|
},
|
87
|
+
"0047a9bd-adea-4272-9708-3354dee0bd8c": {
|
88
|
+
"Id": "0047a9bd-adea-4272-9708-3354dee0bd8c",
|
89
|
+
"Code": "EST",
|
90
|
+
"Name": "Estonia",
|
91
|
+
"TimeZoneName": "(UTC+02:00) Eastern European Time (Tallinn)"
|
92
|
+
},
|
77
93
|
"42ec863c-edb5-46b0-afeb-36f66fa7eebf": {
|
78
94
|
"Id": "42ec863c-edb5-46b0-afeb-36f66fa7eebf",
|
79
95
|
"Code": "FIN",
|
@@ -92,6 +108,18 @@
|
|
92
108
|
"Name": "Germany",
|
93
109
|
"TimeZoneName": "(UTC+01:00) Central European Time (Berlin)"
|
94
110
|
},
|
111
|
+
"24c5afbe-2446-482e-b78d-a9494f8118d5": {
|
112
|
+
"Id": "24c5afbe-2446-482e-b78d-a9494f8118d5",
|
113
|
+
"Code": "GRC",
|
114
|
+
"Name": "Greece",
|
115
|
+
"TimeZoneName": "(UTC+02:00) Eastern European Time (Athens)"
|
116
|
+
},
|
117
|
+
"1aef14ea-054d-45f7-91c5-9e1b19762a95": {
|
118
|
+
"Id": "1aef14ea-054d-45f7-91c5-9e1b19762a95",
|
119
|
+
"Code": "HUN",
|
120
|
+
"Name": "Hungary",
|
121
|
+
"TimeZoneName": "(UTC+01:00) Central European Time (Budapest)"
|
122
|
+
},
|
95
123
|
"a0e21e29-474f-466a-9a2f-3a17458465d8": {
|
96
124
|
"Id": "a0e21e29-474f-466a-9a2f-3a17458465d8",
|
97
125
|
"Code": "ISL",
|
@@ -110,6 +138,24 @@
|
|
110
138
|
"Name": "Italy",
|
111
139
|
"TimeZoneName": "(UTC+01:00) Central European Time (Berlin)"
|
112
140
|
},
|
141
|
+
"51f14b70-8cfb-4f43-b389-a4966e225ddd": {
|
142
|
+
"Id": "51f14b70-8cfb-4f43-b389-a4966e225ddd",
|
143
|
+
"Code": "LVA",
|
144
|
+
"Name": "Latvia",
|
145
|
+
"TimeZoneName": "(UTC+02:00) Eastern European Time (Riga)"
|
146
|
+
},
|
147
|
+
"8022f9e8-d2a7-4446-a248-bcb25ce6d0e2": {
|
148
|
+
"Id": "8022f9e8-d2a7-4446-a248-bcb25ce6d0e2",
|
149
|
+
"Code": "LTU",
|
150
|
+
"Name": "Lithuania",
|
151
|
+
"TimeZoneName": "(UTC+02:00) Eastern European Time (Vilnius)"
|
152
|
+
},
|
153
|
+
"d7158bfc-ab96-4b85-88fb-26740ab8f17c": {
|
154
|
+
"Id": "d7158bfc-ab96-4b85-88fb-26740ab8f17c",
|
155
|
+
"Code": "LUX",
|
156
|
+
"Name": "Luxembourg",
|
157
|
+
"TimeZoneName": "(UTC+01:00) Central European Time (Warsaw)"
|
158
|
+
},
|
113
159
|
"bda681ab-adcb-4f67-bac5-5cbf28d42cc7": {
|
114
160
|
"Id": "bda681ab-adcb-4f67-bac5-5cbf28d42cc7",
|
115
161
|
"Code": "NLD",
|
@@ -134,6 +180,24 @@
|
|
134
180
|
"Name": "Portugal",
|
135
181
|
"TimeZoneName": "(UTC+00:00) United Kingdom Time"
|
136
182
|
},
|
183
|
+
"0b252d8d-18bc-4dbb-9eca-953371586455": {
|
184
|
+
"Id": "0b252d8d-18bc-4dbb-9eca-953371586455",
|
185
|
+
"Code": "ROU",
|
186
|
+
"Name": "Romania",
|
187
|
+
"TimeZoneName": "(UTC+02:00) Eastern European Time (Bucharest)"
|
188
|
+
},
|
189
|
+
"2d3debcc-17e9-4e12-8802-4cd04e778655": {
|
190
|
+
"Id": "2d3debcc-17e9-4e12-8802-4cd04e778655",
|
191
|
+
"Code": "SVK",
|
192
|
+
"Name": "Slovakia",
|
193
|
+
"TimeZoneName": "(UTC+01:00) Central European Time (Bratislava)"
|
194
|
+
},
|
195
|
+
"514f0414-a993-4759-a3e8-db7b83633bfa": {
|
196
|
+
"Id": "514f0414-a993-4759-a3e8-db7b83633bfa",
|
197
|
+
"Code": "SVN",
|
198
|
+
"Name": "Slovenia",
|
199
|
+
"TimeZoneName": "(UTC+01:00) Central European Time (Ljubljana)"
|
200
|
+
},
|
137
201
|
"5456f813-850b-418f-9eef-1225e66302d2": {
|
138
202
|
"Id": "5456f813-850b-418f-9eef-1225e66302d2",
|
139
203
|
"Code": "ESP",
|
@@ -158,6 +222,12 @@
|
|
158
222
|
"Name": "Thailand",
|
159
223
|
"TimeZoneName": "(UTC+07:00) Indochina Time (Bangkok)"
|
160
224
|
},
|
225
|
+
"d251fa3a-078a-4c98-a254-0d65cdecc578": {
|
226
|
+
"Id": "d251fa3a-078a-4c98-a254-0d65cdecc578",
|
227
|
+
"Code": "TUR",
|
228
|
+
"Name": "Turkey",
|
229
|
+
"TimeZoneName": "(UTC+03:00) Türkiye Time"
|
230
|
+
},
|
161
231
|
"f743b0d4-1f38-43e8-a95d-cf18fe1c3ede": {
|
162
232
|
"Id": "f743b0d4-1f38-43e8-a95d-cf18fe1c3ede",
|
163
233
|
"Code": "GBR",
|
@@ -198,6 +268,13 @@
|
|
198
268
|
"MaxChargers": 3,
|
199
269
|
"DefaultFeatures": 471,
|
200
270
|
"DefaultRoute": "default"
|
271
|
+
},
|
272
|
+
"OcppNative": {
|
273
|
+
"Id": 2,
|
274
|
+
"Name": "OcppNative",
|
275
|
+
"MaxChargers": 3,
|
276
|
+
"DefaultFeatures": 577,
|
277
|
+
"DefaultRoute": "default"
|
201
278
|
}
|
202
279
|
},
|
203
280
|
"UserRoles": {
|
@@ -312,7 +389,8 @@
|
|
312
389
|
"OperationFailedDueToChargerState": 538,
|
313
390
|
"InstallationConstraintViolation": 539,
|
314
391
|
"UnknownInstallationId": 540,
|
315
|
-
"UnknownEnergySensorId": 541
|
392
|
+
"UnknownEnergySensorId": 541,
|
393
|
+
"UnauthorizedToPerformOcppNativeChanges": 542
|
316
394
|
},
|
317
395
|
"Settings": {
|
318
396
|
"AuthenticationRequired": 120,
|
@@ -345,7 +423,8 @@
|
|
345
423
|
"DiagnosticsMode": 805,
|
346
424
|
"DisableBLEChargePointName": 806,
|
347
425
|
"InternalDiagnosticsLog": 807,
|
348
|
-
"UnconditionalNfcDetectionIndication": 855
|
426
|
+
"UnconditionalNfcDetectionIndication": 855,
|
427
|
+
"EnableLteDetailedSignalStrength": 856
|
349
428
|
},
|
350
429
|
"Commands": {
|
351
430
|
"Unknown": 0,
|
@@ -377,6 +456,7 @@
|
|
377
456
|
"ShowGranted": 601,
|
378
457
|
"ShowDenied": 602,
|
379
458
|
"IndicateAppConnect": 603,
|
459
|
+
"RequestSignedMIDEventLog": 700,
|
380
460
|
"ConfirmChargeCardAdded": 750,
|
381
461
|
"SetAuthenticationList": 751,
|
382
462
|
"Debug": 800,
|
@@ -396,6 +476,9 @@
|
|
396
476
|
"Observations": {
|
397
477
|
"Unknown": 0,
|
398
478
|
"OfflineMode": 1,
|
479
|
+
"Capabilities": 100,
|
480
|
+
"ProductName": 110,
|
481
|
+
"ArenaId": 111,
|
399
482
|
"AuthenticationRequired": 120,
|
400
483
|
"PaymentActive": 130,
|
401
484
|
"PaymentCurrency": 131,
|
@@ -415,8 +498,10 @@
|
|
415
498
|
"TemperatureInternal5": 201,
|
416
499
|
"TemperatureInternal6": 202,
|
417
500
|
"TemperatureInternalLimit": 203,
|
501
|
+
"TemperaturePowerBoard": 205,
|
418
502
|
"TemperatureInternalMaxLimit": 241,
|
419
503
|
"Humidity": 270,
|
504
|
+
"TamperCover": 280,
|
420
505
|
"VoltagePhase1": 501,
|
421
506
|
"VoltagePhase2": 502,
|
422
507
|
"VoltagePhase3": 503,
|
@@ -436,6 +521,7 @@
|
|
436
521
|
"ChargerOfflineCurrent": 523,
|
437
522
|
"RcdCalibration": 540,
|
438
523
|
"RcdCalibrationNoise": 541,
|
524
|
+
"ManualRcdTest": 542,
|
439
525
|
"TotalChargePowerSession": 553,
|
440
526
|
"SignedMeterValue": 554,
|
441
527
|
"SignedMeterValueInterval": 555,
|
@@ -463,6 +549,7 @@
|
|
463
549
|
"SessionIdentifier": 721,
|
464
550
|
"ChargerCurrentUserUuid": 722,
|
465
551
|
"CompletedSession": 723,
|
552
|
+
"PlugAndChargeAuthorizeRequest": 724,
|
466
553
|
"NewChargeCard": 750,
|
467
554
|
"AuthenticationListVersion": 751,
|
468
555
|
"EnabledNfcTechnologies": 752,
|
@@ -487,12 +574,15 @@
|
|
487
574
|
"VarisciteToMcuPacketErrors": 814,
|
488
575
|
"UptimeVariscite": 820,
|
489
576
|
"UptimeMCU": 821,
|
577
|
+
"CertificateVersion": 823,
|
578
|
+
"SecurityLog": 830,
|
490
579
|
"CarSessionLog": 850,
|
491
580
|
"CommunicationModeConfigurationInconsistency": 851,
|
492
581
|
"RawPilotMonitor": 852,
|
493
582
|
"IT3PhaseDiagnosticsLog": 853,
|
494
583
|
"PilotTestResults": 854,
|
495
584
|
"UnconditionalNfcDetectionIndication": 855,
|
585
|
+
"EnableLteDetailedSignalStrength": 856,
|
496
586
|
"EmcTestCounter": 899,
|
497
587
|
"ProductionTestResults": 900,
|
498
588
|
"PostProductionTestResults": 901,
|
@@ -501,6 +591,7 @@
|
|
501
591
|
"SmartComputerSoftwareApplicationVersion": 911,
|
502
592
|
"SmartComputerSoftwareBootloaderVersion": 912,
|
503
593
|
"SmartComputerHardwareVersion": 913,
|
594
|
+
"MIDLegallyRelevantSoftwareIdentifier": 914,
|
504
595
|
"MacMain": 950,
|
505
596
|
"MacPlcModuleGrid": 951,
|
506
597
|
"MacWiFi": 952,
|
@@ -509,8 +600,12 @@
|
|
509
600
|
"LteMsisdn": 961,
|
510
601
|
"LteIccid": 962,
|
511
602
|
"LteImei": 963,
|
603
|
+
"LteVersion": 964,
|
604
|
+
"LteDetailedSignalStrength": 965,
|
512
605
|
"ProductionTestStationNumber": 970,
|
513
606
|
"MIDCalibration": 980,
|
607
|
+
"MIDPublicKey": 981,
|
608
|
+
"MIDCalibrationID": 982,
|
514
609
|
"IsOcppConnected": -3,
|
515
610
|
"IsOnline": -2,
|
516
611
|
"Pulse": -1
|
@@ -521,6 +616,9 @@
|
|
521
616
|
"ObservationIds": {
|
522
617
|
"Unknown": 0,
|
523
618
|
"OfflineMode": 1,
|
619
|
+
"Capabilities": 100,
|
620
|
+
"ProductName": 110,
|
621
|
+
"ArenaId": 111,
|
524
622
|
"AuthenticationRequired": 120,
|
525
623
|
"PaymentActive": 130,
|
526
624
|
"PaymentCurrency": 131,
|
@@ -540,8 +638,10 @@
|
|
540
638
|
"TemperatureInternal5": 201,
|
541
639
|
"TemperatureInternal6": 202,
|
542
640
|
"TemperatureInternalLimit": 203,
|
641
|
+
"TemperaturePowerBoard": 205,
|
543
642
|
"TemperatureInternalMaxLimit": 241,
|
544
643
|
"Humidity": 270,
|
644
|
+
"TamperCover": 280,
|
545
645
|
"VoltagePhase1": 501,
|
546
646
|
"VoltagePhase2": 502,
|
547
647
|
"VoltagePhase3": 503,
|
@@ -561,6 +661,7 @@
|
|
561
661
|
"ChargerOfflineCurrent": 523,
|
562
662
|
"RcdCalibration": 540,
|
563
663
|
"RcdCalibrationNoise": 541,
|
664
|
+
"ManualRcdTest": 542,
|
564
665
|
"TotalChargePowerSession": 553,
|
565
666
|
"SignedMeterValue": 554,
|
566
667
|
"SignedMeterValueInterval": 555,
|
@@ -588,6 +689,7 @@
|
|
588
689
|
"SessionIdentifier": 721,
|
589
690
|
"ChargerCurrentUserUuid": 722,
|
590
691
|
"CompletedSession": 723,
|
692
|
+
"PlugAndChargeAuthorizeRequest": 724,
|
591
693
|
"NewChargeCard": 750,
|
592
694
|
"AuthenticationListVersion": 751,
|
593
695
|
"EnabledNfcTechnologies": 752,
|
@@ -612,12 +714,15 @@
|
|
612
714
|
"VarisciteToMcuPacketErrors": 814,
|
613
715
|
"UptimeVariscite": 820,
|
614
716
|
"UptimeMCU": 821,
|
717
|
+
"CertificateVersion": 823,
|
718
|
+
"SecurityLog": 830,
|
615
719
|
"CarSessionLog": 850,
|
616
720
|
"CommunicationModeConfigurationInconsistency": 851,
|
617
721
|
"RawPilotMonitor": 852,
|
618
722
|
"IT3PhaseDiagnosticsLog": 853,
|
619
723
|
"PilotTestResults": 854,
|
620
724
|
"UnconditionalNfcDetectionIndication": 855,
|
725
|
+
"EnableLteDetailedSignalStrength": 856,
|
621
726
|
"EmcTestCounter": 899,
|
622
727
|
"ProductionTestResults": 900,
|
623
728
|
"PostProductionTestResults": 901,
|
@@ -626,6 +731,7 @@
|
|
626
731
|
"SmartComputerSoftwareApplicationVersion": 911,
|
627
732
|
"SmartComputerSoftwareBootloaderVersion": 912,
|
628
733
|
"SmartComputerHardwareVersion": 913,
|
734
|
+
"MIDLegallyRelevantSoftwareIdentifier": 914,
|
629
735
|
"MacMain": 950,
|
630
736
|
"MacPlcModuleGrid": 951,
|
631
737
|
"MacWiFi": 952,
|
@@ -634,8 +740,12 @@
|
|
634
740
|
"LteMsisdn": 961,
|
635
741
|
"LteIccid": 962,
|
636
742
|
"LteImei": 963,
|
743
|
+
"LteVersion": 964,
|
744
|
+
"LteDetailedSignalStrength": 965,
|
637
745
|
"ProductionTestStationNumber": 970,
|
638
746
|
"MIDCalibration": 980,
|
747
|
+
"MIDPublicKey": 981,
|
748
|
+
"MIDCalibrationID": 982,
|
639
749
|
"IsOcppConnected": -3,
|
640
750
|
"IsOnline": -2,
|
641
751
|
"Pulse": -1
|
@@ -670,6 +780,7 @@
|
|
670
780
|
"ShowGranted": 601,
|
671
781
|
"ShowDenied": 602,
|
672
782
|
"IndicateAppConnect": 603,
|
783
|
+
"RequestSignedMIDEventLog": 700,
|
673
784
|
"ConfirmChargeCardAdded": 750,
|
674
785
|
"SetAuthenticationList": 751,
|
675
786
|
"Debug": 800,
|
@@ -717,7 +828,8 @@
|
|
717
828
|
"DiagnosticsMode": 805,
|
718
829
|
"DisableBLEChargePointName": 806,
|
719
830
|
"InternalDiagnosticsLog": 807,
|
720
|
-
"UnconditionalNfcDetectionIndication": 855
|
831
|
+
"UnconditionalNfcDetectionIndication": 855,
|
832
|
+
"EnableLteDetailedSignalStrength": 856
|
721
833
|
},
|
722
834
|
"Warnings": {
|
723
835
|
"None": 0,
|
@@ -755,13 +867,15 @@
|
|
755
867
|
"VARISCITE": 2147483648,
|
756
868
|
"MCU_BOOTLOADER": 4294967296,
|
757
869
|
"FPGA_INIT_FAILED": 8589934592,
|
758
|
-
"ILLEGAL_PHASE": 17179869184
|
870
|
+
"ILLEGAL_PHASE": 17179869184,
|
871
|
+
"MID_STORAGE_ERROR": 34359738368
|
759
872
|
}
|
760
873
|
},
|
761
874
|
"Apollo": {
|
762
875
|
"DeviceType": 4,
|
763
876
|
"ObservationIds": {
|
764
877
|
"Unknown": 0,
|
878
|
+
"Capabilities": 100,
|
765
879
|
"AuthenticationRequired": 120,
|
766
880
|
"PaymentActive": 130,
|
767
881
|
"PaymentCurrency": 131,
|
@@ -784,6 +898,7 @@
|
|
784
898
|
"TemperatureTM2": 207,
|
785
899
|
"TemperatureInternalMaxLimit": 241,
|
786
900
|
"Humidity": 270,
|
901
|
+
"TamperCover": 280,
|
787
902
|
"VoltagePhase1": 501,
|
788
903
|
"VoltagePhase2": 502,
|
789
904
|
"VoltagePhase3": 503,
|
@@ -860,10 +975,18 @@
|
|
860
975
|
"UptimeMCU": 821,
|
861
976
|
"DataUsage": 822,
|
862
977
|
"CertificateVersion": 823,
|
978
|
+
"SecurityLog": 830,
|
863
979
|
"CarSessionLog": 850,
|
864
980
|
"CommunicationModeConfigurationInconsistency": 851,
|
865
981
|
"RawPilotMonitor": 852,
|
866
982
|
"IT3PhaseDiagnosticsLog": 853,
|
983
|
+
"SessionController": 860,
|
984
|
+
"OcppNativeUrl": 861,
|
985
|
+
"OcppNativeCbId": 862,
|
986
|
+
"OcppNativeAuthorizationKey": 863,
|
987
|
+
"OcppNativeAuthorizationKeyFromZaptec": 864,
|
988
|
+
"OcppNativeSecurityProfile": 865,
|
989
|
+
"OcppNativeConnected": 866,
|
867
990
|
"ProductionTestResults": 900,
|
868
991
|
"PostProductionTestResults": 901,
|
869
992
|
"SmartMainboardSoftwareApplicationVersion": 908,
|
@@ -940,7 +1063,12 @@
|
|
940
1063
|
"ChargePointName": 802,
|
941
1064
|
"DiagnosticsMode": 805,
|
942
1065
|
"DisableBLEChargePointName": 806,
|
943
|
-
"InternalDiagnosticsLog": 807
|
1066
|
+
"InternalDiagnosticsLog": 807,
|
1067
|
+
"SessionController": 860,
|
1068
|
+
"OcppNativeUrl": 861,
|
1069
|
+
"OcppNativeCbId": 862,
|
1070
|
+
"OcppNativeAuthorizationKey": 863,
|
1071
|
+
"OcppNativeAuthorizationKeyFromZaptec": 864
|
944
1072
|
},
|
945
1073
|
"Warnings": {
|
946
1074
|
"None": 0,
|
@@ -1066,7 +1194,7 @@
|
|
1066
1194
|
"InvitedUser": 7,
|
1067
1195
|
"Country": 8
|
1068
1196
|
},
|
1069
|
-
"Version": "6.5.8.
|
1197
|
+
"Version": "6.5.8.0",
|
1070
1198
|
"SmartWarnings": {
|
1071
1199
|
"WARNING_OK": 0,
|
1072
1200
|
"WARNING_HUMIDITY": 1,
|
@@ -1180,6 +1308,7 @@
|
|
1180
1308
|
"Connectivity_4G": 64,
|
1181
1309
|
"Authentication_Ocpp": 128,
|
1182
1310
|
"PowerManagement_Apm_Tariff_PowerLimit": 256,
|
1311
|
+
"Authentication_OcppNative": 512,
|
1183
1312
|
"LoadBalacing": 32768
|
1184
1313
|
},
|
1185
1314
|
"InstallationTypeConstraints": {
|
@@ -1198,7 +1327,8 @@
|
|
1198
1327
|
"StoppedByRFID": 8,
|
1199
1328
|
"Signed": 16,
|
1200
1329
|
"Void": 32,
|
1201
|
-
"Aborted": 64
|
1330
|
+
"Aborted": 64,
|
1331
|
+
"OcppNative": 128
|
1202
1332
|
},
|
1203
1333
|
"InstallationUpdateStatusCodes": {
|
1204
1334
|
"Ok": 0,
|
@@ -1238,7 +1368,9 @@
|
|
1238
1368
|
"SE4": 9,
|
1239
1369
|
"DK1": 10,
|
1240
1370
|
"DK2": 11,
|
1241
|
-
"FI": 12
|
1371
|
+
"FI": 12,
|
1372
|
+
"NL": 13,
|
1373
|
+
"BE": 14
|
1242
1374
|
},
|
1243
1375
|
"PriceUnit": {
|
1244
1376
|
"Unsupported": 0,
|
@@ -1247,9 +1379,12 @@
|
|
1247
1379
|
"CountryDeliveryAreas": {
|
1248
1380
|
"53215e81-d4a1-48ab-bfa3-001934b71734": [],
|
1249
1381
|
"8e2a76e1-2f43-46bc-9319-0a77b12182e6": [],
|
1382
|
+
"d251fa3a-078a-4c98-a254-0d65cdecc578": [],
|
1250
1383
|
"5456f813-850b-418f-9eef-1225e66302d2": [],
|
1251
1384
|
"04918e62-f761-4ef2-8923-1483fa9fdd05": [],
|
1252
1385
|
"758c174f-d840-4b80-a408-1d46ce2b7e05": [],
|
1386
|
+
"d7158bfc-ab96-4b85-88fb-26740ab8f17c": [],
|
1387
|
+
"0047a9bd-adea-4272-9708-3354dee0bd8c": [],
|
1253
1388
|
"42ec863c-edb5-46b0-afeb-36f66fa7eebf": [
|
1254
1389
|
12
|
1255
1390
|
],
|
@@ -1262,14 +1397,25 @@
|
|
1262
1397
|
"a0e21e29-474f-466a-9a2f-3a17458465d8": [],
|
1263
1398
|
"c66b0918-9e65-4dd4-9b6c-47f989538e6d": [],
|
1264
1399
|
"a33ba41a-16e4-4b00-a2a1-4934d89c3a1c": [],
|
1265
|
-
"
|
1400
|
+
"2d3debcc-17e9-4e12-8802-4cd04e778655": [],
|
1401
|
+
"bda681ab-adcb-4f67-bac5-5cbf28d42cc7": [
|
1402
|
+
13
|
1403
|
+
],
|
1266
1404
|
"52f1e37e-f314-4d48-8a6a-82c74e4830a1": [
|
1267
1405
|
10,
|
1268
1406
|
11
|
1269
1407
|
],
|
1270
1408
|
"fb894235-7a19-4fe0-b6a1-8b9c9ceb9e4e": [],
|
1271
|
-
"
|
1409
|
+
"0b252d8d-18bc-4dbb-9eca-953371586455": [],
|
1410
|
+
"06c1cbd3-66d3-48e3-8ca1-9d427400689c": [],
|
1411
|
+
"1aef14ea-054d-45f7-91c5-9e1b19762a95": [],
|
1412
|
+
"51f14b70-8cfb-4f43-b389-a4966e225ddd": [],
|
1413
|
+
"3073c0bd-9f5c-4f18-80dd-a7b163beb3fe": [
|
1414
|
+
14
|
1415
|
+
],
|
1416
|
+
"24c5afbe-2446-482e-b78d-a9494f8118d5": [],
|
1272
1417
|
"3705d443-31df-4633-8bf4-b8379c82a5cb": [],
|
1418
|
+
"8022f9e8-d2a7-4446-a248-bcb25ce6d0e2": [],
|
1273
1419
|
"83bffdb1-0a92-4574-bb7b-bd0d17387c17": [
|
1274
1420
|
1,
|
1275
1421
|
2,
|
@@ -1278,12 +1424,15 @@
|
|
1278
1424
|
5
|
1279
1425
|
],
|
1280
1426
|
"f743b0d4-1f38-43e8-a95d-cf18fe1c3ede": [],
|
1281
|
-
"
|
1282
|
-
"
|
1427
|
+
"514f0414-a993-4759-a3e8-db7b83633bfa": [],
|
1428
|
+
"d475da45-5b86-42ed-86e5-f30035e16da1": [],
|
1429
|
+
"2365ed9c-8a79-44b5-9bf8-f7a2cf42fb44": []
|
1283
1430
|
}
|
1284
1431
|
},
|
1285
1432
|
"UserActionTypes": {
|
1286
|
-
"
|
1433
|
+
"None": 0,
|
1434
|
+
"AddSense": 1,
|
1435
|
+
"InviteNewUser": 2
|
1287
1436
|
},
|
1288
1437
|
"OcppCloudUrlVersions": {
|
1289
1438
|
"Legacy": 0,
|
data/lib/stekker_zaptec.rb
CHANGED
data/lib/zaptec/client.rb
CHANGED
@@ -42,16 +42,16 @@ module Zaptec
|
|
42
42
|
{
|
43
43
|
username:,
|
44
44
|
password:,
|
45
|
-
grant_type: "password"
|
45
|
+
grant_type: "password",
|
46
46
|
}.to_query,
|
47
47
|
{
|
48
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
49
|
-
}
|
48
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
49
|
+
},
|
50
50
|
)
|
51
51
|
|
52
52
|
@credentials = Zaptec::Credentials.new(
|
53
53
|
response.body["access_token"],
|
54
|
-
start + response.body["expires_in"].to_f
|
54
|
+
start + response.body["expires_in"].to_f,
|
55
55
|
)
|
56
56
|
rescue Faraday::BadRequestError
|
57
57
|
raise Errors::AuthorizationFailed
|
@@ -84,7 +84,7 @@ module Zaptec
|
|
84
84
|
.to_h do |state|
|
85
85
|
[
|
86
86
|
Constants.observation_state_id_to_name(state_id: state.fetch("StateId"), device_type:),
|
87
|
-
state.fetch("ValueAsString", nil)
|
87
|
+
state.fetch("ValueAsString", nil),
|
88
88
|
]
|
89
89
|
end
|
90
90
|
.then { |data| State.new(data) }
|
@@ -146,6 +146,8 @@ module Zaptec
|
|
146
146
|
|
147
147
|
retry
|
148
148
|
end
|
149
|
+
rescue Faraday::ForbiddenError => e
|
150
|
+
raise Errors::Forbidden, "Access denied to charger"
|
149
151
|
rescue Faraday::Error => e
|
150
152
|
raise Errors::RequestFailed.new("Request returned status #{e.response_status}", e.response)
|
151
153
|
end
|
@@ -176,7 +178,7 @@ module Zaptec
|
|
176
178
|
@token_cache.write(
|
177
179
|
TOKENS_CACHE_KEY,
|
178
180
|
@encryptor.encrypt(request_access_token.to_json, cipher_options: { deterministic: true }),
|
179
|
-
expires_in: 1.day
|
181
|
+
expires_in: 1.day,
|
180
182
|
)
|
181
183
|
rescue Faraday::Error => e
|
182
184
|
raise Errors::RequestFailed.new("Request returned status #{e.response_status}", e.response)
|
data/lib/zaptec/constants.rb
CHANGED
@@ -15,6 +15,13 @@ module Zaptec
|
|
15
15
|
.then { |name, _mode| name }
|
16
16
|
end
|
17
17
|
|
18
|
+
def charger_operation_mode_name_to_mode(operation_mode_name)
|
19
|
+
constants
|
20
|
+
.fetch("ChargerOperationModes")
|
21
|
+
.detect { |name, _mode| name == operation_mode_name.to_s }
|
22
|
+
.then { |_name, mode| mode }
|
23
|
+
end
|
24
|
+
|
18
25
|
def command_to_command_id(command)
|
19
26
|
constants
|
20
27
|
.fetch("Commands")
|
data/lib/zaptec/credentials.rb
CHANGED
data/lib/zaptec/errors.rb
CHANGED
data/lib/zaptec/meter_reading.rb
CHANGED
@@ -1,10 +1,46 @@
|
|
1
1
|
module Zaptec
|
2
2
|
class MeterReading
|
3
|
+
GOOD = "G".freeze
|
4
|
+
KWH = "kWh".freeze
|
5
|
+
READINGS = "RD".freeze
|
6
|
+
STATUS = "ST".freeze
|
7
|
+
TIMESTAMP = "TM".freeze
|
8
|
+
UNIT = "RU".freeze
|
9
|
+
VALUE = "RV".freeze
|
10
|
+
WH = "Wh".freeze
|
11
|
+
|
12
|
+
# https://github.com/SAFE-eV/OCMF-Open-Charge-Metering-Format/blob/master/OCMF-de.md#json-basiertes-ocmf-format
|
3
13
|
attr_reader :reading_kwh, :timestamp
|
4
14
|
|
5
15
|
def initialize(reading_kwh:, timestamp:)
|
6
16
|
@reading_kwh = reading_kwh
|
7
17
|
@timestamp = timestamp
|
8
18
|
end
|
19
|
+
|
20
|
+
class << self
|
21
|
+
def parse(ocmf_meter_reading)
|
22
|
+
_prefix, json_payload, _signature = ocmf_meter_reading.split("|")
|
23
|
+
|
24
|
+
data = JSON.parse(json_payload)
|
25
|
+
|
26
|
+
meter_reading = data.fetch(READINGS).detect do |reading|
|
27
|
+
reading.fetch(STATUS) == GOOD && reading[UNIT].in?([WH, KWH])
|
28
|
+
end
|
29
|
+
|
30
|
+
return if meter_reading.blank?
|
31
|
+
|
32
|
+
timestamp = Time.zone.parse(meter_reading.fetch(TIMESTAMP).split.first)
|
33
|
+
|
34
|
+
kwh_magnitude =
|
35
|
+
case meter_reading.fetch(UNIT)
|
36
|
+
when KWH then 1
|
37
|
+
when WH then 1000.0
|
38
|
+
end
|
39
|
+
|
40
|
+
reading_kwh = meter_reading.fetch(VALUE) / kwh_magnitude
|
41
|
+
|
42
|
+
new(reading_kwh:, timestamp:)
|
43
|
+
end
|
44
|
+
end
|
9
45
|
end
|
10
46
|
end
|
data/lib/zaptec/state.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
module Zaptec
|
2
2
|
class State
|
3
|
-
|
3
|
+
CONNECTED_REQUESTING = "Connected_Requesting".freeze
|
4
|
+
CONNECTED_CHARGING = "Connected_Charging".freeze
|
4
5
|
DISCONNECTED = "Disconnected".freeze
|
6
|
+
CHARGING_MODES = [CONNECTED_CHARGING, CONNECTED_REQUESTING].freeze
|
5
7
|
|
6
8
|
def initialize(data)
|
7
9
|
@data = data
|
@@ -20,7 +22,7 @@ module Zaptec
|
|
20
22
|
def online? = @data.fetch(:IsOnline).to_i.positive?
|
21
23
|
|
22
24
|
def meter_reading
|
23
|
-
@meter_reading ||= MeterReading.
|
25
|
+
@meter_reading ||= MeterReading.parse(@data.fetch(:SignedMeterValue))
|
24
26
|
end
|
25
27
|
|
26
28
|
private
|
data/lib/zaptec/version.rb
CHANGED
data/zaptec.gemspec
CHANGED
@@ -28,7 +28,6 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_runtime_dependency "activemodel"
|
29
29
|
spec.add_runtime_dependency "activesupport"
|
30
30
|
spec.add_runtime_dependency "faraday"
|
31
|
-
spec.add_runtime_dependency "faraday_middleware"
|
32
31
|
|
33
32
|
spec.metadata["rubygems_mfa_required"] = "true"
|
34
33
|
end
|