iobroker.lorawan 1.22.31 → 1.22.33
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 +19 -6
- package/io-package.json +27 -27
- package/lib/modules/bridge.js +48 -14
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -19,11 +19,21 @@ The documentation Wiki is here: https://github.com/BenAhrdt/ioBroker.lorawan/wik
|
|
|
19
19
|
<br/>
|
|
20
20
|
For now there is documentation in English here: https://wiki.hafenmeister.de
|
|
21
21
|
|
|
22
|
+
### Home Assistant sensor discovery
|
|
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`. 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
|
+
|
|
22
26
|
## Changelog
|
|
23
27
|
<!--
|
|
24
28
|
Placeholder for the next version (at the beginning of the line):
|
|
25
29
|
### **WORK IN PROGRESS**
|
|
26
30
|
-->
|
|
31
|
+
### 1.22.33 (2026-08-19)
|
|
32
|
+
- (BenAhrdt) Add Home Assistant wind direction and angle measurement classification
|
|
33
|
+
|
|
34
|
+
### 1.22.32 (2026-08-19)
|
|
35
|
+
- (BenAhrdt) Align Home Assistant sensor device classes, state classes, and units with the current specification
|
|
36
|
+
|
|
27
37
|
### 1.22.31 (2026-07-09)
|
|
28
38
|
- (BenAhrdt) Add selection of ToIob source id
|
|
29
39
|
|
|
@@ -34,14 +44,17 @@ For now there is documentation in English here: https://wiki.hafenmeister.de
|
|
|
34
44
|
### 1.22.29 (2026-07-06)
|
|
35
45
|
- (BenAhrdt) Add some roles and units to assignhandler
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
- (BenAhrdt) Add DewPointTemperature to assignhandler
|
|
47
|
+
[Older changes can be found there](CHANGELOG_OLD.md)
|
|
39
48
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
49
|
+
## DISCLAIMER
|
|
50
|
+
The rights of the trademarks and company names, remain with their owners and have no relation to this adapter. The fairuse policy must continue to be adhered to by the operator of the adapter. If this repository is forked, it must be cited as the source.
|
|
51
|
+
|
|
52
|
+
LoRa® is a registered trademark or service mark of Semtech Corporation or its affilantes.
|
|
53
|
+
|
|
54
|
+
LoRaWAN® is a licensed mark.
|
|
55
|
+
|
|
56
|
+
I have no affiliation with the mentioned brands or their subsidiaries, logos, or trademarks, nor am I endorsed by them.
|
|
43
57
|
|
|
44
|
-
[Older changes can be found there](CHANGELOG_OLD.md)
|
|
45
58
|
|
|
46
59
|
## License
|
|
47
60
|
MIT License
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lorawan",
|
|
4
|
-
"version": "1.22.
|
|
4
|
+
"version": "1.22.33",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.22.33": {
|
|
7
|
+
"en": "Add Home Assistant wind direction and angle measurement classification",
|
|
8
|
+
"de": "Klassifizierung der Windrichtungs- und Winkelmessung in Home Assistant hinzufügen",
|
|
9
|
+
"ru": "Добавить в Home Assistant классификацию измерения направления и угла ветра",
|
|
10
|
+
"pt": "Adicionar classificação de medição de direção e ângulo do vento ao Home Assistant",
|
|
11
|
+
"nl": "Voeg een classificatie voor windrichting en -hoekmeting toe aan Home Assistant.",
|
|
12
|
+
"fr": "Ajouter une classification aux mesures de direction et d'angle du vent dans Home Assistant",
|
|
13
|
+
"it": "Aggiungi la classificazione della misurazione della direzione e dell'angolo del vento in Home Assistant",
|
|
14
|
+
"es": "Agregar a Home Assistant la clasificación de medición de dirección y ángulo del viento",
|
|
15
|
+
"pl": "Dodaj klasyfikację pomiaru kierunku i kąta wiatru w Asystencie Domowym",
|
|
16
|
+
"uk": "Додайте класифікацію вимірювання напрямку та кута вітру для Home Assistant",
|
|
17
|
+
"zh-cn": "添加 Home Assistant 风向和风角测量分类"
|
|
18
|
+
},
|
|
19
|
+
"1.22.32": {
|
|
20
|
+
"en": "Align Home Assistant sensor device classes, state classes, and units with the current specification",
|
|
21
|
+
"de": "Richten Sie die Sensorgeräteklassen, Statusklassen und Einheiten von Home Assistant an die aktuelle Spezifikation aus.",
|
|
22
|
+
"ru": "Приведите классы сенсорных устройств Home Assistant, классы состояний и единицы измерения в соответствие с текущими спецификациями.",
|
|
23
|
+
"pt": "Alinhe as classes de dispositivos de sensores, classes de estado e unidades do Home Assistant com a especificação atual.",
|
|
24
|
+
"nl": "Stem de apparaatklassen, statusklassen en eenheden van de Home Assistant-sensoren af op de huidige specificaties.",
|
|
25
|
+
"fr": "Alignez les classes de périphériques de capteurs, les classes d'état et les unités de Home Assistant avec les spécifications actuelles.",
|
|
26
|
+
"it": "Allineare le classi dei dispositivi sensore di Home Assistant, le classi di stato e le unità con le specifiche attuali",
|
|
27
|
+
"es": "Alinee las clases de dispositivos de sensores, las clases de estado y las unidades de Home Assistant con la especificación actual.",
|
|
28
|
+
"pl": "Dostosuj klasy urządzeń czujników Home Assistant, klasy stanów i jednostki do bieżącej specyfikacji",
|
|
29
|
+
"uk": "Узгодьте класи сенсорних пристроїв, класи станів та одиниці Home Assistant із поточною специфікацією",
|
|
30
|
+
"zh-cn": "将 Home Assistant 传感器设备类、状态类和单位与当前规范保持一致。"
|
|
31
|
+
},
|
|
6
32
|
"1.22.31": {
|
|
7
33
|
"en": "Add selection of ToIob source id",
|
|
8
34
|
"de": "Auswahl der ToIob-Quell-ID hinzufügen",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "Ostrzeżenie o naprawie błędu dotyczącego nieprawidłowego identyfikatora\nDodaj profil do downloadconfig",
|
|
68
94
|
"uk": "Попередження про виправлення помилки для неправильного ідентифікатора\nДодати профіль до завантаженої конфігурації",
|
|
69
95
|
"zh-cn": "修复错误 ID 警告\n将配置文件添加到 downloadconfig"
|
|
70
|
-
},
|
|
71
|
-
"1.22.26": {
|
|
72
|
-
"en": "Add ststes into Lock entity for ToIob devices",
|
|
73
|
-
"de": "Fügen Sie Statusmeldungen zur Sperrentität für ToIob-Geräte hinzu.",
|
|
74
|
-
"ru": "Добавьте sttes в сущность Lock для устройств ToIob.",
|
|
75
|
-
"pt": "Adicionar estados à entidade Lock para dispositivos ToIob",
|
|
76
|
-
"nl": "Voeg statussen toe aan de Lock-entiteit voor ToIob-apparaten.",
|
|
77
|
-
"fr": "Ajouter des ststes à l'entité Verrou pour les périphériques ToIob",
|
|
78
|
-
"it": "Aggiungi stati all'entità Blocco per i dispositivi ToIob",
|
|
79
|
-
"es": "Agregar estados a la entidad Bloqueo para dispositivos ToIob",
|
|
80
|
-
"pl": "Dodaj stacje do encji blokady dla urządzeń ToIob",
|
|
81
|
-
"uk": "Додати станції до сутності блокування для пристроїв ToIob",
|
|
82
|
-
"zh-cn": "将状态添加到锁定实体中,用于 ToIob 设备"
|
|
83
|
-
},
|
|
84
|
-
"1.22.25": {
|
|
85
|
-
"en": "Change Assignhandler for case intensive Check\nAdd subAssign for a part of name",
|
|
86
|
-
"de": "Ändern Sie den Zuweisungshandler für die fallintensive Prüfung.\nFüge Unterzuweisung für einen Teil des Namens hinzu",
|
|
87
|
-
"ru": "Изменить обработчик назначений для проверки с интенсивным использованием регистров.\nДобавить подназначение для части имени",
|
|
88
|
-
"pt": "Alterar o Assignhandler para verificação que exige alta sensibilidade a maiúsculas e minúsculas.\nAdicionar subatribuição para uma parte do nome",
|
|
89
|
-
"nl": "Wijzig de Assignhandler voor case-intensieve controles.\nVoeg een subtoewijzing toe voor een deel van de naam.",
|
|
90
|
-
"fr": "Modifier le gestionnaire d'affectation pour la vérification intensive des cas\nAjouter une sous-affectation pour une partie du nom",
|
|
91
|
-
"it": "Cambia Assegnatore gestore per controllo intensivo dei casi\nAggiungi subAssegna per una parte del nome",
|
|
92
|
-
"es": "Modificar Assignhandler para comprobación intensiva de casos\nAgregar subAsignación para una parte del nombre",
|
|
93
|
-
"pl": "Zmień Assignhandler na kontrolę intensywnie wykorzystującą przypadek\nDodaj podprzypisanie dla części nazwy",
|
|
94
|
-
"uk": "Змінити обробник присвоєння для перевірки з інтенсивним виконанням регістрів\nДодати subAssign для частини імені",
|
|
95
|
-
"zh-cn": "更改案例密集型检查的分配处理程序\n为名称的一部分添加子分配"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
package/lib/modules/bridge.js
CHANGED
|
@@ -115,20 +115,25 @@ class bridgeClass extends EventEmiter {
|
|
|
115
115
|
var: { device_class: 'reactive_power' },
|
|
116
116
|
kvar: { device_class: 'reactive_power' },
|
|
117
117
|
|
|
118
|
+
// Energy values bridged by this adapter represent consumption
|
|
119
|
+
// counters and need TOTAL_INCREASING for Home Assistant's energy
|
|
120
|
+
// statistics and Energy Dashboard.
|
|
118
121
|
Wh: { device_class: 'energy', state_class: 'total_increasing' },
|
|
119
122
|
kWh: { device_class: 'energy', state_class: 'total_increasing' },
|
|
120
123
|
MWh: { device_class: 'energy', state_class: 'total_increasing' },
|
|
121
124
|
|
|
125
|
+
// For ambiguous consumption units, this adapter deliberately
|
|
126
|
+
// prefers counter semantics so Home Assistant can evaluate them.
|
|
122
127
|
'm³': { device_class: 'gas', state_class: 'total_increasing' },
|
|
123
128
|
'ft³': { device_class: 'gas', state_class: 'total_increasing' },
|
|
124
129
|
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
L: { device_class: 'water', state_class: 'total_increasing' },
|
|
131
|
+
mL: { device_class: 'volume' },
|
|
127
132
|
gal: { device_class: 'volume' },
|
|
128
133
|
|
|
129
|
-
'L/min': { device_class: '
|
|
130
|
-
'L/s': { device_class: '
|
|
131
|
-
'm³/h': { device_class: '
|
|
134
|
+
'L/min': { device_class: 'volume_flow_rate' },
|
|
135
|
+
'L/s': { device_class: 'volume_flow_rate' },
|
|
136
|
+
'm³/h': { device_class: 'volume_flow_rate' },
|
|
132
137
|
|
|
133
138
|
Pa: { device_class: 'pressure' },
|
|
134
139
|
hPa: { device_class: 'pressure' },
|
|
@@ -137,9 +142,11 @@ class bridgeClass extends EventEmiter {
|
|
|
137
142
|
bar: { device_class: 'pressure' },
|
|
138
143
|
psi: { device_class: 'pressure' },
|
|
139
144
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
// Concentration units are shared by CO2, CO, VOC and several
|
|
146
|
+
// other device classes, so a device class cannot be inferred.
|
|
147
|
+
ppm: {},
|
|
148
|
+
ppb: {},
|
|
149
|
+
'µg/m³': {},
|
|
143
150
|
|
|
144
151
|
'W/m²': { device_class: 'irradiance' },
|
|
145
152
|
mm: { device_class: 'precipitation' },
|
|
@@ -1639,6 +1646,10 @@ class bridgeClass extends EventEmiter {
|
|
|
1639
1646
|
} else if (role.includes('illuminance') || role.includes('brightness')) {
|
|
1640
1647
|
attributes.device_class = 'illuminance';
|
|
1641
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 || '°';
|
|
1642
1653
|
} else if (role.includes('battery')) {
|
|
1643
1654
|
attributes.device_class = 'battery';
|
|
1644
1655
|
attributes.entity_category = 'diagnostic';
|
|
@@ -1667,6 +1678,9 @@ class bridgeClass extends EventEmiter {
|
|
|
1667
1678
|
(role.includes('power.consumption') && normalizedUnitLower.includes('wh'))
|
|
1668
1679
|
) {
|
|
1669
1680
|
attributes.device_class = 'energy';
|
|
1681
|
+
// Energy and consumption roles represent monotonically
|
|
1682
|
+
// increasing counters used by Home Assistant's energy
|
|
1683
|
+
// statistics and Energy Dashboard.
|
|
1670
1684
|
attributes.state_class = 'total_increasing';
|
|
1671
1685
|
attributes.unit_of_measurement = normalizedUnit || 'Wh';
|
|
1672
1686
|
} else if (role.includes('weight')) {
|
|
@@ -1683,7 +1697,9 @@ class bridgeClass extends EventEmiter {
|
|
|
1683
1697
|
attributes.unit_of_measurement = normalizedUnit;
|
|
1684
1698
|
|
|
1685
1699
|
if (this.unitMap[normalizedUnit]) {
|
|
1686
|
-
|
|
1700
|
+
if (this.unitMap[normalizedUnit].device_class) {
|
|
1701
|
+
attributes.device_class = this.unitMap[normalizedUnit].device_class;
|
|
1702
|
+
}
|
|
1687
1703
|
|
|
1688
1704
|
// Falls es in unitMap einen gültigen Eintrag gibt UND noch keine state_class gesetzt wurde
|
|
1689
1705
|
if (!attributes.state_class && this.unitMap[normalizedUnit].state_class) {
|
|
@@ -1706,11 +1722,29 @@ class bridgeClass extends EventEmiter {
|
|
|
1706
1722
|
attributes.max = common.max;
|
|
1707
1723
|
}
|
|
1708
1724
|
|
|
1709
|
-
//
|
|
1710
|
-
//
|
|
1711
|
-
|
|
1725
|
+
// state_class is a sensor-only property. Home Assistant does
|
|
1726
|
+
// not allow MEASUREMENT for classes representing totals.
|
|
1727
|
+
const classesWithoutMeasurement = new Set([
|
|
1728
|
+
'date',
|
|
1729
|
+
'energy',
|
|
1730
|
+
'enum',
|
|
1731
|
+
'gas',
|
|
1732
|
+
'monetary',
|
|
1733
|
+
'timestamp',
|
|
1734
|
+
'volume',
|
|
1735
|
+
'water',
|
|
1736
|
+
]);
|
|
1737
|
+
if (
|
|
1738
|
+
entityType === 'sensor' &&
|
|
1739
|
+
!attributes.state_class &&
|
|
1740
|
+
type !== 'string' &&
|
|
1741
|
+
!classesWithoutMeasurement.has(attributes.device_class)
|
|
1742
|
+
) {
|
|
1712
1743
|
attributes.state_class = 'measurement';
|
|
1713
1744
|
}
|
|
1745
|
+
if (entityType !== 'sensor') {
|
|
1746
|
+
delete attributes.state_class;
|
|
1747
|
+
}
|
|
1714
1748
|
}
|
|
1715
1749
|
|
|
1716
1750
|
if (entityType === 'valve') {
|
|
@@ -1800,8 +1834,8 @@ class bridgeClass extends EventEmiter {
|
|
|
1800
1834
|
.replace(/^mcg\/m3$/i, 'µg/m³')
|
|
1801
1835
|
.replace(/^um\/m3$/i, 'µg/m³')
|
|
1802
1836
|
|
|
1803
|
-
.replace(/^L\/min$/i, '
|
|
1804
|
-
.replace(/^L\/s$/i, '
|
|
1837
|
+
.replace(/^L\/min$/i, 'L/min')
|
|
1838
|
+
.replace(/^L\/s$/i, 'L/s')
|
|
1805
1839
|
|
|
1806
1840
|
.replace(/^m\^?3\/h$/i, 'm³/h')
|
|
1807
1841
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.lorawan",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.33",
|
|
4
4
|
"description": "converts the desired lora gateway data to a ioBroker structure",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "BenAhrdt",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@iobroker/adapter-core": "^3.4.1",
|
|
29
|
-
"@iobroker/dm-utils": "^3.
|
|
29
|
+
"@iobroker/dm-utils": "^3.1.4",
|
|
30
30
|
"easy-crc": "^1.1.0",
|
|
31
31
|
"lodash": "^4.18.1",
|
|
32
|
-
"mqtt": "^5.15.
|
|
32
|
+
"mqtt": "^5.15.2",
|
|
33
33
|
"node-schedule": "^2.1.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
@@ -39,10 +39,10 @@
|
|
|
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
|
-
"@iobroker/testing": "^5.
|
|
42
|
+
"@iobroker/testing": "^5.3.0",
|
|
43
43
|
"@tsconfig/node22": "^22.0.5",
|
|
44
44
|
"@types/lodash": "^4.17.24",
|
|
45
|
-
"@types/node": "^22.
|
|
45
|
+
"@types/node": "^22.20.1",
|
|
46
46
|
"typescript": "~5.9.3"
|
|
47
47
|
},
|
|
48
48
|
"main": "main.js",
|