From cc21d555c543553106a0f0cb75aca1fafb6095a3 Mon Sep 17 00:00:00 2001 From: Thomas <101348966+tt-tom17@users.noreply.github.com> Date: Sat, 18 Nov 2023 21:20:27 +0100 Subject: [PATCH 1/8] v4.3.3.x Create Alias for PageAlarm --- ioBroker/NsPanelTs.ts | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index bcf3e554..bde8d9a1 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -4699,14 +4699,25 @@ function GenerateAlarmPage(page: PageAlarm): Payload[] { out_msgs.push({ payload: 'pageType~cardAlarm' }); let nsPath = NSPanel_Alarm_Path + 'Alarm.'; - if (existsState(nsPath + 'AlarmPin') == false || existsState(nsPath + 'AlarmState') == false || existsState(nsPath + 'AlarmType') == false || existsState(nsPath + 'PIN_Failed') == false || existsState(nsPath + 'PANEL') == false) { - createState(nsPath + 'AlarmPin', '0000', { type: 'string' }, function () { setState(nsPath + 'AlarmPin', '0000') }); - createState(nsPath + 'AlarmState', 'disarmed', { type: 'string' }, function () { setState(nsPath + 'AlarmState', 'disarmed') }); - createState(nsPath + 'AlarmType', 'D1', { type: 'string' }, function () { setState(nsPath + 'AlarmType', 'D1') }); - createState(nsPath + 'PIN_Failed', 0, { type: 'number' }, function () { setState(nsPath + 'PIN_Failed', 0) }); - createState(nsPath + 'PANEL', NSPanel_Path, { type: 'string' }, function () { setState(nsPath + 'PANEL', NSPanel_Path) }); + if (isSetOptionActive) { + if (existsState(nsPath + 'AlarmPin') == false || existsState(nsPath + 'AlarmState') == false || existsState(nsPath + 'AlarmType') == false || existsState(nsPath + 'PIN_Failed') == false || existsState(nsPath + 'PANEL') == false) { + createState(nsPath + 'AlarmPin', '0000', { type: 'string' }, function () { setState(nsPath + 'AlarmPin', '0000') }); + createState(nsPath + 'AlarmState', 'disarmed', { type: 'string' }, function () { setState(nsPath + 'AlarmState', 'disarmed') }); + createState(nsPath + 'AlarmType', 'D1', { type: 'string' }, function () { setState(nsPath + 'AlarmType', 'D1') }); + createState(nsPath + 'PIN_Failed', 0, { type: 'number' }, function () { setState(nsPath + 'PIN_Failed', 0) }); + createState(nsPath + 'PANEL', NSPanel_Path, { type: 'string' }, function () { setState(nsPath + 'PANEL', NSPanel_Path) }); + if (autoCreateAlias) { + setObject(AliasPath + 'Alarm', {type: 'channel', common: {role: 'sensor.alarm.fire', name:'Alarm'}, native: {}}); + await createAliasAsync(AliasPath + 'Alarm.ACTUAL', nsPath + 'AlarmState', true, { type: 'string', role: 'state', name: 'ACTUAL' }); + await createAliasAsync(AliasPath + 'Alarm.PIN', nsPath + 'AlarmPin', true, { type: 'string', role: 'state', name: 'PIN' }); + await createAliasAsync(AliasPath + 'Alarm.TYPE', nsPath + 'AlarmType', true, { type: 'string', role: 'state', name: 'TYPE' }); + await createAliasAsync(AliasPath + 'Alarm.PIN_Failed', nsPath + 'PIN_Failed', true, { type: 'string', role: 'state', name: 'PIN_Failed' }); + await createAliasAsync(AliasPath + 'Alarm.PANEL', nsPath + 'PANEL', true, { type: 'string', role: 'state', name: 'PANEL' }); + } + } } + if (existsState(nsPath + 'AlarmPin') && existsState(nsPath + 'AlarmState') && existsState(nsPath + 'AlarmType')) { //let entityPin = getState(nsPath + 'AlarmPin').val; let entityState = getState(nsPath + 'AlarmState').val; From 8dc2e6cbe11bc66194f3fef045f802b0b97d2308 Mon Sep 17 00:00:00 2001 From: Thomas <101348966+tt-tom17@users.noreply.github.com> Date: Sat, 18 Nov 2023 22:18:10 +0100 Subject: [PATCH 2/8] v4.3.3.x Create Alias for PageAlarm --- ioBroker/NsPanelTs.ts | 48 +++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index bde8d9a1..76573f90 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -4689,6 +4689,35 @@ function GenerateMediaPage(page: PageMedia): Payload[] { } } +async function createAutoAlarmAlias (nsPath: string){ + try { + let Alias_Alarm_Path = 'alias.0.' + nsPath.substring(13, nsPath.length) + if (Debug){ + console.log('Alarm Alias Path: ' + Alias_Alarm_Path); + console.log('Alarm 0_userdata Path: ' + nsPath); + } + if (autoCreateAlias) { + if (isSetOptionActive) { + if (existsState(nsPath + 'AlarmPin') == false || existsState(nsPath + 'AlarmState') == false || existsState(nsPath + 'AlarmType') == false || existsState(nsPath + 'PIN_Failed') == false || existsState(nsPath + 'PANEL') == false) { + await createStateAsync(nsPath + 'AlarmPin', '0000', { type: 'string' }); + await createStateAsync(nsPath + 'AlarmState', 'disarmed', { type: 'string' }); + await createStateAsync(nsPath + 'AlarmType', 'D1', { type: 'string' }); + await createStateAsync(nsPath + 'PIN_Failed', 0, { type: 'number' }); + await createStateAsync(nsPath + 'PANEL', NSPanel_Path, { type: 'string' }); + setObject(Alias_Alarm_Path + 'Alarm', {type: 'channel', common: {role: 'sensor.alarm.fire', name:'Alarm'}, native: {}}); + await createAliasAsync(Alias_Alarm_Path + 'Alarm.ACTUAL', nsPath + 'AlarmState', true, { type: 'string', role: 'state', name: 'ACTUAL' }); + await createAliasAsync(Alias_Alarm_Path + 'Alarm.PIN', nsPath + 'AlarmPin', true, { type: 'string', role: 'state', name: 'PIN' }); + await createAliasAsync(Alias_Alarm_Path + 'Alarm.TYPE', nsPath + 'AlarmType', true, { type: 'string', role: 'state', name: 'TYPE' }); + await createAliasAsync(Alias_Alarm_Path + 'Alarm.PIN_Failed', nsPath + 'PIN_Failed', true, { type: 'string', role: 'state', name: 'PIN_Failed' }); + await createAliasAsync(Alias_Alarm_Path + 'Alarm.PANEL', nsPath + 'PANEL', true, { type: 'string', role: 'state', name: 'PANEL' }); + } + } + } + } catch (err) { + console.warn('error at function createAutoAlarmAlias: ' + err.message); + } +} + function GenerateAlarmPage(page: PageAlarm): Payload[] { try { activePage = page; @@ -4699,24 +4728,7 @@ function GenerateAlarmPage(page: PageAlarm): Payload[] { out_msgs.push({ payload: 'pageType~cardAlarm' }); let nsPath = NSPanel_Alarm_Path + 'Alarm.'; - if (isSetOptionActive) { - if (existsState(nsPath + 'AlarmPin') == false || existsState(nsPath + 'AlarmState') == false || existsState(nsPath + 'AlarmType') == false || existsState(nsPath + 'PIN_Failed') == false || existsState(nsPath + 'PANEL') == false) { - createState(nsPath + 'AlarmPin', '0000', { type: 'string' }, function () { setState(nsPath + 'AlarmPin', '0000') }); - createState(nsPath + 'AlarmState', 'disarmed', { type: 'string' }, function () { setState(nsPath + 'AlarmState', 'disarmed') }); - createState(nsPath + 'AlarmType', 'D1', { type: 'string' }, function () { setState(nsPath + 'AlarmType', 'D1') }); - createState(nsPath + 'PIN_Failed', 0, { type: 'number' }, function () { setState(nsPath + 'PIN_Failed', 0) }); - createState(nsPath + 'PANEL', NSPanel_Path, { type: 'string' }, function () { setState(nsPath + 'PANEL', NSPanel_Path) }); - if (autoCreateAlias) { - setObject(AliasPath + 'Alarm', {type: 'channel', common: {role: 'sensor.alarm.fire', name:'Alarm'}, native: {}}); - await createAliasAsync(AliasPath + 'Alarm.ACTUAL', nsPath + 'AlarmState', true, { type: 'string', role: 'state', name: 'ACTUAL' }); - await createAliasAsync(AliasPath + 'Alarm.PIN', nsPath + 'AlarmPin', true, { type: 'string', role: 'state', name: 'PIN' }); - await createAliasAsync(AliasPath + 'Alarm.TYPE', nsPath + 'AlarmType', true, { type: 'string', role: 'state', name: 'TYPE' }); - await createAliasAsync(AliasPath + 'Alarm.PIN_Failed', nsPath + 'PIN_Failed', true, { type: 'string', role: 'state', name: 'PIN_Failed' }); - await createAliasAsync(AliasPath + 'Alarm.PANEL', nsPath + 'PANEL', true, { type: 'string', role: 'state', name: 'PANEL' }); - } - } - } - + createAutoAlarmAlias(nsPath); if (existsState(nsPath + 'AlarmPin') && existsState(nsPath + 'AlarmState') && existsState(nsPath + 'AlarmType')) { //let entityPin = getState(nsPath + 'AlarmPin').val; From ed655d6596841ea3c10b9599e09fede4691cf781 Mon Sep 17 00:00:00 2001 From: Thomas <101348966+tt-tom17@users.noreply.github.com> Date: Sat, 18 Nov 2023 22:36:43 +0100 Subject: [PATCH 3/8] v4.3.3.x Create alias for Alarm Page --- ioBroker/NsPanelTs.ts | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index 76573f90..9c6808c4 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -4689,27 +4689,26 @@ function GenerateMediaPage(page: PageMedia): Payload[] { } } -async function createAutoAlarmAlias (nsPath: string){ +async function createAutoAlarmAlias (id: string, nsPath: string){ try { - let Alias_Alarm_Path = 'alias.0.' + nsPath.substring(13, nsPath.length) if (Debug){ - console.log('Alarm Alias Path: ' + Alias_Alarm_Path); + console.log('Alarm Alias Path: ' + id); console.log('Alarm 0_userdata Path: ' + nsPath); } if (autoCreateAlias) { if (isSetOptionActive) { - if (existsState(nsPath + 'AlarmPin') == false || existsState(nsPath + 'AlarmState') == false || existsState(nsPath + 'AlarmType') == false || existsState(nsPath + 'PIN_Failed') == false || existsState(nsPath + 'PANEL') == false) { - await createStateAsync(nsPath + 'AlarmPin', '0000', { type: 'string' }); - await createStateAsync(nsPath + 'AlarmState', 'disarmed', { type: 'string' }); - await createStateAsync(nsPath + 'AlarmType', 'D1', { type: 'string' }); - await createStateAsync(nsPath + 'PIN_Failed', 0, { type: 'number' }); - await createStateAsync(nsPath + 'PANEL', NSPanel_Path, { type: 'string' }); - setObject(Alias_Alarm_Path + 'Alarm', {type: 'channel', common: {role: 'sensor.alarm.fire', name:'Alarm'}, native: {}}); - await createAliasAsync(Alias_Alarm_Path + 'Alarm.ACTUAL', nsPath + 'AlarmState', true, { type: 'string', role: 'state', name: 'ACTUAL' }); - await createAliasAsync(Alias_Alarm_Path + 'Alarm.PIN', nsPath + 'AlarmPin', true, { type: 'string', role: 'state', name: 'PIN' }); - await createAliasAsync(Alias_Alarm_Path + 'Alarm.TYPE', nsPath + 'AlarmType', true, { type: 'string', role: 'state', name: 'TYPE' }); - await createAliasAsync(Alias_Alarm_Path + 'Alarm.PIN_Failed', nsPath + 'PIN_Failed', true, { type: 'string', role: 'state', name: 'PIN_Failed' }); - await createAliasAsync(Alias_Alarm_Path + 'Alarm.PANEL', nsPath + 'PANEL', true, { type: 'string', role: 'state', name: 'PANEL' }); + if (existsState(nsPath + '.AlarmPin') == false || existsState(nsPath + '.AlarmState') == false || existsState(nsPath + '.AlarmType') == false || existsState(nsPath + '.PIN_Failed') == false || existsState(nsPath + '.PANEL') == false) { + await createStateAsync(nsPath + '.AlarmPin', '0000', { type: 'string' }); + await createStateAsync(nsPath + '.AlarmState', 'disarmed', { type: 'string' }); + await createStateAsync(nsPath + '.AlarmType', 'D1', { type: 'string' }); + await createStateAsync(nsPath + '.PIN_Failed', 0, { type: 'number' }); + await createStateAsync(nsPath + '.PANEL', NSPanel_Path, { type: 'string' }); + setObject(id, {_id: id, type: 'channel', common: {role: 'sensor.fire.alarm', name:'alarm'}, native: {}}); + await createAliasAsync(id + '.ACTUAL', nsPath + '.AlarmState', true, { type: 'string', role: 'state', name: 'ACTUAL' }); + await createAliasAsync(id + '.PIN', nsPath + '.AlarmPin', true, { type: 'string', role: 'state', name: 'PIN' }); + await createAliasAsync(id + '.TYPE', nsPath + '.AlarmType', true, { type: 'string', role: 'state', name: 'TYPE' }); + await createAliasAsync(id + '.PIN_Failed', nsPath + '.PIN_Failed', true, { type: 'string', role: 'state', name: 'PIN_Failed' }); + await createAliasAsync(id + '.PANEL', nsPath + '.PANEL', true, { type: 'string', role: 'state', name: 'PANEL' }); } } } @@ -4726,13 +4725,15 @@ function GenerateAlarmPage(page: PageAlarm): Payload[] { let out_msgs: Array = []; out_msgs.push({ payload: 'pageType~cardAlarm' }); - let nsPath = NSPanel_Alarm_Path + 'Alarm.'; + let nsPath = NSPanel_Alarm_Path + 'Alarm'; - createAutoAlarmAlias(nsPath); + if (page.items[0].autoCreateALias) { + createAutoAlarmAlias(id, nsPath); + } - if (existsState(nsPath + 'AlarmPin') && existsState(nsPath + 'AlarmState') && existsState(nsPath + 'AlarmType')) { + if (existsState(nsPath + '.AlarmPin') && existsState(nsPath + '.AlarmState') && existsState(nsPath + '.AlarmType')) { //let entityPin = getState(nsPath + 'AlarmPin').val; - let entityState = getState(nsPath + 'AlarmState').val; + let entityState = getState(nsPath + '.AlarmState').val; //let entityType = getState(nsPath + 'AlarmType').val; let arm1: string, arm2: string, arm3: string, arm4: string; let arm1ActionName: string, arm2ActionName: string, arm3ActionName: string, arm4ActionName: string; From 3a1b9071f8437c700760fb094f7f162812b3bf20 Mon Sep 17 00:00:00 2001 From: Thomas <101348966+tt-tom17@users.noreply.github.com> Date: Sat, 18 Nov 2023 22:42:38 +0100 Subject: [PATCH 4/8] Update NsPanelTs.ts --- ioBroker/NsPanelTs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index 9c6808c4..6a6c9214 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -4707,7 +4707,7 @@ async function createAutoAlarmAlias (id: string, nsPath: string){ await createAliasAsync(id + '.ACTUAL', nsPath + '.AlarmState', true, { type: 'string', role: 'state', name: 'ACTUAL' }); await createAliasAsync(id + '.PIN', nsPath + '.AlarmPin', true, { type: 'string', role: 'state', name: 'PIN' }); await createAliasAsync(id + '.TYPE', nsPath + '.AlarmType', true, { type: 'string', role: 'state', name: 'TYPE' }); - await createAliasAsync(id + '.PIN_Failed', nsPath + '.PIN_Failed', true, { type: 'string', role: 'state', name: 'PIN_Failed' }); + await createAliasAsync(id + '.PIN_Failed', nsPath + '.PIN_Failed', true, { type: 'number', role: 'state', name: 'PIN_Failed' }); await createAliasAsync(id + '.PANEL', nsPath + '.PANEL', true, { type: 'string', role: 'state', name: 'PANEL' }); } } From b1d0ad8e1600b0dc5f912b1eae1f58c488f4cfb3 Mon Sep 17 00:00:00 2001 From: Thomas <101348966+tt-tom17@users.noreply.github.com> Date: Mon, 20 Nov 2023 10:43:08 +0100 Subject: [PATCH 5/8] v4.3.3.x create Alias for PageAlarm --- ioBroker/NsPanelTs.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index 6a6c9214..a9907e28 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -4747,7 +4747,7 @@ function GenerateAlarmPage(page: PageAlarm): Payload[] { } if (entityState == 'armed' || entityState == 'triggered') { - arm1 = 'Deaktivieren'; //arm1*~* + arm1 = findLocale('alarm_control_panel', 'disarm') //'Deaktivieren'; //arm1*~* arm1ActionName = 'D1'; //arm1ActionName*~* arm2 = ''; //arm2*~* arm2ActionName = ''; //arm2ActionName*~* @@ -4758,13 +4758,13 @@ function GenerateAlarmPage(page: PageAlarm): Payload[] { } if (entityState == 'disarmed' || entityState == 'arming' || entityState == 'pending') { - arm1 = 'Vollschutz'; //arm1*~* + arm1 = findLocale('alarm_control_panel','arm_away'); //'Vollschutz' //arm1*~* arm1ActionName = 'A1'; //arm1ActionName*~* - arm2 = 'Zuhause'; //arm2*~* + arm2 = findLocale('alarm_control_panel', 'arm_home'); //'Zuhause'; //arm2*~* arm2ActionName = 'A2'; //arm2ActionName*~* - arm3 = 'Nacht'; //arm3*~* + arm3 = findLocale('alarm_control_panel', 'arm_night'); //'Nacht'; //arm3*~* arm3ActionName = 'A3'; //arm3ActionName*~* - arm4 = 'Besuch'; //arm4*~* + arm4 = findLocale('alarm_control_panel', 'arm_vacation') //'Besuch'; //arm4*~* arm4ActionName = 'A4'; //arm4ActionName*~* } From 0fa7e8f562c53a9de198f3f562a333ebdb91d18d Mon Sep 17 00:00:00 2001 From: Thomas <101348966+tt-tom17@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:51:00 +0100 Subject: [PATCH 6/8] v4.3.3.x -auto create Alais for PageAlarm -variable String for Button on PageAlarm --- ioBroker/NsPanelTs.ts | 58 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index a9907e28..32831045 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -261,7 +261,18 @@ const swWindy: RGB = { red: 150, green: 150, blue: 150}; //-- Anfang der Beispiele für Seitengestaltung -- Selbstdefinierte Aliase erforderlich ----------------------- //-- siehe https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Page-%E2%80%90-Typen_How-2_Beispiele - + let Alarmseite = + { + "type": "cardAlarm", + "heading": "Alarm", + "useColor": true, + "subPage": false, + "items": [ + { id: 'alias.0.NSPanel.Alarm', + actionArray: ['Vollschhutz','Zuhause','Nacht','Besuch','Ausschalten'], + autoCreateALias: true } + ] + } //-- ENDE der Beispiele für Seitengestaltung -- Selbstdefinierte Aliase erforderlich ------------------------- @@ -757,7 +768,7 @@ export const config = { defaultColor: Off, defaultBackgroundColor: HMIDark, // Default-Hintergrundfarbe HMIDark oder Black pages: [ - + Alarmseite, NSPanel_Service //Auto-Alias Service Page //Unlock_Service //Auto-Alias Service Page (Service Pages used with cardUnlock) ], @@ -4747,7 +4758,11 @@ function GenerateAlarmPage(page: PageAlarm): Payload[] { } if (entityState == 'armed' || entityState == 'triggered') { - arm1 = findLocale('alarm_control_panel', 'disarm') //'Deaktivieren'; //arm1*~* + if (page.items[0].actionArray !== undefined && page.items[0].actionArray[4] !== '') { + arm1 = page.items[0].actionArray[4]; + } else { + arm1 = findLocale('alarm_control_panel', 'disarm'); //'Deaktivieren'; //arm1*~* + } arm1ActionName = 'D1'; //arm1ActionName*~* arm2 = ''; //arm2*~* arm2ActionName = ''; //arm2ActionName*~* @@ -4758,14 +4773,34 @@ function GenerateAlarmPage(page: PageAlarm): Payload[] { } if (entityState == 'disarmed' || entityState == 'arming' || entityState == 'pending') { - arm1 = findLocale('alarm_control_panel','arm_away'); //'Vollschutz' //arm1*~* - arm1ActionName = 'A1'; //arm1ActionName*~* - arm2 = findLocale('alarm_control_panel', 'arm_home'); //'Zuhause'; //arm2*~* - arm2ActionName = 'A2'; //arm2ActionName*~* - arm3 = findLocale('alarm_control_panel', 'arm_night'); //'Nacht'; //arm3*~* - arm3ActionName = 'A3'; //arm3ActionName*~* - arm4 = findLocale('alarm_control_panel', 'arm_vacation') //'Besuch'; //arm4*~* - arm4ActionName = 'A4'; //arm4ActionName*~* + if (page.items[0].actionArray !== undefined && page.items[0].actionArray[0] !== '') { + arm1 = page.items[0].actionArray[0]; + } else { + arm1 = findLocale('alarm_control_panel', 'arm_away'); //'Vollschutz' //arm1*~* + } + arm1ActionName = 'A1'; //arm1ActionName*~* + if (page.items[0].actionArray !== undefined && page.items[0].actionArray[1] !== '') { + arm2 = page.items[0].actionArray[1]; + } else { + arm2 = findLocale('alarm_control_panel', 'arm_home'); //'Zuhause'; //arm2*~* + } + arm2ActionName = 'A2'; //arm2ActionName*~* + if (page.items[0].actionArray !== undefined && page.items[0].actionArray[2] !== '') { + arm3 = page.items[0].actionArray[2]; + } else { + arm3 = findLocale('alarm_control_panel', 'arm_night'); //'Nacht'; //arm3*~* + } + arm3ActionName = 'A3'; //arm3ActionName*~* + if (page.items[0].actionArray !== undefined && page.items[0].actionArray[3] !== '') { + arm4 = page.items[0].actionArray[3]; + } else { + arm4 = findLocale('alarm_control_panel', 'arm_vacation'); //'Besuch'; //arm4*~* + } + arm4ActionName = 'A4'; //arm4ActionName*~* + } + + if (Debug) { + console.log('GenerateAlarmPage String for arm1: ' + arm1 + ', arm2: ' + arm2 + ', arm3: ' + arm3 + ', arm4: ' + arm4); } if (entityState == 'armed') { @@ -8268,6 +8303,7 @@ type PageItem = { inSel_ChoiceState: (boolean | undefined), iconArray: (string[] | undefined), fontSize: (number | undefined), + actionArray: (string[] | undefined), } type DimMode = { From c2599ed4a3119acec60f6daa42a4bdf4c8031bd3 Mon Sep 17 00:00:00 2001 From: Thomas <101348966+tt-tom17@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:03:27 +0100 Subject: [PATCH 7/8] v4.3.3.6 - Add autoCreateALias to PageAlarm - Add actionStringArray to PageAlarm --- ioBroker/NsPanelTs.ts | 47 +++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index 32831045..79e68f79 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------- -TypeScript v4.3.3.5 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @TT-Tom / @Sternmiere / @Britzelpuf / @ravenS0ne +TypeScript v4.3.3.6 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @TT-Tom / @Sternmiere / @Britzelpuf / @ravenS0ne - abgestimmt auf TFT 53 / v4.3.3 / BerryDriver 9 / Tasmota 13.2.0 @joBr99 Projekt: https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker NsPanelTs.ts (dieses TypeScript in ioBroker) Stable: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/NsPanelTs.ts @@ -53,7 +53,10 @@ ReleaseNotes: - 13.11.2023 - v4.3.3.3 if setOption = false, do not create autoAlias (Functional/Servicemenu) and Datapoints - 15.11.2023 - v4.3.3.4 New Service Page -> ioBroker Info - 16.11.2023 - v4.3.3.5 Add Multilingualism to Service Menu (39 languages) - - 17.11.2023 - v4.3.3.5 Add Multilingualism to cardQR, popupFan, popupTimer (39 languages) + - 17.11.2023 - v4.3.3.5 Add Multilingualism to cardQR, popupFan, popupTimer (39 languages) + - 18.11.2023 - v4.3.3.6 Add autoCreateALias to PageAlarm + - 20.11.2023 - v4.3.3.6 Add actionStringArray to PageAlarm + Todo: - XX.XX.XXXX - v4.4.0 Change the bottomScreensaverEntity (rolling) if more than 6 entries are defined @@ -269,7 +272,7 @@ const swWindy: RGB = { red: 150, green: 150, blue: 150}; "subPage": false, "items": [ { id: 'alias.0.NSPanel.Alarm', - actionArray: ['Vollschhutz','Zuhause','Nacht','Besuch','Ausschalten'], + actionStringArray: ['Vollschhutz','Zuhause','Nacht','Besuch','Ausschalten'], autoCreateALias: true } ] } @@ -4758,8 +4761,8 @@ function GenerateAlarmPage(page: PageAlarm): Payload[] { } if (entityState == 'armed' || entityState == 'triggered') { - if (page.items[0].actionArray !== undefined && page.items[0].actionArray[4] !== '') { - arm1 = page.items[0].actionArray[4]; + if (page.items[0].actionStringArray !== undefined && page.items[0].actionStringArray[4] !== '') { + arm1 = page.items[0].actionStringArray[4]; } else { arm1 = findLocale('alarm_control_panel', 'disarm'); //'Deaktivieren'; //arm1*~* } @@ -4773,30 +4776,30 @@ function GenerateAlarmPage(page: PageAlarm): Payload[] { } if (entityState == 'disarmed' || entityState == 'arming' || entityState == 'pending') { - if (page.items[0].actionArray !== undefined && page.items[0].actionArray[0] !== '') { - arm1 = page.items[0].actionArray[0]; + if (page.items[0].actionStringArray !== undefined && page.items[0].actionStringArray[0] !== '') { + arm1 = page.items[0].actionStringArray[0]; } else { - arm1 = findLocale('alarm_control_panel', 'arm_away'); //'Vollschutz' //arm1*~* + arm1 = findLocale('alarm_control_panel', 'arm_away'); //'Vollschutz' //arm1*~* } - arm1ActionName = 'A1'; //arm1ActionName*~* - if (page.items[0].actionArray !== undefined && page.items[0].actionArray[1] !== '') { - arm2 = page.items[0].actionArray[1]; + arm1ActionName = 'A1'; //arm1ActionName*~* + if (page.items[0].actionStringArray !== undefined && page.items[0].actionStringArray[1] !== '') { + arm2 = page.items[0].actionStringArray[1]; } else { - arm2 = findLocale('alarm_control_panel', 'arm_home'); //'Zuhause'; //arm2*~* + arm2 = findLocale('alarm_control_panel', 'arm_home'); //'Zuhause'; //arm2*~* } - arm2ActionName = 'A2'; //arm2ActionName*~* - if (page.items[0].actionArray !== undefined && page.items[0].actionArray[2] !== '') { - arm3 = page.items[0].actionArray[2]; + arm2ActionName = 'A2'; //arm2ActionName*~* + if (page.items[0].actionStringArray !== undefined && page.items[0].actionStringArray[2] !== '') { + arm3 = page.items[0].actionStringArray[2]; } else { - arm3 = findLocale('alarm_control_panel', 'arm_night'); //'Nacht'; //arm3*~* + arm3 = findLocale('alarm_control_panel', 'arm_night'); //'Nacht'; //arm3*~* } - arm3ActionName = 'A3'; //arm3ActionName*~* - if (page.items[0].actionArray !== undefined && page.items[0].actionArray[3] !== '') { - arm4 = page.items[0].actionArray[3]; + arm3ActionName = 'A3'; //arm3ActionName*~* + if (page.items[0].actionStringArray !== undefined && page.items[0].actionStringArray[3] !== '') { + arm4 = page.items[0].actionStringArray[3]; } else { - arm4 = findLocale('alarm_control_panel', 'arm_vacation'); //'Besuch'; //arm4*~* + arm4 = findLocale('alarm_control_panel', 'arm_vacation'); //'Besuch'; //arm4*~* } - arm4ActionName = 'A4'; //arm4ActionName*~* + arm4ActionName = 'A4'; //arm4ActionName*~* } if (Debug) { @@ -8303,7 +8306,7 @@ type PageItem = { inSel_ChoiceState: (boolean | undefined), iconArray: (string[] | undefined), fontSize: (number | undefined), - actionArray: (string[] | undefined), + actionStringArray: (string[] | undefined), } type DimMode = { From 85e6eb6f73e31952ee47cd16bb6657ddaadbe5e9 Mon Sep 17 00:00:00 2001 From: Armilar <102996011+Armilar@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:49:42 +0100 Subject: [PATCH 8/8] 4.3.3.6 - Update NsPanelTs.ts --- ioBroker/NsPanelTs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index 79e68f79..ae823431 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -272,7 +272,7 @@ const swWindy: RGB = { red: 150, green: 150, blue: 150}; "subPage": false, "items": [ { id: 'alias.0.NSPanel.Alarm', - actionStringArray: ['Vollschhutz','Zuhause','Nacht','Besuch','Ausschalten'], + actionStringArray: ['Vollschutz','Zuhause','Nacht','Besuch','Ausschalten'], autoCreateALias: true } ] } @@ -834,7 +834,7 @@ let globalTracklist: any; let weatherAdapterInstanceNumber: number = 0; let isSetOptionActive: boolean = false; -const scriptVersion: string = 'v4.3.3.5'; +const scriptVersion: string = 'v4.3.3.6'; let nodeVersion: string = ''; let javaScriptVersion: string = '';