iobroker.lorawan 1.22.32 → 1.22.34

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/README.md CHANGED
@@ -21,13 +21,19 @@ For now there is documentation in English here: https://wiki.hafenmeister.de
21
21
 
22
22
  ### Home Assistant sensor discovery
23
23
 
24
- For numeric sensor entities, the bridge assigns Home Assistant `device_class` and `state_class` attributes according to the adapter's counter-first convention. Current measurements use `measurement`. Energy values in `Wh`, `kWh`, or `MWh`, as well as values identified by an ioBroker energy or consumption role, are treated as consumption counters and use `total_increasing` for Home Assistant energy statistics. If a quantity cannot be distinguished reliably from a consumption reading, the bridge prefers counter semantics: `m³` and `ft³` are published as `gas` with `total_increasing`, and `L` as `water` with `total_increasing`. `mL` and `gal` remain generic `volume` values. Ambiguous concentration units such as `ppm`, `ppb`, or `µg/m³` do not imply a specific substance. `L/min`, `L/s`, and `m³/h` use `volume_flow_rate`.
24
+ For numeric sensor entities, the bridge assigns Home Assistant `device_class` and `state_class` attributes according to the adapter's counter-first convention. Current measurements use `measurement`. Wind direction states with the ioBroker role `value.direction.wind` use the device class `wind_direction` and state class `measurement_angle`; an existing unit is retained, while `°` is added if no unit is defined. Energy values in `Wh`, `kWh`, or `MWh`, as well as values identified by an ioBroker energy or consumption role, are treated as consumption counters and use `total_increasing` for Home Assistant energy statistics. If a quantity cannot be distinguished reliably from a consumption reading, the bridge prefers counter semantics: `m³` and `ft³` are published as `gas` with `total_increasing`, and `L` as `water` with `total_increasing`. `mL` and `gal` remain generic `volume` values. Ambiguous concentration units such as `ppm`, `ppb`, or `µg/m³` do not imply a specific substance. `L/min`, `L/s`, and `m³/h` use `volume_flow_rate`.
25
25
 
26
26
  ## Changelog
27
27
  <!--
28
28
  Placeholder for the next version (at the beginning of the line):
29
29
  ### **WORK IN PROGRESS**
30
30
  -->
31
+ ### 1.22.34 (2026-09-23)
32
+ - (BenAhrdt) Process Bridge entity availability on discovery and normal messages and keep existing state types for incompatible values.
33
+
34
+ ### 1.22.33 (2026-08-19)
35
+ - (BenAhrdt) Add Home Assistant wind direction and angle measurement classification
36
+
31
37
  ### 1.22.32 (2026-08-19)
32
38
  - (BenAhrdt) Align Home Assistant sensor device classes, state classes, and units with the current specification
33
39
 
@@ -38,12 +44,6 @@ For numeric sensor entities, the bridge assigns Home Assistant `device_class` an
38
44
  - (BenAhrdt) Add PIR Mini device Profile
39
45
  - (BenAhrdt) Add possibillity to ad states to downlink numbers
40
46
 
41
- ### 1.22.29 (2026-07-06)
42
- - (BenAhrdt) Add some roles and units to assignhandler
43
-
44
- ### 1.22.28 (2026-07-05)
45
- - (BenAhrdt) Add DewPointTemperature to assignhandler
46
-
47
47
  [Older changes can be found there](CHANGELOG_OLD.md)
48
48
 
