homematic-manager 3.4.1 → 3.4.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/node_modules/@homematic-manager/backend/package.json +1 -1
- package/node_modules/@homematic-manager/core/dist/data/types.d.ts +6 -0
- package/node_modules/@homematic-manager/core/dist/easymodes/engine.d.ts +2 -1
- package/node_modules/@homematic-manager/core/dist/easymodes/engine.js +16 -7
- package/node_modules/@homematic-manager/core/dist/easymodes/legacyValues.d.ts +28 -0
- package/node_modules/@homematic-manager/core/dist/easymodes/legacyValues.js +97 -0
- package/node_modules/@homematic-manager/core/dist/easymodes/senderForms.d.ts +101 -0
- package/node_modules/@homematic-manager/core/dist/easymodes/senderForms.js +251 -0
- package/node_modules/@homematic-manager/core/dist/index.d.ts +2 -0
- package/node_modules/@homematic-manager/core/dist/index.js +2 -0
- package/node_modules/@homematic-manager/core/package.json +1 -1
- package/package.json +4 -4
- package/ui/assets/{index-D94DHu87.css → index-BOEXCG42.css} +1 -1
- package/ui/assets/index-Fj6yr6EG.js +21 -0
- package/ui/index.html +2 -2
- package/ui/assets/index-j1HvLwHX.js +0 -21
|
@@ -50,6 +50,12 @@ export interface LinkProfile {
|
|
|
50
50
|
* dialog then shows every parameter.
|
|
51
51
|
*/
|
|
52
52
|
controls?: EasyControl[];
|
|
53
|
+
/**
|
|
54
|
+
* B-98: values an older WebUI wrote for a parameter of this profile (`LONG_PROFILE_ACTION_TYPE` 5
|
|
55
|
+
* of the shutter profiles before June 2026). Detection takes them only where no profile fits the
|
|
56
|
+
* link as the data has it; applying the profile keeps such a value where the link holds it.
|
|
57
|
+
*/
|
|
58
|
+
legacy?: Record<string, Array<number | string | boolean>>;
|
|
53
59
|
}
|
|
54
60
|
/**
|
|
55
61
|
* One control of the CCU easy mode's form of a profile (task 62). `requires` lists parameters the
|
|
@@ -123,7 +123,8 @@ export declare class EasyModeEngine {
|
|
|
123
123
|
/**
|
|
124
124
|
* The profiles a receiver channel type offers for a given sender channel type, expert first.
|
|
125
125
|
* Aliases are followed (`OPTICAL_SIGNAL_RECEIVER` -> `DIMMER_VIRTUAL_RECEIVER` -> `DIMMER`),
|
|
126
|
-
* and the expert profile is always present even when the data does not carry it.
|
|
126
|
+
* and the expert profile is always present even when the data does not carry it. B-98: where
|
|
127
|
+
* eQ-3 changed a profile, it also takes what the older WebUI wrote ({@link withLegacyValues}).
|
|
127
128
|
*/
|
|
128
129
|
profilesFor(receiverType: string, senderType: string): Promise<LinkProfile[]>;
|
|
129
130
|
/**
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* values for a delay or a level, and rules between parameters.
|
|
13
13
|
*/
|
|
14
14
|
import { parameterOrder } from '../paramset/description.js';
|
|
15
|
+
import { legacyProfile, withLegacyValues } from './legacyValues.js';
|
|
15
16
|
/** The parameter the CCU stores the chosen profile in, inside the receiver's LINK paramset. */
|
|
16
17
|
export const UI_HINT = 'UI_HINT';
|
|
17
18
|
/** Profile 0 is the expert view: no constraints, every parameter editable. */
|
|
@@ -92,13 +93,15 @@ export class EasyModeEngine {
|
|
|
92
93
|
/**
|
|
93
94
|
* The profiles a receiver channel type offers for a given sender channel type, expert first.
|
|
94
95
|
* Aliases are followed (`OPTICAL_SIGNAL_RECEIVER` -> `DIMMER_VIRTUAL_RECEIVER` -> `DIMMER`),
|
|
95
|
-
* and the expert profile is always present even when the data does not carry it.
|
|
96
|
+
* and the expert profile is always present even when the data does not carry it. B-98: where
|
|
97
|
+
* eQ-3 changed a profile, it also takes what the older WebUI wrote ({@link withLegacyValues}).
|
|
96
98
|
*/
|
|
97
99
|
async profilesFor(receiverType, senderType) {
|
|
98
100
|
const aliases = await this.#source.receiverTypeAliases();
|
|
99
101
|
const resolved = resolveAlias(receiverType, aliases);
|
|
100
102
|
const profiles = await this.#source.receiverProfiles(resolved);
|
|
101
|
-
|
|
103
|
+
// B-98: the values an older WebUI wrote, for detection where nothing else fits
|
|
104
|
+
const list = withLegacyValues(resolved, senderType, profiles?.senders[senderType] ?? []);
|
|
102
105
|
if (!list.some((profile) => profile.id === EXPERT_PROFILE_ID)) {
|
|
103
106
|
list.push(EXPERT_PROFILE);
|
|
104
107
|
}
|
|
@@ -127,7 +130,9 @@ export class EasyModeEngine {
|
|
|
127
130
|
const keepCurrent = options.keepCurrent ?? true;
|
|
128
131
|
const values = { ...current };
|
|
129
132
|
const problems = [];
|
|
130
|
-
|
|
133
|
+
// B-98: a value an older WebUI wrote stays where the link holds it
|
|
134
|
+
const params = keepCurrent ? legacyProfile(profile).params : profile.params;
|
|
135
|
+
for (const [param, constraint] of Object.entries(params)) {
|
|
131
136
|
if (!(param in description)) {
|
|
132
137
|
problems.push({
|
|
133
138
|
param,
|
|
@@ -181,10 +186,14 @@ export class EasyModeEngine {
|
|
|
181
186
|
return byHint;
|
|
182
187
|
}
|
|
183
188
|
// task 108: the first fitting profile by number, as `get_cur_profile2` breaks on its first match
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
189
|
+
const sorted = [...profiles].sort((a, b) => a.id - b.id);
|
|
190
|
+
const first = sorted.find((profile) => profile.id !== EXPERT_PROFILE_ID && profileFits(profile, linkParamset) !== undefined);
|
|
191
|
+
// B-98: only where nothing fits, a link an older WebUI made (`legacy` values)
|
|
192
|
+
const older = first ??
|
|
193
|
+
sorted.find((profile) => profile.id !== EXPERT_PROFILE_ID &&
|
|
194
|
+
profile.legacy !== undefined &&
|
|
195
|
+
profileFits(legacyProfile(profile), linkParamset) !== undefined);
|
|
196
|
+
return older ?? byHint;
|
|
188
197
|
}
|
|
189
198
|
/**
|
|
190
199
|
* The MASTER paramset of a channel type as the dialog should show it: ordered, with the
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* B-98: what the CCU's WebUI wrote for a profile before eQ-3 changed the profile, so that a link made
|
|
3
|
+
* with the older WebUI is still recognised.
|
|
4
|
+
*
|
|
5
|
+
* On 2026-06-22 eQ-3 changed the long press of the shutter and blind profiles (OpenCCU-Base
|
|
6
|
+
* `src/webui` commit `122e267b`, "Easymode parameter LONG_PROFILE_ACTION_TYPE for blind and jalousie
|
|
7
|
+
* actors changed"): `LONG_PROFILE_ACTION_TYPE` `5` (toggle, last direction) or `{5 1}` became `1`. The
|
|
8
|
+
* profile data follows the new WebUI, so a link a CCU made before - an HmIPW-DRBL4 run as a shutter
|
|
9
|
+
* with "auf / zu & hoch / herunter" holds `5` - fitted none of the profiles and showed as Expert.
|
|
10
|
+
*
|
|
11
|
+
* The profiles of exactly the files eQ-3 changed carry the old values as `legacy`. Detection takes
|
|
12
|
+
* them only where no profile fits the link as the data has it: the current WebUI shows an old
|
|
13
|
+
* "auf / zu & hoch / herunter" link as "Toggle", whose list still takes 5 and whose other presets
|
|
14
|
+
* are the same, and that stays so - but an old "auf / hoch", "zu / herunter" or "Position anfahren"
|
|
15
|
+
* link, which fits nothing, is recognised instead of falling back to Expert. Applying a profile
|
|
16
|
+
* keeps the old value where the link already holds it (nothing to write for a link left as the CCU
|
|
17
|
+
* made it) and writes the new one otherwise, as the current WebUI does.
|
|
18
|
+
*/
|
|
19
|
+
import type { LinkProfile } from '../data/types.js';
|
|
20
|
+
type LegacyValues = Readonly<Record<number, Readonly<Record<string, readonly number[]>>>>;
|
|
21
|
+
/** By receiver folder and sender file: the values the WebUI wrote before the change, per profile. */
|
|
22
|
+
export declare const LEGACY_PROFILE_VALUES: Readonly<Record<string, Readonly<Record<string, LegacyValues>>>>;
|
|
23
|
+
/** The profiles of one receiver folder and sender file, with what the older WebUI wrote as `legacy`. */
|
|
24
|
+
export declare function withLegacyValues(receiverFolder: string, senderFile: string, profiles: readonly LinkProfile[]): LinkProfile[];
|
|
25
|
+
/** A profile whose constraints also hold for its `legacy` values; the current value stays the default. */
|
|
26
|
+
export declare function legacyProfile(profile: LinkProfile): LinkProfile;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=legacyValues.d.ts.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* B-98: what the CCU's WebUI wrote for a profile before eQ-3 changed the profile, so that a link made
|
|
3
|
+
* with the older WebUI is still recognised.
|
|
4
|
+
*
|
|
5
|
+
* On 2026-06-22 eQ-3 changed the long press of the shutter and blind profiles (OpenCCU-Base
|
|
6
|
+
* `src/webui` commit `122e267b`, "Easymode parameter LONG_PROFILE_ACTION_TYPE for blind and jalousie
|
|
7
|
+
* actors changed"): `LONG_PROFILE_ACTION_TYPE` `5` (toggle, last direction) or `{5 1}` became `1`. The
|
|
8
|
+
* profile data follows the new WebUI, so a link a CCU made before - an HmIPW-DRBL4 run as a shutter
|
|
9
|
+
* with "auf / zu & hoch / herunter" holds `5` - fitted none of the profiles and showed as Expert.
|
|
10
|
+
*
|
|
11
|
+
* The profiles of exactly the files eQ-3 changed carry the old values as `legacy`. Detection takes
|
|
12
|
+
* them only where no profile fits the link as the data has it: the current WebUI shows an old
|
|
13
|
+
* "auf / zu & hoch / herunter" link as "Toggle", whose list still takes 5 and whose other presets
|
|
14
|
+
* are the same, and that stays so - but an old "auf / hoch", "zu / herunter" or "Position anfahren"
|
|
15
|
+
* link, which fits nothing, is recognised instead of falling back to Expert. Applying a profile
|
|
16
|
+
* keeps the old value where the link already holds it (nothing to write for a link left as the CCU
|
|
17
|
+
* made it) and writes the new one otherwise, as the current WebUI does.
|
|
18
|
+
*/
|
|
19
|
+
const LONG_PROFILE_ACTION_TYPE = 'LONG_PROFILE_ACTION_TYPE';
|
|
20
|
+
/** SHUTTER_VIRTUAL_RECEIVER: profiles 1, 2, 4 wrote `{5 1}`, profile 3 wrote `5`. */
|
|
21
|
+
const SHUTTER = {
|
|
22
|
+
1: { [LONG_PROFILE_ACTION_TYPE]: [5, 1] },
|
|
23
|
+
2: { [LONG_PROFILE_ACTION_TYPE]: [5, 1] },
|
|
24
|
+
3: { [LONG_PROFILE_ACTION_TYPE]: [5] },
|
|
25
|
+
4: { [LONG_PROFILE_ACTION_TYPE]: [5, 1] },
|
|
26
|
+
};
|
|
27
|
+
/** BLIND_VIRTUAL_RECEIVER: profile 3 wrote `5` or took `{1 5}` / `{5 1}`. */
|
|
28
|
+
const BLIND = { 3: { [LONG_PROFILE_ACTION_TYPE]: [5, 1] } };
|
|
29
|
+
/** By receiver folder and sender file: the values the WebUI wrote before the change, per profile. */
|
|
30
|
+
export const LEGACY_PROFILE_VALUES = {
|
|
31
|
+
SHUTTER_VIRTUAL_RECEIVER: {
|
|
32
|
+
DISPLAY_INPUT_TRANSMITTER: SHUTTER,
|
|
33
|
+
DISPLAY_LEVEL_INPUT_TRANSMITTER: SHUTTER,
|
|
34
|
+
KEY_TRANSCEIVER: SHUTTER,
|
|
35
|
+
MULTI_MODE_INPUT_TRANSMITTER_1: SHUTTER,
|
|
36
|
+
MULTI_MODE_INPUT_TRANSMITTER_3: SHUTTER,
|
|
37
|
+
MULTI_MODE_INPUT_TRANSMITTER_4: SHUTTER,
|
|
38
|
+
},
|
|
39
|
+
BLIND_VIRTUAL_RECEIVER: {
|
|
40
|
+
DISPLAY_INPUT_TRANSMITTER: BLIND,
|
|
41
|
+
DISPLAY_LEVEL_INPUT_TRANSMITTER: BLIND,
|
|
42
|
+
KEY_TRANSCEIVER: BLIND,
|
|
43
|
+
MULTI_MODE_INPUT_TRANSMITTER_1: BLIND,
|
|
44
|
+
MULTI_MODE_INPUT_TRANSMITTER_3: BLIND,
|
|
45
|
+
MULTI_MODE_INPUT_TRANSMITTER_4: BLIND,
|
|
46
|
+
ROTARY_CONTROL_TRANSCEIVER_2: BLIND,
|
|
47
|
+
ROTARY_CONTROL_TRANSCEIVER_3: BLIND,
|
|
48
|
+
SWITCH_TRANSCEIVER: BLIND,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
/** The profiles of one receiver folder and sender file, with what the older WebUI wrote as `legacy`. */
|
|
52
|
+
export function withLegacyValues(receiverFolder, senderFile, profiles) {
|
|
53
|
+
const table = LEGACY_PROFILE_VALUES[receiverFolder]?.[senderFile];
|
|
54
|
+
if (!table) {
|
|
55
|
+
return [...profiles];
|
|
56
|
+
}
|
|
57
|
+
return profiles.map((profile) => {
|
|
58
|
+
const legacy = table[profile.id];
|
|
59
|
+
if (!legacy) {
|
|
60
|
+
return profile;
|
|
61
|
+
}
|
|
62
|
+
const entries = Object.entries(legacy).filter(([param]) => param in profile.params);
|
|
63
|
+
return entries.length === 0
|
|
64
|
+
? profile
|
|
65
|
+
: { ...profile, legacy: Object.fromEntries(entries.map(([param, values]) => [param, [...values]])) };
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/** A profile whose constraints also hold for its `legacy` values; the current value stays the default. */
|
|
69
|
+
export function legacyProfile(profile) {
|
|
70
|
+
if (!profile.legacy) {
|
|
71
|
+
return profile;
|
|
72
|
+
}
|
|
73
|
+
const params = { ...profile.params };
|
|
74
|
+
for (const [param, values] of Object.entries(profile.legacy)) {
|
|
75
|
+
const constraint = params[param];
|
|
76
|
+
if (constraint) {
|
|
77
|
+
params[param] = widened(constraint, values);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return { ...profile, params };
|
|
81
|
+
}
|
|
82
|
+
/** A constraint that also holds for the older WebUI's values; the current value stays the default. */
|
|
83
|
+
function widened(constraint, legacy) {
|
|
84
|
+
switch (constraint.kind) {
|
|
85
|
+
case 'fixed': {
|
|
86
|
+
const values = [constraint.value, ...legacy.filter((value) => value !== constraint.value)];
|
|
87
|
+
return { kind: 'list', values, default: constraint.value };
|
|
88
|
+
}
|
|
89
|
+
case 'list': {
|
|
90
|
+
const extra = legacy.filter((value) => !constraint.values.includes(value));
|
|
91
|
+
return extra.length === 0 ? constraint : { ...constraint, values: [...constraint.values, ...extra] };
|
|
92
|
+
}
|
|
93
|
+
case 'range':
|
|
94
|
+
return constraint;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=legacyValues.js.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task 109: the forms the CCU's WebUI draws for the *sender* side of a link.
|
|
3
|
+
*
|
|
4
|
+
* `ic_setprofiles.cgi` sources `easymodes/<paramid>.tcl` for the sender part of a link, the id being
|
|
5
|
+
* `getParamsetId(<sender>, LINK)`. For almost every sender that file does not exist, or is only a
|
|
6
|
+
* receiver folder's dispatcher, and the sender's LINK parameters - where it has any - are shown raw.
|
|
7
|
+
* Three old BidCos sensors have a form of their own:
|
|
8
|
+
*
|
|
9
|
+
* - `ks550_ch_link` (KS550, HM-WDS100-C6-O) and `wds100_ch_link` (HM-WDS100-C6-O-2): the weather
|
|
10
|
+
* station's storm thresholds, a profile "Sturmschwelle" with the switch-on and switch-off threshold
|
|
11
|
+
* as a Beaufort scale; the HM-WDS100-C6-O-2 copies them into the receiver's `SHORT_COND_VALUE_HI` /
|
|
12
|
+
* `SHORT_COND_VALUE_LO`. Hidden when the receiver is a combination sensor (`WS_CS`).
|
|
13
|
+
* - `wa_od_ch_link` (HM-Sen-Wa-Od, the capacitive filling level sensor): no profile, the upper and
|
|
14
|
+
* lower fill level as a percentage (the raw value is twice it), each switchable off (255).
|
|
15
|
+
*
|
|
16
|
+
* The tables are the WebUI's (`www/config/easymodes`); `data/extracted/easymode_links.json`'s
|
|
17
|
+
* `senders` and `weatherTexts` are extracted from it by `data/scripts/easymode-links.mjs`, and
|
|
18
|
+
* `senderForms.test.ts` fails where this module differs from the extract.
|
|
19
|
+
*/
|
|
20
|
+
import type { Paramset, ParamsetValue } from '../rpc/values.js';
|
|
21
|
+
/** A localised text of the forms: German and English, as the WebUI has them. */
|
|
22
|
+
export interface SenderText {
|
|
23
|
+
readonly de: string;
|
|
24
|
+
readonly en: string;
|
|
25
|
+
}
|
|
26
|
+
/** One entry of a threshold select: the raw value and its Beaufort grade. */
|
|
27
|
+
export interface StormOption {
|
|
28
|
+
readonly value: number;
|
|
29
|
+
/** The Beaufort grade, 0-12 - the index into {@link WIND_FORCE} and {@link WIND_DESCRIPTION}. */
|
|
30
|
+
readonly force: number;
|
|
31
|
+
}
|
|
32
|
+
export interface StormForm {
|
|
33
|
+
readonly kind: 'storm';
|
|
34
|
+
readonly paramsetId: string;
|
|
35
|
+
/** The values the profile "Sturmschwelle" takes for both thresholds (`set range {…}`). */
|
|
36
|
+
readonly range: readonly number[];
|
|
37
|
+
/** What the selects offer, by device type (the HM-WDS100-C6-O-2 has 20 where the others have 25). */
|
|
38
|
+
readonly options: (senderDeviceType: string) => readonly StormOption[];
|
|
39
|
+
/** The receiver parameters the thresholds are copied into, for this sender device type. */
|
|
40
|
+
readonly mirrors: (senderDeviceType: string) => Readonly<Record<string, string>>;
|
|
41
|
+
}
|
|
42
|
+
export interface FillLevelForm {
|
|
43
|
+
readonly kind: 'fillLevel';
|
|
44
|
+
readonly paramsetId: string;
|
|
45
|
+
/** The raw value of a threshold that is switched off. */
|
|
46
|
+
readonly inactive: number;
|
|
47
|
+
/** Raw value per percent: the WebUI shows `100 / (200 / raw)`. */
|
|
48
|
+
readonly perPercent: number;
|
|
49
|
+
}
|
|
50
|
+
export type SenderForm = StormForm | FillLevelForm;
|
|
51
|
+
/** The profile ids of the storm form: the expert view and "Sturmschwelle". */
|
|
52
|
+
export declare const STORM_EXPERT = 0;
|
|
53
|
+
export declare const STORM_THRESHOLD = 1;
|
|
54
|
+
export declare const SENDER_FORMS: Readonly<Record<string, SenderForm>>;
|
|
55
|
+
/** Receivers for which the storm form hides itself ("bei Verknüpfung Wetterstation - Kombisensor sinnlos"). */
|
|
56
|
+
export declare const STORM_HIDDEN_FOR_RECEIVER = "WS_CS";
|
|
57
|
+
/**
|
|
58
|
+
* The sender form of a link: the one the sender's LINK paramset id names, unless that form hides
|
|
59
|
+
* itself for this receiver. `undefined` shows the sender's parameters raw, as before.
|
|
60
|
+
*/
|
|
61
|
+
export declare function senderFormFor(paramsetId: string, receiverType: string): SenderForm | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* The profile of a storm form a link follows, as `get_cur_profile2` decides it: "Sturmschwelle"
|
|
64
|
+
* when both thresholds hold one of its values (`PEER_NEEDS_BURST` takes either), the expert view
|
|
65
|
+
* otherwise - a fresh link's thresholds are 0.
|
|
66
|
+
*/
|
|
67
|
+
export declare function stormProfile(form: StormForm, values: Paramset): number;
|
|
68
|
+
/**
|
|
69
|
+
* What choosing "Sturmschwelle" writes: the thresholds stay where they already hold a value of the
|
|
70
|
+
* profile, otherwise the first one (the WebUI's select starts on it).
|
|
71
|
+
*/
|
|
72
|
+
export declare function applyStormProfile(form: StormForm, values: Paramset): Record<string, number>;
|
|
73
|
+
/**
|
|
74
|
+
* The fill level of a raw threshold as the WebUI shows it: `100 / (200 / raw)` rounded to .0 or .5
|
|
75
|
+
* (`setDecimalPlaces`), and whether the threshold is on at all.
|
|
76
|
+
*/
|
|
77
|
+
export declare function fillLevelPercent(form: FillLevelForm, raw: ParamsetValue | undefined): {
|
|
78
|
+
percent: number;
|
|
79
|
+
active: boolean;
|
|
80
|
+
};
|
|
81
|
+
/** The raw threshold of a percentage (0-100, to .0 or .5), or the inactive value. */
|
|
82
|
+
export declare function fillLevelRaw(form: FillLevelForm, percent: number, active: boolean): number;
|
|
83
|
+
/**
|
|
84
|
+
* `isLowerGTUpper` of the WebUI's fill level form: the lower threshold stays 5 % below the upper
|
|
85
|
+
* one. A lower one at or above the upper pushes the upper up (unless that is off); an upper one at
|
|
86
|
+
* or below the lower pulls the lower down; the lower never below 0, the upper never above 100.
|
|
87
|
+
* Percentages; `undefined` for a threshold that is off.
|
|
88
|
+
*/
|
|
89
|
+
export declare function adjustFillLevels(changed: 'upper' | 'lower', upper: number | undefined, lower: number | undefined): {
|
|
90
|
+
upper: number | undefined;
|
|
91
|
+
lower: number | undefined;
|
|
92
|
+
};
|
|
93
|
+
/** The weather forms' texts (`WEATHER/localization/lang.js`). */
|
|
94
|
+
export declare const STORM_TEXTS: Readonly<Record<string, SenderText>>;
|
|
95
|
+
/** The names of the storm form's profiles (`PROFILES_MAP`): the expert view and "Sturmschwelle". */
|
|
96
|
+
export declare const STORM_PROFILE_NAMES: Readonly<Record<number, SenderText>>;
|
|
97
|
+
/** The Beaufort grades' names, 0-12. */
|
|
98
|
+
export declare const WIND_FORCE: readonly SenderText[];
|
|
99
|
+
/** What each grade looks like outside, 0-12. */
|
|
100
|
+
export declare const WIND_DESCRIPTION: readonly SenderText[];
|
|
101
|
+
//# sourceMappingURL=senderForms.d.ts.map
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task 109: the forms the CCU's WebUI draws for the *sender* side of a link.
|
|
3
|
+
*
|
|
4
|
+
* `ic_setprofiles.cgi` sources `easymodes/<paramid>.tcl` for the sender part of a link, the id being
|
|
5
|
+
* `getParamsetId(<sender>, LINK)`. For almost every sender that file does not exist, or is only a
|
|
6
|
+
* receiver folder's dispatcher, and the sender's LINK parameters - where it has any - are shown raw.
|
|
7
|
+
* Three old BidCos sensors have a form of their own:
|
|
8
|
+
*
|
|
9
|
+
* - `ks550_ch_link` (KS550, HM-WDS100-C6-O) and `wds100_ch_link` (HM-WDS100-C6-O-2): the weather
|
|
10
|
+
* station's storm thresholds, a profile "Sturmschwelle" with the switch-on and switch-off threshold
|
|
11
|
+
* as a Beaufort scale; the HM-WDS100-C6-O-2 copies them into the receiver's `SHORT_COND_VALUE_HI` /
|
|
12
|
+
* `SHORT_COND_VALUE_LO`. Hidden when the receiver is a combination sensor (`WS_CS`).
|
|
13
|
+
* - `wa_od_ch_link` (HM-Sen-Wa-Od, the capacitive filling level sensor): no profile, the upper and
|
|
14
|
+
* lower fill level as a percentage (the raw value is twice it), each switchable off (255).
|
|
15
|
+
*
|
|
16
|
+
* The tables are the WebUI's (`www/config/easymodes`); `data/extracted/easymode_links.json`'s
|
|
17
|
+
* `senders` and `weatherTexts` are extracted from it by `data/scripts/easymode-links.mjs`, and
|
|
18
|
+
* `senderForms.test.ts` fails where this module differs from the extract.
|
|
19
|
+
*/
|
|
20
|
+
/** The profile ids of the storm form: the expert view and "Sturmschwelle". */
|
|
21
|
+
export const STORM_EXPERT = 0;
|
|
22
|
+
export const STORM_THRESHOLD = 1;
|
|
23
|
+
const STORM_THRESHOLDS = ['STORM_UPPER_THRESHOLD', 'STORM_LOWER_THRESHOLD'];
|
|
24
|
+
/** The Beaufort options of the KS550 form: raw value -> grade. */
|
|
25
|
+
const KS550_OPTIONS = [
|
|
26
|
+
[1, 0],
|
|
27
|
+
[2, 1],
|
|
28
|
+
[5, 2],
|
|
29
|
+
[12, 3],
|
|
30
|
+
[25, 4],
|
|
31
|
+
[29, 5],
|
|
32
|
+
[39, 6],
|
|
33
|
+
[50, 7],
|
|
34
|
+
[62, 8],
|
|
35
|
+
[75, 9],
|
|
36
|
+
[89, 10],
|
|
37
|
+
[103, 11],
|
|
38
|
+
[118, 12],
|
|
39
|
+
].map(([value, force]) => ({ value: value ?? 0, force: force ?? 0 }));
|
|
40
|
+
const WDS100_2 = 'HM-WDS100-C6-O-2';
|
|
41
|
+
export const SENDER_FORMS = {
|
|
42
|
+
ks550_ch_link: {
|
|
43
|
+
kind: 'storm',
|
|
44
|
+
paramsetId: 'ks550_ch_link',
|
|
45
|
+
range: [1, 2, 5, 12, 15, 25, 29, 39, 50, 62, 75, 89, 103, 118],
|
|
46
|
+
options: () => KS550_OPTIONS,
|
|
47
|
+
mirrors: () => ({}),
|
|
48
|
+
},
|
|
49
|
+
wds100_ch_link: {
|
|
50
|
+
kind: 'storm',
|
|
51
|
+
paramsetId: 'wds100_ch_link',
|
|
52
|
+
range: [1, 2, 5, 12, 15, 20, 25, 29, 39, 50, 62, 75, 89, 103, 118],
|
|
53
|
+
// `[string first "HM-WDS100-C6-O-2" $SENDER] == 0`: grade 4 is 20 on that one, 25 otherwise
|
|
54
|
+
options: (deviceType) => deviceType.startsWith(WDS100_2)
|
|
55
|
+
? KS550_OPTIONS.map((option) => (option.value === 25 ? { value: 20, force: option.force } : option))
|
|
56
|
+
: KS550_OPTIONS,
|
|
57
|
+
mirrors: (deviceType) => deviceType === WDS100_2
|
|
58
|
+
? { STORM_UPPER_THRESHOLD: 'SHORT_COND_VALUE_HI', STORM_LOWER_THRESHOLD: 'SHORT_COND_VALUE_LO' }
|
|
59
|
+
: {},
|
|
60
|
+
},
|
|
61
|
+
wa_od_ch_link: { kind: 'fillLevel', paramsetId: 'wa_od_ch_link', inactive: 255, perPercent: 2 },
|
|
62
|
+
};
|
|
63
|
+
/** Receivers for which the storm form hides itself ("bei Verknüpfung Wetterstation - Kombisensor sinnlos"). */
|
|
64
|
+
export const STORM_HIDDEN_FOR_RECEIVER = 'WS_CS';
|
|
65
|
+
/**
|
|
66
|
+
* The sender form of a link: the one the sender's LINK paramset id names, unless that form hides
|
|
67
|
+
* itself for this receiver. `undefined` shows the sender's parameters raw, as before.
|
|
68
|
+
*/
|
|
69
|
+
export function senderFormFor(paramsetId, receiverType) {
|
|
70
|
+
const form = SENDER_FORMS[paramsetId];
|
|
71
|
+
if (form?.kind === 'storm' && receiverType === STORM_HIDDEN_FOR_RECEIVER) {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
return form;
|
|
75
|
+
}
|
|
76
|
+
const asNumber = (value) => (typeof value === 'number' ? value : Number(value));
|
|
77
|
+
/**
|
|
78
|
+
* The profile of a storm form a link follows, as `get_cur_profile2` decides it: "Sturmschwelle"
|
|
79
|
+
* when both thresholds hold one of its values (`PEER_NEEDS_BURST` takes either), the expert view
|
|
80
|
+
* otherwise - a fresh link's thresholds are 0.
|
|
81
|
+
*/
|
|
82
|
+
export function stormProfile(form, values) {
|
|
83
|
+
const fits = STORM_THRESHOLDS.every((name) => form.range.includes(asNumber(values[name])));
|
|
84
|
+
return fits ? STORM_THRESHOLD : STORM_EXPERT;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* What choosing "Sturmschwelle" writes: the thresholds stay where they already hold a value of the
|
|
88
|
+
* profile, otherwise the first one (the WebUI's select starts on it).
|
|
89
|
+
*/
|
|
90
|
+
export function applyStormProfile(form, values) {
|
|
91
|
+
const result = {};
|
|
92
|
+
for (const name of STORM_THRESHOLDS) {
|
|
93
|
+
if (!(name in values))
|
|
94
|
+
continue;
|
|
95
|
+
const current = asNumber(values[name]);
|
|
96
|
+
result[name] = form.range.includes(current) ? current : (form.range[0] ?? 0);
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The fill level of a raw threshold as the WebUI shows it: `100 / (200 / raw)` rounded to .0 or .5
|
|
102
|
+
* (`setDecimalPlaces`), and whether the threshold is on at all.
|
|
103
|
+
*/
|
|
104
|
+
export function fillLevelPercent(form, raw) {
|
|
105
|
+
const value = asNumber(raw);
|
|
106
|
+
if (value === form.inactive) {
|
|
107
|
+
return { percent: 0, active: false };
|
|
108
|
+
}
|
|
109
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
110
|
+
return { percent: 0, active: true };
|
|
111
|
+
}
|
|
112
|
+
return { percent: roundHalf(value / form.perPercent), active: true };
|
|
113
|
+
}
|
|
114
|
+
/** The raw threshold of a percentage (0-100, to .0 or .5), or the inactive value. */
|
|
115
|
+
export function fillLevelRaw(form, percent, active) {
|
|
116
|
+
if (!active) {
|
|
117
|
+
return form.inactive;
|
|
118
|
+
}
|
|
119
|
+
const clamped = Math.min(100, Math.max(0, Number.isFinite(percent) ? percent : 0));
|
|
120
|
+
return Math.round(roundHalf(clamped) * form.perPercent);
|
|
121
|
+
}
|
|
122
|
+
/** `setDecimalPlaces`: one decimal, then .1-.2 down to .0, .3-.7 to .5, .8-.9 up to the next whole. */
|
|
123
|
+
function roundHalf(value) {
|
|
124
|
+
const tenths = Math.round(value * 10);
|
|
125
|
+
const whole = Math.floor(tenths / 10);
|
|
126
|
+
const decimal = tenths - whole * 10;
|
|
127
|
+
if (decimal === 0)
|
|
128
|
+
return whole;
|
|
129
|
+
if (decimal <= 2)
|
|
130
|
+
return whole;
|
|
131
|
+
if (decimal <= 7)
|
|
132
|
+
return whole + 0.5;
|
|
133
|
+
return whole + 1;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* `isLowerGTUpper` of the WebUI's fill level form: the lower threshold stays 5 % below the upper
|
|
137
|
+
* one. A lower one at or above the upper pushes the upper up (unless that is off); an upper one at
|
|
138
|
+
* or below the lower pulls the lower down; the lower never below 0, the upper never above 100.
|
|
139
|
+
* Percentages; `undefined` for a threshold that is off.
|
|
140
|
+
*/
|
|
141
|
+
export function adjustFillLevels(changed, upper, lower) {
|
|
142
|
+
let up = upper;
|
|
143
|
+
let low = lower;
|
|
144
|
+
if (changed === 'lower') {
|
|
145
|
+
if (low !== undefined && up !== undefined && low >= up) {
|
|
146
|
+
up = low + 5;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
if (up !== undefined && low !== undefined && up <= low) {
|
|
151
|
+
low = up - 5;
|
|
152
|
+
}
|
|
153
|
+
if (low !== undefined && low < 0) {
|
|
154
|
+
low = 0;
|
|
155
|
+
if (up !== undefined)
|
|
156
|
+
up = 5;
|
|
157
|
+
}
|
|
158
|
+
if (up !== undefined && up > 100) {
|
|
159
|
+
up = 100;
|
|
160
|
+
if (low !== undefined)
|
|
161
|
+
low = 95;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return { upper: up, lower: low };
|
|
165
|
+
}
|
|
166
|
+
/** The weather forms' texts (`WEATHER/localization/lang.js`). */
|
|
167
|
+
export const STORM_TEXTS = {
|
|
168
|
+
weatherProfile1: { de: 'Sturmschwelle', en: 'Storm threshold' },
|
|
169
|
+
windInBeaufort: { de: 'Windstärke in Beaufort', en: 'Wind strength in Beaufort scale' },
|
|
170
|
+
upperStormThreshold: { de: 'Einschaltschwelle', en: 'Switch-on threshold' },
|
|
171
|
+
lowerStormThreshold: { de: 'Ausschaltschwelle', en: 'Switch-off threshold' },
|
|
172
|
+
toolTip0: {
|
|
173
|
+
de: 'Schaltbefehl bei überschreiten der eingestellten Schaltschwelle',
|
|
174
|
+
en: 'Switching command on exceeding the set threshold',
|
|
175
|
+
},
|
|
176
|
+
toolTip1: {
|
|
177
|
+
de: 'Schaltbefehl bei Unterschreiten der eingestellten Schaltschwelle',
|
|
178
|
+
en: 'Switching command on fall below the set threshold',
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
/** The names of the storm form's profiles (`PROFILES_MAP`): the expert view and "Sturmschwelle". */
|
|
182
|
+
export const STORM_PROFILE_NAMES = {
|
|
183
|
+
[STORM_EXPERT]: { de: 'Experte', en: 'Expert' },
|
|
184
|
+
[STORM_THRESHOLD]: { de: 'Sturmschwelle', en: 'Storm threshold' },
|
|
185
|
+
};
|
|
186
|
+
/** The Beaufort grades' names, 0-12. */
|
|
187
|
+
export const WIND_FORCE = [
|
|
188
|
+
{ de: 'Windstärke 0 - Windstille', en: 'Wind strength 0 - Calm' },
|
|
189
|
+
{ de: 'Windstärke 1 - leiser Zug', en: 'Wind strength 1 - Light air' },
|
|
190
|
+
{ de: 'Windstärke 2 - leichte Brise', en: 'Wind strength 2 - Light breeze' },
|
|
191
|
+
{ de: 'Windstärke 3 - schwache Brise', en: 'Wind strength 3 - Gentle breeze' },
|
|
192
|
+
{ de: 'Windstärke 4 - mäßige Brise', en: 'Wind strength 4 - Moderate breeze' },
|
|
193
|
+
{ de: 'Windstärke 5 - frischer Wind', en: 'Wind strength 5 - Fresh breeze' },
|
|
194
|
+
{ de: 'Windstärke 6 - starker Wind', en: 'Wind strength 6 - Strong breeze' },
|
|
195
|
+
{ de: 'Windstärke 7 - steifer Wind', en: 'Wind strength 7 - High wind, moderate gale, near gale' },
|
|
196
|
+
{ de: 'Windstärke 8 - stürmischer Wind', en: 'Wind strength 8 - Gale, fresh gale' },
|
|
197
|
+
{ de: 'Windstärke 9 - Sturm', en: 'Wind strength 9 - Strong gale' },
|
|
198
|
+
{ de: 'Windstärke 10 - schwerer Sturm', en: 'Wind strength 10 - Strom, whole gale' },
|
|
199
|
+
{ de: 'Windstärke 11 - orkanartiger Sturm', en: 'Wind strength 11 - Violent storm' },
|
|
200
|
+
{ de: 'Windstärke 12 - Orkan', en: 'Wind strength 12 - Hurricane force' },
|
|
201
|
+
];
|
|
202
|
+
/** What each grade looks like outside, 0-12. */
|
|
203
|
+
export const WIND_DESCRIPTION = [
|
|
204
|
+
{ de: 'Keine Luftbewegung, Rauch steigt senkrecht empor.', en: 'Calm, smoke rises vertically.' },
|
|
205
|
+
{
|
|
206
|
+
de: 'Kaum merklich, Rauch treibt leicht ab, Windflügel und Windfahnen unbewegt.',
|
|
207
|
+
en: 'Smoke drift indicates wind direction, still wind vanes.',
|
|
208
|
+
},
|
|
209
|
+
{ de: 'Blätter rascheln, Wind im Gesicht spürbar.', en: 'Leaves rustle, wind felt on face.' },
|
|
210
|
+
{
|
|
211
|
+
de: 'Blätter und dünne Zweige bewegen sich, Wimpel werden gestreckt.',
|
|
212
|
+
en: 'Leaves and small twigs constantly moving, light flags extended',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
de: 'Zweige bewegen sich, loses Papier wird vom Boden gehoben.',
|
|
216
|
+
en: 'Leaves and loose paper lifted, small tree branches move',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
de: 'Größere Zweige und Bäume bewegen sich, Wind deutlich hörbar.',
|
|
220
|
+
en: 'Larger tree branches and trees begin to sway, wind noticeable',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
de: 'Dicke Äste bewegen sich, hörbares Pfeifen an Drahtseilen und Telefonleitungen.',
|
|
224
|
+
en: 'Larger tree branches moving, whistling in wires',
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
de: 'Bäume schwanken, Widerstand beim Gehen gegen den Wind.',
|
|
228
|
+
en: 'Whole trees moving, resistance felt walking against wind',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
de: 'Grosse Bäume werden bewegt, Zweige brechen von Bäumen, erhebliche Behinderung beim Gehen.',
|
|
232
|
+
en: 'Larger tress moving, twigs breaking off trees, generally impedes progress',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
de: 'Äste brechen, kleinere Schäden an Häusern, Ziegel werden von Dächern abgehoben, Gartenmöbel werden umgeworfen und verweht.',
|
|
236
|
+
en: 'Branches breaking off trees, slight damages on houses, slate blows off roofs',
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
de: 'Bäume werden entwurzelt, Baumstämme brechen, grössere Schäden an Häusern.',
|
|
240
|
+
en: 'Trees broken or uprooted, considerable damages on houses',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
de: 'Heftige Böen, schwere Sturmschäden, schwere Waldschäden, Dächer werden abgedeckt, Autos werden aus der Spur geworfen. Selten im Landesinneren.',
|
|
244
|
+
en: 'Extreme destruction, forests flattened, shingles are blown off of roofs, devastation, cars thrown. Seldom experienced on inland',
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
de: 'Schwerste Sturmschäden und Verwüstungen. Selten im Landesinneren.',
|
|
248
|
+
en: 'Heavy storm damages and destructions. Seldom experienced on inland',
|
|
249
|
+
},
|
|
250
|
+
];
|
|
251
|
+
//# sourceMappingURL=senderForms.js.map
|
|
@@ -31,6 +31,8 @@ export * from './paramset/multiApply.js';
|
|
|
31
31
|
export * from './easymodes/engine.js';
|
|
32
32
|
export * from './easymodes/form.js';
|
|
33
33
|
export * from './easymodes/linkTypes.js';
|
|
34
|
+
export * from './easymodes/legacyValues.js';
|
|
35
|
+
export * from './easymodes/senderForms.js';
|
|
34
36
|
export * from './serviceMessages/index.js';
|
|
35
37
|
export * from './rssi/index.js';
|
|
36
38
|
export * from './events/ringBuffer.js';
|
|
@@ -35,6 +35,8 @@ export * from './paramset/multiApply.js';
|
|
|
35
35
|
export * from './easymodes/engine.js';
|
|
36
36
|
export * from './easymodes/form.js';
|
|
37
37
|
export * from './easymodes/linkTypes.js';
|
|
38
|
+
export * from './easymodes/legacyValues.js';
|
|
39
|
+
export * from './easymodes/senderForms.js';
|
|
38
40
|
// State the tabs show
|
|
39
41
|
export * from './serviceMessages/index.js';
|
|
40
42
|
export * from './rssi/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homematic-manager",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Configure and administer Homematic and HomematicIP devices - devices and channels, direct links, paramsets, RSSI, service messages, events and an RPC console - from a local HTTP/WebSocket server that also serves the web UI",
|
|
6
6
|
"keywords": [
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@cyclonedx/cyclonedx-npm": "^4.2.1",
|
|
67
|
-
"hm-simulator": "^1.
|
|
67
|
+
"hm-simulator": "^1.5.0"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@homematic-manager/backend": "3.4.
|
|
71
|
-
"@homematic-manager/core": "3.4.
|
|
70
|
+
"@homematic-manager/backend": "3.4.2",
|
|
71
|
+
"@homematic-manager/core": "3.4.2",
|
|
72
72
|
"binrpc": "^4.2.0",
|
|
73
73
|
"homematic-rega": "^2.0.0",
|
|
74
74
|
"homematic-xmlrpc": "^2.0.0",
|