iobroker.lorawan 1.18.31 → 1.18.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 +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 +238 -82
- 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.33 (2025-11-28)
|
|
27
|
+
* (BenAhrdt) change state in Lock entity
|
|
28
|
+
|
|
29
|
+
### 1.18.32 (2025-11-28)
|
|
30
|
+
* (BenAhrdt) Changes in cover and add Lock
|
|
31
|
+
|
|
26
32
|
### 1.18.31 (2025-11-27)
|
|
27
33
|
* (BenAhrdt) Bugfix state at light effekts in case of 0
|
|
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.33",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.18.33": {
|
|
7
|
+
"en": "change state in Lock entity",
|
|
8
|
+
"de": "änderungszustand in Sperreinrichtung",
|
|
9
|
+
"ru": "изменение состояния Lock entity",
|
|
10
|
+
"pt": "mudar o estado na entidade Bloquear",
|
|
11
|
+
"nl": "veranderingstoestand in Lock-entiteit",
|
|
12
|
+
"fr": "changement d'état dans l'entité de verrouillage",
|
|
13
|
+
"it": "cambiamento stato in entità Lock",
|
|
14
|
+
"es": "estado de cambio en la entidad Lock",
|
|
15
|
+
"pl": "zmiana stanu w jednostce blokującej",
|
|
16
|
+
"uk": "змінити стан в суб'єкті блокування",
|
|
17
|
+
"zh-cn": "锁定实体中的变化状态"
|
|
18
|
+
},
|
|
19
|
+
"1.18.32": {
|
|
20
|
+
"en": "Changes in cover and add Lock",
|
|
21
|
+
"de": "Änderungen im Cover und hinzufügen Lock",
|
|
22
|
+
"ru": "Изменения в покрытии и добавление блокировки",
|
|
23
|
+
"pt": "Alterações na capa e adicionar bloqueio",
|
|
24
|
+
"nl": "Wijzigingen in dekking en vergrendelen toevoegen",
|
|
25
|
+
"fr": "Changements dans la couverture et ajouter Lock",
|
|
26
|
+
"it": "Modifiche in copertina e aggiungere Lock",
|
|
27
|
+
"es": "Cambios en la cubierta y añadir bloqueo",
|
|
28
|
+
"pl": "Zmiany w okładce i dodać blokadę",
|
|
29
|
+
"uk": "Зміни в кришці і додати блокування",
|
|
30
|
+
"zh-cn": "封面和加锁的变化"
|
|
31
|
+
},
|
|
6
32
|
"1.18.31": {
|
|
7
33
|
"en": "Bugfix state at light effekts in case of 0",
|
|
8
34
|
"de": "Bugfix Zustand bei Lichteffekten bei 0",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "wright incomming datachange with ack = true",
|
|
68
94
|
"uk": "wright incomming dataexchange with ack = true",
|
|
69
95
|
"zh-cn": "wright 以 ack = true 输入数据交换"
|
|
70
|
-
},
|
|
71
|
-
"1.18.26": {
|
|
72
|
-
"en": "remove more logging for testing",
|
|
73
|
-
"de": "entfernen sie mehr protokollierung für tests",
|
|
74
|
-
"ru": "удалить больше журналов для тестирования",
|
|
75
|
-
"pt": "remover mais registro para testes",
|
|
76
|
-
"nl": "meer loggen verwijderen voor testen",
|
|
77
|
-
"fr": "supprimer plus de journalisation pour tester",
|
|
78
|
-
"it": "rimuovere più registrazione per il test",
|
|
79
|
-
"es": "eliminar más registro para pruebas",
|
|
80
|
-
"pl": "usunąć więcej logowania do testowania",
|
|
81
|
-
"uk": "видалити більше журналів для тестування",
|
|
82
|
-
"zh-cn": "删除更多用于测试的日志"
|
|
83
|
-
},
|
|
84
|
-
"1.18.25": {
|
|
85
|
-
"en": "remove logging for testing",
|
|
86
|
-
"de": "entfernen von protokollen für tests",
|
|
87
|
-
"ru": "удаление бревен для тестирования",
|
|
88
|
-
"pt": "remover o registo para testes",
|
|
89
|
-
"nl": "verwijderen logging voor het testen",
|
|
90
|
-
"fr": "supprimer l'enregistrement pour les essais",
|
|
91
|
-
"it": "rimuovere logging per il test",
|
|
92
|
-
"es": "eliminar registro para pruebas",
|
|
93
|
-
"pl": "usunąć logowanie do testowania",
|
|
94
|
-
"uk": "видалення загартування для тестування",
|
|
95
|
-
"zh-cn": "删除用于测试的日志"
|
|
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,7 +243,9 @@ class bridgeClass {
|
|
|
241
243
|
});
|
|
242
244
|
}
|
|
243
245
|
if (message.effect) {
|
|
244
|
-
const effect =
|
|
246
|
+
const effect =
|
|
247
|
+
this.SubscribedTopics[topic].effects[message.effect] ??
|
|
248
|
+
this.SubscribedTopics[topic].effects[0];
|
|
245
249
|
await this.adapter.setForeignStateAsync(this.SubscribedTopics[topic].LightIds.effects, {
|
|
246
250
|
val: effect,
|
|
247
251
|
c: 'from bridge',
|
|
@@ -261,6 +265,18 @@ class bridgeClass {
|
|
|
261
265
|
}
|
|
262
266
|
}
|
|
263
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
|
+
}
|
|
264
280
|
|
|
265
281
|
// Check for namespace and write own, oder foreign state
|
|
266
282
|
if (this.SubscribedTopics[topic].id.startsWith(this.adapter.namespace)) {
|
|
@@ -823,7 +839,17 @@ class bridgeClass {
|
|
|
823
839
|
if (this.PublishedIds[id].publish[publishTopic].messageAssign[val]) {
|
|
824
840
|
val = this.PublishedIds[id].publish[publishTopic].messageAssign[val];
|
|
825
841
|
} else {
|
|
826
|
-
|
|
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;
|
|
827
853
|
}
|
|
828
854
|
}
|
|
829
855
|
}
|
|
@@ -1737,6 +1763,7 @@ class bridgeClass {
|
|
|
1737
1763
|
await this.getForeignHumidifierConfig();
|
|
1738
1764
|
await this.getForeignLightConfig();
|
|
1739
1765
|
await this.getForeignCoverConfig();
|
|
1766
|
+
await this.getForeignLockConfig();
|
|
1740
1767
|
await this.checkDiscoveries();
|
|
1741
1768
|
} catch (error) {
|
|
1742
1769
|
this.adapter.log.error(`error at ${activeFunction}: ${error}`);
|
|
@@ -2685,7 +2712,7 @@ class bridgeClass {
|
|
|
2685
2712
|
/**
|
|
2686
2713
|
* get Foreign states for Bridge
|
|
2687
2714
|
*
|
|
2688
|
-
* @param config config of the
|
|
2715
|
+
* @param config config of the cover entity
|
|
2689
2716
|
*/
|
|
2690
2717
|
async discoverForeignCover(config) {
|
|
2691
2718
|
const activeFunction = 'bridge.js - discoverForeignCover';
|
|
@@ -2816,7 +2843,7 @@ class bridgeClass {
|
|
|
2816
2843
|
DiscoveryTopic,
|
|
2817
2844
|
DiscoveryPayload,
|
|
2818
2845
|
Id,
|
|
2819
|
-
{ cover: true,
|
|
2846
|
+
{ cover: true, messageAssign: setAssign },
|
|
2820
2847
|
);
|
|
2821
2848
|
|
|
2822
2849
|
// Position
|
|
@@ -2835,66 +2862,6 @@ class bridgeClass {
|
|
|
2835
2862
|
}
|
|
2836
2863
|
|
|
2837
2864
|
// Assign Published Ids
|
|
2838
|
-
// Open
|
|
2839
|
-
if (config.CoverIds.open) {
|
|
2840
|
-
this.assignIdStructure(
|
|
2841
|
-
this.PublishedIds,
|
|
2842
|
-
config.CoverIds.open,
|
|
2843
|
-
{
|
|
2844
|
-
usedDeviceId: Cover.open.DeviceIdentifier,
|
|
2845
|
-
},
|
|
2846
|
-
DiscoveryTopic,
|
|
2847
|
-
DiscoveryPayload,
|
|
2848
|
-
`${coverTopic}${this.EndingState}`,
|
|
2849
|
-
{ cover: true, messageAssign: { true: 'OPEN' } },
|
|
2850
|
-
);
|
|
2851
|
-
}
|
|
2852
|
-
|
|
2853
|
-
// Close
|
|
2854
|
-
if (config.CoverIds.close) {
|
|
2855
|
-
this.assignIdStructure(
|
|
2856
|
-
this.PublishedIds,
|
|
2857
|
-
config.CoverIds.close,
|
|
2858
|
-
{
|
|
2859
|
-
usedDeviceId: Cover.close.DeviceIdentifier,
|
|
2860
|
-
},
|
|
2861
|
-
DiscoveryTopic,
|
|
2862
|
-
DiscoveryPayload,
|
|
2863
|
-
`${coverTopic}${this.EndingState}`,
|
|
2864
|
-
{ cover: true, messageAssign: { true: 'CLOSE' } },
|
|
2865
|
-
);
|
|
2866
|
-
}
|
|
2867
|
-
|
|
2868
|
-
// Stop
|
|
2869
|
-
if (config.CoverIds.stop) {
|
|
2870
|
-
this.assignIdStructure(
|
|
2871
|
-
this.PublishedIds,
|
|
2872
|
-
config.CoverIds.stop,
|
|
2873
|
-
{
|
|
2874
|
-
usedDeviceId: Cover.stop.DeviceIdentifier,
|
|
2875
|
-
},
|
|
2876
|
-
DiscoveryTopic,
|
|
2877
|
-
DiscoveryPayload,
|
|
2878
|
-
`${coverTopic}${this.EndingState}`,
|
|
2879
|
-
{ cover: true, messageAssign: { true: 'STOP' } },
|
|
2880
|
-
);
|
|
2881
|
-
}
|
|
2882
|
-
|
|
2883
|
-
// Position
|
|
2884
|
-
if (config.CoverIds.command) {
|
|
2885
|
-
this.assignIdStructure(
|
|
2886
|
-
this.PublishedIds,
|
|
2887
|
-
config.CoverIds.command,
|
|
2888
|
-
{
|
|
2889
|
-
usedDeviceId: Cover.position.DeviceIdentifier,
|
|
2890
|
-
},
|
|
2891
|
-
DiscoveryTopic,
|
|
2892
|
-
DiscoveryPayload,
|
|
2893
|
-
`${Cover.position.Topic}${this.EndingState}`,
|
|
2894
|
-
{ cover: true, command: true },
|
|
2895
|
-
);
|
|
2896
|
-
}
|
|
2897
|
-
|
|
2898
2865
|
// Position
|
|
2899
2866
|
if (config.CoverIds.position) {
|
|
2900
2867
|
this.assignIdStructure(
|
|
@@ -2948,7 +2915,7 @@ class bridgeClass {
|
|
|
2948
2915
|
}
|
|
2949
2916
|
|
|
2950
2917
|
const informations = {
|
|
2951
|
-
|
|
2918
|
+
cover: {
|
|
2952
2919
|
usedDeviceId: deviceIdentifier,
|
|
2953
2920
|
},
|
|
2954
2921
|
};
|
|
@@ -2962,22 +2929,6 @@ class bridgeClass {
|
|
|
2962
2929
|
// Delay for publish new entity
|
|
2963
2930
|
setTimeout(async () => {
|
|
2964
2931
|
// Subscribe state for onStatechange mathode
|
|
2965
|
-
if (config.CoverIds.open) {
|
|
2966
|
-
await this.publishId(config.CoverIds.open, undefined, {});
|
|
2967
|
-
await this.adapter.subscribeForeignStatesAsync(config.CoverIds.open);
|
|
2968
|
-
}
|
|
2969
|
-
if (config.CoverIds.close) {
|
|
2970
|
-
await this.publishId(config.CoverIds.close, undefined, {});
|
|
2971
|
-
await this.adapter.subscribeForeignStatesAsync(config.CoverIds.close);
|
|
2972
|
-
}
|
|
2973
|
-
if (config.CoverIds.stop) {
|
|
2974
|
-
await this.publishId(config.CoverIds.stop, undefined, {});
|
|
2975
|
-
await this.adapter.subscribeForeignStatesAsync(config.CoverIds.stop);
|
|
2976
|
-
}
|
|
2977
|
-
if (config.CoverIds.command) {
|
|
2978
|
-
await this.publishId(config.CoverIds.command, undefined, {});
|
|
2979
|
-
await this.adapter.subscribeForeignStatesAsync(config.CoverIds.command);
|
|
2980
|
-
}
|
|
2981
2932
|
if (config.CoverIds.position) {
|
|
2982
2933
|
await this.publishId(config.CoverIds.position, undefined, {});
|
|
2983
2934
|
await this.adapter.subscribeForeignStatesAsync(config.CoverIds.position);
|
|
@@ -3001,7 +2952,7 @@ class bridgeClass {
|
|
|
3001
2952
|
* ******************************************************************/
|
|
3002
2953
|
|
|
3003
2954
|
/**
|
|
3004
|
-
* @param config Configuration of the
|
|
2955
|
+
* @param config Configuration of the cover entity, wich is to genereate
|
|
3005
2956
|
*/
|
|
3006
2957
|
async generateForeignCoverIds(config) {
|
|
3007
2958
|
const activeFunction = 'generateForeignCoverIds';
|
|
@@ -3048,6 +2999,211 @@ class bridgeClass {
|
|
|
3048
2999
|
}
|
|
3049
3000
|
}
|
|
3050
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
|
+
if (config.LockIds.state) {
|
|
3103
|
+
DiscoveryPayload.state_topic = `${lockTopic}${this.EndingState}`;
|
|
3104
|
+
}
|
|
3105
|
+
|
|
3106
|
+
// Assign Subscribed Topics
|
|
3107
|
+
// Incomming set
|
|
3108
|
+
this.assignTopicStructure(
|
|
3109
|
+
this.SubscribedTopics,
|
|
3110
|
+
`${lockTopic}${this.EndingSet}`,
|
|
3111
|
+
{
|
|
3112
|
+
usedDeviceId: deviceIdentifier,
|
|
3113
|
+
},
|
|
3114
|
+
DiscoveryTopic,
|
|
3115
|
+
DiscoveryPayload,
|
|
3116
|
+
Id,
|
|
3117
|
+
{ lock: true, messageAssign: setAssign },
|
|
3118
|
+
);
|
|
3119
|
+
|
|
3120
|
+
// Assign Published Ids
|
|
3121
|
+
// sending state
|
|
3122
|
+
if (config.LockIds.state) {
|
|
3123
|
+
this.assignIdStructure(
|
|
3124
|
+
this.PublishedIds,
|
|
3125
|
+
config.LockIds.state,
|
|
3126
|
+
{
|
|
3127
|
+
usedDeviceId: Lock.state.DeviceIdentifier,
|
|
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.state) {
|
|
3152
|
+
await this.publishId(config.LockIds.state, undefined, {});
|
|
3153
|
+
await this.adapter.subscribeForeignStatesAsync(config.LockIds.state);
|
|
3154
|
+
}
|
|
3155
|
+
}, 1000);
|
|
3156
|
+
} catch (error) {
|
|
3157
|
+
this.adapter.log.error(`error at ${activeFunction}: ${error}`);
|
|
3158
|
+
}
|
|
3159
|
+
}
|
|
3160
|
+
|
|
3161
|
+
/*********************************************************************
|
|
3162
|
+
* *************** generate Foreign Lock Ids **********************
|
|
3163
|
+
* ******************************************************************/
|
|
3164
|
+
|
|
3165
|
+
/**
|
|
3166
|
+
* @param config Configuration of the Lock entity, wich is to genereate
|
|
3167
|
+
*/
|
|
3168
|
+
async generateForeignLockIds(config) {
|
|
3169
|
+
const activeFunction = 'generateForeignLockIds';
|
|
3170
|
+
this.adapter.log.debug(`Function ${activeFunction} started.`);
|
|
3171
|
+
try {
|
|
3172
|
+
const LockIds = {};
|
|
3173
|
+
if (config.LockSeparate === 'string') {
|
|
3174
|
+
LockIds.command = config.CommandId;
|
|
3175
|
+
}
|
|
3176
|
+
if (config.LockSeparate === 'separate') {
|
|
3177
|
+
LockIds.lock = config.LockId;
|
|
3178
|
+
LockIds.unlock = config.UnlockId;
|
|
3179
|
+
if (config.LockOpen) {
|
|
3180
|
+
LockIds.open = config.OpenId;
|
|
3181
|
+
}
|
|
3182
|
+
}
|
|
3183
|
+
if (config.LockSeparateState) {
|
|
3184
|
+
LockIds.state = config.StateId;
|
|
3185
|
+
}
|
|
3186
|
+
for (const id of Object.values(LockIds)) {
|
|
3187
|
+
if (!(await this.adapter.getForeignObjectAsync(id))) {
|
|
3188
|
+
this.adapter.log.debug(`Id: ${id} does not exsit.`);
|
|
3189
|
+
return false;
|
|
3190
|
+
}
|
|
3191
|
+
}
|
|
3192
|
+
if (config.LockName === '') {
|
|
3193
|
+
this.adapter.log.debug(`Cover name is empty`);
|
|
3194
|
+
return false;
|
|
3195
|
+
}
|
|
3196
|
+
const indexOfSpace = config.LockName.indexOf(' -- ');
|
|
3197
|
+
if (indexOfSpace > 0) {
|
|
3198
|
+
config.LockName = config.LockName.substring(0, indexOfSpace);
|
|
3199
|
+
}
|
|
3200
|
+
config.LockIds = LockIds;
|
|
3201
|
+
return true;
|
|
3202
|
+
} catch (error) {
|
|
3203
|
+
this.adapter.log.error(`error at ${activeFunction}: ${error}`);
|
|
3204
|
+
}
|
|
3205
|
+
}
|
|
3206
|
+
|
|
3051
3207
|
/**
|
|
3052
3208
|
* @param id id to discover foreign state
|
|
3053
3209
|
* @param clear clear the ids from internal memory
|