edilkamin 1.10.0 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/cli.js +105 -0
- package/dist/cjs/src/index.d.ts +3 -2
- package/dist/cjs/src/index.js +5 -1
- package/dist/cjs/src/library.d.ts +26 -1
- package/dist/cjs/src/library.js +219 -1
- package/dist/cjs/src/library.test.js +356 -0
- package/dist/cjs/src/types.d.ts +127 -1
- package/dist/cjs/src/types.js +64 -0
- package/dist/esm/package.json +1 -1
- package/dist/esm/src/cli.js +105 -0
- package/dist/esm/src/index.d.ts +3 -2
- package/dist/esm/src/index.js +2 -1
- package/dist/esm/src/library.d.ts +26 -1
- package/dist/esm/src/library.js +217 -0
- package/dist/esm/src/library.test.js +357 -1
- package/dist/esm/src/types.d.ts +127 -1
- package/dist/esm/src/types.js +63 -1
- package/package.json +1 -1
- package/src/cli.ts +156 -0
- package/src/index.ts +11 -1
- package/src/library.test.ts +463 -1
- package/src/library.ts +279 -0
- package/src/types.ts +180 -0
package/src/library.ts
CHANGED
|
@@ -6,11 +6,18 @@ import { cognitoUserPoolsTokenProvider } from "aws-amplify/auth/cognito";
|
|
|
6
6
|
import { processResponse } from "./buffer-utils";
|
|
7
7
|
import { API_URL } from "./constants";
|
|
8
8
|
import {
|
|
9
|
+
AlarmsLogType,
|
|
9
10
|
DeviceAssociationBody,
|
|
10
11
|
DeviceAssociationResponse,
|
|
11
12
|
DeviceInfoRawType,
|
|
12
13
|
DeviceInfoType,
|
|
13
14
|
EditDeviceAssociationBody,
|
|
15
|
+
PowerDistributionType,
|
|
16
|
+
RegenerationDataType,
|
|
17
|
+
ServiceCountersType,
|
|
18
|
+
ServiceStatusType,
|
|
19
|
+
TotalCountersType,
|
|
20
|
+
UsageAnalyticsType,
|
|
14
21
|
} from "./types";
|
|
15
22
|
|
|
16
23
|
/**
|
|
@@ -624,6 +631,267 @@ const getPelletAutonomyTime =
|
|
|
624
631
|
return info.status.pellet.autonomy_time;
|
|
625
632
|
};
|
|
626
633
|
|
|
634
|
+
const getTotalCounters =
|
|
635
|
+
(baseURL: string) =>
|
|
636
|
+
/**
|
|
637
|
+
* Retrieves lifetime operating counters.
|
|
638
|
+
* Includes power-on count and runtime hours per power level.
|
|
639
|
+
* These counters are never reset.
|
|
640
|
+
*
|
|
641
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
642
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
643
|
+
* @returns {Promise<TotalCountersType>} - Lifetime operating statistics.
|
|
644
|
+
*/
|
|
645
|
+
async (jwtToken: string, macAddress: string): Promise<TotalCountersType> => {
|
|
646
|
+
const info = await deviceInfo(baseURL)(jwtToken, macAddress);
|
|
647
|
+
return info.nvm.total_counters;
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
const getServiceCounters =
|
|
651
|
+
(baseURL: string) =>
|
|
652
|
+
/**
|
|
653
|
+
* Retrieves service counters (runtime since last maintenance).
|
|
654
|
+
* These counters track hours per power level since last service reset.
|
|
655
|
+
*
|
|
656
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
657
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
658
|
+
* @returns {Promise<ServiceCountersType>} - Service tracking statistics.
|
|
659
|
+
*/
|
|
660
|
+
async (
|
|
661
|
+
jwtToken: string,
|
|
662
|
+
macAddress: string,
|
|
663
|
+
): Promise<ServiceCountersType> => {
|
|
664
|
+
const info = await deviceInfo(baseURL)(jwtToken, macAddress);
|
|
665
|
+
return info.nvm.service_counters;
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
const getAlarmHistory =
|
|
669
|
+
(baseURL: string) =>
|
|
670
|
+
/**
|
|
671
|
+
* Retrieves the alarm history log.
|
|
672
|
+
* Contains a circular buffer of recent alarms with timestamps.
|
|
673
|
+
*
|
|
674
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
675
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
676
|
+
* @returns {Promise<AlarmsLogType>} - Alarm history log.
|
|
677
|
+
*/
|
|
678
|
+
async (jwtToken: string, macAddress: string): Promise<AlarmsLogType> => {
|
|
679
|
+
const info = await deviceInfo(baseURL)(jwtToken, macAddress);
|
|
680
|
+
return info.nvm.alarms_log;
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
const getRegenerationData =
|
|
684
|
+
(baseURL: string) =>
|
|
685
|
+
/**
|
|
686
|
+
* Retrieves regeneration and maintenance data.
|
|
687
|
+
* Includes blackout counter and last intervention timestamp.
|
|
688
|
+
*
|
|
689
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
690
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
691
|
+
* @returns {Promise<RegenerationDataType>} - Maintenance tracking data.
|
|
692
|
+
*/
|
|
693
|
+
async (
|
|
694
|
+
jwtToken: string,
|
|
695
|
+
macAddress: string,
|
|
696
|
+
): Promise<RegenerationDataType> => {
|
|
697
|
+
const info = await deviceInfo(baseURL)(jwtToken, macAddress);
|
|
698
|
+
return info.nvm.regeneration;
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
const getServiceTime =
|
|
702
|
+
(baseURL: string) =>
|
|
703
|
+
/**
|
|
704
|
+
* Retrieves the total service time in hours.
|
|
705
|
+
*
|
|
706
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
707
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
708
|
+
* @returns {Promise<number>} - Total service hours.
|
|
709
|
+
*/
|
|
710
|
+
async (jwtToken: string, macAddress: string): Promise<number> => {
|
|
711
|
+
const info = await deviceInfo(baseURL)(jwtToken, macAddress);
|
|
712
|
+
return info.status.counters.service_time;
|
|
713
|
+
};
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Default service threshold in hours (from OEM parameters).
|
|
717
|
+
* Most devices use 2000 hours.
|
|
718
|
+
*/
|
|
719
|
+
const DEFAULT_SERVICE_THRESHOLD = 2000;
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Derives usage analytics from an existing DeviceInfo response.
|
|
723
|
+
* This is a pure function that performs client-side calculations without API calls.
|
|
724
|
+
*
|
|
725
|
+
* Use this when you already have a DeviceInfo object (e.g., from a previous deviceInfo() call)
|
|
726
|
+
* to avoid making an additional API request.
|
|
727
|
+
*
|
|
728
|
+
* @param {DeviceInfoType} deviceInfo - The device info response object.
|
|
729
|
+
* @param {number} [serviceThreshold=2000] - Service threshold in hours.
|
|
730
|
+
* @returns {UsageAnalyticsType} - Comprehensive usage analytics.
|
|
731
|
+
*
|
|
732
|
+
* @example
|
|
733
|
+
* const info = await api.deviceInfo(token, mac);
|
|
734
|
+
* const analytics = deriveUsageAnalytics(info);
|
|
735
|
+
*/
|
|
736
|
+
export const deriveUsageAnalytics = (
|
|
737
|
+
deviceInfo: DeviceInfoType,
|
|
738
|
+
serviceThreshold: number = DEFAULT_SERVICE_THRESHOLD,
|
|
739
|
+
): UsageAnalyticsType => {
|
|
740
|
+
const totalCounters = deviceInfo.nvm.total_counters;
|
|
741
|
+
const serviceCounters = deviceInfo.nvm.service_counters;
|
|
742
|
+
const regeneration = deviceInfo.nvm.regeneration;
|
|
743
|
+
const alarmsLog = deviceInfo.nvm.alarms_log;
|
|
744
|
+
|
|
745
|
+
const totalOperatingHours =
|
|
746
|
+
totalCounters.p1_working_time +
|
|
747
|
+
totalCounters.p2_working_time +
|
|
748
|
+
totalCounters.p3_working_time +
|
|
749
|
+
totalCounters.p4_working_time +
|
|
750
|
+
totalCounters.p5_working_time;
|
|
751
|
+
|
|
752
|
+
const hoursSinceService =
|
|
753
|
+
serviceCounters.p1_working_time +
|
|
754
|
+
serviceCounters.p2_working_time +
|
|
755
|
+
serviceCounters.p3_working_time +
|
|
756
|
+
serviceCounters.p4_working_time +
|
|
757
|
+
serviceCounters.p5_working_time;
|
|
758
|
+
|
|
759
|
+
const powerDistribution: PowerDistributionType =
|
|
760
|
+
totalOperatingHours === 0
|
|
761
|
+
? { p1: 0, p2: 0, p3: 0, p4: 0, p5: 0 }
|
|
762
|
+
: {
|
|
763
|
+
p1: (totalCounters.p1_working_time / totalOperatingHours) * 100,
|
|
764
|
+
p2: (totalCounters.p2_working_time / totalOperatingHours) * 100,
|
|
765
|
+
p3: (totalCounters.p3_working_time / totalOperatingHours) * 100,
|
|
766
|
+
p4: (totalCounters.p4_working_time / totalOperatingHours) * 100,
|
|
767
|
+
p5: (totalCounters.p5_working_time / totalOperatingHours) * 100,
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
return {
|
|
771
|
+
totalPowerOns: totalCounters.power_ons,
|
|
772
|
+
totalOperatingHours,
|
|
773
|
+
powerDistribution,
|
|
774
|
+
serviceStatus: {
|
|
775
|
+
totalServiceHours: deviceInfo.status.counters.service_time,
|
|
776
|
+
hoursSinceService,
|
|
777
|
+
serviceThresholdHours: serviceThreshold,
|
|
778
|
+
isServiceDue: hoursSinceService >= serviceThreshold,
|
|
779
|
+
},
|
|
780
|
+
blackoutCount: regeneration.blackout_counter,
|
|
781
|
+
lastMaintenanceDate:
|
|
782
|
+
regeneration.last_intervention > 0
|
|
783
|
+
? new Date(regeneration.last_intervention * 1000)
|
|
784
|
+
: null,
|
|
785
|
+
alarmCount: alarmsLog.number,
|
|
786
|
+
};
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
const getTotalOperatingHours =
|
|
790
|
+
(baseURL: string) =>
|
|
791
|
+
/**
|
|
792
|
+
* Calculates total operating hours across all power levels.
|
|
793
|
+
*
|
|
794
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
795
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
796
|
+
* @returns {Promise<number>} - Total operating hours.
|
|
797
|
+
*/
|
|
798
|
+
async (jwtToken: string, macAddress: string): Promise<number> => {
|
|
799
|
+
const counters = await getTotalCounters(baseURL)(jwtToken, macAddress);
|
|
800
|
+
return (
|
|
801
|
+
counters.p1_working_time +
|
|
802
|
+
counters.p2_working_time +
|
|
803
|
+
counters.p3_working_time +
|
|
804
|
+
counters.p4_working_time +
|
|
805
|
+
counters.p5_working_time
|
|
806
|
+
);
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
const getPowerDistribution =
|
|
810
|
+
(baseURL: string) =>
|
|
811
|
+
/**
|
|
812
|
+
* Calculates power level usage distribution as percentages.
|
|
813
|
+
*
|
|
814
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
815
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
816
|
+
* @returns {Promise<PowerDistributionType>} - Percentage time at each power level.
|
|
817
|
+
*/
|
|
818
|
+
async (
|
|
819
|
+
jwtToken: string,
|
|
820
|
+
macAddress: string,
|
|
821
|
+
): Promise<PowerDistributionType> => {
|
|
822
|
+
const counters = await getTotalCounters(baseURL)(jwtToken, macAddress);
|
|
823
|
+
const total =
|
|
824
|
+
counters.p1_working_time +
|
|
825
|
+
counters.p2_working_time +
|
|
826
|
+
counters.p3_working_time +
|
|
827
|
+
counters.p4_working_time +
|
|
828
|
+
counters.p5_working_time;
|
|
829
|
+
|
|
830
|
+
if (total === 0) {
|
|
831
|
+
return { p1: 0, p2: 0, p3: 0, p4: 0, p5: 0 };
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
return {
|
|
835
|
+
p1: (counters.p1_working_time / total) * 100,
|
|
836
|
+
p2: (counters.p2_working_time / total) * 100,
|
|
837
|
+
p3: (counters.p3_working_time / total) * 100,
|
|
838
|
+
p4: (counters.p4_working_time / total) * 100,
|
|
839
|
+
p5: (counters.p5_working_time / total) * 100,
|
|
840
|
+
};
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
const getServiceStatus =
|
|
844
|
+
(baseURL: string) =>
|
|
845
|
+
/**
|
|
846
|
+
* Calculates service status including whether maintenance is due.
|
|
847
|
+
*
|
|
848
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
849
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
850
|
+
* @param {number} [thresholdHours=2000] - Service threshold in hours.
|
|
851
|
+
* @returns {Promise<ServiceStatusType>} - Service status with computed fields.
|
|
852
|
+
*/
|
|
853
|
+
async (
|
|
854
|
+
jwtToken: string,
|
|
855
|
+
macAddress: string,
|
|
856
|
+
thresholdHours: number = DEFAULT_SERVICE_THRESHOLD,
|
|
857
|
+
): Promise<ServiceStatusType> => {
|
|
858
|
+
const info = await deviceInfo(baseURL)(jwtToken, macAddress);
|
|
859
|
+
const serviceCounters = info.nvm.service_counters;
|
|
860
|
+
const hoursSinceService =
|
|
861
|
+
serviceCounters.p1_working_time +
|
|
862
|
+
serviceCounters.p2_working_time +
|
|
863
|
+
serviceCounters.p3_working_time +
|
|
864
|
+
serviceCounters.p4_working_time +
|
|
865
|
+
serviceCounters.p5_working_time;
|
|
866
|
+
|
|
867
|
+
return {
|
|
868
|
+
totalServiceHours: info.status.counters.service_time,
|
|
869
|
+
hoursSinceService,
|
|
870
|
+
serviceThresholdHours: thresholdHours,
|
|
871
|
+
isServiceDue: hoursSinceService >= thresholdHours,
|
|
872
|
+
};
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
const getUsageAnalytics =
|
|
876
|
+
(baseURL: string) =>
|
|
877
|
+
/**
|
|
878
|
+
* Retrieves comprehensive usage analytics in a single call.
|
|
879
|
+
* Combines multiple statistics into a unified analytics object.
|
|
880
|
+
*
|
|
881
|
+
* @param {string} jwtToken - The JWT token for authentication.
|
|
882
|
+
* @param {string} macAddress - The MAC address of the device.
|
|
883
|
+
* @param {number} [serviceThreshold=2000] - Service threshold in hours.
|
|
884
|
+
* @returns {Promise<UsageAnalyticsType>} - Comprehensive usage analytics.
|
|
885
|
+
*/
|
|
886
|
+
async (
|
|
887
|
+
jwtToken: string,
|
|
888
|
+
macAddress: string,
|
|
889
|
+
serviceThreshold: number = DEFAULT_SERVICE_THRESHOLD,
|
|
890
|
+
): Promise<UsageAnalyticsType> => {
|
|
891
|
+
const info = await deviceInfo(baseURL)(jwtToken, macAddress);
|
|
892
|
+
return deriveUsageAnalytics(info, serviceThreshold);
|
|
893
|
+
};
|
|
894
|
+
|
|
627
895
|
const registerDevice =
|
|
628
896
|
(baseURL: string) =>
|
|
629
897
|
/**
|
|
@@ -748,6 +1016,17 @@ const configure = (baseURL: string = API_URL) => ({
|
|
|
748
1016
|
getLanguage: getLanguage(baseURL),
|
|
749
1017
|
getPelletInReserve: getPelletInReserve(baseURL),
|
|
750
1018
|
getPelletAutonomyTime: getPelletAutonomyTime(baseURL),
|
|
1019
|
+
// Statistics getters
|
|
1020
|
+
getTotalCounters: getTotalCounters(baseURL),
|
|
1021
|
+
getServiceCounters: getServiceCounters(baseURL),
|
|
1022
|
+
getAlarmHistory: getAlarmHistory(baseURL),
|
|
1023
|
+
getRegenerationData: getRegenerationData(baseURL),
|
|
1024
|
+
getServiceTime: getServiceTime(baseURL),
|
|
1025
|
+
// Analytics functions
|
|
1026
|
+
getTotalOperatingHours: getTotalOperatingHours(baseURL),
|
|
1027
|
+
getPowerDistribution: getPowerDistribution(baseURL),
|
|
1028
|
+
getServiceStatus: getServiceStatus(baseURL),
|
|
1029
|
+
getUsageAnalytics: getUsageAnalytics(baseURL),
|
|
751
1030
|
});
|
|
752
1031
|
|
|
753
1032
|
export {
|
package/src/types.ts
CHANGED
|
@@ -24,11 +24,19 @@ interface PelletAutonomyType {
|
|
|
24
24
|
autonomy_time: number;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Status counters including service time.
|
|
29
|
+
*/
|
|
30
|
+
interface StatusCountersType {
|
|
31
|
+
service_time: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
27
34
|
interface StatusType {
|
|
28
35
|
commands: CommandsType;
|
|
29
36
|
temperatures: TemperaturesType;
|
|
30
37
|
flags: GeneralFlagsType;
|
|
31
38
|
pellet: PelletAutonomyType;
|
|
39
|
+
counters: StatusCountersType;
|
|
32
40
|
}
|
|
33
41
|
|
|
34
42
|
interface UserParametersType {
|
|
@@ -47,10 +55,171 @@ interface UserParametersType {
|
|
|
47
55
|
language: number;
|
|
48
56
|
}
|
|
49
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Lifetime operating counters - never reset.
|
|
60
|
+
* Tracks total power-on cycles and runtime hours per power level.
|
|
61
|
+
*/
|
|
62
|
+
interface TotalCountersType {
|
|
63
|
+
power_ons: number;
|
|
64
|
+
p1_working_time: number;
|
|
65
|
+
p2_working_time: number;
|
|
66
|
+
p3_working_time: number;
|
|
67
|
+
p4_working_time: number;
|
|
68
|
+
p5_working_time: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Service counters - reset after maintenance.
|
|
73
|
+
* Tracks runtime hours per power level since last service.
|
|
74
|
+
*/
|
|
75
|
+
interface ServiceCountersType {
|
|
76
|
+
p1_working_time: number;
|
|
77
|
+
p2_working_time: number;
|
|
78
|
+
p3_working_time: number;
|
|
79
|
+
p4_working_time: number;
|
|
80
|
+
p5_working_time: number;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Individual alarm entry from the alarm history log.
|
|
85
|
+
*/
|
|
86
|
+
interface AlarmEntryType {
|
|
87
|
+
type: number;
|
|
88
|
+
timestamp: number;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Alarm history log - circular buffer of recent alarms.
|
|
93
|
+
*/
|
|
94
|
+
interface AlarmsLogType {
|
|
95
|
+
number: number;
|
|
96
|
+
index: number;
|
|
97
|
+
alarms: AlarmEntryType[];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Regeneration and maintenance tracking data.
|
|
102
|
+
*/
|
|
103
|
+
interface RegenerationDataType {
|
|
104
|
+
time: number;
|
|
105
|
+
last_intervention: number;
|
|
106
|
+
daylight_time_flag: number;
|
|
107
|
+
blackout_counter: number;
|
|
108
|
+
airkare_working_hours_counter: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Power level distribution as percentages.
|
|
113
|
+
*/
|
|
114
|
+
interface PowerDistributionType {
|
|
115
|
+
p1: number;
|
|
116
|
+
p2: number;
|
|
117
|
+
p3: number;
|
|
118
|
+
p4: number;
|
|
119
|
+
p5: number;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Service status with computed fields.
|
|
124
|
+
*/
|
|
125
|
+
interface ServiceStatusType {
|
|
126
|
+
totalServiceHours: number;
|
|
127
|
+
hoursSinceService: number;
|
|
128
|
+
serviceThresholdHours: number;
|
|
129
|
+
isServiceDue: boolean;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Comprehensive usage analytics.
|
|
134
|
+
*/
|
|
135
|
+
interface UsageAnalyticsType {
|
|
136
|
+
totalPowerOns: number;
|
|
137
|
+
totalOperatingHours: number;
|
|
138
|
+
powerDistribution: PowerDistributionType;
|
|
139
|
+
serviceStatus: ServiceStatusType;
|
|
140
|
+
blackoutCount: number;
|
|
141
|
+
lastMaintenanceDate: Date | null;
|
|
142
|
+
alarmCount: number;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Alarm type codes from Edilkamin devices.
|
|
147
|
+
* Based on AlarmsEnum.java from Android app (version 1.3.1-RC2 released 2025/12/10).
|
|
148
|
+
*/
|
|
149
|
+
enum AlarmCode {
|
|
150
|
+
NONE = 0,
|
|
151
|
+
FLUE_BLOCK = 1,
|
|
152
|
+
SMOKE_EXTRACTOR_FAILURE = 2,
|
|
153
|
+
END_PELLET = 3,
|
|
154
|
+
MISSING_LIGHTING = 4,
|
|
155
|
+
NO_NAME_ALARM = 5,
|
|
156
|
+
SMOKE_PROBE_FAILURE = 6,
|
|
157
|
+
FUMES_OVERTEMPERATURE = 7,
|
|
158
|
+
PELLET_TANK_SAFETY_THERMOSTAT = 8,
|
|
159
|
+
GEAR_MOTOR_FAILURE = 9,
|
|
160
|
+
BOARD_OVER_TEMPERATURE = 10,
|
|
161
|
+
SAFETY_PRESSURE_SWITCH_INTERVENTION = 11,
|
|
162
|
+
ROOM_PROBE_FAILURE = 12,
|
|
163
|
+
ROOM_PROBE_2_OR_BOILER_PROBE_FAILURE = 13,
|
|
164
|
+
ROOM_PROBE_3_OR_BOILER_PROBE_FAILURE = 14,
|
|
165
|
+
WATER_EARTHQUAKE_SAFETY_THERMOSTAT_INTERVENTION = 15,
|
|
166
|
+
WATER_PRESSURE_TRANSDUCER_FAILURE = 16,
|
|
167
|
+
OUTSIDE_PROBE_OR_LOW_STORAGE_PROBE_FAILURE = 17,
|
|
168
|
+
PUFFER_PROBE_FAILURE = 18,
|
|
169
|
+
CRUCIBLE_CLEANING_FAILURE = 19,
|
|
170
|
+
TRIAC_FAILURE = 20,
|
|
171
|
+
BLACKOUT = 21,
|
|
172
|
+
OPEN_DOOR = 22,
|
|
173
|
+
OVERTEMPERATURE_PANEL = 23,
|
|
174
|
+
BOARD_FUSE = 24,
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Human-readable descriptions for alarm codes.
|
|
179
|
+
*/
|
|
180
|
+
const AlarmDescriptions: Record<AlarmCode, string> = {
|
|
181
|
+
[AlarmCode.NONE]: "No alarm",
|
|
182
|
+
[AlarmCode.FLUE_BLOCK]: "Flue/chimney blockage",
|
|
183
|
+
[AlarmCode.SMOKE_EXTRACTOR_FAILURE]: "Smoke extractor motor failure",
|
|
184
|
+
[AlarmCode.END_PELLET]: "Pellet tank empty",
|
|
185
|
+
[AlarmCode.MISSING_LIGHTING]: "Ignition failure",
|
|
186
|
+
[AlarmCode.NO_NAME_ALARM]: "Unnamed alarm",
|
|
187
|
+
[AlarmCode.SMOKE_PROBE_FAILURE]: "Smoke temperature probe failure",
|
|
188
|
+
[AlarmCode.FUMES_OVERTEMPERATURE]: "Exhaust overtemperature",
|
|
189
|
+
[AlarmCode.PELLET_TANK_SAFETY_THERMOSTAT]:
|
|
190
|
+
"Pellet tank safety thermostat triggered",
|
|
191
|
+
[AlarmCode.GEAR_MOTOR_FAILURE]: "Gear motor/auger failure",
|
|
192
|
+
[AlarmCode.BOARD_OVER_TEMPERATURE]: "Control board overtemperature",
|
|
193
|
+
[AlarmCode.SAFETY_PRESSURE_SWITCH_INTERVENTION]:
|
|
194
|
+
"Safety pressure switch activated",
|
|
195
|
+
[AlarmCode.ROOM_PROBE_FAILURE]: "Room temperature probe failure",
|
|
196
|
+
[AlarmCode.ROOM_PROBE_2_OR_BOILER_PROBE_FAILURE]:
|
|
197
|
+
"Room probe 2 or boiler probe failure",
|
|
198
|
+
[AlarmCode.ROOM_PROBE_3_OR_BOILER_PROBE_FAILURE]:
|
|
199
|
+
"Room probe 3 or boiler probe failure",
|
|
200
|
+
[AlarmCode.WATER_EARTHQUAKE_SAFETY_THERMOSTAT_INTERVENTION]:
|
|
201
|
+
"Water/earthquake safety thermostat",
|
|
202
|
+
[AlarmCode.WATER_PRESSURE_TRANSDUCER_FAILURE]:
|
|
203
|
+
"Water pressure transducer failure",
|
|
204
|
+
[AlarmCode.OUTSIDE_PROBE_OR_LOW_STORAGE_PROBE_FAILURE]:
|
|
205
|
+
"Outside probe or low storage probe failure",
|
|
206
|
+
[AlarmCode.PUFFER_PROBE_FAILURE]: "Buffer tank probe failure",
|
|
207
|
+
[AlarmCode.CRUCIBLE_CLEANING_FAILURE]: "Crucible cleaning failure",
|
|
208
|
+
[AlarmCode.TRIAC_FAILURE]: "Power control (TRIAC) failure",
|
|
209
|
+
[AlarmCode.BLACKOUT]: "Power outage detected",
|
|
210
|
+
[AlarmCode.OPEN_DOOR]: "Door open alarm",
|
|
211
|
+
[AlarmCode.OVERTEMPERATURE_PANEL]: "Panel overtemperature",
|
|
212
|
+
[AlarmCode.BOARD_FUSE]: "Control board fuse issue",
|
|
213
|
+
};
|
|
214
|
+
|
|
50
215
|
interface DeviceInfoType {
|
|
51
216
|
status: StatusType;
|
|
52
217
|
nvm: {
|
|
53
218
|
user_parameters: UserParametersType;
|
|
219
|
+
total_counters: TotalCountersType;
|
|
220
|
+
service_counters: ServiceCountersType;
|
|
221
|
+
alarms_log: AlarmsLogType;
|
|
222
|
+
regeneration: RegenerationDataType;
|
|
54
223
|
};
|
|
55
224
|
}
|
|
56
225
|
|
|
@@ -115,6 +284,8 @@ interface DiscoveredDevice {
|
|
|
115
284
|
}
|
|
116
285
|
|
|
117
286
|
export type {
|
|
287
|
+
AlarmEntryType,
|
|
288
|
+
AlarmsLogType,
|
|
118
289
|
BufferEncodedType,
|
|
119
290
|
CommandsType,
|
|
120
291
|
DeviceAssociationBody,
|
|
@@ -125,7 +296,16 @@ export type {
|
|
|
125
296
|
EditDeviceAssociationBody,
|
|
126
297
|
GeneralFlagsType,
|
|
127
298
|
PelletAutonomyType,
|
|
299
|
+
PowerDistributionType,
|
|
300
|
+
RegenerationDataType,
|
|
301
|
+
ServiceCountersType,
|
|
302
|
+
ServiceStatusType,
|
|
303
|
+
StatusCountersType,
|
|
128
304
|
StatusType,
|
|
129
305
|
TemperaturesType,
|
|
306
|
+
TotalCountersType,
|
|
307
|
+
UsageAnalyticsType,
|
|
130
308
|
UserParametersType,
|
|
131
309
|
};
|
|
310
|
+
|
|
311
|
+
export { AlarmCode, AlarmDescriptions };
|