iobroker.shelly
Advanced tools
Comparing version 5.2.0 to 5.3.0
{ | ||
"common": { | ||
"name": "shelly", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"news": { | ||
"5.3.0": { | ||
"en": "Added Shelly Plus I4\nAdded more objects for power metering channels (current, voltage, limits, ...)\nMoved device temperature of generation 2 devices to relays (this is the official way)\nAdded Sys channel (eco mode, timezone, ...) for generation 1 devices\nFixed datatype error of Shelly 1/PM ext switch\nAdded option to enable/disable WiFi access point (generation 2 devices)\nAdded power limits and position control for covers (generation 2 devices)\nRemoved colors for online state indication on device objects", | ||
"de": "Shelly Plus I4 hinzugefügt\nWeitere Objekte für Leistungsmesskanäle hinzugefügt (Strom, Spannung, Grenzwerte, ...)\nGerätetemperatur von Geräten der Generation 2 auf Relais verschoben (dies ist der offizielle Weg)\nSys-Kanal (Eco-Modus, Zeitzone, ...) für Geräte der Generation 1 hinzugefügt\nDatentypfehler von Shelly 1/PM ext switch behoben\nOption zum Aktivieren/Deaktivieren des WLAN-Zugangspunkts hinzugefügt (Generation 2-Geräte)\nLeistungsbegrenzungen und Positionskontrolle für Abdeckungen hinzugefügt (Generation 2 Geräte)\nFarben für die Anzeige des Online-Status auf Geräteobjekten entfernt", | ||
"ru": "Добавлен Шелли Плюс I4\nДобавлено больше объектов для каналов учета электроэнергии (ток, напряжение, пределы, ...)\nТемпература устройства устройств поколения 2 перенесена на реле (это официальный способ)\nДобавлен канал Sys (эко-режим, часовой пояс, ...) для устройств поколения 1.\nИсправлена ошибка типа данных переключателя расширения Shelly 1/PM.\nДобавлена возможность включения/отключения точки доступа WiFi (устройства 2-го поколения)\nДобавлены ограничения мощности и контроль положения для крышек (устройства 2-го поколения)\nУдалены цвета для индикации онлайн-состояния на объектах устройств.", | ||
"pt": "Adicionado Shelly Plus I4\nAdicionados mais objetos para canais de medição de energia (corrente, tensão, limites, ...)\nMovimentada a temperatura do dispositivo dos dispositivos da geração 2 para os relés (esta é a maneira oficial)\nAdicionado canal Sys (modo eco, fuso horário, ...) para dispositivos de geração 1\nCorrigido o erro de tipo de dados do switch Shelly 1/PM ext\nAdicionada opção para ativar/desativar ponto de acesso WiFi (dispositivos de geração 2)\nAdicionados limites de energia e controle de posição para tampas (dispositivos de geração 2)\nCores removidas para indicação de estado online em objetos de dispositivo", | ||
"nl": "Shelly Plus I4 toegevoegd\nMeer objecten toegevoegd voor vermogensmeetkanalen (stroom, spanning, limieten, ...)\nApparaattemperatuur van apparaten van generatie 2 verplaatst naar relais (dit is de officiële manier)\nSys-kanaal toegevoegd (eco-modus, tijdzone, ...) voor generatie 1-apparaten\nVaste datatypefout van Shelly 1/PM ext switch\nOptie toegevoegd om WiFi-toegangspunt in/uit te schakelen (generatie 2-apparaten)\nToegevoegde vermogenslimieten en positieregeling voor afdekkingen (generatie 2-apparaten)\nKleuren verwijderd voor online statusindicatie op apparaatobjecten", | ||
"fr": "Ajout de Shelly Plus I4\nAjout de plus d'objets pour les canaux de mesure de puissance (courant, tension, limites, ...)\nDéplacement de la température de l'appareil des appareils de génération 2 vers les relais (c'est la méthode officielle)\nAjout du canal Sys (mode éco, fuseau horaire, ...) pour les appareils de génération 1\nErreur de type de données fixe du commutateur Shelly 1/PM ext\nAjout d'une option pour activer/désactiver le point d'accès WiFi (appareils de génération 2)\nAjout de limites de puissance et de contrôle de position pour les couvercles (appareils de génération 2)\nSuppression des couleurs pour l'indication d'état en ligne sur les objets de l'appareil", | ||
"it": "Aggiunto Shelly Plus I4\nAggiunti più oggetti per i canali di misurazione della potenza (corrente, tensione, limiti, ...)\nSpostata la temperatura del dispositivo dei dispositivi di generazione 2 sui relè (questo è il modo ufficiale)\nAggiunto canale Sys (modalità eco, fuso orario, ...) per i dispositivi di prima generazione\nRisolto l'errore del tipo di dati dello switch Shelly 1/PM ext\nAggiunta opzione per abilitare/disabilitare il punto di accesso WiFi (dispositivi di seconda generazione)\nAggiunti limiti di potenza e controllo della posizione per le coperture (dispositivi di seconda generazione)\nRimossi i colori per l'indicazione dello stato online sugli oggetti del dispositivo", | ||
"es": "Añadido Shelly Plus I4\nSe agregaron más objetos para los canales de medición de energía (corriente, voltaje, límites, ...)\nSe movió la temperatura del dispositivo de los dispositivos de generación 2 a los relés (esta es la forma oficial)\nSe agregó el canal Sys (modo eco, zona horaria, ...) para dispositivos de generación 1\nSe corrigió el error de tipo de datos del interruptor externo Shelly 1/PM\nOpción agregada para habilitar/deshabilitar el punto de acceso WiFi (dispositivos de generación 2)\nSe agregaron límites de potencia y control de posición para cubiertas (dispositivos de generación 2)\nColores eliminados para la indicación de estado en línea en los objetos del dispositivo", | ||
"pl": "Dodano Shelly Plus I4\nDodano więcej obiektów dla kanałów pomiaru mocy (prąd, napięcie, limity, ...)\nPrzeniesiono temperaturę urządzeń generacji 2 na przekaźniki (jest to oficjalny sposób)\nDodano kanał Sys (tryb ekologiczny, strefa czasowa, ...) dla urządzeń generacji 1\nNaprawiono błąd typu danych przełącznika Shelly 1/PM ext\nDodano opcję włączania/wyłączania punktu dostępowego Wi-Fi (urządzenia generacji 2)\nDodano limity mocy i kontrolę położenia osłon (urządzenia generacji 2)\nUsunięto kolory dla wskazania stanu online na obiektach urządzenia", | ||
"zh-cn": "添加了 Shelly Plus I4\n为功率计量通道添加了更多对象(电流、电压、限制……)\n将第 2 代设备的设备温度移动到继电器(这是官方方式)\n为第 1 代设备添加了系统通道(生态模式、时区...)\n修复了 Shelly 1/PM ext 开关的数据类型错误\n添加了启用/禁用 WiFi 接入点的选项(第 2 代设备)\n增加了盖子的功率限制和位置控制(第 2 代设备)\n移除了设备对象上在线状态指示的颜色" | ||
}, | ||
"5.2.0": { | ||
"en": "Added Shelly Pro 1\nAdded Shelly Pro 1 PM\nAdded Shelly Pro 2\nAdded Shelly Pro 2 PM\nAdded Shelly Plus 2 PM\nAllow to change device and channel names of generation 2 devices\nAdded auto on/off timers for generation 2 devices\nAdded input mode, events and initial state for generation 2 devices\nAdded support of covers / shutters for generation 2 devices\nReplaced node-fetch with axios (also for digest auth)", | ||
"de": "Shelly Pro 1 hinzugefügt\nShelly Pro 13 Uhr hinzugefügt\nShelly Pro 2 hinzugefügt\nShelly Pro 14 Uhr hinzugefügt\nShelly Plus 14 Uhr hinzugefügt\nErmöglicht das Ändern von Geräte- und Kanalnamen von Geräten der Generation 2\nAuto-On/Off-Timer für Geräte der Generation 2 hinzugefügt\nEingabemodus, Ereignisse und Anfangszustand für Geräte der Generation 2 hinzugefügt\nUnterstützung von Abdeckungen/Verschlüssen für Geräte der Generation 2 hinzugefügt\nNode-Fetch durch Axios ersetzt (auch für Digest-Authentifizierung)", | ||
"ru": "Добавлен Шелли Про 1\nДобавлен Шелли Про 13:00\nДобавлен Шелли Про 2\nДобавлен Шелли Про 14:00\nДобавлен Шелли Плюс 14:00\nРазрешить изменять имена устройств и каналов устройств поколения 2\nДобавлены таймеры автоматического включения/выключения для устройств 2-го поколения.\nДобавлен режим ввода, события и начальное состояние для устройств поколения 2.\nДобавлена поддержка крышек/жалюзи для устройств поколения 2\nNode-fetch заменен на axios (также для дайджест-аутентификации)", | ||
"pt": "Adicionado Shelly Pro 1\nAdicionado Shelly Pro 13:00\nAdicionado Shelly Pro 2\nAdicionado Shelly Pro 14:00\nAdicionado Shelly Plus 14:00\nPermitir alterar nomes de dispositivos e canais de dispositivos de geração 2\nAdicionados temporizadores automáticos de ligar/desligar para dispositivos de geração 2\nAdicionado modo de entrada, eventos e estado inicial para dispositivos de geração 2\nAdicionado suporte de tampas / persianas para dispositivos de geração 2\nSubstituição de busca de nó por axios (também para autenticação de resumo)", | ||
"nl": "Shelly Pro 1 toegevoegd\nShelly Pro om 13:00 uur toegevoegd\nShelly Pro 2 toegevoegd\nShelly Pro 14.00 uur toegevoegd\nShelly Plus 14.00 uur toegevoegd\nToestaan om apparaat- en kanaalnamen van generatie 2-apparaten te wijzigen\nAutomatische aan/uit-timers toegevoegd voor apparaten van generatie 2\nInvoermodus, gebeurtenissen en beginstatus toegevoegd voor apparaten van generatie 2\nOndersteuning toegevoegd voor covers / shutters voor generatie 2 apparaten\nNode-fetch vervangen door axios (ook voor digest auth)", | ||
"fr": "Ajout de Shelly Pro 1\nAjout de Shelly Pro 1 PM\nAjout de Shelly Pro 2\nAjout de Shelly Pro 2 PM\nAjout de Shelly Plus 2 PM\nAutoriser la modification des noms d'appareils et de canaux des appareils de génération 2\nAjout de minuteries marche/arrêt automatiques pour les appareils de génération 2\nAjout du mode d'entrée, des événements et de l'état initial pour les appareils de génération 2\nAjout de la prise en charge des couvertures/obturateurs pour les appareils de génération 2\nNode-fetch remplacé par axios (également pour Digest Auth)", | ||
"it": "Aggiunto Shelly Pro 1\nAggiunto Shelly Pro 13:00\nAggiunto Shelly Pro 2\nAggiunto Shelly Pro 14:00\nAggiunto Shelly Plus 14:00\nConsenti di cambiare i nomi dei dispositivi e dei canali dei dispositivi di generazione 2\nAggiunti timer di accensione/spegnimento automatici per i dispositivi di seconda generazione\nAggiunta modalità di input, eventi e stato iniziale per i dispositivi di seconda generazione\nAggiunto supporto per coperture/persiane per dispositivi di generazione 2\nSostituito node-fetch con axios (anche per digest auth)", | ||
"es": "Añadido Shelly Pro 1\nSe agregó Shelly Pro a la 1 p. m.\nAñadido Shelly Pro 2\nSe agregó Shelly Pro a las 2 p. m.\nSe agregó Shelly Plus a las 2 p. m.\nPermitir cambiar los nombres de los dispositivos y canales de los dispositivos de generación 2\nTemporizadores de encendido/apagado automático agregados para dispositivos de generación 2\nModo de entrada agregado, eventos y estado inicial para dispositivos de generación 2\nSe agregó soporte de cubiertas / persianas para dispositivos de generación 2\nSe reemplazó la búsqueda de nodos con axios (también para autenticación de resumen)", | ||
"pl": "Dodano Shelly Pro 1\nDodano Shelly Pro o 13:00\nDodano Shelly Pro 2\nDodano Shelly Pro 14:00\nDodano Shelly Plus 14:00\nZezwalaj na zmianę nazw urządzeń i kanałów urządzeń generacji 2\nDodano zegary automatycznego włączania/wyłączania dla urządzeń generacji 2\nDodano tryb wejścia, zdarzenia i stan początkowy dla urządzeń generacji 2\nDodano obsługę osłon / rolet dla urządzeń generacji 2\nZamieniono pobieranie węzła na axios (również dla auth skrótu)", | ||
"de": "Shelly Pro 1 hinzugefügt\nShelly Pro 1 PM hinzugefügt\nShelly Pro 2 hinzugefügt\nShelly Pro 2 PM hinzugefügt\nShelly Plus 2 PM hinzugefügt\nErmöglicht das Ändern von Geräte- und Kanalnamen von Geräten der Generation 2\nAuto-On/Off-Timer für Geräte der Generation 2 hinzugefügt\nEingabemodus, Ereignisse und Anfangszustand für Geräte der Generation 2 hinzugefügt\nUnterstützung von Abdeckungen/Verschlüssen für Geräte der Generation 2 hinzugefügt\nNode-Fetch durch Axios ersetzt (auch für Digest-Authentifizierung)", | ||
"ru": "Добавлен Шелли Про 1\nДобавлен Шелли Про 1\nДобавлен Шелли Про 2\nДобавлен Шелли Про 2\nДобавлен Шелли Плюс 2\nРазрешить изменять имена устройств и каналов устройств поколения 2\nДобавлены таймеры автоматического включения/выключения для устройств 2-го поколения.\nДобавлен режим ввода, события и начальное состояние для устройств поколения 2.\nДобавлена поддержка крышек/жалюзи для устройств поколения 2\nNode-fetch заменен на axios (также для дайджест-аутентификации)", | ||
"pt": "Adicionado Shelly Pro 1\nAdicionado Shelly Pro 1\nAdicionado Shelly Pro 2\nAdicionado Shelly Pro 2\nAdicionado Shelly Plus 2\nPermitir alterar nomes de dispositivos e canais de dispositivos de geração 2\nAdicionados temporizadores automáticos de ligar/desligar para dispositivos de geração 2\nAdicionado modo de entrada, eventos e estado inicial para dispositivos de geração 2\nAdicionado suporte de tampas / persianas para dispositivos de geração 2\nSubstituição de busca de nó por axios (também para autenticação de resumo)", | ||
"nl": "Shelly Pro 1 toegevoegd\nShelly Pro om 1 toegevoegd\nShelly Pro 2 toegevoegd\nShelly Pro 2 toegevoegd\nShelly Plus 2 toegevoegd\nToestaan om apparaat- en kanaalnamen van generatie 2-apparaten te wijzigen\nAutomatische aan/uit-timers toegevoegd voor apparaten van generatie 2\nInvoermodus, gebeurtenissen en beginstatus toegevoegd voor apparaten van generatie 2\nOndersteuning toegevoegd voor covers / shutters voor generatie 2 apparaten\nNode-fetch vervangen door axios (ook voor digest auth)", | ||
"fr": "Ajout de Shelly Pro 1\nAjout de Shelly Pro 1\nAjout de Shelly Pro 2\nAjout de Shelly Pro 2 PM\nAjout de Shelly Plus 2 PM\nAutoriser la modification des noms d'appareils et de canaux des appareils de génération 2\nAjout de minuteries marche/arrêt automatiques pour les appareils de génération 2\nAjout du mode d'entrée, des événements et de l'état initial pour les appareils de génération 2\nAjout de la prise en charge des couvertures/obturateurs pour les appareils de génération 2\nNode-fetch remplacé par axios (également pour Digest Auth)", | ||
"it": "Aggiunto Shelly Pro 1\nAggiunto Shelly Pro 1\nAggiunto Shelly Pro 2\nAggiunto Shelly Pro 2 PM\nAggiunto Shelly Plus 2\nConsenti di cambiare i nomi dei dispositivi e dei canali dei dispositivi di generazione 2\nAggiunti timer di accensione/spegnimento automatici per i dispositivi di seconda generazione\nAggiunta modalità di input, eventi e stato iniziale per i dispositivi di seconda generazione\nAggiunto supporto per coperture/persiane per dispositivi di generazione 2\nSostituito node-fetch con axios (anche per digest auth)", | ||
"es": "Añadido Shelly Pro 1\nSe agregó Shelly Pro 1\nAñadido Shelly Pro 2\nSe agregó Shelly Pro 2 PM\nSe agregó Shelly Plus 2\nPermitir cambiar los nombres de los dispositivos y canales de los dispositivos de generación 2\nTemporizadores de encendido/apagado automático agregados para dispositivos de generación 2\nModo de entrada agregado, eventos y estado inicial para dispositivos de generación 2\nSe agregó soporte de cubiertas / persianas para dispositivos de generación 2\nSe reemplazó la búsqueda de nodos con axios (también para autenticación de resumen)", | ||
"pl": "Dodano Shelly Pro 1\nDodano Shelly Pro o 1\nDodano Shelly Pro 2\nDodano Shelly Pro 2\nDodano Shelly Plus 2\nZezwalaj na zmianę nazw urządzeń i kanałów urządzeń generacji 2\nDodano zegary automatycznego włączania/wyłączania dla urządzeń generacji 2\nDodano tryb wejścia, zdarzenia i stan początkowy dla urządzeń generacji 2\nDodano obsługę osłon / rolet dla urządzeń generacji 2\nZamieniono pobieranie węzła na axios (również dla auth skrótu)", | ||
"zh-cn": "添加了 Shelly Pro 1\n添加了 Shelly Pro 下午 1 点\n添加了 Shelly Pro 2\n添加了 Shelly Pro 2 PM\n添加了 Shelly Plus 2 PM\n允许更改第 2 代设备的设备和通道名称\n为第 2 代设备添加了自动开/关计时器\n为第 2 代设备添加了输入模式、事件和初始状态\n增加了对第 2 代设备的盖板/百叶窗的支持\n将 node-fetch 替换为 axios(也用于摘要身份验证)" | ||
@@ -77,14 +89,2 @@ }, | ||
"zh-cn": "重要提示:适配器现在至少需要 Node.js 12.x、js-controller 3.3+ 和 Admin 5.1.25+\n* Shelly Plus 支持 (1, 1 PM)\n* Shelly Pro 支持 (4 PM)\n* 更新标志\n* 使用类定义代替\n* 使用内部加密方法\n* 管理员 5 配置" | ||
}, | ||
"4.1.2": { | ||
"en": "Fix the online checks to stay online", | ||
"de": "Beheben Sie die Online-Checks, um online zu bleiben", | ||
"ru": "Исправьте онлайн-чеки, чтобы оставаться в сети", | ||
"pt": "Corrija as verificações online para permanecer online", | ||
"nl": "Los de online cheques op om online te blijven", | ||
"fr": "Corrigez les chèques en ligne pour rester en ligne", | ||
"it": "Risolvi i controlli online per rimanere online", | ||
"es": "Arregle los cheques en línea para permanecer en línea", | ||
"pl": "Napraw czeki online, aby pozostać online", | ||
"zh-cn": "修复在线检查以保持在线状态" | ||
} | ||
@@ -126,2 +126,9 @@ }, | ||
"docs/en/basics.md", | ||
"docs/en/protocol-coap.md", | ||
"docs/en/protocol-mqtt.md", | ||
"docs/en/restricted-login.md", | ||
"docs/en/state-changes.md" | ||
], | ||
"de": [ | ||
"docs/de/basics.md", | ||
"docs/de/protocol-coap.md", | ||
@@ -131,9 +138,2 @@ "docs/de/protocol-mqtt.md", | ||
"docs/de/state-changes.md" | ||
], | ||
"de": [ | ||
"docs/de/basics.md", | ||
"docs/en/protocol-coap.md", | ||
"docs/en/protocol-mqtt.md", | ||
"docs/en/restricted-login.md", | ||
"docs/de/state-changes.md" | ||
] | ||
@@ -144,3 +144,3 @@ }, | ||
"icon": "shelly.png", | ||
"enabled": true, | ||
"enabled": false, | ||
"compact": true, | ||
@@ -151,4 +151,4 @@ "extIcon": "https://raw.githubusercontent.com/iobroker-community-adapters/ioBroker.shelly/master/admin/shelly.png", | ||
"switch", | ||
"smarthome", | ||
"iobroker" | ||
"coap", | ||
"mqtt" | ||
], | ||
@@ -155,0 +155,0 @@ "readme": "https://github.com/iobroker-community-adapters/ioBroker.shelly/blob/master/README.md", |
@@ -48,2 +48,3 @@ /* jshint -W097 */ | ||
const shellyplus2pm = require(__dirname + '/devices/gen2/shellyplus2pm').shellyplus2pm; | ||
const shellyplusi4 = require(__dirname + '/devices/gen2/shellyplusi4').shellyplusi4; | ||
const shellypro1 = require(__dirname + '/devices/gen2/shellypro1').shellypro1; | ||
@@ -89,2 +90,3 @@ const shellypro1pm = require(__dirname + '/devices/gen2/shellypro1pm').shellypro1pm; | ||
'shellyplus2pm': shellyplus2pm, | ||
'shellyplusi4': shellyplusi4, | ||
'shellypro1': shellypro1, | ||
@@ -131,2 +133,3 @@ 'shellypro1pm': shellypro1pm, | ||
'shellyplus2pm': ['shellyplus2pm'], | ||
'shellyplusi4': ['shellyplusi4'], | ||
'shellypro1': ['shellypro1'], | ||
@@ -173,2 +176,3 @@ 'shellypro1pm': ['shellypro1pm'], | ||
'shellyplus2pm': 2, | ||
'shellyplusi4': 2, | ||
'shellypro1': 2, | ||
@@ -175,0 +179,0 @@ 'shellypro1pm': 2, |
@@ -228,2 +228,95 @@ /* jshint -W097 */ | ||
} | ||
}, | ||
'Sys.eco': { | ||
coap: { | ||
http_publish: '/settings', | ||
http_publish_funct: (value) => { return value ? JSON.parse(value).eco_mode_enabled : undefined; }, | ||
http_cmd: '/settings', | ||
http_cmd_funct: (value) => { return { eco_mode_enabled: value }; } | ||
}, | ||
mqtt: { | ||
http_publish: '/settings', | ||
http_publish_funct: (value) => { return value ? JSON.parse(value).eco_mode_enabled : undefined; }, | ||
http_cmd: '/settings', | ||
http_cmd_funct: (value) => { return { eco_mode_enabled: value }; } | ||
}, | ||
common: { | ||
'name': 'Eco Mode', | ||
'type': 'boolean', | ||
'role': 'state', | ||
'read': true, | ||
'write': true | ||
} | ||
}, | ||
'Sys.sntp': { | ||
coap: { | ||
http_publish: '/settings', | ||
http_publish_funct: (value) => { return value ? JSON.parse(value).sntp.server : undefined; }, | ||
http_cmd: '/settings', | ||
http_cmd_funct: (value) => { return { sntp_server: value }; } | ||
}, | ||
mqtt: { | ||
http_publish: '/settings', | ||
http_publish_funct: (value) => { return value ? JSON.parse(value).sntp.server : undefined; }, | ||
http_cmd: '/settings', | ||
http_cmd_funct: (value) => { return { sntp_server: value }; } | ||
}, | ||
common: { | ||
'name': 'SNTP Server', | ||
'type': 'string', | ||
'role': 'url', | ||
'read': true, | ||
'write': true | ||
} | ||
}, | ||
'Sys.timezone': { | ||
coap: { | ||
http_publish: '/settings', | ||
http_publish_funct: (value) => { return value ? JSON.parse(value).timezone : undefined; } | ||
}, | ||
mqtt: { | ||
http_publish: '/settings', | ||
http_publish_funct: (value) => { return value ? JSON.parse(value).timezone : undefined; } | ||
}, | ||
common: { | ||
'name': 'Timezone', | ||
'type': 'string', | ||
'role': 'text', | ||
'read': true, | ||
'write': false | ||
} | ||
}, | ||
'Sys.lat': { | ||
coap: { | ||
http_publish: '/settings', | ||
http_publish_funct: (value) => { return value ? JSON.parse(value).lat : undefined; } | ||
}, | ||
mqtt: { | ||
http_publish: '/settings', | ||
http_publish_funct: (value) => { return value ? JSON.parse(value).lat : undefined; } | ||
}, | ||
common: { | ||
'name': 'Latitude', | ||
'type': 'number', | ||
'role': 'value.gps.latitude', | ||
'read': true, | ||
'write': false | ||
} | ||
}, | ||
'Sys.lon': { | ||
coap: { | ||
http_publish: '/settings', | ||
http_publish_funct: (value) => { return value ? JSON.parse(value).lng : undefined; } | ||
}, | ||
mqtt: { | ||
http_publish: '/settings', | ||
http_publish_funct: (value) => { return value ? JSON.parse(value).lng : undefined; } | ||
}, | ||
common: { | ||
'name': 'Longitude', | ||
'type': 'number', | ||
'role': 'value.gps.longitude', | ||
'read': true, | ||
'write': false | ||
} | ||
} | ||
@@ -316,3 +409,3 @@ }; | ||
http_publish: '/rpc/Shelly.GetDeviceInfo', | ||
http_publish_funct: (value) => { return value ? JSON.parse(value).ver : undefined; } | ||
http_publish_funct: (value) => { return value ? JSON.parse(value).fw_id : undefined; } | ||
}, | ||
@@ -518,2 +611,17 @@ common: { | ||
} | ||
}, | ||
'WiFi.apEnabled': { | ||
mqtt: { | ||
http_publish: '/rpc/WiFi.GetConfig', | ||
http_publish_funct: (value) => { return value ? JSON.parse(value).ap.enable : undefined; }, | ||
mqtt_cmd: '<mqttprefix>/rpc', | ||
mqtt_cmd_funct: (value) => { return JSON.stringify({id: 0, src: 'iobroker', method: 'WiFi.SetConfig', params: {config: {ap: {enable: value}}}}); } | ||
}, | ||
common: { | ||
'name': 'Access Point Enabled', | ||
'type': 'boolean', | ||
'role': 'state', | ||
'read': true, | ||
'write': true | ||
} | ||
} | ||
@@ -520,0 +628,0 @@ }; |
@@ -458,3 +458,4 @@ /* jshint -W097 */ | ||
coap: { | ||
coap_publish: '3117' // CoAP >= FW 1.8 | ||
coap_publish: '3117', // CoAP >= FW 1.8 | ||
coap_publish_funct: (value) => { return value == 1 ? true : false; } | ||
}, | ||
@@ -461,0 +462,0 @@ mqtt: { |
@@ -609,3 +609,4 @@ /* jshint -W097 */ | ||
coap: { | ||
coap_publish: '3117' // CoAP >= FW 1.8 | ||
coap_publish: '3117', // CoAP >= FW 1.8 | ||
coap_publish_funct: (value) => { return value == 1 ? true : false; } | ||
}, | ||
@@ -612,0 +613,0 @@ mqtt: { |
@@ -16,54 +16,3 @@ /* jshint -W097 */ | ||
const shellyplus1 = { | ||
'temperatureC': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'temperature') | ||
) { | ||
return valueObj.params['switch:0'].temperature.tC; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Temperature °C', | ||
'type': 'number', | ||
'role': 'value.temperature', | ||
'read': true, | ||
'write': false, | ||
'unit': '°C' | ||
} | ||
}, | ||
'temperatureF': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'temperature') | ||
) { | ||
return valueObj.params['switch:0'].temperature.tF; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Temperature °F', | ||
'type': 'number', | ||
'role': 'value.temperature', | ||
'read': true, | ||
'write': false, | ||
'unit': '°F' | ||
} | ||
} | ||
}; | ||
@@ -70,0 +19,0 @@ |
@@ -16,111 +16,6 @@ /* jshint -W097 */ | ||
const shellyplus1pm = { | ||
'Relay0.Power': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'apower') | ||
) { | ||
return valueObj.params['switch:0'].apower; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Power', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'W' | ||
} | ||
}, | ||
'Relay0.Energy': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'aenergy') | ||
) { | ||
return valueObj.params['switch:0'].aenergy.total; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Energy', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'Wh' | ||
} | ||
}, | ||
'temperatureC': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'temperature') | ||
) { | ||
return valueObj.params['switch:0'].temperature.tC; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Temperature °C', | ||
'type': 'number', | ||
'role': 'value.temperature', | ||
'read': true, | ||
'write': false, | ||
'unit': '°C' | ||
} | ||
}, | ||
'temperatureF': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'temperature') | ||
) { | ||
return valueObj.params['switch:0'].temperature.tF; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Temperature °F', | ||
'type': 'number', | ||
'role': 'value.temperature', | ||
'read': true, | ||
'write': false, | ||
'unit': '°F' | ||
} | ||
} | ||
}; | ||
shellyHelper.addSwitchToGen2Device(shellyplus1pm, 0); | ||
shellyHelper.addSwitchToGen2Device(shellyplus1pm, 0, true); | ||
@@ -127,0 +22,0 @@ shellyHelper.addInputToGen2Device(shellyplus1pm, 0); |
@@ -16,110 +16,2 @@ /* jshint -W097 */ | ||
const shellyplus2pm = { | ||
'Relay0.Power': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'apower') | ||
) { | ||
return valueObj.params['switch:0'].apower; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Power', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'W' | ||
} | ||
}, | ||
'Relay0.Energy': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'aenergy') | ||
) { | ||
return valueObj.params['switch:0'].aenergy.total; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Energy', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'Wh' | ||
} | ||
}, | ||
'Relay1.Power': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:1') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:1'], 'apower') | ||
) { | ||
return valueObj.params['switch:1'].apower; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Power', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'W' | ||
} | ||
}, | ||
'Relay1.Energy': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:1') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:1'], 'aenergy') | ||
) { | ||
return valueObj.params['switch:1'].aenergy.total; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Energy', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'Wh' | ||
} | ||
}, | ||
'Sys.profile': { | ||
@@ -146,4 +38,4 @@ mqtt: { | ||
shellyHelper.addSwitchToGen2Device(shellyplus2pm, 0); | ||
shellyHelper.addSwitchToGen2Device(shellyplus2pm, 1); | ||
shellyHelper.addSwitchToGen2Device(shellyplus2pm, 0, true); | ||
shellyHelper.addSwitchToGen2Device(shellyplus2pm, 1, true); | ||
@@ -150,0 +42,0 @@ shellyHelper.addInputToGen2Device(shellyplus2pm, 0); |
@@ -16,54 +16,3 @@ /* jshint -W097 */ | ||
const shellypro1 = { | ||
'temperatureC': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'temperature') | ||
) { | ||
return valueObj.params['switch:0'].temperature.tC; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Temperature °C', | ||
'type': 'number', | ||
'role': 'value.temperature', | ||
'read': true, | ||
'write': false, | ||
'unit': '°C' | ||
} | ||
}, | ||
'temperatureF': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'temperature') | ||
) { | ||
return valueObj.params['switch:0'].temperature.tF; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Temperature °F', | ||
'type': 'number', | ||
'role': 'value.temperature', | ||
'read': true, | ||
'write': false, | ||
'unit': '°F' | ||
} | ||
} | ||
}; | ||
@@ -70,0 +19,0 @@ |
@@ -16,111 +16,6 @@ /* jshint -W097 */ | ||
const shellypro1pm = { | ||
'Relay0.Power': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'apower') | ||
) { | ||
return valueObj.params['switch:0'].apower; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Power', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'W' | ||
} | ||
}, | ||
'Relay0.Energy': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'aenergy') | ||
) { | ||
return valueObj.params['switch:0'].aenergy.total; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Energy', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'Wh' | ||
} | ||
}, | ||
'temperatureC': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'temperature') | ||
) { | ||
return valueObj.params['switch:0'].temperature.tC; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Temperature °C', | ||
'type': 'number', | ||
'role': 'value.temperature', | ||
'read': true, | ||
'write': false, | ||
'unit': '°C' | ||
} | ||
}, | ||
'temperatureF': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'temperature') | ||
) { | ||
return valueObj.params['switch:0'].temperature.tF; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Temperature °F', | ||
'type': 'number', | ||
'role': 'value.temperature', | ||
'read': true, | ||
'write': false, | ||
'unit': '°F' | ||
} | ||
} | ||
}; | ||
shellyHelper.addSwitchToGen2Device(shellypro1pm, 0); | ||
shellyHelper.addSwitchToGen2Device(shellypro1pm, 0, true); | ||
@@ -127,0 +22,0 @@ shellyHelper.addInputToGen2Device(shellypro1pm, 0); |
@@ -16,54 +16,3 @@ /* jshint -W097 */ | ||
const shellypro2 = { | ||
'temperatureC': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'temperature') | ||
) { | ||
return valueObj.params['switch:0'].temperature.tC; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Temperature °C', | ||
'type': 'number', | ||
'role': 'value.temperature', | ||
'read': true, | ||
'write': false, | ||
'unit': '°C' | ||
} | ||
}, | ||
'temperatureF': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'temperature') | ||
) { | ||
return valueObj.params['switch:0'].temperature.tF; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Temperature °F', | ||
'type': 'number', | ||
'role': 'value.temperature', | ||
'read': true, | ||
'write': false, | ||
'unit': '°F' | ||
} | ||
} | ||
}; | ||
@@ -70,0 +19,0 @@ |
@@ -16,110 +16,2 @@ /* jshint -W097 */ | ||
const shellypro2pm = { | ||
'Relay0.Power': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'apower') | ||
) { | ||
return valueObj.params['switch:0'].apower; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Power', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'W' | ||
} | ||
}, | ||
'Relay0.Energy': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'aenergy') | ||
) { | ||
return valueObj.params['switch:0'].aenergy.total; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Energy', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'Wh' | ||
} | ||
}, | ||
'Relay1.Power': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:1') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:1'], 'apower') | ||
) { | ||
return valueObj.params['switch:1'].apower; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Power', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'W' | ||
} | ||
}, | ||
'Relay1.Energy': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:1') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:1'], 'aenergy') | ||
) { | ||
return valueObj.params['switch:1'].aenergy.total; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Energy', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'Wh' | ||
} | ||
}, | ||
'Sys.profile': { | ||
@@ -146,4 +38,4 @@ mqtt: { | ||
shellyHelper.addSwitchToGen2Device(shellypro2pm, 0); | ||
shellyHelper.addSwitchToGen2Device(shellypro2pm, 1); | ||
shellyHelper.addSwitchToGen2Device(shellypro2pm, 0, true); | ||
shellyHelper.addSwitchToGen2Device(shellypro2pm, 1, true); | ||
@@ -150,0 +42,0 @@ shellyHelper.addInputToGen2Device(shellypro2pm, 0); |
@@ -16,224 +16,9 @@ /* jshint -W097 */ | ||
const shellypro4pm = { | ||
'Relay0.Power': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'apower') | ||
) { | ||
return valueObj.params['switch:0'].apower; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Power', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'W' | ||
} | ||
}, | ||
'Relay0.Energy': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:0') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:0'], 'aenergy') | ||
) { | ||
return valueObj.params['switch:0'].aenergy.total; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Energy', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'Wh' | ||
} | ||
}, | ||
'Relay1.Power': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:1') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:1'], 'apower') | ||
) { | ||
return valueObj.params['switch:1'].apower; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Power', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'W' | ||
} | ||
}, | ||
'Relay1.Energy': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:1') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:1'], 'aenergy') | ||
) { | ||
return valueObj.params['switch:1'].aenergy.total; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Energy', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'Wh' | ||
} | ||
}, | ||
'Relay2.Power': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:2') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:2'], 'apower') | ||
) { | ||
return valueObj.params['switch:2'].apower; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Power', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'W' | ||
} | ||
}, | ||
'Relay2.Energy': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:2') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:2'], 'aenergy') | ||
) { | ||
return valueObj.params['switch:2'].aenergy.total; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Energy', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'Wh' | ||
} | ||
}, | ||
'Relay3.Power': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:3') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:3'], 'apower') | ||
) { | ||
return valueObj.params['switch:3'].apower; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Power', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'W' | ||
} | ||
}, | ||
'Relay3.Energy': { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, 'switch:3') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params['switch:3'], 'aenergy') | ||
) { | ||
return valueObj.params['switch:3'].aenergy.total; | ||
} | ||
return undefined; | ||
} | ||
}, | ||
common: { | ||
'name': 'Energy', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'Wh' | ||
} | ||
} | ||
}; | ||
shellyHelper.addSwitchToGen2Device(shellypro4pm, 0); | ||
shellyHelper.addSwitchToGen2Device(shellypro4pm, 1); | ||
shellyHelper.addSwitchToGen2Device(shellypro4pm, 2); | ||
shellyHelper.addSwitchToGen2Device(shellypro4pm, 3); | ||
shellyHelper.addSwitchToGen2Device(shellypro4pm, 0, true); | ||
shellyHelper.addSwitchToGen2Device(shellypro4pm, 1, true); | ||
shellyHelper.addSwitchToGen2Device(shellypro4pm, 2, true); | ||
shellyHelper.addSwitchToGen2Device(shellypro4pm, 3, true); | ||
@@ -240,0 +25,0 @@ shellyHelper.addInputToGen2Device(shellypro4pm, 0); |
@@ -46,3 +46,2 @@ /* jshint -W097 */ | ||
this.httpIoBrokerStateTimeout = null; | ||
this.firmwareUpdatePollingTimeout = null; | ||
@@ -68,4 +67,3 @@ this.states = {}; | ||
// Handle firmware updates | ||
this.firmwareUpdatePolling(); | ||
this.eventEmitter.on('onFirmwareUpdate', async () => await this.firmwareUpdate(true)); | ||
this.eventEmitter.on('onFirmwareUpdate', async () => await this.firmwareUpdate()); | ||
} | ||
@@ -553,11 +551,3 @@ | ||
async firmwareUpdatePolling() { | ||
if (this.adapter.config.autoupdate) { | ||
await this.firmwareUpdate(true); | ||
this.firmwareUpdatePollingTimeout = setTimeout(async () => await this.firmwareUpdatePolling(), 15 * 60 * 1000); // Every 15 Minutes | ||
} | ||
} | ||
async firmwareUpdate(update) { | ||
if (!update) return; | ||
async firmwareUpdate() { | ||
if (this.getDeviceName() === undefined) return; | ||
@@ -572,6 +562,8 @@ | ||
const firmwareUpdateState = await this.adapter.getStateAsync(this.getDeviceName() + '.firmware'); | ||
this.adapter.log.debug(`[firmwareUpdate] received state ${JSON.stringify(firmwareUpdateState)} for ${this.getName()}`); | ||
this.adapter.log.silly(`[firmwareUpdate] received state ${JSON.stringify(firmwareUpdateState)} for ${this.getName()}`); | ||
// Check if device has firmware update | ||
if (firmwareUpdateState && firmwareUpdateState.val) { | ||
this.adapter.log.debug(`[firmwareUpdate] Update available for ${this.getName()} - performing update process`); | ||
if (this.getDeviceGen() === 1) { | ||
@@ -594,3 +586,2 @@ const body = await this.requestAsync('/ota?update=true'); | ||
clearTimeout(this.httpIoBrokerStateTimeout); | ||
clearTimeout(this.firmwareUpdatePollingTimeout); | ||
@@ -597,0 +588,0 @@ this.states = {}; |
@@ -402,20 +402,8 @@ /* jshint -W097 */ | ||
*/ | ||
function addSwitchToGen2Device(deviceObj, switchId) { | ||
function addSwitchToGen2Device(deviceObj, switchId, hasPowerMetering) { | ||
deviceObj[`Relay${switchId}.Switch`] = { | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, `switch:${switchId}`) && | ||
Object.prototype.hasOwnProperty.call(valueObj.params[`switch:${switchId}`], 'output') | ||
) { | ||
return valueObj.params[`switch:${switchId}`].output; | ||
} | ||
return undefined; | ||
}, | ||
mqtt_publish: `<mqttprefix>/status/switch:${switchId}`, | ||
mqtt_publish_funct: (value) => { return JSON.parse(value).output; }, | ||
mqtt_cmd: '<mqttprefix>/rpc', | ||
@@ -567,16 +555,4 @@ mqtt_cmd_funct: (value) => { return JSON.stringify({id: 1, src: 'iobroker', method: 'Switch.Set', params: {id: switchId, on: value}}); } | ||
mqtt: { | ||
mqtt_publish: '<mqttprefix>/events/rpc', | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(valueObj, 'method') && | ||
valueObj.method === 'NotifyStatus' && | ||
Object.prototype.hasOwnProperty.call(valueObj, 'params') && | ||
Object.prototype.hasOwnProperty.call(valueObj.params, `switch:${switchId}`) && | ||
Object.prototype.hasOwnProperty.call(valueObj.params[`switch:${switchId}`], 'source') | ||
) { | ||
return valueObj.params[`switch:${switchId}`].source; | ||
} | ||
return undefined; | ||
} | ||
mqtt_publish: `<mqttprefix>/status/switch:${switchId}`, | ||
mqtt_publish_funct: (value) => { return JSON.parse(value).source; } | ||
}, | ||
@@ -592,2 +568,170 @@ common: { | ||
deviceObj[`Relay${switchId}.temperatureC`] = { | ||
mqtt: { | ||
mqtt_publish: `<mqttprefix>/status/switch:${switchId}`, | ||
mqtt_publish_funct: (value) => { return JSON.parse(value).temperature.tC; } | ||
}, | ||
common: { | ||
'name': 'Temperature °C', | ||
'type': 'number', | ||
'role': 'value.temperature', | ||
'read': true, | ||
'write': false, | ||
'unit': '°C' | ||
} | ||
}; | ||
deviceObj[`Relay${switchId}.temperatureF`] = { | ||
mqtt: { | ||
mqtt_publish: `<mqttprefix>/status/switch:${switchId}`, | ||
mqtt_publish_funct: (value) => { return JSON.parse(value).temperature.tF; } | ||
}, | ||
common: { | ||
'name': 'Temperature °F', | ||
'type': 'number', | ||
'role': 'value.temperature', | ||
'read': true, | ||
'write': false, | ||
'unit': '°F' | ||
} | ||
}; | ||
if (hasPowerMetering) { | ||
deviceObj[`Relay${switchId}.Power`] = { | ||
mqtt: { | ||
mqtt_publish: `<mqttprefix>/status/switch:${switchId}`, | ||
mqtt_publish_funct: (value) => { return JSON.parse(value).apower; } | ||
}, | ||
common: { | ||
'name': 'Power', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'W' | ||
} | ||
}; | ||
deviceObj[`Relay${switchId}.Voltage`] = { | ||
mqtt: { | ||
mqtt_publish: `<mqttprefix>/status/switch:${switchId}`, | ||
mqtt_publish_funct: (value) => { return JSON.parse(value).voltage; } | ||
}, | ||
common: { | ||
'name': 'Voltage', | ||
'type': 'number', | ||
'role': 'value.voltage', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'V' | ||
} | ||
}; | ||
deviceObj[`Relay${switchId}.Current`] = { | ||
mqtt: { | ||
mqtt_publish: `<mqttprefix>/status/switch:${switchId}`, | ||
mqtt_publish_funct: (value) => { return JSON.parse(value).current; } | ||
}, | ||
common: { | ||
'name': 'Current', | ||
'type': 'number', | ||
'role': 'value.current', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'A' | ||
} | ||
}; | ||
deviceObj[`Relay${switchId}.Energy`] = { | ||
mqtt: { | ||
mqtt_publish: `<mqttprefix>/status/switch:${switchId}`, | ||
mqtt_publish_funct: (value) => { return JSON.parse(value).aenergy.total; } | ||
}, | ||
common: { | ||
'name': 'Energy', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'read': true, | ||
'write': false, | ||
'def': 0, | ||
'unit': 'Wh' | ||
} | ||
}; | ||
/* | ||
deviceObj[`Relay${switchId}.Overvoltage`] = { | ||
mqtt: { | ||
mqtt_publish: `<mqttprefix>/status/switch:${switchId}`, | ||
mqtt_publish_funct: (value) => { | ||
const valueObj = JSON.parse(value); | ||
return valueObj.errors && Array.prototype.includes.call(valueObj.errors, 'overvoltage'); | ||
} | ||
}, | ||
common: { | ||
'name': 'Overvoltage', | ||
'type': 'boolean', | ||
'role': 'indicator.alarm', | ||
'read': true, | ||
'write': false, | ||
'def': false | ||
} | ||
}; | ||
*/ | ||
deviceObj[`Relay${switchId}.LimitPower`] = { | ||
mqtt: { | ||
http_publish: `/rpc/Switch.GetConfig?id=${switchId}`, | ||
http_publish_funct: async (value, self) => { return value ? JSON.parse(value).power_limit : undefined; }, | ||
mqtt_cmd: '<mqttprefix>/rpc', | ||
mqtt_cmd_funct: (value) => { return JSON.stringify({id: 0, src: 'iobroker', method: 'Switch.SetConfig', params: {id: switchId, config: {power_limit: value}}}); } | ||
}, | ||
common: { | ||
'name': 'Power Limit', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'unit': 'W', | ||
'read': true, | ||
'write': true | ||
} | ||
}; | ||
deviceObj[`Relay${switchId}.LimitCurrent`] = { | ||
mqtt: { | ||
http_publish: `/rpc/Switch.GetConfig?id=${switchId}`, | ||
http_publish_funct: async (value, self) => { return value ? JSON.parse(value).current_limit : undefined; }, | ||
mqtt_cmd: '<mqttprefix>/rpc', | ||
mqtt_cmd_funct: (value) => { return JSON.stringify({id: 0, src: 'iobroker', method: 'Switch.SetConfig', params: {id: switchId, config: {current_limit: value}}}); } | ||
}, | ||
common: { | ||
'name': 'Current Limit', | ||
'type': 'number', | ||
'role': 'value.current', | ||
'unit': 'A', | ||
'read': true, | ||
'write': true | ||
} | ||
}; | ||
deviceObj[`Relay${switchId}.LimitVoltage`] = { | ||
mqtt: { | ||
http_publish: `/rpc/Switch.GetConfig?id=${switchId}`, | ||
http_publish_funct: async (value, self) => { return value ? JSON.parse(value).voltage_limit : undefined; }, | ||
mqtt_cmd: '<mqttprefix>/rpc', | ||
mqtt_cmd_funct: (value) => { return JSON.stringify({id: 0, src: 'iobroker', method: 'Switch.SetConfig', params: {id: switchId, config: {voltage_limit: value}}}); } | ||
}, | ||
common: { | ||
'name': 'Current Limit', | ||
'type': 'number', | ||
'role': 'value.voltage', | ||
'unit': 'V', | ||
'read': true, | ||
'write': true | ||
} | ||
}; | ||
} | ||
} | ||
@@ -840,2 +984,71 @@ | ||
deviceObj[`Cover${coverId}.LimitPower`] = { | ||
mqtt: { | ||
http_publish: `/rpc/Cover.GetConfig?id=${coverId}`, | ||
http_publish_funct: async (value, self) => { return value ? JSON.parse(value).power_limit : undefined; }, | ||
mqtt_cmd: '<mqttprefix>/rpc', | ||
mqtt_cmd_funct: (value) => { return JSON.stringify({id: 0, src: 'iobroker', method: 'Cover.SetConfig', params: {id: coverId, config: {power_limit: value}}}); } | ||
}, | ||
common: { | ||
'name': 'Power Limit', | ||
'type': 'number', | ||
'role': 'value.power', | ||
'unit': 'W', | ||
'read': true, | ||
'write': true | ||
} | ||
}; | ||
deviceObj[`Cover${coverId}.LimitCurrent`] = { | ||
mqtt: { | ||
http_publish: `/rpc/Cover.GetConfig?id=${coverId}`, | ||
http_publish_funct: async (value, self) => { return value ? JSON.parse(value).current_limit : undefined; }, | ||
mqtt_cmd: '<mqttprefix>/rpc', | ||
mqtt_cmd_funct: (value) => { return JSON.stringify({id: 0, src: 'iobroker', method: 'Cover.SetConfig', params: {id: coverId, config: {current_limit: value}}}); } | ||
}, | ||
common: { | ||
'name': 'Current Limit', | ||
'type': 'number', | ||
'role': 'value.current', | ||
'unit': 'A', | ||
'read': true, | ||
'write': true | ||
} | ||
}; | ||
deviceObj[`Cover${coverId}.LimitVoltage`] = { | ||
mqtt: { | ||
http_publish: `/rpc/Cover.GetConfig?id=${coverId}`, | ||
http_publish_funct: async (value, self) => { return value ? JSON.parse(value).voltage_limit : undefined; }, | ||
mqtt_cmd: '<mqttprefix>/rpc', | ||
mqtt_cmd_funct: (value) => { return JSON.stringify({id: 0, src: 'iobroker', method: 'Cover.SetConfig', params: {id: coverId, config: {voltage_limit: value}}}); } | ||
}, | ||
common: { | ||
'name': 'Current Limit', | ||
'type': 'number', | ||
'role': 'value.voltage', | ||
'unit': 'V', | ||
'read': true, | ||
'write': true | ||
} | ||
}; | ||
deviceObj[`Cover${coverId}.Position`] = { | ||
mqtt: { | ||
mqtt_cmd: '<mqttprefix>/rpc', | ||
mqtt_cmd_funct: (value) => { return JSON.stringify({id: 0, src: 'iobroker', method: 'Cover.GoToPosition', params: {id: coverId, pos: value}}); } | ||
}, | ||
common: { | ||
'name': 'Position', | ||
'type': 'number', | ||
'role': 'level.blind', | ||
'read': true, | ||
'write': true, | ||
'unit': '%', | ||
'def': 0, | ||
'min': 0, | ||
'max': 100 | ||
} | ||
}; | ||
deviceObj[`Cover${coverId}.Status`] = { | ||
@@ -842,0 +1055,0 @@ mqtt: { |
30
main.js
@@ -24,2 +24,3 @@ /* jshint -W097 */ | ||
this.serverCoap = null; | ||
this.firmwareUpdateTimeout = null; | ||
this.onlineCheckTimeout = null; | ||
@@ -55,2 +56,4 @@ | ||
this.autoFirmwareUpdate(); | ||
// Start MQTT server | ||
@@ -99,2 +102,4 @@ setImmediate(() => { | ||
if (stateId === 'info.update') { | ||
this.log.debug(`[firmwareUpdate] info.update state changed - starting update on every device`); | ||
this.eventEmitter.emit('onFirmwareUpdate'); | ||
@@ -117,2 +122,7 @@ } | ||
if (this.firmwareUpdateTimeout) { | ||
this.clearTimeout(this.firmwareUpdateTimeout); | ||
this.firmwareUpdateTimeout = null; | ||
} | ||
try { | ||
@@ -199,7 +209,2 @@ this.log.info('Closing Adapter'); | ||
await this.setStateAsync(idOnline, { val: status, ack: true }); | ||
await this.extendObjectAsync(deviceId, { | ||
common: { | ||
color: status ? '#46a100' : '#ff0400' | ||
} | ||
}); | ||
} | ||
@@ -247,3 +252,3 @@ | ||
common: { | ||
color: '#ff0400' | ||
color: null // Remove color from previous versions | ||
} | ||
@@ -256,2 +261,15 @@ }); | ||
autoFirmwareUpdate() { | ||
if (this.config.autoupdate) { | ||
this.log.debug(`[firmwareUpdate] Auto-Update enabled - starting update on every device`); | ||
this.eventEmitter.emit('onFirmwareUpdate'); | ||
this.firmwareUpdateTimeout = this.setTimeout(() => { | ||
this.firmwareUpdateTimeout = null; | ||
this.autoFirmwareUpdate(); | ||
}, 15 * 60 * 1000); // Restart firmware update in 60 Seconds | ||
} | ||
} | ||
removeNamespace(id) { | ||
@@ -258,0 +276,0 @@ const re = new RegExp(this.namespace + '*\\.', 'g'); |
{ | ||
"name": "iobroker.shelly", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"description": "Shelly", | ||
@@ -40,7 +40,7 @@ "author": { | ||
"@apollon/iobroker-tools": "^0.2.0", | ||
"@iobroker/adapter-core": "^2.5.1", | ||
"@iobroker/adapter-core": "^2.6.0", | ||
"axios": "^0.26.0", | ||
"coiot-coap": "^1.0.0", | ||
"crypto": "^1.0.1", | ||
"mqtt": "^4.3.5", | ||
"mqtt": "^4.3.6", | ||
"mqtt-connection": "^4.1.0", | ||
@@ -61,3 +61,3 @@ "shelly-iot": "^1.1.2", | ||
"@types/mocha": "^9.1.0", | ||
"@types/node": "^17.0.18", | ||
"@types/node": "^17.0.19", | ||
"@types/proxyquire": "^1.3.28", | ||
@@ -70,3 +70,3 @@ "@types/sinon": "^10.0.11", | ||
"gulp": "^4.0.2", | ||
"mocha": "^9.2.0", | ||
"mocha": "^9.2.1", | ||
"proxyquire": "^2.1.3", | ||
@@ -73,0 +73,0 @@ "sinon": "^13.0.1", |
@@ -66,2 +66,3 @@ ![Logo](admin/shelly.png) | ||
|Shelly Plus 2 PM (shellyplus2pm)|---|supported since v5.2.0| | ||
|Shelly Plus I4 (shellyplusi4)|---|supported since v5.3.0| | ||
|Shelly Pro 1 (shellypro1)|---|supported since v5.2.0| | ||
@@ -91,4 +92,13 @@ |Shelly Pro 1 PM (shellypro1pm)|---|supported since v5.2.0| | ||
--> | ||
### 5.3.0 (2022-02-27) | ||
* (klein0r) Added Shelly Plus I4 | ||
* (klein0r) Added more objects for power metering channels (current, voltage, limits, ...) | ||
* (klein0r) Moved device temperature of generation 2 devices to relays (this is the official way) | ||
* (klein0r) Added Sys channel (eco mode, timezone, ...) for generation 1 devices | ||
* (klein0r) Fixed datatype error of Shelly 1/PM ext switch | ||
* (klein0r) Added option to enable/disable WiFi access point (generation 2 devices) | ||
* (klein0r) Added power limits and position control for covers (generation 2 devices) | ||
* (klein0r) Removed colors for online state indication on device objects | ||
### 5.2.0 (2022-02-16) | ||
* (klein0r) Added Shelly Pro 1 | ||
@@ -106,3 +116,2 @@ * (klein0r) Added Shelly Pro 1 PM | ||
### 5.1.3 (2022-02-13) | ||
* (klein0r) Changed common.states strings to objects | ||
@@ -109,0 +118,0 @@ * (klein0r) Just perform firmware update if an available update was detected |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
66
452
808069
16727
50
Updatedmqtt@^4.3.6