49
49
  ## DISCLAIMER
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "lorawan",
4
- "version": "1.22.32",
4
+ "version": "1.22.34",
5
5
  "news": {
6
+ "1.22.34": {
7
+ "en": "Process Bridge entity availability on discovery and normal messages and keep existing state types for incompatible values.",
8
+ "de": "Verarbeitet Bridge-Entitäten in Discovery- und Normalnachrichten und behält bestehende Statustypen für inkompatible Werte bei.",
9
+ "ru": "Доступность объектов Process Bridge при обнаружении и обычных сообщениях и сохраняйте существующие типы состояний для несовместимых значений.",
10
+ "pt": "Use a entidade Process Bridge na descoberta e em mensagens normais e mantenha os tipos de estado incompatíveis.",
11
+ "nl": "Verwerk de beschikbaarheid van entiteiten bij detectie en normale berichten en behoud bestaande statussen voor incompatibele waarden.",
12
+ "fr": "Traitez la disponibilité des entités Bridge lors de leur découverte et des messages normaux et conservez les types d'état existants.",
13
+ "it": "Entità Process Bridge su discovery e messaggi normali e conserva i tipi di stato esistenti per valori incompatibili.",
14
+ "es": "Procese Bridge la disponibilidad de la entidad al detectar y los mensajes normales y conservar los tipos de estado existentes para valores incompatibles.",
15
+ "pl": "Przetwarzaj dostępność jednostek programu Bridge w wiadomościach wykrywania i zwykłych komunikatów i zachowaj istniejące typy stanów dla niekompatybilnych wartości.",
16
+ "uk": "Обробляйте доступність сутності Bridge при виявленні та звичайних повідомленнях та збережіть існуючі типи станів для несумісних значень.",
17
+ "zh-cn": "处理 Bridge 实体在发现和普通消息中的可用性,并保留现有状态类型以防不兼容的值。"
18
+ },
19
+ "1.22.33": {
20
+ "en": "Add Home Assistant wind direction and angle measurement classification",
21
+ "de": "Klassifizierung der Windrichtungs- und Winkelmessung in Home Assistant hinzufügen",
22
+ "ru": "Добавить в Home Assistant классификацию измерения направления и угла ветра",
23
+ "pt": "Adicionar classificação de medição de direção e ângulo do vento ao Home Assistant",
24
+ "nl": "Voeg een classificatie voor windrichting en -hoekmeting toe aan Home Assistant.",
25
+ "fr": "Ajouter une classification aux mesures de direction et d'angle du vent dans Home Assistant",
26
+ "it": "Aggiungi la classificazione della misurazione della direzione e dell'angolo del vento in Home Assistant",
27
+ "es": "Agregar a Home Assistant la clasificación de medición de dirección y ángulo del viento",
28
+ "pl": "Dodaj klasyfikację pomiaru kierunku i kąta wiatru w Asystencie Domowym",
29
+ "uk": "Додайте класифікацію вимірювання напрямку та кута вітру для Home Assistant",
30
+ "zh-cn": "添加 Home Assistant 风向和风角测量分类"
31
+ },
6
32
  "1.22.32": {
7
33
  "en": "Align Home Assistant sensor device classes, state classes, and units with the current specification",
8
34
  "de": "Richten Sie die Sensorgeräteklassen, Statusklassen und Einheiten von Home Assistant an die aktuelle Spezifikation aus.",
@@ -67,32 +93,6 @@
67
93
  "pl": "Dodaj DewPointTemperature do assignhandler",
68
94
  "uk": "Додати DewPointTemperature до assignhandler",
69
95
  "zh-cn": "将露点温度添加到赋值处理程序"
70
- },
71
- "1.22.27": {
72
- "en": "Bugfix warning for wrong id\nAdd Profile to downloadconfig",
73
- "de": "Bugfix-Warnung wegen falscher ID\nProfil zu downloadconfig hinzufügen",
74
- "ru": "Исправлено предупреждение об ошибке, связанной с неверным идентификатором.\nДобавить профиль в downloadconfig",
75
- "pt": "Aviso de correção de bug para ID incorreto\nAdicionar perfil ao downloadconfig",
76
- "nl": "Bugfix-waarschuwing voor onjuiste ID\nVoeg profiel toe aan downloadconfig",
77
- "fr": "Avertissement de correction de bug pour identifiant incorrect\nAjouter le profil à downloadconfig",
78
- "it": "Avviso di correzione bug per ID errato\nAggiungi il profilo a downloadconfig",
79
- "es": "Advertencia de corrección de errores por ID incorrecto\nAgregar perfil a downloadconfig",
80
- "pl": "Ostrzeżenie o naprawie błędu dotyczącego nieprawidłowego identyfikatora\nDodaj profil do downloadconfig",
81
- "uk": "Попередження про виправлення помилки для неправильного ідентифікатора\nДодати профіль до завантаженої конфігурації",
82
- "zh-cn": "修复错误 ID 警告\n将配置文件添加到 downloadconfig"
83
- },
84
- "1.22.26": {
85
- "en": "Add ststes into Lock entity for ToIob devices",
86
- "de": "Fügen Sie Statusmeldungen zur Sperrentität für ToIob-Geräte hinzu.",
87
- "ru": "Добавьте sttes в сущность Lock для устройств ToIob.",
88
- "pt": "Adicionar estados à entidade Lock para dispositivos ToIob",
89
- "nl": "Voeg statussen toe aan de Lock-entiteit voor ToIob-apparaten.",
90
- "fr": "Ajouter des ststes à l'entité Verrou pour les périphériques ToIob",
91
- "it": "Aggiungi stati all'entità Blocco per i dispositivi ToIob",
92
- "es": "Agregar estados a la entidad Bloqueo para dispositivos ToIob",
93
- "pl": "Dodaj stacje do encji blokady dla urządzeń ToIob",
94
- "uk": "Додати станції до сутності блокування для пристроїв ToIob",
95
- "zh-cn": "将状态添加到锁定实体中,用于 ToIob 设备"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -1646,6 +1646,10 @@ class bridgeClass extends EventEmiter {
1646
1646
  } else if (role.includes('illuminance') || role.includes('brightness')) {
1647
1647
  attributes.device_class = 'illuminance';
1648
1648
  attributes.unit_of_measurement = 'lx'; //normalizedUnit || 'lx';
1649
+ } else if (role.includes('direction.wind')) {
1650
+ attributes.device_class = 'wind_direction';
1651
+ attributes.state_class = 'measurement_angle';
1652
+ attributes.unit_of_measurement = normalizedUnit || '°';
1649
1653
  } else if (role.includes('battery')) {
1650
1654
  attributes.device_class = 'battery';
1651
1655
  attributes.entity_category = 'diagnostic';
@@ -127,29 +127,19 @@ class bridgeDeviceHandlerClass {
127
127
  },
128
128
  native: {},
129
129
  });
130
- if (message.discovery) {
131
- if (available[entityInfo.device.availableId] === undefined) {
132
- if (entity.domain !== 'button' && entity.domain !== 'event' && entity.domain !== 'scene') {
133
- available[entityInfo.device.availableId] = entity.available;
134
- await this.adapter.setState(
135
- entityInfo.device.availableId,
136
- available[entityInfo.device.availableId],
137
- true,
138
- );
139
- }
140
- } else if (available[entityInfo.device.availableId] === true) {
141
- if (
142
- entity.domain !== 'button' &&
143
- entity.domain !== 'event' &&
144
- entity.domain !== 'scene' &&
145
- entity.available === false
146
- ) {
147
- available[entityInfo.device.availableId] = false;
148
- await this.adapter.setState(entityInfo.device.availableId, false, true);
149
- }
130
+ const relevantForAvailability =
131
+ entity.domain !== 'button' && entity.domain !== 'event' && entity.domain !== 'scene';
132
+ if (relevantForAvailability && typeof entity.available === 'boolean') {
133
+ const availableId = entityInfo.device.availableId;
134
+ const previousAvailability = available[availableId];
135
+ const nextAvailability =
136
+ previousAvailability === undefined
137
+ ? entity.available
138
+ : previousAvailability && entity.available;
139
+ if (previousAvailability !== nextAvailability) {
140
+ available[availableId] = nextAvailability;
141
+ await this.adapter.setState(availableId, nextAvailability, true);
150
142
  }
151
- } else {
152
- await this.adapter.setState(entityInfo.device.availableId, true, true);
153
143
  }
154
144
 
155
145
  // DeviceLink
@@ -182,11 +172,13 @@ class bridgeDeviceHandlerClass {
182
172
  }
183
173
  unique_id.replace('.', '_');
184
174
  for (const state of entityInfo.state) {
175
+ const existingObject = await this.adapter.getObjectAsync(state.id);
176
+ const stateType = existingObject?.common?.type || state.type;
185
177
  await this.adapter.extendObject(state.id, {
186
178
  type: 'state',
187
179
  common: {
188
180
  name: state.name,
189
- type: state.type,
181
+ type: stateType,
190
182
  role: state.role,
191
183
  read: state.read,
192
184
  write: state.write,
@@ -199,19 +191,26 @@ class bridgeDeviceHandlerClass {
199
191
  native: { entity: entity, entityInfo: entityInfo, state: state },
200
192
  });
201
193
  let stateValue = state.val;
202
- if (state.type === 'boolean') {
203
- stateValue = state.val === 'on';
204
- } else if (state.type === 'number') {
205
- if (state.states && typeof state.val === 'string') {
194
+ if (stateType === 'boolean') {
195
+ if (typeof state.val === 'boolean') {
206
196
  stateValue = state.val;
197
+ } else if (state.val === 'on' || state.val === 'true') {
198
+ stateValue = true;
199
+ } else if (state.val === 'off' || state.val === 'false') {
200
+ stateValue = false;
207
201
  } else {
208
- stateValue = Number(state.val);
202
+ stateValue = undefined;
209
203
  }
204
+ } else if (stateType === 'number') {
205
+ stateValue = Number(state.val);
206
+ } else if (stateType === 'string') {
207
+ stateValue = String(state.val);
210
208
  }
211
209
  if (
212
210
  this.adapter.objectExists(state.id) &&
213
211
  state.val != null &&
214
- !Number.isNaN(stateValue) &&
212
+ stateValue !== undefined &&
213
+ (stateType !== 'number' || Number.isFinite(stateValue)) &&
215
214
  stateValue != '#000000'
216
215
  ) {
217
216
  await this.adapter.setState(state.id, stateValue, true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lorawan",
3
- "version": "1.22.32",
3
+ "version": "1.22.34",
4
4
  "description": "converts the desired lora gateway data to a ioBroker structure",
5
5
  "author": {
6
6
  "name": "BenAhrdt",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@iobroker/adapter-core": "^3.4.1",
29
- "@iobroker/dm-utils": "^3.1.4",
29
+ "@iobroker/dm-utils": "^3.2.0",
30
30
  "easy-crc": "^1.1.0",
31
31
  "lodash": "^4.18.1",
32
32
  "mqtt": "^5.15.2",
@@ -35,13 +35,13 @@
35
35
  "devDependencies": {
36
36
  "@alcalzone/release-script": "^5.2.1",
37
37
  "@alcalzone/release-script-plugin-iobroker": "^5.2.0",
38
- "@alcalzone/release-script-plugin-license": "^5.2.0",
38
+ "@alcalzone/release-script-plugin-license": "^5.2.2",
39
39
  "@alcalzone/release-script-plugin-manual-review": "^5.2.0",
40
40
  "@iobroker/adapter-dev": "^1.5.0",
41
41
  "@iobroker/eslint-config": "^2.2.0",
42
42
  "@iobroker/testing": "^5.3.0",
43
- "@tsconfig/node22": "^22.0.5",
44
- "@types/lodash": "^4.17.24",
43
+ "@tsconfig/node22": "^22.0.6",
44
+ "@types/lodash": "^4.17.25",
45
45
  "@types/node": "^22.20.1",
46
46
  "typescript": "~5.9.3"
47
47
  },