-
-
Notifications
You must be signed in to change notification settings - Fork 193
/
NsPanelTs.ts
11396 lines (10514 loc) · 600 KB
/
NsPanelTs.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*-----------------------------------------------------------------------
TypeScript v4.4.0.11 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @TT-Tom / @ticaki / @Britzelpuf / @Sternmiere / @ravenS0ne
- abgestimmt auf TFT 53 / v4.4.0 / BerryDriver 9 / Tasmota 14.3.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
icon_mapping.ts: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/icon_mapping.ts (TypeScript muss in global liegen)
ioBroker-Unterstützung: https://forum.iobroker.net/topic/50888/sonoff-nspanel
@Kuckuckmann: WIKI zu diesem Projekt unter: https://github.com/joBr99/nspanel-lovelace-ui/wiki (siehe Sidebar)
***************************************************************************************************************
Achtung: Keine Beispiele mehr im Script. Die Beispiele sind jetzt unter nachfolgendem Link zu finden:
- https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Page-%E2%80%90-Typen_How-2_Beispiele
***************************************************************************************************************
Icons unter: https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html
************************************************************************************************
Achtung Änderung des Sonoff ESP-Temperatursensors
!!! Bitte "SetOption146 1" in der Tasmota-Console ausführen !!!
************************************************************************************************
In bestimmten Situationen kommt es vor, dass sich das Panel mit FlashNextion
unter Tasmota > 12.2.0 nicht flashen lässt. Für den Fall ein Tasmota Downgrade
durchführen und FlashNextion wiederholen.
************************************************************************************************
Ab Tasmota > 13.0.0 ist für ein Upgrade ggfs. eine Umpartitionierung erforderlich
https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Tasmota-FAQ#3-tasmota-update-probleme
*****************************************************************************************************************************
Ab Script Version 4.3.2.1 muss in der JavaScript Instanz die npm Module 'moment' und 'moment-parseformat' eingetragen sein
https://github.com/joBr99/nspanel-lovelace-ui/wiki/iobroker---Basisinstallation#8--einstellungen-in-js-adapter-instanz
*****************************************************************************************************************************
ReleaseNotes:
Bugfixes und Erweiterungen:
See ChangeLog all Release Notes: https://github.com/joBr99/nspanel-lovelace-ui/wiki/Release-Notes
- 08.11.2023 - v4.3.3 Upgrade TFT 53 / 4.3.3
- 11.11.2023 - v4.3.3.1 Fix for Issues #1020 HandleHardwareButton buttonConfig.mode -> 'toggle' and 'set'
- 12.11.2023 - v4.3.3.2 Add autoCreateALias to cardUnlock
- 12.11.2023 - v4.3.3.2 Change NodeJS to at least v18.X.X
- 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 cardUnlock, 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
- 20.11.2023 - v4.3.3.6 Add Multilingualism to cardAlarm (39 languages)
- 20.11.2023 - v4.3.3.7 Add Multilingualism to cardMedia (39 languages)
- 20.11.2023 - v4.3.3.8 Add Method dayjs (Multilingualism)
- 20.11.2023 - v4.3.3.9 Add ScreensaverEntityOnColor, ...OffColor, ...OnText, ...OffText
- 23.11.2023 - v4.3.3.10 Code Optimization in Config Area
- 24.11.2023 - v4.3.3.11 Add autoCreateALias to PageQR
- 24.11.2023 - v4.3.3.12 Separation of page creation and page updates in cardPower
- 24.11.2023 - v4.3.3.12 Add alwaysOnDisplay to cardPower - Leave display on if the alwaysOnDisplay parameter is "true"
- 25.11.2023 - v4.3.3.13 Separation of page creation and page updates in cardMedia
- 25.11.2023 - v4.3.3.13 Add alwaysOnDisplay to cardMedia - Leave display on if the alwaysOnDisplay parameter is "true"
- 25.11.2023 - v4.3.3.13 Fix Sonos Repeat/Shuffle
- 25.11.2023 - v4.3.3.14 Refactoring Sonos-Player (with Playlist, Tracklist, Favorites, Eqalizer (if no Favorites))
- 29.11.2023 - v4.3.3.15 Fix cardMedia Volume-Slider / Add Init Release to Startup
- 30.11.2023 - v4.3.3.16 Beautification of the Sonos player Strings / Add Duration & Elapsed
- 01.12.2023 - v4.3.3.16 Fix Datapoints with Value null
- 02.12.2023 - v4.3.3.16 Request replaced by Axios
- 04.12.2023 - v4.3.3.17 Add SEEK and CROSSFADE to Sonos cardMedia
- 05.12.2023 - v4.3.3.18 Add (ELAPSED/DURATION) to v2Adapter alexa2
- 06.12.2023 - v4.3.3.18 Replace missing Type console.log --> log(message, 'serverity')
- 07.12.2023 - v4.3.3.19 Fix Trigger activeDimmodeBrightness if Dimmode = -1
- 08.12.2023 - v4.3.3.20 add Role AlarmTime for Alarm Clock
- 09.12.2023 - v4.3.3.21 Add createAutoAlias to popupTimer only for Time
- 14.12.2023 - v4.3.3.22 Add UpdateMessage => disable the update messages
- 14.12.2023 - v4.3.3.22 Fix name by static Navi Icon
- 17.12.2023 - v4.3.3.23 Optimization of the blind control (enable or disable Up/Stop/Down)
- 18.12.2023 - v4.3.3.24 Hotfix Update Message / Add Icon Colors to Entity Button
- 21.12.2023 - v4.3.3.25 Add switch of cardQR by hidePassword: true
- 26.12.2023 - v4.3.3.26 Fix Log output payload -> Json.stringify
- 28.12.2023 - v4.3.3.27 Fix Payload (pageItem.id -> placeId) by Function CreateEntity
- 28.12.2023 - v4.3.3.27 Fix Fallback PageItem.name by Function CreateEntity --> Many Bugs
- 30.12.2023 - v4.3.3.28 Fix short ID's in v4.3.3.27
- 30.12.2023 - v4.3.3.28 Fix window Icons in CreateEntity
- 30.12.2023 - v4.3.3.28 Add MQTT-Client Check
- 02.01.2024 - v4.3.3.29 Add Tasmota Buzzer for NotifyPage
- 02.02.2024 - v4.3.3.29 Fix ThermoPage -> UnSubScribsWatcher
- 02.02.2024 - v4.3.3.30 Add stronger config type checks
- 03.02.2024 - v4.3.3.31 Remove: autoCreateAlias from cardMedia
- 03.02.2024 - v4.3.3.31 Remove: adapterPlayerInstance from every card except cardMedia
- 03.02.2024 - v4.3.3.31 [dev]: optional with type - cardMedia has adapterPlayerInstance all other not
- 03.02.2024 - v4.3.3.31 [dev]: add PlayerType some more work to do
- 03.02.2024 - v4.3.3.31 changed: adapterPlayerInstance instance 0-9 allowed. Always require a '.' at the end.
- 04.01.2024 - v4.3.3.32 Hotfix Spotify
- 04.01.2024 - v4.3.3.32 [DEV] Add Types see commits
- 04.01.2024 - v4.3.3.32 Add more details to types for: leftScreensaverEntity, indicatorScreensaverEntity, PageThermo, PageMedia
- 04.01.2024 - v4.3.3.32 Remove not uses propertys from PageItem
- 05.01.2024 - v4.3.3.32 Add Body for BoseSoundtouch-Player
- 05.01.2024 - v4.3.3.33 Add BoseSoundtouch Functions
- 05.01.2024 - v4.3.3.33 Screensaver Fix max Number of indicatorScreensaverEntity
- 07.01.2024 - v4.3.3.33 Fix BoseSoundtouch Proto
- 08.01.2024 - v4.3.3.34 Fix: Disabled Icon Status while bug in updating data points in ioBroker (reason unknown)
- 08.01.2024 - v4.3.3.35 Add: relay.1/relay.2 show the confirmed status
- 09.01.2024 - v4.3.3.36 Fix: change ScreensaverTimeout and activeBrightness
- 09.01.2024 - v4.3.3.36 Fix: schedule SendTime
- 09.01.2024 - v4.3.3.36 Fix: Function _schedule SummerTime/WinterTime
- 15.01.2024 - v4.3.3.37 Change: Allow data points to be flushed for popUpNotify. Activate screensaver with one click.
- 16.01.2024 - v4.3.3.38 Fix: joBr99#1098
- 16.01.2024 - v4.3.3.38 Types: Number of PageItems defined & HandleScreensaverStatusIcons rewritten
- 16.01.2024 - v4.3.3.38 Optimate: function SendTime()
- 17.01.2024 - v4.3.3.38 Add: ScreensaverEntityIconSelect for MRIcons is like common.states for states.
- 17.01.2024 - v4.3.3.38 Add: Changing the ScreensaverEntityValue value updates the screensaver.
- 19.01.2024 - v4.3.3.38 Change: yAxisTicks parameter is not required in cardLChart PageItem
- 20.01.2024 - v4.3.3.38 Add: click on indicatorIcon navigate to Page
- 23.01.2024 - v4.3.3.39 Add: Optional setOn & setOff for HW button with mode 'set'
- 28.01.2024 - v4.3.3.39 Fix: ack for read-only state
- 03.02.2024 - v4.3.3.40 Fix: RGB maxValueColorTemp
- 05.02.2024 - v4.3.3.40 Fix: SqueezeboxRPC-Media-Player and add some Functions
- 06.02.2024 - v4.3.3.41 Fix: activeBrightness -> null
- 06.02.2024 - v4.3.3.41 Fix: bHome -> corrected PageId
- 07.02.2024 - v4.3.3.42 Minor Fixes
- 09.02.2024 - v4.3.3.42 Change pageId with Alias in Communication with HMI
- 09.02.2024 - v4.3.3.42 Spotify Media-Player: Dynamic loading of the speaker list, playlist, tracklist, fix repeat, add seek, add elapsed/duration
- 10.02.2024 - v4.3.3.42 Spotify Minor Fixes; Add miValue / maxValue to Volume-Slider
- 10.02.2024 - v4.3.3.43 Fix: cardGrid2 => 9 Entities for Layout 'us-p' issue #1167
- 11.02.2024 - v4.3.3.43 Fix VolumeSlider
- 05.05.2024 - v4.3.3.44 Fix MQTT-Port-check
- 13.05.2024 - v4.4.0.0 TFT 54 / 4.4.0
- 19.05.2024 - v4.4.0.1 TFT 53 / 4.4.0
- 13.06.2024 - v4.4.0.2 Calculated energy consumption in relation to dimming mode and relay state (not the energy consumption of the outputs)
- 13.06.2024 - v4.4.0.3 Check prefix '.tele.' in config.NSPanelReceiveTopic
- 13.09.2024 - v4.4.0.4 New Feature: Hidden Carts
- 18.09.2024 - v4.4.0.5 Remove day.JS
- 19.09.2024 - v4.4.0.6 Check Ports with mqtt.X and mqtt-client.X
- 27.09.2024 - v4.4.0.6 Fix: Using MQTT adapter or MQTT-CLIENT adapter / Minor Fix by wolwin
- 09.10.2024 - v4.4.0.7 Fix: first start and initialisation with new NSPanel device - Fix by wolwin
- 25.10.2024 - v4.4.0.8 Fix: InitDimmode => timeDimMode Day / timeDimMode Night
- 25.10.2024 - v4.4.0.8 Add Always On Display (AOD) to cardTHermo
- 25.10.2024 - v4.4.0.8 Add Hide Buttons at Power Off to cardThermo (Climate Alias Channel)
- 26.10.2024 - v4.4.0.8 Add Custom Icon Object to cartdThermo (Climate Alias Channel
- 31.10.2024 - v4.4.0.9 Fix: del 'HandleMessage()' in Trigger 'activeDimmodeBrightness'
- 22.11.2024 - v4.4.0.10 Fix: Bug #1266 trigger timeoutScreensaver
- 22.11.2024 - v4.4.0.11 Add new value 'PopupNotify' to ActivePage
Todo:
- XX.12.2024 - v5.0.0 ioBroker Adapter
***************************************************************************************************************
* DE: Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObject" gesetzt sein! *
* EN: In order for the script to create the aliases, “setObject” must be set in the JavaScript instance! *
***************************************************************************************************************
Wenn Rule definiert, dann können die Hardware-Tasten ebenfalls für Seitensteuerung (dann nicht mehr als Relais) genutzt werden
Tasmota Konsole:
Rule2 on Button1#state do Publish %topic%/tele/RESULT {"CustomRecv":"event,button1"} endon on Button2#state do Publish %topic%/tele/RESULT {"CustomRecv":"event,button2"} endon
Rule2 1 (Rule aktivieren)
Rule2 0 (Rule deaktivieren)
Mögliche Seiten-Ansichten:
screensaver Page - wird nach definiertem Zeitraum (config) mit Dimm-Modus aktiv (Uhrzeit, Datum, Aktuelle Temperatur mit Symbol)
(die 4 kleineren Icons können als Wetter-Vorschau + 4Tage (Symbol + Höchsttemperatur) oder zur Anzeige definierter Infos konfiguriert werden)
cardEntities Page - 4 vertikale angeordnete Steuerelemente - auch als Subpage
cardGrid Page - 6 horizontal angeordnete Steuerelemente in 2 Reihen a 3 Steuerelemente - auch als Subpage
cardGrid2 Page - 8 horizontal angeordnete Steuerelemente in 2 Reihen a 4 Steuerelemente bzw. beim US-Modell im Portrait-Modus
9 horizontal angeordnete Steuerelemente in 3 Reihen a 3 Steuerelemente - auch als Subpage
cardThermo Page - Thermostat mit Solltemperatur, Isttemperatur, Mode - Weitere Eigenschaften können im Alias definiert werden
cardMedia Page - Mediaplayer - Ausnahme: Alias sollte mit Alias-Manager automatisch über Alexa-Verzeichnis Player angelegt werden
cardAlarm Page - Alarmseite mit Zustand und Tastenfeld
cardPower Page - Energiefluss
cardChart Page - Balken-Diagramme aus History, SQL oder InfluxDB
cardLChart Page - Linien-Diagramme aus History, SQL oder InfluxDB
Vollständige Liste zur Einrichtung unter:
https://github.com/joBr99/nspanel-lovelace-ui/wiki/ioBroker-Card-Definitionen-(Seiten)
Popup-Pages:
popupLight Page - in Abhängigkeit zum gewählten Alias werden "Helligkeit", "Farbtemperatur" und "Farbauswahl" bereitgestellt
popupShutter Page - die Shutter-Position (Rollo, Jalousie, Markise, Leinwand, etc.) kann über einen Slider verändert werden.
popupNotify Page - Info - Seite mit Headline Text und Buttons - Intern für manuelle Updates / Extern zur Befüllung von Datenpunkten unter 0_userdata
screensaver Notify - Über zwei externe Datenpunkte in 0_userdata können "Headline" und "Text" an den Screensaver zur Info gesendet werden
popupInSel Page - Auswahlliste (InputSelect)
Mögliche Aliase: (Vorzugsweise mit ioBroker-Adapter "Geräte verwalten" konfigurieren, da SET, GET, ACTUAL, etc. verwendet werden)
Info - Werte aus Datenpunkt
Schieberegler - Slider numerische Werte (SET/ACTUAL)
Lautstärke - Volume (SET/ACTUAL) und MUTE
Lautstärke-Gruppe - analog Lautstärke
Licht - An/Aus (Schalter)
Steckdose - An/Aus (Schalter)
Dimmer - An/Aus, Brightness
Farbtemperatur - An/Aus, Farbtemperatur und Brightness
HUE-Licht - Zum Schalten von Color-Leuchtmitteln über HUE-Wert, Brightness, Farbtemperatur, An/Aus (HUE kann auch fehlen)
RGB-Licht - RGB-Leuchtmitteln/Stripes welche Rot/Grün/ und Blau separat benötigen (Tasmota, WifiLight, etc.) + Brightness, Farbtemperatur
RGB-Licht-einzeln - RGB-Leuchtmitteln/Stripes welche HEX-Farbwerte benötigen (Tasmota, WifiLight, etc.) + Brightness, Farbtemperatur
Jalousien - Up, Stop, Down, Position
Fenster - Sensor open
Tür - Sensor open
Tor - Sensor open
Bewegung - Sensor Presence
Verschluss - Türschloss SET/ACTUAL/OPEN
Taste - Für Szenen oder Radiosender, etc. --> Nur Funktionsaufruf - Kein Taster wie MonoButton - True/False
Tastensensor - Für Auswahlmenü (popupInSel)
Thermostat - Aktuelle Raumtemperatur, Setpoint, etc.
Temperatur - Temperatur aus Datenpunkt, analog Info
Klimaanlage - Buttons zur Steuerung der Klimaanlage im unteren Bereich
Temperatur - Anzeige von Temperatur - Datenpunkten, analog Info
Feuchtigkeit - Anzeige von Humidity - Datenpunkten, analog Info
Medien - Steuerung von Alexa, etc. - Über Alias-Manager im Verzeichnis Player automatisch anlegen (Geräte-Manager funktioniert nicht)
Wettervorhersage - Aktuelle Außen-Temperatur (Temp) und aktuelles AccuWeather-Icon (Icon) für Screensaver
Warnung - Abfall, etc. -- Info mit IconColor
Timer (siehe Wiki)
Vollständige Liste zur Einrichtung unter:
https://github.com/joBr99/nspanel-lovelace-ui/wiki/ioBroker-ALIAS-Definitionen
Interne Sonoff-Sensoren (über Tasmota):
ESP-Temperatur - wird in 0_userdata.0. abgelegt, kann als Alias importiert werden --> SetOption146 1
Temperatur - Raumtemperatur - wird in 0_userdata.0. abgelegt, kann als Alias importiert werden
(!!! Achtung: der interne Sonoff-Sensor liefert keine exakten Daten, da das NSPanel-Board und der ESP selbst Hitze produzieren !!!
ggf. Offset einplanen oder besser einen externen Sensor über Zigbee etc. verwenden)
Timestamp - wird in 0_userdata.0. Zeitpunkt der letzten Sensorübertragung
Tasmota-Status0 - (zyklische Ausführung)
liefert relevanten Tasmota-Informationen und kann bei Bedarf in "function get_tasmota_status0()" erweitert werden. Daten werden in 0_userdata.0. abgelegt
Erforderliche Adapter:
AccuWeather oder DasWetter: - Bei Nutzung der Wetterfunktionen (und zur Icon-Konvertierung) im Screensaver
Alexa2: - Bei Nutzung der dynamischen SpeakerList in der cardMedia
Geräte verwalten - Für Erstellung der Aliase
MQTT-Adapter - Für Kommunikation zwischen Skript und Tasmota
JavaScript-Adapter
Upgrades in Konsole:
Tasmota BerryDriver : Backlog UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; Restart 1
TFT EU STABLE Version : FlashNextion http://nspanel.pky.eu/lovelace-ui/github/nspanel-v4.4.0.tft
---------------------------------------------------------------------------------------
*/
/******************************* Begin CONFIG Parameter *******************************/
// DE: liefert bei true detailliertere Meldundgen im Log.
// EN: if true, provides more detailed messages in the log.
let Debug: boolean = false;
/***** 1. Tasmota-Config *****/
// DE: Anpassen an die Verzeichnisse der MQTT-Adapter-Instanz
// EN: Adapt to the MQTT adapter instance directories
const NSPanelReceiveTopic: string = 'mqtt.0.SmartHome.NSPanel_1.tele.RESULT';
const NSPanelSendTopic: string = 'mqtt.0.SmartHome.NSPanel_1.cmnd.CustomSend';
// DE: nur ändern, falls der User im Tasmota vor dem Kompilieren umbenannt wurde (Standard Tasmota: admin)
// EN: only change if the user was renamed in Tasmota before compiling (default Tasmota: admin)
const tasmota_web_admin_user: string = 'admin';
// DE: setzten, falls "Web Admin Password" in Tasmota vergeben
// EN set if "Web Admin Password" is assigned in Tasmota
const tasmota_web_admin_password: string = '';
// DE: Setzen der bevorzugten Tasmota32-Version (für Updates)
// EN: Set preferred Tasmota32 version (for updates)
const tasmotaOtaVersion: string = 'tasmota32-DE.bin';
// DE: Es können ebenfalls andere Versionen verwendet werden wie zum Beispiel:
// EN: Other versions can also be used, such as:
// 'tasmota32-nspanel.bin' or 'tasmota32.bin' or 'tasmota32-DE.bin' or etc.
/***** 2. Directories in 0_userdata.0... *****/
// DE: Anpassen an das jeweilige NSPanel
// EN: Adapt to the respective NSPanel
const NSPanel_Path = '0_userdata.0.NSPanel.1.';
// DE: Pfad für gemeinsame Nutzung durch mehrere Panels (bei Nutzung der cardAlarm/cardUnlock)
// EN: Path for sharing between multiple panels (when using cardAlarm/cardUnlock)
const NSPanel_Alarm_Path = '0_userdata.0.NSPanel.';
/***** 3. Weather adapter Config *****/
// DE: Mögliche Wetteradapter 'accuweather.0.' oder 'daswetter.0.'
// EN: Possible weather adapters 'accuweather.0.' or 'the weather.0.'
const weatherAdapterInstance: string = 'accuweather.0.';
// DE: Mögliche Werte: 'Min', 'Max' oder 'MinMax' im Screensaver
// EN: Possible values: 'Min', 'Max' or 'MinMax' in the screensaver
const weatherScreensaverTempMinMax: string = 'MinMax';
// DE: Dieser Alias wird automatisch für den gewählten Wetter erstellt und kann entsprechend angepasst werden
// EN: This alias is automatically created for the selected weather and can be adjusted accordingly
const weatherEntityPath: string = 'alias.0.Wetter';
/***** 4. Color constants for use in the PageItems *****/
// DE: Bei Bedarf können weitere Farben definiert werden
// EN: If necessary, additional colors can be defined
const HMIOff: RGB = { red: 68, green: 115, blue: 158 }; // Blue-Off - Original Entity Off
const HMIOn: RGB = { red: 3, green: 169, blue: 244 }; // Blue-On
const HMIDark: RGB = { red: 29, green: 29, blue: 29 }; // Original Background Color
const Off: RGB = { red: 253, green: 128, blue: 0 }; // Orange-Off - nicer color transitions
const On: RGB = { red: 253, green: 216, blue: 53 };
const MSRed: RGB = { red: 251, green: 105, blue: 98 };
const MSYellow: RGB = { red: 255, green: 235, blue: 156 };
const MSGreen: RGB = { red: 121, green: 222, blue: 121 };
const Red: RGB = { red: 255, green: 0, blue: 0 };
const White: RGB = { red: 255, green: 255, blue: 255 };
const Yellow: RGB = { red: 255, green: 255, blue: 0 };
const Green: RGB = { red: 0, green: 255, blue: 0 };
const Blue: RGB = { red: 0, green: 0, blue: 255 };
const DarkBlue: RGB = { red: 0, green: 0, blue: 136 };
const Gray: RGB = { red: 136, green: 136, blue: 136 };
const Black: RGB = { red: 0, green: 0, blue: 0 };
const Cyan: RGB = { red: 0, green: 255, blue: 255 };
const Magenta: RGB = { red: 255, green: 0, blue: 255 };
const colorSpotify: RGB = { red: 30, green: 215, blue: 96 };
const colorAlexa: RGB = { red: 49, green: 196, blue: 243 };
const colorSonos: RGB = { red: 216, green: 161, blue: 88 };
const colorRadio: RGB = { red: 255, green: 127, blue: 0 };
const BatteryFull: RGB = { red: 96, green: 176, blue: 62 };
const BatteryEmpty: RGB = { red: 179, green: 45, blue: 25 };
//Menu Icon Colors
const Menu: RGB = { red: 150, green: 150, blue: 100 };
const MenuLowInd: RGB = { red: 255, green: 235, blue: 156 };
const MenuHighInd: RGB = { red: 251, green: 105, blue: 98 };
//Dynamische Indikatoren (Abstufung grün nach gelb nach rot)
const colorScale0: RGB = { red: 99, green: 190, blue: 123 };
const colorScale1: RGB = { red: 129, green: 199, blue: 126 };
const colorScale2: RGB = { red: 161, green: 208, blue: 127 };
const colorScale3: RGB = { red: 129, green: 217, blue: 126 };
const colorScale4: RGB = { red: 222, green: 226, blue: 131 };
const colorScale5: RGB = { red: 254, green: 235, blue: 132 };
const colorScale6: RGB = { red: 255, green: 210, blue: 129 };
const colorScale7: RGB = { red: 251, green: 185, blue: 124 };
const colorScale8: RGB = { red: 251, green: 158, blue: 117 };
const colorScale9: RGB = { red: 248, green: 131, blue: 111 };
const colorScale10: RGB = { red: 248, green: 105, blue: 107 };
//Screensaver Default Theme Colors
const scbackground: RGB = { red: 0, green: 0, blue: 0};
const scbackgroundInd1: RGB = { red: 255, green: 0, blue: 0};
const scbackgroundInd2: RGB = { red: 121, green: 222, blue: 121};
const scbackgroundInd3: RGB = { red: 255, green: 255, blue: 0};
const sctime: RGB = { red: 255, green: 255, blue: 255};
const sctimeAMPM: RGB = { red: 255, green: 255, blue: 255};
const scdate: RGB = { red: 255, green: 255, blue: 255};
const sctMainIcon: RGB = { red: 255, green: 255, blue: 255};
const sctMainText: RGB = { red: 255, green: 255, blue: 255};
const sctForecast1: RGB = { red: 255, green: 255, blue: 255};
const sctForecast2: RGB = { red: 255, green: 255, blue: 255};
const sctForecast3: RGB = { red: 255, green: 255, blue: 255};
const sctForecast4: RGB = { red: 255, green: 255, blue: 255};
const sctF1Icon: RGB = { red: 255, green: 235, blue: 156};
const sctF2Icon: RGB = { red: 255, green: 235, blue: 156};
const sctF3Icon: RGB = { red: 255, green: 235, blue: 156};
const sctF4Icon: RGB = { red: 255, green: 235, blue: 156};
const sctForecast1Val: RGB = { red: 255, green: 255, blue: 255};
const sctForecast2Val: RGB = { red: 255, green: 255, blue: 255};
const sctForecast3Val: RGB = { red: 255, green: 255, blue: 255};
const sctForecast4Val: RGB = { red: 255, green: 255, blue: 255};
const scbar: RGB = { red: 255, green: 255, blue: 255};
const sctMainIconAlt: RGB = { red: 255, green: 255, blue: 255};
const sctMainTextAlt: RGB = { red: 255, green: 255, blue: 255};
const sctTimeAdd: RGB = { red: 255, green: 255, blue: 255};
//Auto-Weather-Colors
const swClearNight: RGB = { red: 150, green: 150, blue: 100};
const swCloudy: RGB = { red: 75, green: 75, blue: 75};
const swExceptional: RGB = { red: 255, green: 50, blue: 50};
const swFog: RGB = { red: 150, green: 150, blue: 150};
const swHail: RGB = { red: 200, green: 200, blue: 200};
const swLightning: RGB = { red: 200, green: 200, blue: 0};
const swLightningRainy: RGB = { red: 200, green: 200, blue: 150};
const swPartlycloudy: RGB = { red: 150, green: 150, blue: 150};
const swPouring: RGB = { red: 50, green: 50, blue: 255};
const swRainy: RGB = { red: 100, green: 100, blue: 255};
const swSnowy: RGB = { red: 150, green: 150, blue: 150};
const swSnowyRainy: RGB = { red: 150, green: 150, blue: 255};
const swSunny: RGB = { red: 255, green: 255, blue: 0};
const swWindy: RGB = { red: 150, green: 150, blue: 150};
/***** 5. Script - Parameters *****/
// DE: Für diese Option muss der Haken in setObjects in deiner javascript.X. Instanz gesetzt sein.
// EN: This option requires the check mark in setObjects in your javascript.X. instance must be set.
const autoCreateAlias = true;
// DE: Verzeichnis für Auto-Aliase (wird per Default aus dem NSPanel-Verzeichnis gebildet und muss nicht verändert werden)
// EN: Directory for auto aliases (is created by default from the NSPanel directory and does not need to be changed)
const AliasPath: string = 'alias.0.' + NSPanel_Path.substring(13, NSPanel_Path.length);
// DE: Default-Farbe für Off-Zustände
// EN: Default color for off states
const defaultOffColorParam: any = Off;
// DE: Default-Farbe für On-Zustände
// EN: Default color for on states
const defaultOnColorParam: any = On;
const defaultColorParam: any = Off;
// DE: Default-Hintergrundfarbe HMIDark oder Black
// EN: Default background color HMIDark or Black
const defaultBackgroundColorParam: any = HMIDark;
/******************************** End CONFIG Parameter ********************************/
//-- Anfang für eigene Seiten -- z.T. selbstdefinierte Aliase erforderlich ----------------
//-- Start for your own pages -- some self-defined aliases required ----------------
//-- https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Page-%E2%80%90-Typen_How-2_Beispiele
//-- ENDE für eigene Seiten -- z.T. selbstdefinierte Aliase erforderlich -------------------------
//-- END for your own pages -- some self-defined aliases required ------------------------
/***********************************************************************************************
** Service Pages mit Auto-Alias (Nachfolgende Seiten werden mit Alias automatisch angelegt) **
** https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Service-Men%C3%BC **
***********************************************************************************************/
/* DE: German
Wenn das Service Menü abgesichert werden soll, kann eine cardUnlock vorgeschaltet werden.
Für diesen Fall ist folgende Vorgehensweise erforderlich:
- cardUnlock Seite "Unlock_Service" in der Config unter pages auskommentieren ("//" entfernen)
- Servicemenü aus pages "NSPanel_Service" unter pages kommentieren ("//" hinzufügen)
*/
/*************************************************************************************************
** Service pages with auto alias (subsequent pages are automatically created with alias) **
** https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Service-Men%C3%BC **
************************************************************************************************/
/* EN: English
If the service menu needs to be secured, a cardUnlock can be installed upstream.
In this case, the following procedure is required:
- comment out cardUnlock page "Unlock_Service" in the config under pages (remove "//")
- Comment service menu from pages "NSPanel_Service" under pages (add "//")
*/
//Level 0 (if service pages are used with cardUnlock)
let Unlock_Service: PageType =
{
'type': 'cardUnlock',
'heading': findLocaleServMenu('service_pages'),
'useColor': true,
'items': [/*PageItem*/{ id: 'alias.0.NSPanel.Unlock',
targetPage: 'NSPanel_Service_SubPage',
autoCreateALias: true }
]
};
//Level_0 (if service pages are used without cardUnlock)
let NSPanel_Service: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('service_menu'),
'useColor': true,
'items': [
/*PageItem*/{ navigate: true, id: 'NSPanel_Infos', icon: 'information-outline', offColor: Menu, onColor: Menu, name: findLocaleServMenu('infos'), buttonText: findLocaleServMenu('more')},
/*PageItem*/{ navigate: true, id: 'NSPanel_Einstellungen', icon: 'monitor-edit', offColor: Menu, onColor: Menu, name: findLocaleServMenu('settings'), buttonText: findLocaleServMenu('more')},
/*PageItem*/{ navigate: true, id: 'NSPanel_Firmware', icon: 'update', offColor: Menu, onColor: Menu, name: findLocaleServMenu('firmware'), buttonText: findLocaleServMenu('more')},
/*PageItem*/{ id: AliasPath + 'Config.rebootNSPanel', name: findLocaleServMenu('reboot') ,icon: 'refresh', offColor: MSRed, onColor: MSGreen, buttonText: findLocaleServMenu('start')},
]
};
//Level_0 (if service pages are used with cardUnlock)
let NSPanel_Service_SubPage: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('service_menu'),
'useColor': true,
'subPage': true,
'parent': Unlock_Service,
'home': 'Unlock_Service',
'items': [
/*PageItem*/{ navigate: true, id: 'NSPanel_Infos', icon: 'information-outline', offColor: Menu, onColor: Menu, name: findLocaleServMenu('infos'), buttonText: findLocaleServMenu('more')},
/*PageItem*/{ navigate: true, id: 'NSPanel_Einstellungen', icon: 'monitor-edit', offColor: Menu, onColor: Menu, name: findLocaleServMenu('settings'), buttonText: findLocaleServMenu('more')},
/*PageItem*/{ navigate: true, id: 'NSPanel_Firmware', icon: 'update', offColor: Menu, onColor: Menu, name: findLocaleServMenu('firmware'), buttonText: findLocaleServMenu('more')},
/*PageItem*/{ id: AliasPath + 'Config.rebootNSPanel', name: findLocaleServMenu('reboot') ,icon: 'refresh', offColor: MSRed, onColor: MSGreen, buttonText: findLocaleServMenu('start')},
]
};
//Level_1
let NSPanel_Infos: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('nspanel_infos'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Service,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ navigate: true, id: 'NSPanel_Wifi_Info_1', icon: 'wifi', offColor: Menu, onColor: Menu, name: findLocaleServMenu('wifi'), buttonText: findLocaleServMenu('more')},
/*PageItem*/{ navigate: true, id: 'NSPanel_Sensoren', icon: 'memory', offColor: Menu, onColor: Menu, name: findLocaleServMenu('sensors_hardware'), buttonText: findLocaleServMenu('more')},
/*PageItem*/{ navigate: true, id: 'NSPanel_IoBroker', icon: 'information-outline', offColor: Menu, onColor: Menu, name: findLocaleServMenu('info_iobroker'), buttonText: findLocaleServMenu('more')},
/*PageItem*/{ id: AliasPath + 'Config.Update.UpdateMessage', name: findLocaleServMenu('update_message') ,icon: 'message-alert-outline', offColor: HMIOff, onColor: MSGreen},
]
};
//Level_2
let NSPanel_Wifi_Info_1: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('nspanel_wifi1'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Infos,
'next': 'NSPanel_Wifi_Info_2',
'items': [
/*PageItem*/{ id: AliasPath + 'ipAddress', name: findLocaleServMenu('ip_address'), icon: 'ip-network-outline', offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Tasmota.Wifi.BSSId', name: findLocaleServMenu('mac_address'), icon: 'check-network', offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Tasmota.Wifi.RSSI', name: findLocaleServMenu('rssi'), icon: 'signal', unit: '%', colorScale: {'val_min': 100, 'val_max': 0} },
/*PageItem*/{ id: AliasPath + 'Tasmota.Wifi.Signal', name: findLocaleServMenu('wifi_signal'), icon: 'signal-distance-variant', unit: 'dBm', colorScale: {'val_min': 0, 'val_max': -100} },
]
};
let NSPanel_Wifi_Info_2: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('nspanel_wifi2'),
'useColor': true,
'subPage': true,
'prev': 'NSPanel_Wifi_Info_1',
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'Tasmota.Wifi.SSId', name: findLocaleServMenu('ssid'), icon: 'signal-distance-variant', offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Tasmota.Wifi.Mode', name: findLocaleServMenu('mode'), icon: 'signal-distance-variant', offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Tasmota.Wifi.Channel', name: findLocaleServMenu('channel'), icon: 'timeline-clock-outline', offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Tasmota.Wifi.AP', name: findLocaleServMenu('accesspoint'), icon: 'router-wireless-settings', offColor: Menu, onColor: Menu },
]
};
let NSPanel_Sensoren: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('sensors1'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Infos,
'next': 'NSPanel_Hardware',
'items': [
/*PageItem*/{ id: AliasPath + 'Sensor.ANALOG.Temperature', name: findLocaleServMenu('room_temperature'), icon: 'home-thermometer-outline', unit: '°C', colorScale: {'val_min': 0, 'val_max': 40, 'val_best': 22 } },
/*PageItem*/{ id: AliasPath + 'Sensor.ESP32.Temperature', name: findLocaleServMenu('esp_temperature'), icon: 'thermometer', unit: '°C', colorScale: {'val_min': 0, 'val_max': 100, 'val_best': 50 } },
/*PageItem*/{ id: AliasPath + 'Sensor.TempUnit', name: findLocaleServMenu('temperature_unit'), icon: 'temperature-celsius', offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Sensor.Time', name: findLocaleServMenu('refresh'), icon: 'clock-check-outline', offColor: Menu, onColor: Menu },
]
};
let NSPanel_Hardware: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('hardware2'),
'useColor': true,
'subPage': true,
'prev': 'NSPanel_Sensoren',
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'Tasmota.Product', name: findLocaleServMenu('product'), icon: 'devices', offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Tasmota.Hardware', name: findLocaleServMenu('esp32_hardware'), icon: 'memory', offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Display.Model', name: findLocaleServMenu('nspanel_version'), offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Tasmota.Uptime', name: findLocaleServMenu('operating_time'), icon: 'timeline-clock-outline', offColor: Menu, onColor: Menu },
]
};
let NSPanel_IoBroker: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('info_iobroker'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Infos,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'IoBroker.ScriptVersion', name: findLocaleServMenu('script_version_nspanelts'), offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'IoBroker.NodeJSVersion', name: findLocaleServMenu('nodejs_version'), offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'IoBroker.JavaScriptVersion', name: findLocaleServMenu('instance_javascript'), offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'IoBroker.ScriptName', name: findLocaleServMenu('scriptname'), offColor: Menu, onColor: Menu },
]
};
//Level_1
let NSPanel_Einstellungen: PageType =
{
'type': 'cardGrid',
'heading': findLocaleServMenu('settings'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Service,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ navigate: true, id: 'NSPanel_Screensaver', icon: 'monitor-dashboard',offColor: Menu, onColor: Menu, name: findLocaleServMenu('screensaver'), buttonText: findLocaleServMenu('more')},
/*PageItem*/{ navigate: true, id: 'NSPanel_Relays', icon: 'electric-switch', offColor: Menu, onColor: Menu, name: findLocaleServMenu('relays'), buttonText: findLocaleServMenu('more')},
/*PageItem*/{ id:AliasPath + 'Config.temperatureUnitNumber', icon: 'gesture-double-tap', name: findLocaleServMenu('temp_unit'), offColor: Menu, onColor: Menu,
modeList: ['°C', '°F', 'K']},
/*PageItem*/{ id: AliasPath + 'Config.localeNumber', icon: 'select-place', name: findLocaleServMenu('language'), offColor: Menu, onColor: Menu,
modeList: ['en-US', 'de-DE', 'nl-NL', 'da-DK', 'es-ES', 'fr-FR', 'it-IT', 'ru-RU', 'nb-NO', 'nn-NO', 'pl-PL', 'pt-PT', 'af-ZA', 'ar-SY',
'bg-BG', 'ca-ES', 'cs-CZ', 'el-GR', 'et-EE', 'fa-IR', 'fi-FI', 'he-IL', 'hr-xx', 'hu-HU', 'hy-AM', 'id-ID', 'is-IS', 'lb-xx',
'lt-LT', 'ro-RO', 'sk-SK', 'sl-SI', 'sv-SE', 'th-TH', 'tr-TR', 'uk-UA', 'vi-VN', 'zh-CN', 'zh-TW']},
/*PageItem*/{ navigate: true, id: 'NSPanel_Script', icon: 'code-json',offColor: Menu, onColor: Menu, name: findLocaleServMenu('script'), buttonText: findLocaleServMenu('more')},
]
};
//Level_2
let NSPanel_Screensaver: PageType =
{
'type': 'cardGrid',
'heading': findLocaleServMenu('screensaver'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Einstellungen,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ navigate: true, id: 'NSPanel_ScreensaverDimmode', icon: 'sun-clock', offColor: Menu, onColor: Menu, name: findLocaleServMenu('dimmode')},
/*PageItem*/{ navigate: true, id: 'NSPanel_ScreensaverBrightness', icon: 'brightness-5', offColor: Menu, onColor: Menu, name: findLocaleServMenu('brightness')},
/*PageItem*/{ navigate: true, id: 'NSPanel_ScreensaverLayout', icon: 'page-next-outline', offColor: Menu, onColor: Menu, name: findLocaleServMenu('layout')},
/*PageItem*/{ navigate: true, id: 'NSPanel_ScreensaverWeather', icon: 'weather-partly-rainy', offColor: Menu, onColor: Menu, name: findLocaleServMenu('weather')},
/*PageItem*/{ navigate: true, id: 'NSPanel_ScreensaverDateformat', icon: 'calendar-expand-horizontal', offColor: Menu, onColor: Menu, name: findLocaleServMenu('date_format')},
/*PageItem*/{ navigate: true, id: 'NSPanel_ScreensaverIndicators', icon: 'monitor-edit', offColor: Menu, onColor: Menu, name: findLocaleServMenu('indicators')}
]
};
//Level_3
let NSPanel_ScreensaverDimmode: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('dimmode'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Screensaver,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'Dimmode.brightnessDay', name: findLocaleServMenu('brightness_day'), icon: 'brightness-5', offColor: Menu, onColor: Menu, minValue: 5, maxValue: 10},
/*PageItem*/{ id: AliasPath + 'Dimmode.brightnessNight', name: findLocaleServMenu('brightness_night'), icon: 'brightness-4', offColor: Menu, onColor: Menu, minValue: 0, maxValue: 4},
/*PageItem*/{ id: AliasPath + 'Dimmode.hourDay', name: findLocaleServMenu('hour_day'), icon: 'sun-clock', offColor: Menu, onColor: Menu, minValue: 0, maxValue: 23},
/*PageItem*/{ id: AliasPath + 'Dimmode.hourNight', name: findLocaleServMenu('hour_night'), icon: 'sun-clock-outline', offColor: Menu, onColor: Menu, minValue: 0, maxValue: 23}
]
};
//Level_3
let NSPanel_ScreensaverBrightness: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('brightness'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Screensaver,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'ScreensaverInfo.activeBrightness', name: findLocaleServMenu('brightness_activ'), icon: 'brightness-5', offColor: Menu, onColor: Menu, minValue: 20, maxValue: 100},
/*PageItem*/{ id: AliasPath + 'Config.Screensaver.timeoutScreensaver', name: findLocaleServMenu('screensaver_timeout'), icon: 'clock-end', offColor: Menu, onColor: Menu, minValue: 0, maxValue: 60},
/*PageItem*/{ id: AliasPath + 'Config.Screensaver.screenSaverDoubleClick', name: findLocaleServMenu('wakeup_doublecklick') ,icon: 'gesture-two-double-tap', offColor: HMIOff, onColor: HMIOn}
]
};
//Level_3
let NSPanel_ScreensaverLayout: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('layout'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Screensaver,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'Config.Screensaver.alternativeScreensaverLayout', name: findLocaleServMenu('alternative_layout') ,icon: 'page-previous-outline', offColor: HMIOff, onColor: HMIOn},
/*PageItem*/{ id: AliasPath + 'Config.Screensaver.ScreensaverAdvanced', name: findLocaleServMenu('advanced_layout') ,icon: 'page-next-outline', offColor: HMIOff, onColor: HMIOn},
]
};
//Level_3
let NSPanel_ScreensaverWeather: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('weather_parameters'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Screensaver,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'ScreensaverInfo.weatherForecast', name: findLocaleServMenu('weather_forecast_offon') ,icon: 'weather-sunny-off', offColor: HMIOff, onColor: HMIOn},
/*PageItem*/{ id: AliasPath + 'ScreensaverInfo.weatherForecastTimer', name: findLocaleServMenu('weather_forecast_change_switch') ,icon: 'devices', offColor: HMIOff, onColor: HMIOn},
/*PageItem*/{ id: AliasPath + 'ScreensaverInfo.entityChangeTime', name: findLocaleServMenu('weather_forecast_change_time'), icon: 'cog-sync', offColor: Menu, onColor: Menu, minValue: 15, maxValue: 60},
/*PageItem*/{ id: AliasPath + 'Config.Screensaver.autoWeatherColorScreensaverLayout', name: findLocaleServMenu('weather_forecast_icon_colors') ,icon: 'format-color-fill', offColor: HMIOff, onColor: HMIOn},
]
};
//Level_3
let NSPanel_ScreensaverDateformat: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('date_format'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Screensaver,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'Config.Dateformat.Switch.weekday', name: findLocaleServMenu('weekday_large') ,icon: 'calendar-expand-horizontal', offColor: HMIOff, onColor: HMIOn},
/*PageItem*/{ id: AliasPath + 'Config.Dateformat.Switch.month', name: findLocaleServMenu('month_large') ,icon: 'calendar-expand-horizontal', offColor: HMIOff, onColor: HMIOn},
]
};
//Level_3
let NSPanel_ScreensaverIndicators: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('indicators'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Screensaver,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'Config.MRIcons.alternateMRIconSize.1', name: findLocaleServMenu('mr_icon1_size') ,icon: 'format-size', offColor: HMIOff, onColor: HMIOn},
/*PageItem*/{ id: AliasPath + 'Config.MRIcons.alternateMRIconSize.2', name: findLocaleServMenu('mr_icon2_size') ,icon: 'format-size', offColor: HMIOff, onColor: HMIOn},
]
};
//Level_2
let NSPanel_Relays: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('relays'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Einstellungen,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'Relay.1', name: findLocaleServMenu('relay1_onoff'), icon: 'power', offColor: HMIOff, onColor: HMIOn},
/*PageItem*/{ id: AliasPath + 'Relay.2', name: findLocaleServMenu('relay2_onoff'), icon: 'power', offColor: HMIOff, onColor: HMIOn},
]
};
//Level_2
let NSPanel_Script: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('script'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Einstellungen,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'Config.ScripgtDebugStatus', name: findLocaleServMenu('debugmode_offon') ,icon: 'code-tags-check', offColor: HMIOff, onColor: HMIOn},
/*PageItem*/{ id: AliasPath + 'Config.MQTT.portCheck', name: findLocaleServMenu('port_check_offon') ,icon: 'check-network', offColor: HMIOff, onColor: HMIOn},
/*PageItem*/{ id: AliasPath + 'Config.hiddenCards', name: findLocaleServMenu('hiddencards_offon'), icon: 'check-network', offColor: HMIOff, onColor: HMIOn },
]
};
//Level_1
let NSPanel_Firmware: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('firmware'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Service,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'autoUpdate', name: findLocaleServMenu('automatically_updates') ,icon: 'power', offColor: HMIOff, onColor: HMIOn},
/*PageItem*/{ navigate: true, id: 'NSPanel_FirmwareTasmota', icon: 'usb-flash-drive', offColor: Menu, onColor: Menu, name: findLocaleServMenu('tasmota_firmware'), buttonText: findLocaleServMenu('more')},
/*PageItem*/{ navigate: true, id: 'NSPanel_FirmwareBerry', icon: 'usb-flash-drive', offColor: Menu, onColor: Menu, name: findLocaleServMenu('berry_driver'), buttonText: findLocaleServMenu('more')},
/*PageItem*/{ navigate: true, id: 'NSPanel_FirmwareNextion', icon: 'cellphone-cog', offColor: Menu, onColor: Menu, name: findLocaleServMenu('nextion_tft_firmware'), buttonText: findLocaleServMenu('more')}
]
};
let NSPanel_FirmwareTasmota: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('tasmota'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Firmware,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'Tasmota.Version', name: findLocaleServMenu('installed_release'), offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Tasmota_Firmware.onlineVersion', name: findLocaleServMenu('available_release'), offColor: Menu, onColor: Menu },
/*PageItem*/{ id: 'Divider' },
/*PageItem*/{ id: AliasPath + 'Config.Update.UpdateTasmota', name: findLocaleServMenu('update_tasmota') ,icon: 'refresh', offColor: HMIOff, onColor: MSGreen, buttonText: findLocaleServMenu('start')},
]
};
let NSPanel_FirmwareBerry: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('berry_driver'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Firmware,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'Display.BerryDriver', name: findLocaleServMenu('installed_release'), offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Berry_Driver.onlineVersion', name: findLocaleServMenu('available_release'), offColor: Menu, onColor: Menu},
/*PageItem*/{ id: 'Divider' },
/*PageItem*/{ id: AliasPath + 'Config.Update.UpdateBerry', name: findLocaleServMenu('update_berry_driver') ,icon: 'refresh', offColor: HMIOff, onColor: MSGreen, buttonText: findLocaleServMenu('start')},
]
};
let NSPanel_FirmwareNextion: PageType =
{
'type': 'cardEntities',
'heading': findLocaleServMenu('nextion_tft'),
'useColor': true,
'subPage': true,
'parent': NSPanel_Firmware,
'home': 'NSPanel_Service',
'items': [
/*PageItem*/{ id: AliasPath + 'Display_Firmware.TFT.currentVersion', name: findLocaleServMenu('installed_release'), offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Display_Firmware.TFT.desiredVersion', name: findLocaleServMenu('desired_release'), offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Display.Model', name: findLocaleServMenu('nspanel_model'), offColor: Menu, onColor: Menu },
/*PageItem*/{ id: AliasPath + 'Config.Update.UpdateNextion', name: 'Nextion TFT Update' ,icon: 'refresh', offColor: HMIOff, onColor: MSGreen, buttonText: findLocaleServMenu('start')},
]
};
// End of Service Pages
/***********************************************************************
** **
** Configuration **
** **
***********************************************************************/
export const config: Config = {
// Seiteneinteilung / Page division
// Hauptseiten / Mainpages
pages: [
NSPanel_Service, //Auto-Alias Service Page
//Unlock_Service //Auto-Alias Service Page (Service Pages used with cardUnlock)
],
// Unterseiten / Subpages
subPages: [
NSPanel_Service_SubPage, //Auto-Alias Service Page (only used with cardUnlock)
NSPanel_Infos, //Auto-Alias Service Page
NSPanel_Wifi_Info_1, //Auto-Alias Service Page
NSPanel_Wifi_Info_2, //Auto-Alias Service Page
NSPanel_Sensoren, //Auto-Alias Service Page
NSPanel_Hardware, //Auto-Alias Service Page
NSPanel_IoBroker, //Auot-Alias Service Page
NSPanel_Einstellungen, //Auto-Alias Service Page
NSPanel_Screensaver, //Auto-Alias Service Page
NSPanel_ScreensaverDimmode, //Auto-Alias Service Page
NSPanel_ScreensaverBrightness, //Auto-Alias Service Page
NSPanel_ScreensaverLayout, //Auto-Alias Service Page
NSPanel_ScreensaverWeather, //Auto-Alias Service Page
NSPanel_ScreensaverDateformat, //Auto-Alias Service Page
NSPanel_ScreensaverIndicators, //Auto-Alias Service Page
NSPanel_Relays, //Auto-Alias Service Page
NSPanel_Script, //Auto-Alias Service Page
NSPanel_Firmware, //Auto-Alias Service Page
NSPanel_FirmwareTasmota, //Auto-Alias Service Page
NSPanel_FirmwareBerry, //Auto-Alias Service Page
NSPanel_FirmwareNextion, //Auto-Alias Service Page
],
/***********************************************************************
** **
** Screensaver Configuration **
** **
***********************************************************************/
leftScreensaverEntity: [
// Examples for Advanced-Screensaver: https://github.com/joBr99/nspanel-lovelace-ui/wiki/ioBroker-Config-Screensaver#entity-status-icons-ab-v400
],
bottomScreensaverEntity: [
// bottomScreensaverEntity 1
{
ScreensaverEntity: 'accuweather.0.Daily.Day1.Sunrise',
ScreensaverEntityFactor: 1,
ScreensaverEntityDecimalPlaces: 0,
ScreensaverEntityDateFormat: {hour: '2-digit', minute: '2-digit'}, // Description at Wiki-Pages
ScreensaverEntityIconOn: 'weather-sunset-up',
ScreensaverEntityIconOff: null,
ScreensaverEntityText: 'Sonne',
ScreensaverEntityUnitText: '%',
ScreensaverEntityIconColor: MSYellow //{'val_min': 0, 'val_max': 100}
},
// bottomScreensaverEntity 2
{
ScreensaverEntity: 'accuweather.0.Current.WindSpeed',
ScreensaverEntityFactor: (1000 / 3600),
ScreensaverEntityDecimalPlaces: 1,
ScreensaverEntityIconOn: 'weather-windy',
ScreensaverEntityIconOff: null,
ScreensaverEntityText: "Wind",
ScreensaverEntityUnitText: 'm/s',
ScreensaverEntityIconColor: {'val_min': 0, 'val_max': 120}
},
// bottomScreensaverEntity 3
{
ScreensaverEntity: 'accuweather.0.Current.WindGust',
ScreensaverEntityFactor: (1000 / 3600),
ScreensaverEntityDecimalPlaces: 1,
ScreensaverEntityIconOn: 'weather-tornado',
ScreensaverEntityIconOff: null,
ScreensaverEntityText: 'Böen',
ScreensaverEntityUnitText: 'm/s',
ScreensaverEntityIconColor: {'val_min': 0, 'val_max': 120}
},
// bottomScreensaverEntity 4
{
ScreensaverEntity: 'accuweather.0.Current.WindDirectionText',
ScreensaverEntityFactor: 1,
ScreensaverEntityDecimalPlaces: 0,
ScreensaverEntityIconOn: 'windsock',
ScreensaverEntityIconOff: null,
ScreensaverEntityText: 'Windr.',
ScreensaverEntityUnitText: '°',
ScreensaverEntityIconColor: White
},
// bottomScreensaverEntity 5 (for Alternative and Advanced Screensaver)
{
ScreensaverEntity: 'accuweather.0.Current.RelativeHumidity',
ScreensaverEntityFactor: 1,
ScreensaverEntityDecimalPlaces: 1,
ScreensaverEntityIconOn: 'water-percent',
ScreensaverEntityIconOff: null,
ScreensaverEntityText: 'Feuchte',
ScreensaverEntityUnitText: '%',
ScreensaverEntityIconColor: {'val_min': 0, 'val_max': 100, 'val_best': 65}
},
// bottomScreensaverEntity 6 (for Advanced Screensaver)
{
ScreensaverEntity: NSPanel_Path + 'Relay.1',
ScreensaverEntityIconOn: 'coach-lamp-variant',
ScreensaverEntityText: 'Street',
ScreensaverEntityOnColor: Yellow,
ScreensaverEntityOffColor: White,
ScreensaverEntityOnText: 'Is ON',
ScreensaverEntityOffText: 'Not ON'
},
// Examples for Advanced-Screensaver: https://github.com/joBr99/nspanel-lovelace-ui/wiki/ioBroker-Config-Screensaver#entity-status-icons-ab-v400
],
indicatorScreensaverEntity: [
// Examples for Advanced-Screensaver: https://github.com/joBr99/nspanel-lovelace-ui/wiki/ioBroker-Config-Screensaver#entity-status-icons-ab-v400
],
// Status Icon
mrIcon1ScreensaverEntity: {
ScreensaverEntity: NSPanel_Path + 'Relay.1',
ScreensaverEntityIconOn: 'lightbulb',
ScreensaverEntityIconOff: null,
ScreensaverEntityValue: null,
ScreensaverEntityValueDecimalPlace: 0,
ScreensaverEntityValueUnit: null,
ScreensaverEntityOnColor: On,
ScreensaverEntityOffColor: HMIOff
},
mrIcon2ScreensaverEntity: {
ScreensaverEntity: NSPanel_Path + 'Relay.2',
ScreensaverEntityIconOn: 'lightbulb',
ScreensaverEntityIconOff: null,
ScreensaverEntityValue: null,
ScreensaverEntityValueDecimalPlace: 0,
ScreensaverEntityValueUnit: null,
ScreensaverEntityOnColor: On,
ScreensaverEntityOffColor: HMIOff
},
// ------ DE: Ende der Screensaver Einstellungen --------------------
// ------ EN: End of screensaver settings ---------------------------
//-------DE: Anfang Einstellungen für Hardware Button, wenn Sie softwareseitig genutzt werden (Rule2) -------------
//-------EN: Start Settings for Hardware Button, if used in software (Rule2) --------------------------------------
// DE: Konfiguration des linken Schalters des NSPanels
// EN: Configuration of the left switch of the NSPanel
button1: {
// DE: Mögliche Werte wenn Rule2 definiert: 'page', 'toggle', 'set' - Wenn nicht definiert --> mode: null
// EN: Possible values if Rule2 defined: 'page', 'toggle', 'set' - If not defined --> mode: null
mode: null,
// DE: Zielpage - Verwendet wenn mode = page
// EN: Target page - Used if mode = page
page: null,
// DE: Zielentity - Verwendet wenn mode = set oder toggle
// EN: Target entity - Used if mode = set or toggle
entity: null,
// DE: Zielwert - Verwendet wenn mode = set
// EN: Target value - Used if mode = set
setValue: null
},
// DE: Konfiguration des rechten Schalters des NSPanels
// EN: Configuration of the right switch of the NSPanel
button2: {
mode: null,
page: null,
entity: null,
setValue: null
},
//--------- DE: Ende - Einstellungen für Hardware Button, wenn Sie softwareseitig genutzt werden (Rule2) -------------
//--------- EN: End - settings for hardware button if they are used in software (Rule2) ------------------------------
// DE: WICHTIG !! Parameter nicht ändern WICHTIG!!
// EN: IMPORTANT !! Do not change parameters IMPORTANT!!
panelRecvTopic: NSPanelReceiveTopic,
panelSendTopic: NSPanelSendTopic,
weatherEntity: weatherEntityPath,
defaultOffColor: defaultOffColorParam,
defaultOnColor: defaultOnColorParam,
defaultColor: defaultColorParam,
defaultBackgroundColor: defaultBackgroundColorParam,