iobroker.lorawan 1.22.30 → 1.22.32
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/admin/i18n/de.json +2 -0
- package/admin/i18n/en.json +2 -0
- package/admin/i18n/es.json +2 -0
- package/admin/i18n/fr.json +2 -0
- package/admin/i18n/it.json +2 -0
- package/admin/i18n/nl.json +2 -0
- package/admin/i18n/pl.json +2 -0
- package/admin/i18n/pt.json +2 -0
- package/admin/i18n/ru.json +2 -0
- package/admin/i18n/uk.json +2 -0
- package/admin/i18n/zh-cn.json +2 -0
- package/admin/jsonConfig.json +17 -0
- package/io-package.json +28 -27
- package/lib/modules/bridge.js +44 -14
- package/lib/modules/bridgeDeviceHandler.js +3 -2
- 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`. 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.32 (2026-08-19)
|
|
32
|
+
- (BenAhrdt) Align Home Assistant sensor device classes, state classes, and units with the current specification
|
|
33
|
+
|
|
34
|
+
### 1.22.31 (2026-07-09)
|
|
35
|
+
- (BenAhrdt) Add selection of ToIob source id
|
|
36
|
+
|
|
27
37
|
### 1.22.30 (2026-07-07)
|
|
28
38
|
- (BenAhrdt) Add PIR Mini device Profile
|
|
29
39
|
- (BenAhrdt) Add possibillity to ad states to downlink numbers
|
|
@@ -34,14 +44,17 @@ For now there is documentation in English here: https://wiki.hafenmeister.de
|
|
|
34
44
|
### 1.22.28 (2026-07-05)
|
|
35
45
|
- (BenAhrdt) Add DewPointTemperature to assignhandler
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
- (BenAhrdt) Bugfix warning for wrong id
|
|
39
|
-
- (BenAhrdt) Add Profile to downloadconfig
|
|
47
|
+
[Older changes can be found there](CHANGELOG_OLD.md)
|
|
40
48
|
|
|
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/admin/i18n/de.json
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"BridgeTypeOff": "aus",
|
|
29
29
|
"BridgeTypeSH": "Smart Home",
|
|
30
30
|
"BridgeTypeTooltip": "Wählen Sie den Typ des Fremdsystems aus",
|
|
31
|
+
"BridgeToIobIdSource": "ToIob-ID Quelle",
|
|
32
|
+
"BridgeToIobIdSourceTooltip": "Wählen Sie, ob ToIob-Geräte ihre ioBroker-State-ID aus der entity_id oder unique_id bilden",
|
|
31
33
|
"BridgenotificationActivation": "Benachrichtigungsaktivierung",
|
|
32
34
|
"BridgenotificationTooltip": "Aktivieren oder deaktivieren Sie die Benachrichtigung",
|
|
33
35
|
"ClimateActTemperatureText": "Isttemperatur",
|
package/admin/i18n/en.json
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"BridgeTypeOff": "off",
|
|
29
29
|
"BridgeTypeSH": "Smart Home",
|
|
30
30
|
"BridgeTypeTooltip": "Select the Type of the foreign System",
|
|
31
|
+
"BridgeToIobIdSource": "ToIob ID source",
|
|
32
|
+
"BridgeToIobIdSourceTooltip": "Select whether ToIob devices build their ioBroker state ID from entity_id or unique_id",
|
|
31
33
|
"BridgenotificationActivation": "notification activation",
|
|
32
34
|
"BridgenotificationTooltip": "activate or deactivate the notification",
|
|
33
35
|
"ClimateActTemperatureText": "Target Temperature",
|
package/admin/i18n/es.json
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"BridgeTypeOff": "apagado",
|
|
29
29
|
"BridgeTypeSH": "Hogar inteligente",
|
|
30
30
|
"BridgeTypeTooltip": "Seleccione el tipo de sistema externo",
|
|
31
|
+
"BridgeToIobIdSource": "Fuente de ID ToIob",
|
|
32
|
+
"BridgeToIobIdSourceTooltip": "Seleccione si los dispositivos ToIob crean su ID de estado de ioBroker desde entity_id o unique_id",
|
|
31
33
|
"BridgenotificationActivation": "activación de notificación",
|
|
32
34
|
"BridgenotificationTooltip": "activar o desactivar la notificación",
|
|
33
35
|
"ClimateActTemperatureText": "Temperatura objetivo",
|
package/admin/i18n/fr.json
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"BridgeTypeOff": "désactivé",
|
|
29
29
|
"BridgeTypeSH": "Maison intelligente",
|
|
30
30
|
"BridgeTypeTooltip": "Sélectionnez le type du système étranger",
|
|
31
|
+
"BridgeToIobIdSource": "Source d'ID ToIob",
|
|
32
|
+
"BridgeToIobIdSourceTooltip": "Choisissez si les appareils ToIob créent leur ID d'état ioBroker à partir de entity_id ou unique_id",
|
|
31
33
|
"BridgenotificationActivation": "activation des notifications",
|
|
32
34
|
"BridgenotificationTooltip": "activer ou désactiver la notification",
|
|
33
35
|
"ClimateActTemperatureText": "Température cible",
|
package/admin/i18n/it.json
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"BridgeTypeOff": "spento",
|
|
29
29
|
"BridgeTypeSH": "Casa intelligente",
|
|
30
30
|
"BridgeTypeTooltip": "Selezionare la Tipologia del Sistema estero",
|
|
31
|
+
"BridgeToIobIdSource": "Origine ID ToIob",
|
|
32
|
+
"BridgeToIobIdSourceTooltip": "Scegliere se i dispositivi ToIob creano l'ID stato ioBroker da entity_id o unique_id",
|
|
31
33
|
"BridgenotificationActivation": "attivazione delle notifiche",
|
|
32
34
|
"BridgenotificationTooltip": "attivare o disattivare la notifica",
|
|
33
35
|
"ClimateActTemperatureText": "Temperatura target",
|
package/admin/i18n/nl.json
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"BridgeTypeOff": "uit",
|
|
29
29
|
"BridgeTypeSH": "Slim huis",
|
|
30
30
|
"BridgeTypeTooltip": "Selecteer het type van het buitenlandse systeem",
|
|
31
|
+
"BridgeToIobIdSource": "ToIob-ID-bron",
|
|
32
|
+
"BridgeToIobIdSourceTooltip": "Selecteer of ToIob-apparaten hun ioBroker-state-ID maken uit entity_id of unique_id",
|
|
31
33
|
"BridgenotificationActivation": "melding activering",
|
|
32
34
|
"BridgenotificationTooltip": "activeer of deactiveer de melding",
|
|
33
35
|
"ClimateActTemperatureText": "Doeltemperatuur",
|
package/admin/i18n/pl.json
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"BridgeTypeOff": "wyłączony",
|
|
29
29
|
"BridgeTypeSH": "Inteligentny dom",
|
|
30
30
|
"BridgeTypeTooltip": "Wybierz typ obcego systemu",
|
|
31
|
+
"BridgeToIobIdSource": "Źródło ID ToIob",
|
|
32
|
+
"BridgeToIobIdSourceTooltip": "Wybierz, czy urządzenia ToIob tworzą ID stanu ioBroker z entity_id czy unique_id",
|
|
31
33
|
"BridgenotificationActivation": "aktywacja powiadomień",
|
|
32
34
|
"BridgenotificationTooltip": "włączyć lub wyłączyć powiadomienie",
|
|
33
35
|
"ClimateActTemperatureText": "Temperatura docelowa",
|
package/admin/i18n/pt.json
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"BridgeTypeOff": "desligado",
|
|
29
29
|
"BridgeTypeSH": "Casa inteligente",
|
|
30
30
|
"BridgeTypeTooltip": "Selecione o tipo do sistema externo",
|
|
31
|
+
"BridgeToIobIdSource": "Fonte de ID ToIob",
|
|
32
|
+
"BridgeToIobIdSourceTooltip": "Selecione se os dispositivos ToIob criam o ID de estado ioBroker a partir de entity_id ou unique_id",
|
|
31
33
|
"BridgenotificationActivation": "ativação de notificação",
|
|
32
34
|
"BridgenotificationTooltip": "ativar ou desativar a notificação",
|
|
33
35
|
"ClimateActTemperatureText": "Temperatura alvo",
|
package/admin/i18n/ru.json
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"BridgeTypeOff": "выключенный",
|
|
29
29
|
"BridgeTypeSH": "Умный дом",
|
|
30
30
|
"BridgeTypeTooltip": "Выберите тип сторонней системы",
|
|
31
|
+
"BridgeToIobIdSource": "Источник ID ToIob",
|
|
32
|
+
"BridgeToIobIdSourceTooltip": "Выберите, создают ли устройства ToIob ID состояния ioBroker из entity_id или unique_id",
|
|
31
33
|
"BridgenotificationActivation": "активация уведомления",
|
|
32
34
|
"BridgenotificationTooltip": "активировать или деактивировать уведомление",
|
|
33
35
|
"ClimateActTemperatureText": "Целевая температура",
|
package/admin/i18n/uk.json
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"BridgeTypeOff": "вимкнено",
|
|
29
29
|
"BridgeTypeSH": "Розумний будинок",
|
|
30
30
|
"BridgeTypeTooltip": "Виберіть тип сторонньої системи",
|
|
31
|
+
"BridgeToIobIdSource": "Джерело ID ToIob",
|
|
32
|
+
"BridgeToIobIdSourceTooltip": "Виберіть, чи пристрої ToIob створюють ID стану ioBroker з entity_id або unique_id",
|
|
31
33
|
"BridgenotificationActivation": "активація сповіщень",
|
|
32
34
|
"BridgenotificationTooltip": "активувати або деактивувати сповіщення",
|
|
33
35
|
"ClimateActTemperatureText": "Цільова температура",
|
package/admin/i18n/zh-cn.json
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"BridgeTypeOff": "离开",
|
|
29
29
|
"BridgeTypeSH": "智能家居",
|
|
30
30
|
"BridgeTypeTooltip": "选择外部系统类型",
|
|
31
|
+
"BridgeToIobIdSource": "ToIob ID 来源",
|
|
32
|
+
"BridgeToIobIdSourceTooltip": "选择 ToIob 设备从 entity_id 还是 unique_id 创建 ioBroker state ID",
|
|
31
33
|
"BridgenotificationActivation": "通知激活",
|
|
32
34
|
"BridgenotificationTooltip": "激活或停用通知",
|
|
33
35
|
"ClimateActTemperatureText": "目标温度",
|
package/admin/jsonConfig.json
CHANGED
|
@@ -878,6 +878,23 @@
|
|
|
878
878
|
"lg": 3,
|
|
879
879
|
"xl": 3
|
|
880
880
|
},
|
|
881
|
+
"BridgeToIobIdSource": {
|
|
882
|
+
"newLine": true,
|
|
883
|
+
"type": "select",
|
|
884
|
+
"label": "BridgeToIobIdSource",
|
|
885
|
+
"hidden": "data.BridgeType === 'off'",
|
|
886
|
+
"tooltip": "BridgeToIobIdSourceTooltip",
|
|
887
|
+
"options": [
|
|
888
|
+
{ "label": "Entity Id", "value": "entity_id" },
|
|
889
|
+
{ "label": "Unique Id", "value": "unique_id" }
|
|
890
|
+
],
|
|
891
|
+
"default": "entity_id",
|
|
892
|
+
"xs": 12,
|
|
893
|
+
"sm": 3,
|
|
894
|
+
"md": 3,
|
|
895
|
+
"lg": 3,
|
|
896
|
+
"xl": 3
|
|
897
|
+
},
|
|
881
898
|
"_BridgeServersettingsHeader": {
|
|
882
899
|
"newLine": true,
|
|
883
900
|
"type": "header",
|
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.32",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.22.32": {
|
|
7
|
+
"en": "Align Home Assistant sensor device classes, state classes, and units with the current specification",
|
|
8
|
+
"de": "Richten Sie die Sensorgeräteklassen, Statusklassen und Einheiten von Home Assistant an die aktuelle Spezifikation aus.",
|
|
9
|
+
"ru": "Приведите классы сенсорных устройств Home Assistant, классы состояний и единицы измерения в соответствие с текущими спецификациями.",
|
|
10
|
+
"pt": "Alinhe as classes de dispositivos de sensores, classes de estado e unidades do Home Assistant com a especificação atual.",
|
|
11
|
+
"nl": "Stem de apparaatklassen, statusklassen en eenheden van de Home Assistant-sensoren af op de huidige specificaties.",
|
|
12
|
+
"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.",
|
|
13
|
+
"it": "Allineare le classi dei dispositivi sensore di Home Assistant, le classi di stato e le unità con le specifiche attuali",
|
|
14
|
+
"es": "Alinee las clases de dispositivos de sensores, las clases de estado y las unidades de Home Assistant con la especificación actual.",
|
|
15
|
+
"pl": "Dostosuj klasy urządzeń czujników Home Assistant, klasy stanów i jednostki do bieżącej specyfikacji",
|
|
16
|
+
"uk": "Узгодьте класи сенсорних пристроїв, класи станів та одиниці Home Assistant із поточною специфікацією",
|
|
17
|
+
"zh-cn": "将 Home Assistant 传感器设备类、状态类和单位与当前规范保持一致。"
|
|
18
|
+
},
|
|
19
|
+
"1.22.31": {
|
|
20
|
+
"en": "Add selection of ToIob source id",
|
|
21
|
+
"de": "Auswahl der ToIob-Quell-ID hinzufügen",
|
|
22
|
+
"ru": "Добавить выборку идентификатора источника ToIob",
|
|
23
|
+
"pt": "Adicionar seleção de ID da fonte ToIob",
|
|
24
|
+
"nl": "Voeg een selectie van de ToIob-bron-ID toe.",
|
|
25
|
+
"fr": "Ajouter une sélection d'identifiants de source ToIob",
|
|
26
|
+
"it": "Aggiungi selezione ID sorgente ToIob",
|
|
27
|
+
"es": "Agregar selección de ID de origen ToIob",
|
|
28
|
+
"pl": "Dodaj wybór identyfikatora źródłowego obiektu ToIob",
|
|
29
|
+
"uk": "Додати вибір ідентифікатора джерела ToIob",
|
|
30
|
+
"zh-cn": "添加 ToIob 源 ID 的选择"
|
|
31
|
+
},
|
|
6
32
|
"1.22.30": {
|
|
7
33
|
"en": "Add PIR Mini device Profile\nAdd possibillity to ad states to downlink numbers",
|
|
8
34
|
"de": "PIR-Mini-Geräteprofil hinzufügen\nFüge die Möglichkeit hinzu, Anzeigenstatus zu Downlink-Nummern hinzuzufügen",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "Dodaj stacje do encji blokady dla urządzeń ToIob",
|
|
68
94
|
"uk": "Додати станції до сутності блокування для пристроїв ToIob",
|
|
69
95
|
"zh-cn": "将状态添加到锁定实体中,用于 ToIob 设备"
|
|
70
|
-
},
|
|
71
|
-
"1.22.25": {
|
|
72
|
-
"en": "Change Assignhandler for case intensive Check\nAdd subAssign for a part of name",
|
|
73
|
-
"de": "Ändern Sie den Zuweisungshandler für die fallintensive Prüfung.\nFüge Unterzuweisung für einen Teil des Namens hinzu",
|
|
74
|
-
"ru": "Изменить обработчик назначений для проверки с интенсивным использованием регистров.\nДобавить подназначение для части имени",
|
|
75
|
-
"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",
|
|
76
|
-
"nl": "Wijzig de Assignhandler voor case-intensieve controles.\nVoeg een subtoewijzing toe voor een deel van de naam.",
|
|
77
|
-
"fr": "Modifier le gestionnaire d'affectation pour la vérification intensive des cas\nAjouter une sous-affectation pour une partie du nom",
|
|
78
|
-
"it": "Cambia Assegnatore gestore per controllo intensivo dei casi\nAggiungi subAssegna per una parte del nome",
|
|
79
|
-
"es": "Modificar Assignhandler para comprobación intensiva de casos\nAgregar subAsignación para una parte del nombre",
|
|
80
|
-
"pl": "Zmień Assignhandler na kontrolę intensywnie wykorzystującą przypadek\nDodaj podprzypisanie dla części nazwy",
|
|
81
|
-
"uk": "Змінити обробник присвоєння для перевірки з інтенсивним виконанням регістрів\nДодати subAssign для частини імені",
|
|
82
|
-
"zh-cn": "更改案例密集型检查的分配处理程序\n为名称的一部分添加子分配"
|
|
83
|
-
},
|
|
84
|
-
"1.22.24": {
|
|
85
|
-
"en": "Add Absolute Humidity to device_class",
|
|
86
|
-
"de": "Füge der Geräteklasse die absolute Luftfeuchtigkeit hinzu.",
|
|
87
|
-
"ru": "Добавить абсолютную влажность в device_class",
|
|
88
|
-
"pt": "Adicionar umidade absoluta à classe do dispositivo",
|
|
89
|
-
"nl": "Voeg absolute luchtvochtigheid toe aan de device_class.",
|
|
90
|
-
"fr": "Ajouter l'humidité absolue à la classe de périphérique",
|
|
91
|
-
"it": "Aggiungi l'umidità assoluta alla classe di dispositivi",
|
|
92
|
-
"es": "Agregar humedad absoluta a device_class",
|
|
93
|
-
"pl": "Dodaj wilgotność bezwzględną do device_class",
|
|
94
|
-
"uk": "Додати абсолютну вологість до класу пристроїв",
|
|
95
|
-
"zh-cn": "将绝对湿度添加到设备类"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -429,6 +429,7 @@
|
|
|
429
429
|
"RefreshDiscoveryCronJob": "0 * * * *",
|
|
430
430
|
"BridgeEnum": "*",
|
|
431
431
|
"BridgenotificationActivation": "allNotifications, bridgeConnection, newDiscover, deviceState",
|
|
432
|
+
"BridgeToIobIdSource": "entity_id",
|
|
432
433
|
"BridgeDevicesToGenerate": [
|
|
433
434
|
"toIobDevices",
|
|
434
435
|
"foreignDevices",
|
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' },
|
|
@@ -1667,6 +1674,9 @@ class bridgeClass extends EventEmiter {
|
|
|
1667
1674
|
(role.includes('power.consumption') && normalizedUnitLower.includes('wh'))
|
|
1668
1675
|
) {
|
|
1669
1676
|
attributes.device_class = 'energy';
|
|
1677
|
+
// Energy and consumption roles represent monotonically
|
|
1678
|
+
// increasing counters used by Home Assistant's energy
|
|
1679
|
+
// statistics and Energy Dashboard.
|
|
1670
1680
|
attributes.state_class = 'total_increasing';
|
|
1671
1681
|
attributes.unit_of_measurement = normalizedUnit || 'Wh';
|
|
1672
1682
|
} else if (role.includes('weight')) {
|
|
@@ -1683,7 +1693,9 @@ class bridgeClass extends EventEmiter {
|
|
|
1683
1693
|
attributes.unit_of_measurement = normalizedUnit;
|
|
1684
1694
|
|
|
1685
1695
|
if (this.unitMap[normalizedUnit]) {
|
|
1686
|
-
|
|
1696
|
+
if (this.unitMap[normalizedUnit].device_class) {
|
|
1697
|
+
attributes.device_class = this.unitMap[normalizedUnit].device_class;
|
|
1698
|
+
}
|
|
1687
1699
|
|
|
1688
1700
|
// Falls es in unitMap einen gültigen Eintrag gibt UND noch keine state_class gesetzt wurde
|
|
1689
1701
|
if (!attributes.state_class && this.unitMap[normalizedUnit].state_class) {
|
|
@@ -1706,11 +1718,29 @@ class bridgeClass extends EventEmiter {
|
|
|
1706
1718
|
attributes.max = common.max;
|
|
1707
1719
|
}
|
|
1708
1720
|
|
|
1709
|
-
//
|
|
1710
|
-
//
|
|
1711
|
-
|
|
1721
|
+
// state_class is a sensor-only property. Home Assistant does
|
|
1722
|
+
// not allow MEASUREMENT for classes representing totals.
|
|
1723
|
+
const classesWithoutMeasurement = new Set([
|
|
1724
|
+
'date',
|
|
1725
|
+
'energy',
|
|
1726
|
+
'enum',
|
|
1727
|
+
'gas',
|
|
1728
|
+
'monetary',
|
|
1729
|
+
'timestamp',
|
|
1730
|
+
'volume',
|
|
1731
|
+
'water',
|
|
1732
|
+
]);
|
|
1733
|
+
if (
|
|
1734
|
+
entityType === 'sensor' &&
|
|
1735
|
+
!attributes.state_class &&
|
|
1736
|
+
type !== 'string' &&
|
|
1737
|
+
!classesWithoutMeasurement.has(attributes.device_class)
|
|
1738
|
+
) {
|
|
1712
1739
|
attributes.state_class = 'measurement';
|
|
1713
1740
|
}
|
|
1741
|
+
if (entityType !== 'sensor') {
|
|
1742
|
+
delete attributes.state_class;
|
|
1743
|
+
}
|
|
1714
1744
|
}
|
|
1715
1745
|
|
|
1716
1746
|
if (entityType === 'valve') {
|
|
@@ -1800,8 +1830,8 @@ class bridgeClass extends EventEmiter {
|
|
|
1800
1830
|
.replace(/^mcg\/m3$/i, 'µg/m³')
|
|
1801
1831
|
.replace(/^um\/m3$/i, 'µg/m³')
|
|
1802
1832
|
|
|
1803
|
-
.replace(/^L\/min$/i, '
|
|
1804
|
-
.replace(/^L\/s$/i, '
|
|
1833
|
+
.replace(/^L\/min$/i, 'L/min')
|
|
1834
|
+
.replace(/^L\/s$/i, 'L/s')
|
|
1805
1835
|
|
|
1806
1836
|
.replace(/^m\^?3\/h$/i, 'm³/h')
|
|
1807
1837
|
|
|
@@ -773,8 +773,9 @@ class bridgeDeviceHandlerClass {
|
|
|
773
773
|
const activeFunction = 'bridgeDeviceHandler.js - buildSafeStateId';
|
|
774
774
|
this.adapter.log.silly(`Function ${activeFunction} started.`);
|
|
775
775
|
try {
|
|
776
|
-
|
|
777
|
-
const baseId =
|
|
776
|
+
const idSource = this.adapter.config.BridgeToIobIdSource || 'entity_id';
|
|
777
|
+
const baseId =
|
|
778
|
+
idSource === 'unique_id' ? entity.unique_id || entity.entity_id : entity.entity_id || entity.unique_id;
|
|
778
779
|
|
|
779
780
|
if (!baseId) {
|
|
780
781
|
return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.lorawan",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.32",
|
|
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",
|