iobroker.lorawan 1.18.30 → 1.18.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 +6 -0
- package/admin/i18n/de/translations.json +13 -0
- package/admin/i18n/en/translations.json +14 -1
- package/admin/i18n/es/translations.json +13 -0
- package/admin/i18n/fr/translations.json +13 -0
- package/admin/i18n/it/translations.json +13 -0
- package/admin/i18n/nl/translations.json +13 -0
- package/admin/i18n/pl/translations.json +13 -0
- package/admin/i18n/pt/translations.json +13 -0
- package/admin/i18n/ru/translations.json +13 -0
- package/admin/i18n/uk/translations.json +13 -0
- package/admin/i18n/zh-cn/translations.json +13 -0
- package/admin/jsonConfig.json +157 -1
- package/io-package.json +29 -28
- package/lib/modules/bridge.js +242 -84
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,12 @@ For now there is documentation in English here: https://wiki.hafenmeister.de
|
|
|
23
23
|
Placeholder for the next version (at the beginning of the line):
|
|
24
24
|
### **WORK IN PROGRESS**
|
|
25
25
|
-->
|
|
26
|
+
### 1.18.32 (2025-11-28)
|
|
27
|
+
* (BenAhrdt) Changes in cover and add Lock
|
|
28
|
+
|
|
29
|
+
### 1.18.31 (2025-11-27)
|
|
30
|
+
* (BenAhrdt) Bugfix state at light effekts in case of 0
|
|
31
|
+
|
|
26
32
|
### 1.18.30 (2025-11-27)
|
|
27
33
|
* (BenAhrdt) setting dataExchange to 2 entitie (FromIob & ToIob)
|
|
28
34
|
|
|
@@ -88,6 +88,18 @@
|
|
|
88
88
|
"LoRaWAN Network Service is disconnected": "Der Lorawan Netzwerkdienst ist getrennt",
|
|
89
89
|
"LoRaWAN device is back online": "Folgendes Lorawan Gerät ist wieder online",
|
|
90
90
|
"LoRaWAN device is offline": "Folgendes Lorawan Gerät ist offline",
|
|
91
|
+
"LockHeader": "Definieren Sie Zustände für eine Sperrentität",
|
|
92
|
+
"LockInformation": "Hier können Sie ein Array von Sperrdefinitionen definieren",
|
|
93
|
+
"LockLockText": "Verriegeln Id",
|
|
94
|
+
"LockNameText": "Entitätsname",
|
|
95
|
+
"LockOpen": "offen",
|
|
96
|
+
"LockOpenText": "Öffnen Id",
|
|
97
|
+
"LockOpenTooltip": "Ausgewählt: separate boolesche Zustände für Öffnen",
|
|
98
|
+
"LockSeparate": "separate",
|
|
99
|
+
"LockSeparateState": "separater Status",
|
|
100
|
+
"LockSeparateStateTooltip": "ausgewählt: separater Status für den Status der Sperre",
|
|
101
|
+
"LockSeparateTooltip": "Ausgewählt: separate boolesche Zustände für Sperren und Entsperren. Ansonsten ein String-Zustand.",
|
|
102
|
+
"LockUnlockText": "Entriegeln Id",
|
|
91
103
|
"LorawanOff": "Aus",
|
|
92
104
|
"MQTTInstance": "MQTT -Instanz",
|
|
93
105
|
"NoBridgeConfiged": "Es wurde keine Bridge Konfiguriert !!!",
|
|
@@ -101,6 +113,7 @@
|
|
|
101
113
|
"Serverinformation": "Legen Sie die wichtigsten Kommunikationseinstellungen für Ihren Server fest",
|
|
102
114
|
"ServersettingsHeader": "Server Einstellungen",
|
|
103
115
|
"State": "State",
|
|
116
|
+
"StateText": "Status Id",
|
|
104
117
|
"String": "Zeichenkette",
|
|
105
118
|
"UpText": "Up-Befehls-ID",
|
|
106
119
|
"VirtualMode": "Virtueller Modus",
|
|
@@ -226,5 +226,18 @@
|
|
|
226
226
|
"OneString": "one string for command",
|
|
227
227
|
"no command": "no command id",
|
|
228
228
|
"CoverPosition": "position",
|
|
229
|
-
"CoverPositionTooltip": "selected: separate id for position"
|
|
229
|
+
"CoverPositionTooltip": "selected: separate id for position",
|
|
230
|
+
"LockHeader": "Define States for a Lock Entity",
|
|
231
|
+
"LockInformation": "Here you can define an array of Lock definitions",
|
|
232
|
+
"LockNameText": "Entityname",
|
|
233
|
+
"LockSeparate": "separate",
|
|
234
|
+
"LockSeparateTooltip": "selected: separate boolean states for lock, unlock. Otherwise, one string state.",
|
|
235
|
+
"LockOpen": "open",
|
|
236
|
+
"LockOpenTooltip": "selected: separate boolean states for open",
|
|
237
|
+
"LockSeparateState": "separate state",
|
|
238
|
+
"LockSeparateStateTooltip": "selected: separate state for the state of the lock",
|
|
239
|
+
"StateText": "State ID",
|
|
240
|
+
"LockLockText": "Lock ID",
|
|
241
|
+
"LockUnlockText": "Unlock ID",
|
|
242
|
+
"LockOpenText": "Open ID"
|
|
230
243
|
}
|
|
@@ -88,6 +88,18 @@
|
|
|
88
88
|
"LoRaWAN Network Service is disconnected": "El servicio de red LoRaWAN está desconectado",
|
|
89
89
|
"LoRaWAN device is back online": "El siguiente dispositivo LoRaWAN vuelve a estar en línea",
|
|
90
90
|
"LoRaWAN device is offline": "El siguiente dispositivo LoRaWAN está fuera de línea",
|
|
91
|
+
"LockHeader": "Definir estados para una entidad de bloqueo",
|
|
92
|
+
"LockInformation": "Aquí puede definir una serie de definiciones de bloqueo.",
|
|
93
|
+
"LockLockText": "ID de bloqueo",
|
|
94
|
+
"LockNameText": "nombre de entidad",
|
|
95
|
+
"LockOpen": "abierto",
|
|
96
|
+
"LockOpenText": "Abrir identificación",
|
|
97
|
+
"LockOpenTooltip": "seleccionado: estados booleanos separados para abrir",
|
|
98
|
+
"LockSeparate": "separado",
|
|
99
|
+
"LockSeparateState": "estado separado",
|
|
100
|
+
"LockSeparateStateTooltip": "seleccionado: estado separado para el estado de la cerradura",
|
|
101
|
+
"LockSeparateTooltip": "seleccionado: estados booleanos separados para bloquear, desbloquear. De lo contrario, un estado de cadena.",
|
|
102
|
+
"LockUnlockText": "Desbloquear identificación",
|
|
91
103
|
"LorawanOff": "apagado",
|
|
92
104
|
"MQTTInstance": "Instancia MQTT",
|
|
93
105
|
"NoBridgeConfiged": "¡¡¡No hay ningún puente configurado !!!",
|
|
@@ -101,6 +113,7 @@
|
|
|
101
113
|
"Serverinformation": "Establezca la configuración principal de comunicación para su servidor",
|
|
102
114
|
"ServersettingsHeader": "Configuración del servidor",
|
|
103
115
|
"State": "Estado",
|
|
116
|
+
"StateText": "identificación estatal",
|
|
104
117
|
"String": "Cadena",
|
|
105
118
|
"UpText": "ID de comando arriba",
|
|
106
119
|
"VirtualMode": "Modo Virtual",
|
|
@@ -88,6 +88,18 @@
|
|
|
88
88
|
"LoRaWAN Network Service is disconnected": "Le service réseau LoRaWAN est déconnecté",
|
|
89
89
|
"LoRaWAN device is back online": "L'appareil LoRaWAN suivant est de nouveau en ligne",
|
|
90
90
|
"LoRaWAN device is offline": "L'appareil LoRaWAN suivant est hors ligne",
|
|
91
|
+
"LockHeader": "Définir les états d'une entité de verrouillage",
|
|
92
|
+
"LockInformation": "Ici, vous pouvez définir un tableau de définitions de verrouillage",
|
|
93
|
+
"LockLockText": "ID de verrouillage",
|
|
94
|
+
"LockNameText": "Nom de l'entité",
|
|
95
|
+
"LockOpen": "ouvrir",
|
|
96
|
+
"LockOpenText": "Ouvrir l'identifiant",
|
|
97
|
+
"LockOpenTooltip": "sélectionné : états booléens séparés pour l'ouverture",
|
|
98
|
+
"LockSeparate": "séparé",
|
|
99
|
+
"LockSeparateState": "état séparé",
|
|
100
|
+
"LockSeparateStateTooltip": "sélectionné : état séparé pour l'état de la serrure",
|
|
101
|
+
"LockSeparateTooltip": "sélectionné : états booléens séparés pour le verrouillage et le déverrouillage. Sinon, un état de chaîne.",
|
|
102
|
+
"LockUnlockText": "Déverrouiller l'identifiant",
|
|
91
103
|
"LorawanOff": "désactivé",
|
|
92
104
|
"MQTTInstance": "Instance MQTT",
|
|
93
105
|
"NoBridgeConfiged": "Il n'y a pas de pont configuré !!!",
|
|
@@ -101,6 +113,7 @@
|
|
|
101
113
|
"Serverinformation": "Définissez les principaux paramètres de communication sur votre serveur",
|
|
102
114
|
"ServersettingsHeader": "Paramètres du serveur",
|
|
103
115
|
"State": "État",
|
|
116
|
+
"StateText": "ID d'État",
|
|
104
117
|
"String": "Chaîne",
|
|
105
118
|
"UpText": "ID de commande vers le haut",
|
|
106
119
|
"VirtualMode": "Mode virtuel",
|
|
@@ -88,6 +88,18 @@
|
|
|
88
88
|
"LoRaWAN Network Service is disconnected": "Il servizio di rete LoRaWAN è disconnesso",
|
|
89
89
|
"LoRaWAN device is back online": "Il seguente dispositivo LoRaWAN è di nuovo online",
|
|
90
90
|
"LoRaWAN device is offline": "Il seguente dispositivo LoRaWAN è offline",
|
|
91
|
+
"LockHeader": "Definire gli stati per un'entità di blocco",
|
|
92
|
+
"LockInformation": "Qui puoi definire un array di definizioni di Lock",
|
|
93
|
+
"LockLockText": "Blocca l'ID",
|
|
94
|
+
"LockNameText": "Nome entità",
|
|
95
|
+
"LockOpen": "aprire",
|
|
96
|
+
"LockOpenText": "Apri documento d'identità",
|
|
97
|
+
"LockOpenTooltip": "selezionato: stati booleani separati per aperto",
|
|
98
|
+
"LockSeparate": "separato",
|
|
99
|
+
"LockSeparateState": "stato separato",
|
|
100
|
+
"LockSeparateStateTooltip": "selezionato: stato separato per lo stato della serratura",
|
|
101
|
+
"LockSeparateTooltip": "selezionato: stati booleani separati per blocco, sblocco. Altrimenti, uno stato di stringa.",
|
|
102
|
+
"LockUnlockText": "Sblocca l'identità",
|
|
91
103
|
"LorawanOff": "spento",
|
|
92
104
|
"MQTTInstance": "Istanza MQTT",
|
|
93
105
|
"NoBridgeConfiged": "Non c'è nessun bridge configurato!!!",
|
|
@@ -101,6 +113,7 @@
|
|
|
101
113
|
"Serverinformation": "Configura le principali impostazioni di comunicazione sul tuo server",
|
|
102
114
|
"ServersettingsHeader": "Impostazioni del server",
|
|
103
115
|
"State": "Stato",
|
|
116
|
+
"StateText": "ID dello stato",
|
|
104
117
|
"String": "Corda",
|
|
105
118
|
"UpText": "ID comando su",
|
|
106
119
|
"VirtualMode": "Modalità virtuale",
|
|
@@ -88,6 +88,18 @@
|
|
|
88
88
|
"LoRaWAN Network Service is disconnected": "LoRaWAN-netwerkservice is verbroken",
|
|
89
89
|
"LoRaWAN device is back online": "Het volgende LoRaWAN-apparaat is weer online",
|
|
90
90
|
"LoRaWAN device is offline": "Het volgende LoRaWAN-apparaat is offline",
|
|
91
|
+
"LockHeader": "Definieer statussen voor een vergrendelingsentiteit",
|
|
92
|
+
"LockInformation": "Hier kunt u een reeks slotdefinities definiëren",
|
|
93
|
+
"LockLockText": "Vergrendel-ID",
|
|
94
|
+
"LockNameText": "Entiteitsnaam",
|
|
95
|
+
"LockOpen": "open",
|
|
96
|
+
"LockOpenText": "Open-ID",
|
|
97
|
+
"LockOpenTooltip": "geselecteerd: afzonderlijke Booleaanse statussen voor open",
|
|
98
|
+
"LockSeparate": "verschillend",
|
|
99
|
+
"LockSeparateState": "aparte staat",
|
|
100
|
+
"LockSeparateStateTooltip": "geselecteerd: aparte status voor de status van het slot",
|
|
101
|
+
"LockSeparateTooltip": "geselecteerd: aparte booleaanse statussen voor vergrendelen, ontgrendelen. Anders is er één stringstatus.",
|
|
102
|
+
"LockUnlockText": "Ontgrendel ID",
|
|
91
103
|
"LorawanOff": "uit",
|
|
92
104
|
"MQTTInstance": "MQTT-instantie",
|
|
93
105
|
"NoBridgeConfiged": "Er is geen bridge geconfigureerd!!!",
|
|
@@ -101,6 +113,7 @@
|
|
|
101
113
|
"Serverinformation": "Stel de belangrijkste communicatie-instellingen in op uw server",
|
|
102
114
|
"ServersettingsHeader": "Serverinstellingen",
|
|
103
115
|
"State": "Staat",
|
|
116
|
+
"StateText": "Staats-ID",
|
|
104
117
|
"String": "Snaar",
|
|
105
118
|
"UpText": "Commando-ID omhoog",
|
|
106
119
|
"VirtualMode": "Virtuele modus",
|
|
@@ -88,6 +88,18 @@
|
|
|
88
88
|
"LoRaWAN Network Service is disconnected": "Usługa sieciowa LoRaWAN jest rozłączona",
|
|
89
89
|
"LoRaWAN device is back online": "Następujące urządzenie LoRaWAN jest ponownie online",
|
|
90
90
|
"LoRaWAN device is offline": "Następujące urządzenie LoRaWAN jest w trybie offline",
|
|
91
|
+
"LockHeader": "Zdefiniuj stany dla elementu blokady",
|
|
92
|
+
"LockInformation": "Tutaj możesz zdefiniować tablicę definicji blokad",
|
|
93
|
+
"LockLockText": "Zablokuj identyfikator",
|
|
94
|
+
"LockNameText": "Nazwa jednostki",
|
|
95
|
+
"LockOpen": "Otwarte",
|
|
96
|
+
"LockOpenText": "Otwórz dowód",
|
|
97
|
+
"LockOpenTooltip": "wybrane: oddzielne stany logiczne dla otwarcia",
|
|
98
|
+
"LockSeparate": "oddzielny",
|
|
99
|
+
"LockSeparateState": "odrębny stan",
|
|
100
|
+
"LockSeparateStateTooltip": "wybrane: odrębny stan dla stanu zamka",
|
|
101
|
+
"LockSeparateTooltip": "wybrane: oddzielne stany logiczne dla blokady, odblokowania. W przeciwnym razie jeden stan ciągu.",
|
|
102
|
+
"LockUnlockText": "Odblokuj identyfikator",
|
|
91
103
|
"LorawanOff": "wyłączony",
|
|
92
104
|
"MQTTInstance": "Instancja MQTT",
|
|
93
105
|
"NoBridgeConfiged": "Nie ma skonfigurowanego mostu!!!",
|
|
@@ -101,6 +113,7 @@
|
|
|
101
113
|
"Serverinformation": "Skonfiguruj główne ustawienia komunikacji z serwerem",
|
|
102
114
|
"ServersettingsHeader": "Ustawienia serwera",
|
|
103
115
|
"State": "Państwo",
|
|
116
|
+
"StateText": "Stanowy identyfikator",
|
|
104
117
|
"String": "Smyczkowy",
|
|
105
118
|
"UpText": "W górę identyfikator polecenia",
|
|
106
119
|
"VirtualMode": "Tryb wirtualny",
|
|
@@ -88,6 +88,18 @@
|
|
|
88
88
|
"LoRaWAN Network Service is disconnected": "O serviço de rede LoRaWAN está desconectado",
|
|
89
89
|
"LoRaWAN device is back online": "O seguinte dispositivo LoRaWAN está online novamente",
|
|
90
90
|
"LoRaWAN device is offline": "O seguinte dispositivo LoRaWAN está offline",
|
|
91
|
+
"LockHeader": "Definir estados para uma entidade de bloqueio",
|
|
92
|
+
"LockInformation": "Aqui você pode definir uma série de definições de bloqueio",
|
|
93
|
+
"LockLockText": "ID de bloqueio",
|
|
94
|
+
"LockNameText": "Nome da entidade",
|
|
95
|
+
"LockOpen": "abrir",
|
|
96
|
+
"LockOpenText": "Abrir ID",
|
|
97
|
+
"LockOpenTooltip": "selecionado: estados booleanos separados para aberto",
|
|
98
|
+
"LockSeparate": "separar",
|
|
99
|
+
"LockSeparateState": "estado separado",
|
|
100
|
+
"LockSeparateStateTooltip": "selecionado: estado separado para o estado do bloqueio",
|
|
101
|
+
"LockSeparateTooltip": "selecionado: estados booleanos separados para bloqueio, desbloqueio. Caso contrário, um estado de string.",
|
|
102
|
+
"LockUnlockText": "ID de desbloqueio",
|
|
91
103
|
"LorawanOff": "desligado",
|
|
92
104
|
"MQTTInstance": "Instância MQTT",
|
|
93
105
|
"NoBridgeConfiged": "Não há nenhuma ponte configurada!!!",
|
|
@@ -101,6 +113,7 @@
|
|
|
101
113
|
"Serverinformation": "Defina as principais configurações de comunicação para o seu servidor",
|
|
102
114
|
"ServersettingsHeader": "Configurações do servidor",
|
|
103
115
|
"State": "Estado",
|
|
116
|
+
"StateText": "ID do estado",
|
|
104
117
|
"String": "Corda",
|
|
105
118
|
"UpText": "ID do comando para cima",
|
|
106
119
|
"VirtualMode": "Modo Virtual",
|
|
@@ -88,6 +88,18 @@
|
|
|
88
88
|
"LoRaWAN Network Service is disconnected": "Сетевая служба LoRaWAN отключена",
|
|
89
89
|
"LoRaWAN device is back online": "Следующее устройство LoRaWAN снова подключено к сети",
|
|
90
90
|
"LoRaWAN device is offline": "Следующее устройство LoRaWAN не в сети",
|
|
91
|
+
"LockHeader": "Определите состояния для объекта блокировки",
|
|
92
|
+
"LockInformation": "Здесь вы можете определить массив определений блокировки.",
|
|
93
|
+
"LockLockText": "Идентификатор блокировки",
|
|
94
|
+
"LockNameText": "Имя объекта",
|
|
95
|
+
"LockOpen": "открыть",
|
|
96
|
+
"LockOpenText": "Открыть идентификатор",
|
|
97
|
+
"LockOpenTooltip": "выбрано: отдельные логические состояния для открытия",
|
|
98
|
+
"LockSeparate": "отдельный",
|
|
99
|
+
"LockSeparateState": "отдельное государство",
|
|
100
|
+
"LockSeparateStateTooltip": "выбрано: отдельное состояние для состояния замка",
|
|
101
|
+
"LockSeparateTooltip": "выбрано: отдельные логические состояния для блокировки и разблокировки. В противном случае одно строковое состояние.",
|
|
102
|
+
"LockUnlockText": "Разблокировать идентификатор",
|
|
91
103
|
"LorawanOff": "выключенный",
|
|
92
104
|
"MQTTInstance": "Экземпляр MQTT",
|
|
93
105
|
"NoBridgeConfiged": "Не настроен мост!!!",
|
|
@@ -101,6 +113,7 @@
|
|
|
101
113
|
"Serverinformation": "Установите основные настройки связи на ваш сервер",
|
|
102
114
|
"ServersettingsHeader": "Настройки сервера",
|
|
103
115
|
"State": "Состояние",
|
|
116
|
+
"StateText": "Государственный идентификатор",
|
|
104
117
|
"String": "Нить",
|
|
105
118
|
"UpText": "Идентификатор команды вверх",
|
|
106
119
|
"VirtualMode": "Виртуальный режим",
|
|
@@ -88,6 +88,18 @@
|
|
|
88
88
|
"LoRaWAN Network Service is disconnected": "Службу мережі LoRaWAN відключено",
|
|
89
89
|
"LoRaWAN device is back online": "Наступний пристрій LoRaWAN знову в мережі",
|
|
90
90
|
"LoRaWAN device is offline": "Наступний пристрій LoRaWAN офлайн",
|
|
91
|
+
"LockHeader": "Визначення станів для сутності блокування",
|
|
92
|
+
"LockInformation": "Тут ви можете визначити масив визначень замків",
|
|
93
|
+
"LockLockText": "ID блокування",
|
|
94
|
+
"LockNameText": "Назва сутності",
|
|
95
|
+
"LockOpen": "ВІДЧИНЕНО",
|
|
96
|
+
"LockOpenText": "Відкрити ідентифікатор",
|
|
97
|
+
"LockOpenTooltip": "вибрано: окремі логічні стани для відкриття",
|
|
98
|
+
"LockSeparate": "окремо",
|
|
99
|
+
"LockSeparateState": "окрема держава",
|
|
100
|
+
"LockSeparateStateTooltip": "вибрано: окремий стан для стану блокування",
|
|
101
|
+
"LockSeparateTooltip": "вибрано: окремі логічні стани для блокування, розблокування. В іншому випадку один рядковий стан.",
|
|
102
|
+
"LockUnlockText": "Розблокувати ID",
|
|
91
103
|
"LorawanOff": "вимкнено",
|
|
92
104
|
"MQTTInstance": "Екземпляр MQTT",
|
|
93
105
|
"NoBridgeConfiged": "Міст не налаштований !!!",
|
|
@@ -101,6 +113,7 @@
|
|
|
101
113
|
"Serverinformation": "Встановіть основні параметри зв'язку на вашому сервері",
|
|
102
114
|
"ServersettingsHeader": "Налаштування сервера",
|
|
103
115
|
"State": "Держава",
|
|
116
|
+
"StateText": "Державний ідентифікатор",
|
|
104
117
|
"String": "Рядок",
|
|
105
118
|
"UpText": "Ідентифікатор команди вгору",
|
|
106
119
|
"VirtualMode": "Віртуальний режим",
|
|
@@ -88,6 +88,18 @@
|
|
|
88
88
|
"LoRaWAN Network Service is disconnected": "LoRaWAN网络服务已断开",
|
|
89
89
|
"LoRaWAN device is back online": "以下 LoRaWAN 设备已重新上线",
|
|
90
90
|
"LoRaWAN device is offline": "以下 LoRaWAN 设备离线",
|
|
91
|
+
"LockHeader": "定义锁实体的状态",
|
|
92
|
+
"LockInformation": "在这里你可以定义一个Lock定义的数组",
|
|
93
|
+
"LockLockText": "锁ID",
|
|
94
|
+
"LockNameText": "实体名称",
|
|
95
|
+
"LockOpen": "打开",
|
|
96
|
+
"LockOpenText": "开放ID",
|
|
97
|
+
"LockOpenTooltip": "selected:打开的单独布尔状态",
|
|
98
|
+
"LockSeparate": "分离",
|
|
99
|
+
"LockSeparateState": "独立国家",
|
|
100
|
+
"LockSeparateStateTooltip": "selected:锁状态的单独状态",
|
|
101
|
+
"LockSeparateTooltip": "selected:锁定、解锁的单独布尔状态。否则,为一个字符串状态。",
|
|
102
|
+
"LockUnlockText": "解锁ID",
|
|
91
103
|
"LorawanOff": "离开",
|
|
92
104
|
"MQTTInstance": "MQTT实例",
|
|
93
105
|
"NoBridgeConfiged": "没有配置桥接!!!",
|
|
@@ -101,6 +113,7 @@
|
|
|
101
113
|
"Serverinformation": "设置服务器的主要通信设置",
|
|
102
114
|
"ServersettingsHeader": "服务器设置",
|
|
103
115
|
"State": "状态",
|
|
116
|
+
"StateText": "州身份证",
|
|
104
117
|
"String": "细绳",
|
|
105
118
|
"UpText": "向上命令ID",
|
|
106
119
|
"VirtualMode": "虚拟模式",
|
package/admin/jsonConfig.json
CHANGED
|
@@ -2109,7 +2109,163 @@
|
|
|
2109
2109
|
"xl": 4
|
|
2110
2110
|
}
|
|
2111
2111
|
]
|
|
2112
|
-
}
|
|
2112
|
+
},
|
|
2113
|
+
"_LockForeignHeader":{
|
|
2114
|
+
"newLine": true,
|
|
2115
|
+
"type": "header",
|
|
2116
|
+
"text": "LockHeader",
|
|
2117
|
+
"size": 3,
|
|
2118
|
+
"xs": 12,
|
|
2119
|
+
"sm": 12,
|
|
2120
|
+
"md": 12,
|
|
2121
|
+
"lg": 12,
|
|
2122
|
+
"xl": 12
|
|
2123
|
+
},
|
|
2124
|
+
"_LockForeignInformation":{
|
|
2125
|
+
"newLine":true,
|
|
2126
|
+
"type": "staticText",
|
|
2127
|
+
"label": "LockInformation",
|
|
2128
|
+
"xs": 12,
|
|
2129
|
+
"sm": 12,
|
|
2130
|
+
"md": 12,
|
|
2131
|
+
"lg": 12,
|
|
2132
|
+
"xl": 12
|
|
2133
|
+
},
|
|
2134
|
+
"LockForeignConfig":{
|
|
2135
|
+
"newLine": true,
|
|
2136
|
+
"type":"accordion",
|
|
2137
|
+
"titleAttr": "LockName",
|
|
2138
|
+
"clone": true,
|
|
2139
|
+
"xs": 12,
|
|
2140
|
+
"sm": 12,
|
|
2141
|
+
"md": 12,
|
|
2142
|
+
"lg": 12,
|
|
2143
|
+
"xl": 12,
|
|
2144
|
+
"items":[
|
|
2145
|
+
{
|
|
2146
|
+
"type": "text",
|
|
2147
|
+
"attr": "LockName",
|
|
2148
|
+
"label": "LockNameText",
|
|
2149
|
+
"validator": "if(data.LockName === ''){return false;}else{return true;}",
|
|
2150
|
+
"validatorNoSaveOnError": true,
|
|
2151
|
+
"default": "Lock Name",
|
|
2152
|
+
"xs": 12,
|
|
2153
|
+
"sm": 4,
|
|
2154
|
+
"md": 4,
|
|
2155
|
+
"lg": 4,
|
|
2156
|
+
"xl": 4
|
|
2157
|
+
},
|
|
2158
|
+
{
|
|
2159
|
+
"type": "select",
|
|
2160
|
+
"attr": "LockSeparate",
|
|
2161
|
+
"label": "LockSeparate",
|
|
2162
|
+
"tooltip": "LockSeparateTooltip",
|
|
2163
|
+
"options": [
|
|
2164
|
+
{"label":"OneString","value":"string"},
|
|
2165
|
+
{"label":"SeparateIds","value":"separate"}
|
|
2166
|
+
],
|
|
2167
|
+
"default": "string",
|
|
2168
|
+
"xs": 12,
|
|
2169
|
+
"sm": 2,
|
|
2170
|
+
"md": 2,
|
|
2171
|
+
"lg": 2,
|
|
2172
|
+
"xl": 2
|
|
2173
|
+
},
|
|
2174
|
+
{
|
|
2175
|
+
"type": "checkbox",
|
|
2176
|
+
"attr": "LockOpen",
|
|
2177
|
+
"label": "LockOpen",
|
|
2178
|
+
"tooltip": "LockOpenTooltip",
|
|
2179
|
+
"hidden": "data.LockSeparate !== 'separate'",
|
|
2180
|
+
"default": true,
|
|
2181
|
+
"xs": 12,
|
|
2182
|
+
"sm": 2,
|
|
2183
|
+
"md": 2,
|
|
2184
|
+
"lg": 2,
|
|
2185
|
+
"xl": 2
|
|
2186
|
+
},
|
|
2187
|
+
{
|
|
2188
|
+
"type": "checkbox",
|
|
2189
|
+
"attr": "LockSeparateState",
|
|
2190
|
+
"label": "LockSeparateState",
|
|
2191
|
+
"tooltip": "LockSeparateStateTooltip",
|
|
2192
|
+
"default": false,
|
|
2193
|
+
"xs": 12,
|
|
2194
|
+
"sm": 2,
|
|
2195
|
+
"md": 2,
|
|
2196
|
+
"lg": 2,
|
|
2197
|
+
"xl": 2
|
|
2198
|
+
},
|
|
2199
|
+
{
|
|
2200
|
+
"type": "objectId",
|
|
2201
|
+
"newLine": true,
|
|
2202
|
+
"attr": "CommandId",
|
|
2203
|
+
"label": "CommandText",
|
|
2204
|
+
"hidden": "data.LockSeparate !== 'string'",
|
|
2205
|
+
"xs": 12,
|
|
2206
|
+
"sm": 4,
|
|
2207
|
+
"md": 4,
|
|
2208
|
+
"lg": 4,
|
|
2209
|
+
"xl": 4
|
|
2210
|
+
},
|
|
2211
|
+
{
|
|
2212
|
+
"type": "objectId",
|
|
2213
|
+
"newLine": true,
|
|
2214
|
+
"attr": "LockId",
|
|
2215
|
+
"label": "LockLockText",
|
|
2216
|
+
"hidden": "data.LockSeparate !== 'separate'",
|
|
2217
|
+
"xs": 12,
|
|
2218
|
+
"sm": 4,
|
|
2219
|
+
"md": 4,
|
|
2220
|
+
"lg": 4,
|
|
2221
|
+
"xl": 4
|
|
2222
|
+
},
|
|
2223
|
+
{
|
|
2224
|
+
"type": "objectId",
|
|
2225
|
+
"attr": "UnlockId",
|
|
2226
|
+
"label": "LockUnlockText",
|
|
2227
|
+
"hidden": "data.LockSeparate !== 'separate'",
|
|
2228
|
+
"xs": 12,
|
|
2229
|
+
"sm": 4,
|
|
2230
|
+
"md": 4,
|
|
2231
|
+
"lg": 4,
|
|
2232
|
+
"xl": 4
|
|
2233
|
+
},
|
|
2234
|
+
{
|
|
2235
|
+
"type": "objectId",
|
|
2236
|
+
"attr": "OpenId",
|
|
2237
|
+
"label": "LockOpenText",
|
|
2238
|
+
"hidden": "data.LockSeparate !== 'separate' || data.LockOpen === false",
|
|
2239
|
+
"xs": 12,
|
|
2240
|
+
"sm": 4,
|
|
2241
|
+
"md": 4,
|
|
2242
|
+
"lg": 4,
|
|
2243
|
+
"xl": 4
|
|
2244
|
+
},
|
|
2245
|
+
{
|
|
2246
|
+
"type": "staticText",
|
|
2247
|
+
"attr": "_staticTextSeparateState",
|
|
2248
|
+
"label": "",
|
|
2249
|
+
"hidden": "data.LockSeparate === 'separate' && data.LockOpen === true",
|
|
2250
|
+
"xs": 12,
|
|
2251
|
+
"sm": 2,
|
|
2252
|
+
"md": 2,
|
|
2253
|
+
"lg": 2,
|
|
2254
|
+
"xl": 2
|
|
2255
|
+
},
|
|
2256
|
+
{
|
|
2257
|
+
"type": "objectId",
|
|
2258
|
+
"attr": "StateId",
|
|
2259
|
+
"label": "StateText",
|
|
2260
|
+
"hidden": "data.LockSeparateState === false",
|
|
2261
|
+
"xs": 12,
|
|
2262
|
+
"sm": 4,
|
|
2263
|
+
"md": 4,
|
|
2264
|
+
"lg": 4,
|
|
2265
|
+
"xl": 4
|
|
2266
|
+
}
|
|
2267
|
+
]
|
|
2268
|
+
}
|
|
2113
2269
|
}
|
|
2114
2270
|
}
|
|
2115
2271
|
}
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lorawan",
|
|
4
|
-
"version": "1.18.
|
|
4
|
+
"version": "1.18.32",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.18.32": {
|
|
7
|
+
"en": "Changes in cover and add Lock",
|
|
8
|
+
"de": "Änderungen im Cover und hinzufügen Lock",
|
|
9
|
+
"ru": "Изменения в покрытии и добавление блокировки",
|
|
10
|
+
"pt": "Alterações na capa e adicionar bloqueio",
|
|
11
|
+
"nl": "Wijzigingen in dekking en vergrendelen toevoegen",
|
|
12
|
+
"fr": "Changements dans la couverture et ajouter Lock",
|
|
13
|
+
"it": "Modifiche in copertina e aggiungere Lock",
|
|
14
|
+
"es": "Cambios en la cubierta y añadir bloqueo",
|
|
15
|
+
"pl": "Zmiany w okładce i dodać blokadę",
|
|
16
|
+
"uk": "Зміни в кришці і додати блокування",
|
|
17
|
+
"zh-cn": "封面和加锁的变化"
|
|
18
|
+
},
|
|
19
|
+
"1.18.31": {
|
|
20
|
+
"en": "Bugfix state at light effekts in case of 0",
|
|
21
|
+
"de": "Bugfix Zustand bei Lichteffekten bei 0",
|
|
22
|
+
"ru": "Состояние Bugfix на световых эффектах в случае 0",
|
|
23
|
+
"pt": "Estado de correção de erros em efekts de luz em caso de 0",
|
|
24
|
+
"nl": "Bugfix toestand bij lichte effekts in geval van 0",
|
|
25
|
+
"fr": "État Bugfix aux effects légers en cas de 0",
|
|
26
|
+
"it": "Bugfix stato alla luce effekts in caso di 0",
|
|
27
|
+
"es": "Estado de Bugfix en effekts luz en caso de 0",
|
|
28
|
+
"pl": "Stan bugfix w lekkich effekts w przypadku 0",
|
|
29
|
+
"uk": "Стан Бугфікса при легких діях при 0",
|
|
30
|
+
"zh-cn": "0 时在 effekts 时发生错误"
|
|
31
|
+
},
|
|
6
32
|
"1.18.30": {
|
|
7
33
|
"en": "setting dataExchange to 2 entitie (FromIob & ToIob)",
|
|
8
34
|
"de": "daten ausgeben Austausch zu 2 Teilnehmern (FromIob & ToIob)",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "usunąć więcej logowania do testowania",
|
|
68
94
|
"uk": "видалити більше журналів для тестування",
|
|
69
95
|
"zh-cn": "删除更多用于测试的日志"
|
|
70
|
-
},
|
|
71
|
-
"1.18.25": {
|
|
72
|
-
"en": "remove logging for testing",
|
|
73
|
-
"de": "entfernen von protokollen für tests",
|
|
74
|
-
"ru": "удаление бревен для тестирования",
|
|
75
|
-
"pt": "remover o registo para testes",
|
|
76
|
-
"nl": "verwijderen logging voor het testen",
|
|
77
|
-
"fr": "supprimer l'enregistrement pour les essais",
|
|
78
|
-
"it": "rimuovere logging per il test",
|
|
79
|
-
"es": "eliminar registro para pruebas",
|
|
80
|
-
"pl": "usunąć logowanie do testowania",
|
|
81
|
-
"uk": "видалення загартування для тестування",
|
|
82
|
-
"zh-cn": "删除用于测试的日志"
|
|
83
|
-
},
|
|
84
|
-
"1.18.24": {
|
|
85
|
-
"en": "add dataExchange between Adapter and Bridge-Partner (Complex JSON possible)",
|
|
86
|
-
"de": "daten hinzufügen Austausch zwischen Adapter und Bridge-Partner (Komplex JSON möglich)",
|
|
87
|
-
"ru": "добавить данные Обмен между адаптером и Bridge-Partner (комплекс JSON)",
|
|
88
|
-
"pt": "adicionar dados Troca entre adaptador e parceiro de ponte (complexo JSON possível)",
|
|
89
|
-
"nl": "gegevens toevoegen Uitwisseling tussen Adapter en Bridge-Partner (complex JSON mogelijk)",
|
|
90
|
-
"fr": "ajouter des données Échange entre Adaptateur et Bridge-Partner (Complex JSON possible)",
|
|
91
|
-
"it": "aggiungere i dati Scambio tra adattatore e Bridge-Partner (Complex JSON possibile)",
|
|
92
|
-
"es": "añadir datos Intercambio entre Adaptador y Bridge-Partner (Complejo JSON posible)",
|
|
93
|
-
"pl": "dodaj dane Wymiana między Adapterem a partnerem Bridge- (możliwy kompleks JSON)",
|
|
94
|
-
"uk": "додати дані Обмін між адаптером і Bridge-Partner (Комплексний JSON можливо)",
|
|
95
|
-
"zh-cn": "添加数据 适配器与Bridge-Partner之间的交换(可能复杂JSON)"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -456,7 +456,8 @@
|
|
|
456
456
|
"ClimateForeignConfig": [],
|
|
457
457
|
"HumidifierForeignConfig": [],
|
|
458
458
|
"LightForeignConfig": [],
|
|
459
|
-
"CoverForeignConfig": []
|
|
459
|
+
"CoverForeignConfig": [],
|
|
460
|
+
"LockForeignConfig": []
|
|
460
461
|
},
|
|
461
462
|
"objects": [],
|
|
462
463
|
"instanceObjects": [
|
package/lib/modules/bridge.js
CHANGED
|
@@ -39,6 +39,7 @@ class bridgeClass {
|
|
|
39
39
|
this.EndingVirtualClimate = '.virtual_climate';
|
|
40
40
|
this.EndingVirtualHumidifier = '.virtual_humiditier';
|
|
41
41
|
this.EndingVirtualCover = '.virtual_cover';
|
|
42
|
+
this.EndingVirtualLock = '.virtual_lock';
|
|
42
43
|
this.EndingVirtualLight = '.virtual_light';
|
|
43
44
|
this.EndingVirtualMode = '.virtual_mode';
|
|
44
45
|
this.NotificationId = '.notification';
|
|
@@ -52,6 +53,7 @@ class bridgeClass {
|
|
|
52
53
|
this.DeHumidifierEntityType = 'dehumidifier';
|
|
53
54
|
this.NotificationEntityType = 'device_automation';
|
|
54
55
|
this.CoverEntityType = 'cover';
|
|
56
|
+
this.LockEntityType = 'lock';
|
|
55
57
|
this.MaxValueCount = 5;
|
|
56
58
|
this.Words = {
|
|
57
59
|
notification: 'notification',
|
|
@@ -241,9 +243,9 @@ class bridgeClass {
|
|
|
241
243
|
});
|
|
242
244
|
}
|
|
243
245
|
if (message.effect) {
|
|
244
|
-
const effect =
|
|
245
|
-
|
|
246
|
-
|
|
246
|
+
const effect =
|
|
247
|
+
this.SubscribedTopics[topic].effects[message.effect] ??
|
|
248
|
+
this.SubscribedTopics[topic].effects[0];
|
|
247
249
|
await this.adapter.setForeignStateAsync(this.SubscribedTopics[topic].LightIds.effects, {
|
|
248
250
|
val: effect,
|
|
249
251
|
c: 'from bridge',
|
|
@@ -263,6 +265,18 @@ class bridgeClass {
|
|
|
263
265
|
}
|
|
264
266
|
}
|
|
265
267
|
}
|
|
268
|
+
if (this.SubscribedTopics[topic].lock) {
|
|
269
|
+
if (this.SubscribedTopics[topic].messageAssign) {
|
|
270
|
+
if (this.SubscribedTopics[topic].messageAssign[message]) {
|
|
271
|
+
message = this.SubscribedTopics[topic].messageAssign[message];
|
|
272
|
+
} else {
|
|
273
|
+
this.adapter.log.warn(
|
|
274
|
+
`Incomming Message: ${message} at topic: ${topic} can not be found in possible values.`,
|
|
275
|
+
);
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
266
280
|
|
|
267
281
|
// Check for namespace and write own, oder foreign state
|
|
268
282
|
if (this.SubscribedTopics[topic].id.startsWith(this.adapter.namespace)) {
|
|
@@ -825,7 +839,17 @@ class bridgeClass {
|
|
|
825
839
|
if (this.PublishedIds[id].publish[publishTopic].messageAssign[val]) {
|
|
826
840
|
val = this.PublishedIds[id].publish[publishTopic].messageAssign[val];
|
|
827
841
|
} else {
|
|
828
|
-
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
if (this.PublishedIds[id].publish[publishTopic].lock) {
|
|
848
|
+
if (this.PublishedIds[id].publish[publishTopic].messageAssign) {
|
|
849
|
+
if (this.PublishedIds[id].publish[publishTopic].messageAssign[val]) {
|
|
850
|
+
val = this.PublishedIds[id].publish[publishTopic].messageAssign[val];
|
|
851
|
+
} else {
|
|
852
|
+
return;
|
|
829
853
|
}
|
|
830
854
|
}
|
|
831
855
|
}
|
|
@@ -1739,6 +1763,7 @@ class bridgeClass {
|
|
|
1739
1763
|
await this.getForeignHumidifierConfig();
|
|
1740
1764
|
await this.getForeignLightConfig();
|
|
1741
1765
|
await this.getForeignCoverConfig();
|
|
1766
|
+
await this.getForeignLockConfig();
|
|
1742
1767
|
await this.checkDiscoveries();
|
|
1743
1768
|
} catch (error) {
|
|
1744
1769
|
this.adapter.log.error(`error at ${activeFunction}: ${error}`);
|
|
@@ -2687,7 +2712,7 @@ class bridgeClass {
|
|
|
2687
2712
|
/**
|
|
2688
2713
|
* get Foreign states for Bridge
|
|
2689
2714
|
*
|
|
2690
|
-
* @param config config of the
|
|
2715
|
+
* @param config config of the cover entity
|
|
2691
2716
|
*/
|
|
2692
2717
|
async discoverForeignCover(config) {
|
|
2693
2718
|
const activeFunction = 'bridge.js - discoverForeignCover';
|
|
@@ -2818,7 +2843,7 @@ class bridgeClass {
|
|
|
2818
2843
|
DiscoveryTopic,
|
|
2819
2844
|
DiscoveryPayload,
|
|
2820
2845
|
Id,
|
|
2821
|
-
{ cover: true,
|
|
2846
|
+
{ cover: true, messageAssign: setAssign },
|
|
2822
2847
|
);
|
|
2823
2848
|
|
|
2824
2849
|
// Position
|
|
@@ -2837,66 +2862,6 @@ class bridgeClass {
|
|
|
2837
2862
|
}
|
|
2838
2863
|
|
|
2839
2864
|
// Assign Published Ids
|
|
2840
|
-
// Open
|
|
2841
|
-
if (config.CoverIds.open) {
|
|
2842
|
-
this.assignIdStructure(
|
|
2843
|
-
this.PublishedIds,
|
|
2844
|
-
config.CoverIds.open,
|
|
2845
|
-
{
|
|
2846
|
-
usedDeviceId: Cover.open.DeviceIdentifier,
|
|
2847
|
-
},
|
|
2848
|
-
DiscoveryTopic,
|
|
2849
|
-
DiscoveryPayload,
|
|
2850
|
-
`${coverTopic}${this.EndingState}`,
|
|
2851
|
-
{ cover: true, messageAssign: { true: 'OPEN' } },
|
|
2852
|
-
);
|
|
2853
|
-
}
|
|
2854
|
-
|
|
2855
|
-
// Close
|
|
2856
|
-
if (config.CoverIds.close) {
|
|
2857
|
-
this.assignIdStructure(
|
|
2858
|
-
this.PublishedIds,
|
|
2859
|
-
config.CoverIds.close,
|
|
2860
|
-
{
|
|
2861
|
-
usedDeviceId: Cover.close.DeviceIdentifier,
|
|
2862
|
-
},
|
|
2863
|
-
DiscoveryTopic,
|
|
2864
|
-
DiscoveryPayload,
|
|
2865
|
-
`${coverTopic}${this.EndingState}`,
|
|
2866
|
-
{ cover: true, messageAssign: { true: 'CLOSE' } },
|
|
2867
|
-
);
|
|
2868
|
-
}
|
|
2869
|
-
|
|
2870
|
-
// Stop
|
|
2871
|
-
if (config.CoverIds.stop) {
|
|
2872
|
-
this.assignIdStructure(
|
|
2873
|
-
this.PublishedIds,
|
|
2874
|
-
config.CoverIds.stop,
|
|
2875
|
-
{
|
|
2876
|
-
usedDeviceId: Cover.stop.DeviceIdentifier,
|
|
2877
|
-
},
|
|
2878
|
-
DiscoveryTopic,
|
|
2879
|
-
DiscoveryPayload,
|
|
2880
|
-
`${coverTopic}${this.EndingState}`,
|
|
2881
|
-
{ cover: true, messageAssign: { true: 'STOP' } },
|
|
2882
|
-
);
|
|
2883
|
-
}
|
|
2884
|
-
|
|
2885
|
-
// Position
|
|
2886
|
-
if (config.CoverIds.command) {
|
|
2887
|
-
this.assignIdStructure(
|
|
2888
|
-
this.PublishedIds,
|
|
2889
|
-
config.CoverIds.command,
|
|
2890
|
-
{
|
|
2891
|
-
usedDeviceId: Cover.position.DeviceIdentifier,
|
|
2892
|
-
},
|
|
2893
|
-
DiscoveryTopic,
|
|
2894
|
-
DiscoveryPayload,
|
|
2895
|
-
`${Cover.position.Topic}${this.EndingState}`,
|
|
2896
|
-
{ cover: true, command: true },
|
|
2897
|
-
);
|
|
2898
|
-
}
|
|
2899
|
-
|
|
2900
2865
|
// Position
|
|
2901
2866
|
if (config.CoverIds.position) {
|
|
2902
2867
|
this.assignIdStructure(
|
|
@@ -2950,7 +2915,7 @@ class bridgeClass {
|
|
|
2950
2915
|
}
|
|
2951
2916
|
|
|
2952
2917
|
const informations = {
|
|
2953
|
-
|
|
2918
|
+
cover: {
|
|
2954
2919
|
usedDeviceId: deviceIdentifier,
|
|
2955
2920
|
},
|
|
2956
2921
|
};
|
|
@@ -2964,22 +2929,6 @@ class bridgeClass {
|
|
|
2964
2929
|
// Delay for publish new entity
|
|
2965
2930
|
setTimeout(async () => {
|
|
2966
2931
|
// Subscribe state for onStatechange mathode
|
|
2967
|
-
if (config.CoverIds.open) {
|
|
2968
|
-
await this.publishId(config.CoverIds.open, undefined, {});
|
|
2969
|
-
await this.adapter.subscribeForeignStatesAsync(config.CoverIds.open);
|
|
2970
|
-
}
|
|
2971
|
-
if (config.CoverIds.close) {
|
|
2972
|
-
await this.publishId(config.CoverIds.close, undefined, {});
|
|
2973
|
-
await this.adapter.subscribeForeignStatesAsync(config.CoverIds.close);
|
|
2974
|
-
}
|
|
2975
|
-
if (config.CoverIds.stop) {
|
|
2976
|
-
await this.publishId(config.CoverIds.stop, undefined, {});
|
|
2977
|
-
await this.adapter.subscribeForeignStatesAsync(config.CoverIds.stop);
|
|
2978
|
-
}
|
|
2979
|
-
if (config.CoverIds.command) {
|
|
2980
|
-
await this.publishId(config.CoverIds.command, undefined, {});
|
|
2981
|
-
await this.adapter.subscribeForeignStatesAsync(config.CoverIds.command);
|
|
2982
|
-
}
|
|
2983
2932
|
if (config.CoverIds.position) {
|
|
2984
2933
|
await this.publishId(config.CoverIds.position, undefined, {});
|
|
2985
2934
|
await this.adapter.subscribeForeignStatesAsync(config.CoverIds.position);
|
|
@@ -3003,7 +2952,7 @@ class bridgeClass {
|
|
|
3003
2952
|
* ******************************************************************/
|
|
3004
2953
|
|
|
3005
2954
|
/**
|
|
3006
|
-
* @param config Configuration of the
|
|
2955
|
+
* @param config Configuration of the cover entity, wich is to genereate
|
|
3007
2956
|
*/
|
|
3008
2957
|
async generateForeignCoverIds(config) {
|
|
3009
2958
|
const activeFunction = 'generateForeignCoverIds';
|
|
@@ -3050,6 +2999,215 @@ class bridgeClass {
|
|
|
3050
2999
|
}
|
|
3051
3000
|
}
|
|
3052
3001
|
|
|
3002
|
+
/**
|
|
3003
|
+
* get Foreign states for Bridge
|
|
3004
|
+
*/
|
|
3005
|
+
async getForeignLockConfig() {
|
|
3006
|
+
const activeFunction = 'bridge.js - getForeignLockConfig';
|
|
3007
|
+
this.adapter.log.debug(`Function ${activeFunction} started.`);
|
|
3008
|
+
try {
|
|
3009
|
+
for (const config of this.adapter.config.LockForeignConfig) {
|
|
3010
|
+
await this.discoverForeignLock(config);
|
|
3011
|
+
}
|
|
3012
|
+
} catch (error) {
|
|
3013
|
+
this.adapter.log.error(`error at ${activeFunction}: ${error}`);
|
|
3014
|
+
}
|
|
3015
|
+
}
|
|
3016
|
+
|
|
3017
|
+
/**
|
|
3018
|
+
* get Foreign states for Bridge
|
|
3019
|
+
*
|
|
3020
|
+
* @param config config of the Lock entity
|
|
3021
|
+
*/
|
|
3022
|
+
async discoverForeignLock(config) {
|
|
3023
|
+
const activeFunction = 'bridge.js - discoverForeignLock';
|
|
3024
|
+
this.adapter.log.debug(`Function ${activeFunction} started.`);
|
|
3025
|
+
try {
|
|
3026
|
+
// Assign the Ids (use the codenameing of discoverClimate)
|
|
3027
|
+
if (!(await this.generateForeignLockIds(config))) {
|
|
3028
|
+
this.adapter.log.warn(`The Foreign Cover config is not complete, or has error(s): ${config.LockName}`);
|
|
3029
|
+
return;
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
const Lock = {};
|
|
3033
|
+
const setAssign = {};
|
|
3034
|
+
// lock
|
|
3035
|
+
if (config.LockIds.lock) {
|
|
3036
|
+
Lock.lock = {};
|
|
3037
|
+
setAssign.LOCK = { id: config.LockIds.lock, val: true };
|
|
3038
|
+
Lock.lock.DeviceIdentifier = (await this.getParentNameing(config.LockIds.lock))?.parentName;
|
|
3039
|
+
}
|
|
3040
|
+
|
|
3041
|
+
// unlock
|
|
3042
|
+
if (config.LockIds.unlock) {
|
|
3043
|
+
Lock.unlock = {};
|
|
3044
|
+
setAssign.UNLOCK = { id: config.LockIds.unlock, val: true };
|
|
3045
|
+
}
|
|
3046
|
+
|
|
3047
|
+
// open
|
|
3048
|
+
if (config.LockIds.open) {
|
|
3049
|
+
Lock.open = {};
|
|
3050
|
+
setAssign.OPEN = { id: config.LockIds.open, val: true };
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
// Command
|
|
3054
|
+
if (config.LockIds.command) {
|
|
3055
|
+
Lock.command = {};
|
|
3056
|
+
setAssign.LOCK = { id: config.LockIds.command, val: 'lock' };
|
|
3057
|
+
setAssign.UNLOCK = { id: config.LockIds.command, val: 'unlock' };
|
|
3058
|
+
setAssign.OPEN = { id: config.LockIds.command, val: 'unlatch' };
|
|
3059
|
+
Lock.command.DeviceIdentifier = (await this.getParentNameing(config.LockIds.command))?.parentName;
|
|
3060
|
+
}
|
|
3061
|
+
|
|
3062
|
+
// State
|
|
3063
|
+
if (config.LockIds.state) {
|
|
3064
|
+
Lock.state = {};
|
|
3065
|
+
Lock.state.DeviceIdentifier = (await this.getParentNameing(config.LockIds.state))?.parentName;
|
|
3066
|
+
}
|
|
3067
|
+
|
|
3068
|
+
// Assign deviceIdentifier
|
|
3069
|
+
let deviceIdentifier = '';
|
|
3070
|
+
let generalId = '';
|
|
3071
|
+
if (Lock.lock) {
|
|
3072
|
+
deviceIdentifier = Lock.lock.DeviceIdentifier;
|
|
3073
|
+
generalId = config.LockIds.open;
|
|
3074
|
+
} else if (Lock.command) {
|
|
3075
|
+
deviceIdentifier = Lock.command.DeviceIdentifier;
|
|
3076
|
+
generalId = config.LockIds.command;
|
|
3077
|
+
}
|
|
3078
|
+
|
|
3079
|
+
// unique string
|
|
3080
|
+
const lockUniqueString = await this.getUniqueString(
|
|
3081
|
+
`${this.adapter.namespace}.${config.LockName}`,
|
|
3082
|
+
deviceIdentifier,
|
|
3083
|
+
);
|
|
3084
|
+
const DiscoveryTopic =
|
|
3085
|
+
`${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${this.LockEntityType}/${lockUniqueString?.path}/config`.toLowerCase();
|
|
3086
|
+
const indexLastDotOnOff = generalId.lastIndexOf('.');
|
|
3087
|
+
const Id = generalId.substring(0, indexLastDotOnOff) + this.EndingVirtualLock;
|
|
3088
|
+
|
|
3089
|
+
// Generate Light Topic
|
|
3090
|
+
const lockTopic = `${this.bridgeMqttClient.BridgePrefix}${lockUniqueString?.path}`.toLowerCase();
|
|
3091
|
+
|
|
3092
|
+
const DiscoveryPayload = {
|
|
3093
|
+
name: config.LockName,
|
|
3094
|
+
unique_id: `${lockUniqueString?.flat}`.toLowerCase(),
|
|
3095
|
+
payload_open: 'OPEN',
|
|
3096
|
+
device: {
|
|
3097
|
+
identifiers: [this.normalizeString(deviceIdentifier).toLowerCase()],
|
|
3098
|
+
name: deviceIdentifier,
|
|
3099
|
+
},
|
|
3100
|
+
};
|
|
3101
|
+
DiscoveryPayload.command_topic = `${lockTopic}${this.EndingSet}`;
|
|
3102
|
+
DiscoveryPayload.state_topic = `${lockTopic}${this.EndingState}`;
|
|
3103
|
+
|
|
3104
|
+
// Assign Subscribed Topics
|
|
3105
|
+
// Incomming set
|
|
3106
|
+
this.assignTopicStructure(
|
|
3107
|
+
this.SubscribedTopics,
|
|
3108
|
+
`${lockTopic}${this.EndingSet}`,
|
|
3109
|
+
{
|
|
3110
|
+
usedDeviceId: deviceIdentifier,
|
|
3111
|
+
},
|
|
3112
|
+
DiscoveryTopic,
|
|
3113
|
+
DiscoveryPayload,
|
|
3114
|
+
Id,
|
|
3115
|
+
{ lock: true, messageAssign: setAssign },
|
|
3116
|
+
);
|
|
3117
|
+
|
|
3118
|
+
// Assign Published Ids
|
|
3119
|
+
// sending state
|
|
3120
|
+
if (config.LockIds.command || config.LockIds.state) {
|
|
3121
|
+
let stateId = config.LockIds.state ?? config.LockIds.command;
|
|
3122
|
+
let usedDeviceidentifier = Lock.state.DeviceIdentifier ?? deviceIdentifier;
|
|
3123
|
+
this.assignIdStructure(
|
|
3124
|
+
this.PublishedIds,
|
|
3125
|
+
stateId,
|
|
3126
|
+
{
|
|
3127
|
+
usedDeviceId: usedDeviceidentifier,
|
|
3128
|
+
},
|
|
3129
|
+
DiscoveryTopic,
|
|
3130
|
+
DiscoveryPayload,
|
|
3131
|
+
`${lockTopic}${this.EndingState}`,
|
|
3132
|
+
{ Lock: true, messageAssign: { locked: 'LOCKED', unlocked: 'UNLOCKED' } },
|
|
3133
|
+
);
|
|
3134
|
+
}
|
|
3135
|
+
|
|
3136
|
+
const informations = {
|
|
3137
|
+
lock: {
|
|
3138
|
+
usedDeviceId: deviceIdentifier,
|
|
3139
|
+
},
|
|
3140
|
+
};
|
|
3141
|
+
|
|
3142
|
+
// Publishing the discover message
|
|
3143
|
+
await this.publishDiscovery(Id, {
|
|
3144
|
+
topic: DiscoveryTopic,
|
|
3145
|
+
payload: structuredClone(DiscoveryPayload),
|
|
3146
|
+
informations: informations,
|
|
3147
|
+
});
|
|
3148
|
+
// Delay for publish new entity
|
|
3149
|
+
setTimeout(async () => {
|
|
3150
|
+
// Subscribe state for onStatechange mathode
|
|
3151
|
+
if (config.LockIds.command) {
|
|
3152
|
+
await this.publishId(config.LockIds.command, undefined, {});
|
|
3153
|
+
await this.adapter.subscribeForeignStatesAsync(config.LockIds.command);
|
|
3154
|
+
}
|
|
3155
|
+
if (config.LockIds.state) {
|
|
3156
|
+
await this.publishId(config.LockIds.state, undefined, {});
|
|
3157
|
+
await this.adapter.subscribeForeignStatesAsync(config.LockIds.state);
|
|
3158
|
+
}
|
|
3159
|
+
}, 1000);
|
|
3160
|
+
} catch (error) {
|
|
3161
|
+
this.adapter.log.error(`error at ${activeFunction}: ${error}`);
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
|
|
3165
|
+
/*********************************************************************
|
|
3166
|
+
* *************** generate Foreign Lock Ids **********************
|
|
3167
|
+
* ******************************************************************/
|
|
3168
|
+
|
|
3169
|
+
/**
|
|
3170
|
+
* @param config Configuration of the Lock entity, wich is to genereate
|
|
3171
|
+
*/
|
|
3172
|
+
async generateForeignLockIds(config) {
|
|
3173
|
+
const activeFunction = 'generateForeignLockIds';
|
|
3174
|
+
this.adapter.log.debug(`Function ${activeFunction} started.`);
|
|
3175
|
+
try {
|
|
3176
|
+
const LockIds = {};
|
|
3177
|
+
if (config.LockSeparate === 'string') {
|
|
3178
|
+
LockIds.command = config.CommandId;
|
|
3179
|
+
}
|
|
3180
|
+
if (config.LockSeparate === 'separate') {
|
|
3181
|
+
LockIds.lock = config.LockId;
|
|
3182
|
+
LockIds.unlock = config.UnlockId;
|
|
3183
|
+
if (config.LockOpen) {
|
|
3184
|
+
LockIds.open = config.OpenId;
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
if (config.LockSeparateState) {
|
|
3188
|
+
LockIds.state = config.StateId;
|
|
3189
|
+
}
|
|
3190
|
+
for (const id of Object.values(LockIds)) {
|
|
3191
|
+
if (!(await this.adapter.getForeignObjectAsync(id))) {
|
|
3192
|
+
this.adapter.log.debug(`Id: ${id} does not exsit.`);
|
|
3193
|
+
return false;
|
|
3194
|
+
}
|
|
3195
|
+
}
|
|
3196
|
+
if (config.LockName === '') {
|
|
3197
|
+
this.adapter.log.debug(`Cover name is empty`);
|
|
3198
|
+
return false;
|
|
3199
|
+
}
|
|
3200
|
+
const indexOfSpace = config.LockName.indexOf(' -- ');
|
|
3201
|
+
if (indexOfSpace > 0) {
|
|
3202
|
+
config.LockName = config.LockName.substring(0, indexOfSpace);
|
|
3203
|
+
}
|
|
3204
|
+
config.LockIds = LockIds;
|
|
3205
|
+
return true;
|
|
3206
|
+
} catch (error) {
|
|
3207
|
+
this.adapter.log.error(`error at ${activeFunction}: ${error}`);
|
|
3208
|
+
}
|
|
3209
|
+
}
|
|
3210
|
+
|
|
3053
3211
|
/**
|
|
3054
3212
|
* @param id id to discover foreign state
|
|
3055
3213
|
* @param clear clear the ids from internal memory
|