-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample_sendTo_script_iobroker.ts
1169 lines (1099 loc) · 42.6 KB
/
example_sendTo_script_iobroker.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
async function configuration (): Promise<void> {
// Diese Konfiguration für den Fahrplan ist ein Beispiel was die interne Adapterkonfiguration benutzt, diese
// ist recht komplex und wird nicht weiter erläutert. Da gibts später fertige Templates die man hier verwenden kann.
// wie am Fahrplan Beispiel zu sehen ist.
const fahrplan: any = {
heading: 'Fahrplan Script',
native: {
card: 'cardEntities',
dpInit: 'fahrplan.0.0',
uniqueID: 'fahrplanrouten',
template: 'entities.fahrplan.routes',
}
};
// Konfiguration findet im Admin statt, uniqueName muß gleich dem namen in der Adminkonfiguration sein.
const qrCode: PageType = {
type: 'cardQR',
uniqueName: 'qrCode'
};
// Ein Beispiel für eine Gridseite mit verschiedenen Farbskalen
const irgendeinName: PageType = {
type: 'cardGrid',
uniqueName: 'main',
heading: 'Wohnzimmer',
useColor: true,
items: [
{id: 'alias.0.Temperatur', name: 'standard', onColor: Red, offColor: Blue, colorScale: {'val_min': 0, 'val_max': 40}},
{id: 'alias.0.Temperatur', name: 'hue', onColor: Red, offColor: Blue, colorScale: {'val_min': 0, 'val_max': 40, mode: 'hue'}},
{id: 'alias.0.Temperatur', name: 'cie', onColor: Red, offColor: Blue, colorScale: {'val_min': 0, 'val_max': 40, mode: 'cie'}},
{id: 'alias.0.Temperatur', name: 'standard log min', onColor: Red, offColor: Blue, colorScale: {'val_min': 0, 'val_max': 40, log10: 'min'}},
{id: 'alias.0.Temperatur', name: 'hue log min', onColor: Red, offColor: Blue, colorScale: {'val_min': 0, 'val_max': 40, mode: 'hue', log10: 'min'}},
{id: 'alias.0.Temperatur', name: 'cie log min', onColor: Red, offColor: Blue, colorScale: {'val_min': 0, 'val_max': 40, mode: 'cie', log10: 'min'}},
{id: 'alias.0.Temperatur', name: 'standard', onColor: Red, offColor: Blue, colorScale: {'val_min': 0, 'val_max': 40}},
{id: 'alias.0.Temperatur', name: 'hue', onColor: Red, offColor: Blue, colorScale: {'val_min': 0, 'val_max': 40, mode: 'hue'}},
{id: 'alias.0.Temperatur', name: 'cie', onColor: Red, offColor: Blue, colorScale: {'val_min': 0, 'val_max': 40, mode: 'cie'}},
{id: 'alias.0.Temperatur', name: 'standard log max', onColor: Red, offColor: Blue, colorScale: {'val_min': 0, 'val_max': 40, log10: 'max'}},
{id: 'alias.0.Temperatur', name: 'hue log max', onColor: Red, offColor: Blue, colorScale: {'val_min': 0, 'val_max': 40, mode: 'hue', log10: 'max'}},
{id: 'alias.0.Temperatur', name: 'cie log max', onColor: Red, offColor: Blue, colorScale: {'val_min': 0, 'val_max': 40, mode: 'cie', log10: 'max'}},
]
};
const grid1: PageType = {
uniqueName: 'grid1', // keine Navigation, am besten uniqueName von config.ts übernehmen
heading: 'Grid 1',
items: [
{id: 'alias.0.Licht.lights.Gerät_1'},
{id: 'alias.0.Licht.lights.Gerät_2'},
{id: '0_userdata.0.Einzelne_Geräte.dimmer'},
{id: 'alias.0.NSPanel.allgemein.hue', },
{navigate: true, targetPage: 'fahrplanrouten'},
{id: 'alias.0.NSPanel.allgemein.shutter'}
],
type: 'cardGrid',
useColor: true
}
const config: ScriptConfig.Config = {
panelTopic: 'nspanel/ns_panel4',
weatherEntity: 'accuweather.0.',
defaultOffColor: Off,
defaultOnColor: On,
defaultBackgroundColor: HMIDark,
weatherAddDefaultItems: false,
// Als Gedankenstütze, die Hauptseite muß main heißen!
//panelName: 'NSPanel', //unique name for the panel
// Seiteneinteilung / Page division
// Hauptseiten / Mainpages
pages: [
irgendeinName,
grid1,
qrCode,
],
// Unterseiten / Subpages
subPages: [
fahrplan
],
/***********************************************************************
** **
** Screensaver Configuration **
** **
***********************************************************************/
favoritScreensaverEntity: [
{
type: 'template',
template: 'text.accuweather.favorit',
dpInit: `/^accuweather\\.0.+/`,
modeScr: 'favorit',
}
],
alternateScreensaverEntity: [
// only used with alternate Screensaver
],
indicatorScreensaverEntity: [
// indicatorScreensaverEntity 1 (only Advanced Screensaver)
{
type: 'script',
ScreensaverEntity: 'alias.0.NSPanel.allgemein.Status_offene_Fenster.ACTUAL',
ScreensaverEntityFactor: 1,
ScreensaverEntityDecimalPlaces: 0,
ScreensaverEntityIconOn: 'window-open-variant',
ScreensaverEntityIconOff: 'window-closed-variant',
ScreensaverEntityText: 'Fenster',
ScreensaverEntityUnitText: '%',
ScreensaverEntityIconColor: {val_min: 0, val_max: 1},
},
// indicatorScreensaverEntity 2 (only Advanced Screensaver)
{
type: 'script',
ScreensaverEntity: 'alias.0.NSPanel.allgemein.Status_offene_Tuer.ACTUAL',
ScreensaverEntityFactor: 1,
ScreensaverEntityDecimalPlaces: 0,
ScreensaverEntityIconOn: 'door-open',
ScreensaverEntityIconOff: 'door-closed',
ScreensaverEntityText: 'Tür',
ScreensaverEntityUnitText: '',
ScreensaverEntityIconColor: {val_min: 0, val_max: 1},
},
// indicatorScreensaverEntity 3 (only Advanced Screensaver)
{
type: 'script',
ScreensaverEntity: 'alias.0.NSPanel.allgemein.Status_Licht_An.ACTUAL',
ScreensaverEntityFactor: 1,
ScreensaverEntityDecimalPlaces: 0,
ScreensaverEntityIconOn: 'lightbulb',
ScreensaverEntityIconOff: null,
ScreensaverEntityText: 'Licht',
ScreensaverEntityUnitText: '',
ScreensaverEntityIconColor: {val_min: 0, val_max: 1},
},
// indicatorScreensaverEntity 4 (only Advanced Screensaver)
{
type: 'script',
ScreensaverEntity: 'alias.0.Türschloss.ACTUAL',
ScreensaverEntityFactor: 1,
ScreensaverEntityDecimalPlaces: 0,
ScreensaverEntityIconOn: 'lock',
ScreensaverEntityIconOff: 'lock-open',
ScreensaverEntityText: 'Türschloss',
ScreensaverEntityUnitText: '',
ScreensaverEntityIconColor: {val_min: 0, val_max: 1, val_best: 1},
},
// indicatorScreensaverEntity 5 (only Advanced Screensaver)
{
type: 'script',
ScreensaverEntity: 'alias.0.NSPanel.allgemein.Auto.Safety.ACTUAL',
ScreensaverEntityFactor: 1,
ScreensaverEntityDecimalPlaces: 0,
ScreensaverEntityIconOn: 'car-key',
ScreensaverEntityIconOff: null,
ScreensaverEntityText: 'Auto',
ScreensaverEntityUnitText: '',
ScreensaverEntityIconColor: {val_min: 0, val_max: 1, val_best: 1},
},
],
bottomScreensaverEntity: [
// bottomScreensaverEntity 1
{
type: 'script',
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
{
type: 'script',
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
{
type: 'script',
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
{
type: 'script',
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)
{
type: 'script',
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)
{
type: 'script',
ScreensaverEntity: '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
// Some templates for the screensaver uncomment the lines to use them
// If u use an other instance for the weather data, change the instance in the following lines
// If you want to have them all, set weatherAddDefaultItems=true in the config and leave the following lines as they are!
/*
// Bottom 1 - accuWeather.0. sunrise/set
{
type: 'template',
template: 'text.accuweather.sunriseset',
dpInit: `/^accuweather\\.0.Daily.+/`,
modeScr: 'bottom',
},
// Bottom 2 - accuWeather.0. Forecast Day 1
{
type: 'template',
template: 'text.accuweather.bot2values',
dpInit: `/^accuweather\\.0.+?d1$/g`,
modeScr: 'bottom',
},
// Bottom 3 - accuWeather.0. Forecast Day 2
{
type: 'template',
template: 'text.accuweather.bot2values',
dpInit: `/^accuweather\\.0.+?d2$/`,
modeScr: 'bottom',
},
// Bottom 4 - accuWeather.0. Forecast Day 3
{
type: 'template',
template: 'text.accuweather.bot2values',
dpInit: `/^accuweather\\.0.+?d3$/`,
modeScr: 'bottom',
},
// Bottom 5 - accuWeather.0. Forecast Day 4
{
type: 'template',
template: 'text.accuweather.bot2values',
dpInit: `/^accuweather\\.0.+?d4$/`,
modeScr: 'bottom',
},
// Bottom 6 - accuWeather.0. Forecast Day 5
{
type: 'template',
template: 'text.accuweather.bot2values',
dpInit: `/^accuweather\\.0.+?d5$/`,
modeScr: 'bottom',
},
// Bottom 7 - Windgeschwindigkeit
{
type: 'template',
template: 'text.accuweather.windspeed',
dpInit: `/^accuweather\\.0./`,
modeScr: 'bottom',
},
// Bottom 8 - Böen
{
type: 'template',
template: 'text.accuweather.windgust',
dpInit: `/^accuweather\\.0./`,
modeScr: 'bottom',
},
// Bottom 9 - Windrichtung
{
type: 'template',
template: 'text.accuweather.winddirection',
dpInit: `/^accuweather\\.0./`,
modeScr: 'bottom',
},
// Bottom 10 - UV-Index
{
type: 'template',
template: 'text.accuweather.uvindex',
dpInit: `/^accuweather\\.0./`,
modeScr: 'bottom',
},
*/
],
leftScreensaverEntity: [
// leftScreensaverEntity 1 (only Advanced Screensaver)
{
type: 'script',
ScreensaverEntity: 'alias.0.NSPanel.Flur.Sensor.ANALOG.Temperature.ACTUAL',
ScreensaverEntityFactor: 1,
ScreensaverEntityDecimalPlaces: 1,
ScreensaverEntityIconOn: 'thermometer',
ScreensaverEntityIconOff: null,
ScreensaverEntityText: 'Temperatur',
ScreensaverEntityUnitText: '°C',
ScreensaverEntityIconColor: {val_min: 0, val_max: 35, val_best: 22},
},
// leftScreensaverEntity 2 (only Advanced Screensaver)
{
type: 'script',
ScreensaverEntity: 'alias.0.Heizung.WärmeTagesVerbrauch.ACTUAL',
ScreensaverEntityFactor: 1,
ScreensaverEntityDecimalPlaces: 1,
ScreensaverEntityIconOn: 'counter',
ScreensaverEntityIconOff: null,
ScreensaverEntityText: 'Wärme',
ScreensaverEntityUnitText: ' kWh',
ScreensaverEntityIconColor: MSYellow, //{'val_min': 0, 'val_max': 5000}
},
// leftScreensaverEntity 3 (only Advanced Screensaver)
{
type: 'script',
ScreensaverEntity: 'alias.0.NSPanel.allgemein.Abfall.event1.INFO',
ScreensaverEntityFactor: 1,
ScreensaverEntityDecimalPlaces: 0,
ScreensaverEntityDateFormat: {year: 'numeric', month: '2-digit', day: '2-digit'},
ScreensaverEntityIconOn: 'trash-can',
ScreensaverEntityIconOff: null,
ScreensaverEntityText: 'Abfall',
ScreensaverEntityUnitText: '',
ScreensaverEntityIconColor: '0_userdata.0.Abfallkalender.1.color',
},
],
// Status Icon
mrIcon1ScreensaverEntity: {
type: 'script',
ScreensaverEntity: 'Relay.1',
ScreensaverEntityIconOn: 'lightbulb',
ScreensaverEntityIconOff: null,
ScreensaverEntityValue: null,
ScreensaverEntityValueDecimalPlace: 0,
ScreensaverEntityValueUnit: null,
ScreensaverEntityOnColor: On,
ScreensaverEntityOffColor: HMIOff
},
mrIcon2ScreensaverEntity: {
type: 'script',
ScreensaverEntity: '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!!
};
/**
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
* END STOP END STOP END - No more configuration - END STOP END STOP END *
********************************************************************************
* For a update copy and paste the code below from orginal file. *
* ******************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
*/
log(await sendToAsync('nspanel-lovelace-ui.0', 'ScriptConfig', {...config, version}))
}
const version = '0.5.0';
const HMIOff = {red: 68, green: 115, blue: 158}; // Blue-Off - Original Entity Off
const HMIOn = {red: 3, green: 169, blue: 244}; // Blue-On
const HMIDark = {red: 29, green: 29, blue: 29}; // Original Background Color
const Off = {red: 253, green: 128, blue: 0}; // Orange-Off - nicer color transitions
const On = {red: 253, green: 216, blue: 53};
const MSRed = {red: 251, green: 105, blue: 98};
const MSYellow = {red: 255, green: 235, blue: 156};
const MSGreen = {red: 121, green: 222, blue: 121};
const Red = {red: 255, green: 0, blue: 0};
const White = {red: 255, green: 255, blue: 255};
const Yellow = {red: 255, green: 255, blue: 0};
const Green = {red: 0, green: 255, blue: 0};
const Blue = {red: 0, green: 0, blue: 255};
const DarkBlue = {red: 0, green: 0, blue: 136};
const Gray = {red: 136, green: 136, blue: 136};
const Black = {red: 0, green: 0, blue: 0};
const Cyan = {red: 0, green: 255, blue: 255};
const Magenta = {red: 255, green: 0, blue: 255};
const colorSpotify = {red: 30, green: 215, blue: 96};
const colorAlexa = {red: 49, green: 196, blue: 243};
const colorSonos = {red: 216, green: 161, blue: 88};
const colorRadio = {red: 255, green: 127, blue: 0};
const BatteryFull = {red: 96, green: 176, blue: 62};
const BatteryEmpty = {red: 179, green: 45, blue: 25};
//Menu Icon Colors
const Menu = {red: 150, green: 150, blue: 100};
const MenuLowInd = {red: 255, green: 235, blue: 156};
const MenuHighInd = {red: 251, green: 105, blue: 98};
//Dynamische Indikatoren (Abstufung grün nach gelb nach rot)
const colorScale0 = {red: 99, green: 190, blue: 123};
const colorScale1 = {red: 129, green: 199, blue: 126};
const colorScale2 = {red: 161, green: 208, blue: 127};
const colorScale3 = {red: 129, green: 217, blue: 126};
const colorScale4 = {red: 222, green: 226, blue: 131};
const colorScale5 = {red: 254, green: 235, blue: 132};
const colorScale6 = {red: 255, green: 210, blue: 129};
const colorScale7 = {red: 251, green: 185, blue: 124};
const colorScale8 = {red: 251, green: 158, blue: 117};
const colorScale9 = {red: 248, green: 131, blue: 111};
const colorScale10 = {red: 248, green: 105, blue: 107};
//Screensaver Default Theme Colors
const scbackground = {red: 0, green: 0, blue: 0};
const scbackgroundInd1 = {red: 255, green: 0, blue: 0};
const scbackgroundInd2 = {red: 121, green: 222, blue: 121};
const scbackgroundInd3 = {red: 255, green: 255, blue: 0};
const sctime = {red: 255, green: 255, blue: 255};
const sctimeAMPM = {red: 255, green: 255, blue: 255};
const scdate = {red: 255, green: 255, blue: 255};
const sctMainIcon = {red: 255, green: 255, blue: 255};
const sctMainText = {red: 255, green: 255, blue: 255};
const sctForecast1 = {red: 255, green: 255, blue: 255};
const sctForecast2 = {red: 255, green: 255, blue: 255};
const sctForecast3 = {red: 255, green: 255, blue: 255};
const sctForecast4 = {red: 255, green: 255, blue: 255};
const sctF1Icon = {red: 255, green: 235, blue: 156};
const sctF2Icon = {red: 255, green: 235, blue: 156};
const sctF3Icon = {red: 255, green: 235, blue: 156};
const sctF4Icon = {red: 255, green: 235, blue: 156};
const sctForecast1Val = {red: 255, green: 255, blue: 255};
const sctForecast2Val = {red: 255, green: 255, blue: 255};
const sctForecast3Val = {red: 255, green: 255, blue: 255};
const sctForecast4Val = {red: 255, green: 255, blue: 255};
const scbar = {red: 255, green: 255, blue: 255};
const sctMainIconAlt = {red: 255, green: 255, blue: 255};
const sctMainTextAlt = {red: 255, green: 255, blue: 255};
const sctTimeAdd = {red: 255, green: 255, blue: 255};
//Auto-Weather-Colors
const swClearNight = {red: 150, green: 150, blue: 100};
const swCloudy = {red: 75, green: 75, blue: 75};
const swExceptional = {red: 255, green: 50, blue: 50};
const swFog = {red: 150, green: 150, blue: 150};
const swHail = {red: 200, green: 200, blue: 200};
const swLightning = {red: 200, green: 200, blue: 0};
const swLightningRainy = {red: 200, green: 200, blue: 150};
const swPartlycloudy = {red: 150, green: 150, blue: 150};
const swPouring = {red: 50, green: 50, blue: 255};
const swRainy = {red: 100, green: 100, blue: 255};
const swSnowy = {red: 150, green: 150, blue: 150};
const swSnowyRainy = {red: 150, green: 150, blue: 255};
const swSunny = {red: 255, green: 255, blue: 0};
const swWindy = {red: 150, green: 150, blue: 150};
type PageType = ScriptConfig.PageType;
type Config = ScriptConfig.Config;
type PageBaseType = ScriptConfig.PageBaseType;
type PageItem = ScriptConfig.PageItem;
type PageBaseItem = ScriptConfig.PageBaseItem;
type PageMediaItem = ScriptConfig.PageMediaItem;
type PageThermoItem = ScriptConfig.PageThermoItem;
type PageEntities = ScriptConfig.PageEntities;
type PageGrid = ScriptConfig.PageGrid;
type PageGrid2 = ScriptConfig.PageGrid2;
type PageGrid3 = ScriptConfig.PageGrid3;
type PageThermo = ScriptConfig.PageThermo;
type PageMedia = ScriptConfig.PageMedia;
type PageAlarm = ScriptConfig.PageAlarm;
type PageUnlock = ScriptConfig.PageUnlock;
type PageQR = ScriptConfig.PageQR;
type PagePower = ScriptConfig.PagePower;
type PageChart = ScriptConfig.PageChart;
type PagetypeType = ScriptConfig.PagetypeType;
type NavigationItemConfig = ScriptConfig.NavigationItemConfig;
declare namespace ScriptConfig {
export type PopupType =
| 'popupFan'
| 'popupInSel'
| 'popupLight'
| 'popupLightNew'
| 'popupNotify'
| 'popupShutter'
| 'popupThermo'
| 'popupTimer';
export type EventMethod =
| 'startup'
| 'sleepReached'
| 'pageOpenDetail'
| 'buttonPress2'
| 'renderCurrentPage'
| 'button1'
| 'button2';
export type panelRecvType = {
event: 'event';
method: EventMethod;
};
export type NavigationItemConfig = {
name: string;
left?: {
single?: string;
double?: string;
};
right?: {
single?: string;
double?: string;
};
page: string;
optional?: never;
} | null;
export type SerialType = 'button' | 'light' | 'shutter' | 'text' | 'input_sel' | 'timer' | 'number' | 'fan';
/**
* Defines the possible roles for entities in the NSPanel.
*
* This type represents the various roles that entities can have within the NSPanel system.
*
*/
export type roles =
| 'light'
| 'socket'
| 'dimmer'
| 'hue'
| 'rgb'
| 'rgbSingle'
| 'ct'
| 'blind'
| 'door'
| 'window'
| 'volumeGroup'
| 'volume'
| 'info'
| 'humidity'
| 'temperature'
| 'value.temperature'
| 'value.humidity'
| 'thermostat'
| 'warning'
| 'cie'
| 'gate'
| 'motion'
| 'buttonSensor'
| 'button'
| 'value.time'
| 'level.timer'
| 'value.alarmtime'
| 'level.mode.fan'
| 'lock'
| 'slider'
| 'switch.mode.wlan'
| 'media'
| 'timeTable'
| 'airCondition';
export type ButtonActionType =
| 'bExit'
| 'bUp'
| 'bNext'
| 'bSubNext'
| 'bPrev'
| 'bSubPrev'
| 'bHome'
| 'notifyAction'
| 'OnOff'
| 'button'
| 'up'
| 'stop'
| 'down'
| 'positionSlider'
| 'tiltOpen'
| 'tiltStop'
| 'tiltSlider'
| 'tiltClose'
| 'brightnessSlider'
| 'colorTempSlider'
| 'colorWheel'
| 'tempUpd'
| 'tempUpdHighLow'
| 'media-back'
| 'media-pause'
| 'media-next'
| 'media-shuffle'
| 'volumeSlider'
| 'mode-speakerlist'
| 'mode-playlist'
| 'mode-tracklist'
| 'mode-repeat'
| 'mode-equalizer'
| 'mode-seek'
| 'mode-crossfade'
| 'mode-favorites'
| 'mode-insel'
| 'media-OnOff'
| 'timer-start'
| 'timer-pause'
| 'timer-cancle'
| 'timer-finish'
| 'hvac_action'
| 'mode-modus1'
| 'mode-modus2'
| 'mode-modus3'
| 'number-set'
| 'mode-preset_modes'
| 'A1'
| 'A2'
| 'A3'
| 'A4'
| 'D1'
| 'U1'
| 'f1Icon'
| 'f2Icon'
| 'f3Icon'
| 'f4Icon'
| 'f5Icon';
export type RGB = {
red: number;
green: number;
blue: number;
};
export type Payload = {
payload: string;
};
export type PageBaseType = {
type: PagetypeType;
uniqueName?: string;
heading: string;
items: PageItem[];
useColor: boolean;
subPage?: boolean;
parent?: string;
parentIcon?: string;
parentIconColor?: RGB;
prev?: string;
prevIcon?: string;
prevIconColor?: RGB;
next?: string;
nextIcon?: string;
nextIconColor?: RGB;
home?: string;
homeIcon?: string;
homeIconColor?: RGB;
hiddenByTrigger?: boolean;
};
export type PagetypeType =
| 'cardChart'
| 'cardLChart'
| 'cardEntities'
| 'cardGrid'
| 'cardGrid2'
| 'cardGrid3'
| 'cardThermo'
| 'cardMedia'
| 'cardUnlock'
| 'cardQR'
| 'cardAlarm'
| 'cardPower'; //| 'cardBurnRec'
export type PageType =
| PageChart
| PageEntities
| PageGrid
| PageGrid2
| PageGrid3
| PageThermo
| PageMedia
| PageUnlock
| PageQR
| PageAlarm
| PagePower
| {type: undefined; heading?: string; native: any};
export type PageEntities = {
type: 'cardEntities';
items: PageItem[];
} & PageBaseType;
export type PageGrid = {
type: 'cardGrid';
items: PageItem[];
} & PageBaseType;
export type PageGrid2 = {
type: 'cardGrid2';
items: PageItem[];
} & PageBaseType;
export type PageGrid3 = {
type: 'cardGrid3';
items: PageItem[];
} & PageBaseType;
export type PageThermo = {
type: 'cardThermo';
items: [PageThermoItem];
} & Omit<PageBaseType, 'useColor'>;
export type PageMedia = {
type: 'cardMedia';
items: [PageMediaItem];
} & Omit<PageBaseType, 'useColor' | 'autoCreateAlias'>;
export type PageAlarm = {
type: 'cardAlarm';
items: [PageItem];
} & Omit<PageBaseType, 'useColor'>;
export type PageUnlock = {
type: 'cardUnlock';
items: [PageItem];
} & Omit<PageBaseType, 'useColor'> &
Partial<Pick<PageBaseType, 'useColor'>>;
export type PageQR = {
type: 'cardQR';
} & Omit<PageBaseType, 'useColor' | 'heading' | 'items'>;
export type PagePower = {
type: 'cardPower';
items: [PageItem];
} & Omit<PageBaseType, 'useColor'>;
export type PageChart = {
type: 'cardChart' | 'cardLChart';
items: PageItem[];
} & Omit<PageBaseType, 'useColor'>;
export type PageItem = PageBaseItem | PageMediaItem | PageThermoItem;
export type PageMediaItem = {
adapterPlayerInstance: adapterPlayerInstanceType;
mediaDevice?: string;
colorMediaIcon?: RGB;
colorMediaArtist?: RGB;
colorMediaTitle?: RGB;
speakerList?: string[];
playList?: string[];
equalizerList?: string[];
repeatList?: string[];
globalTracklist?: string[];
crossfade?: boolean;
} & PageBaseItem;
export type PageThermoItem = {
popupThermoMode1?: string[];
popupThermoMode2?: string[];
popupThermoMode3?: string[];
popUpThermoName?: string[];
setThermoAlias?: string[];
setThermoDestTemp2?: string;
} & PageBaseItem;
// mean string start with getState(' and end with ').val
type getStateID = string;
export type PageBaseItem = {
uniqueName?: string;
role?: string;
/**
* The data point with the data to be used.
*/
id?: string | null;
/**
* The icon that is used in the standard case or if ID is true
*/
icon?: string;
/**
* The icon that is used when id is false
*/
icon2?: string;
/**
* Used with blinds for partially open.
*/
icon3?: string;
/**
* The color that is used in the standard case or if ID is true
*/
onColor?: RGB;
/**
* The color that is used when id is false
*/
offColor?: RGB;
useColor?: boolean;
/**
* Interpolate the icon colour by ID
*/
interpolateColor?: boolean;
minValueBrightness?: number;
maxValueBrightness?: number;
minValueColorTemp?: number;
maxValueColorTemp?: number;
minValueLevel?: number;
maxValueLevel?: number;
minValueTilt?: number;
maxValueTilt?: number;
minValue?: number;
maxValue?: number;
stepValue?: number;
prefixName?: string;
suffixName?: string;
name?: string;
secondRow?: string;
buttonText?: string;
unit?: string;
navigate?: boolean;
colormode?: string;
colorScale?: IconScaleElement;
targetPage?: string;
modeList?: string[];
hidePassword?: boolean;
autoCreateALias?: boolean;
yAxis?: string;
yAxisTicks?: number[] | string;
xAxisDecorationId?: string;
useValue?: boolean;
monobutton?: boolean;
inSel_ChoiceState?: boolean;
iconArray?: string[];
customIcons?: any[];
fontSize?: number;
actionStringArray?: string[];
alwaysOnDisplay?: boolean;
};
export type DimMode = {
dimmodeOn: boolean | undefined;
brightnessDay: number | undefined;
brightnessNight: number | undefined;
timeDay: string | undefined;
timeNight: string | undefined;
};
export type ConfigButtonFunction = {
mode: 'page' | 'toggle' | 'set' | null;
page:
| PageThermo
| PageMedia
| PageAlarm
| PageQR
| PageEntities
| PageGrid
| PageGrid2
| PagePower
| PageChart
| PageUnlock
| null;
entity: string | null;
setValue: string | number | boolean | null;
setOn?: {dp: string; val: iobJS.StateValue};
setOff?: {dp: string; val: iobJS.StateValue};
};
export type Config = {
version?: string;
panelName?: string;
/**
* The topic to receive and send messages to the panel.
*/
panelTopic: string;
/**
* The weather adapter and instance to use.
* example: accuweather.0
* supported: accuweather
*/
weatherEntity: string;
/**
* Adds standard icons to the bottom field of the screensaver.
*/
weatherAddDefaultItems?: boolean;
favoritScreensaverEntity: ScreenSaverElement[]
alternateScreensaverEntity: ScreenSaverElement[]
leftScreensaverEntity: ScreenSaverElementWithUndefined[];
bottomScreensaverEntity: ScreenSaverElement[];
indicatorScreensaverEntity: ScreenSaverElementWithUndefined[];
mrIcon1ScreensaverEntity: ScreenSaverMRElement;
mrIcon2ScreensaverEntity: ScreenSaverMRElement;
/**
* The default color for the panel.
* @deprecated use defaultOnColor and defaultOffColor
*/
defaultColor?: RGB;
defaultOnColor: RGB;
defaultOffColor: RGB;
defaultBackgroundColor: RGB;
pages: PageType[];
subPages: PageType[];
button1: ConfigButtonFunction;
button2: ConfigButtonFunction;
nativePages?: any[];
navigation?: NavigationItemConfig[];
advancedOptions?: {
/**
* active the swipe function for the screensaver
*/
screensaverSwipe?: boolean;
/**
* active the button function for the indicator of the screensaver
*/
screensaverIndicatorButtons?: boolean;
};
};
export type leftScreensaverEntityType =
| [ScreenSaverElementWithUndefined?, ScreenSaverElementWithUndefined?, ScreenSaverElementWithUndefined?]
| [];
export type indicatorScreensaverEntityType =
| [
ScreenSaverElementWithUndefined?,
ScreenSaverElementWithUndefined?,
ScreenSaverElementWithUndefined?,
ScreenSaverElementWithUndefined?,
ScreenSaverElementWithUndefined?,
]
| [];
export type ScreenSaverElementWithUndefined = null | undefined | ScreenSaverElement;