mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-15 17:36:59 +01:00
Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui
This commit is contained in:
@@ -1424,6 +1424,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1710,6 +1710,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1741,6 +1741,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -72,20 +72,20 @@ cardThermo
|
|||||||
319 Unique line(s) of event code
|
319 Unique line(s) of event code
|
||||||
cardGrid
|
cardGrid
|
||||||
44 Component(s)
|
44 Component(s)
|
||||||
579 Line(s) of event code
|
583 Line(s) of event code
|
||||||
330 Unique line(s) of event code
|
332 Unique line(s) of event code
|
||||||
cardMedia
|
cardGrid2
|
||||||
59 Component(s)
|
52 Component(s)
|
||||||
699 Line(s) of event code
|
693 Line(s) of event code
|
||||||
354 Unique line(s) of event code
|
384 Unique line(s) of event code
|
||||||
popupLight
|
popupLight
|
||||||
28 Component(s)
|
28 Component(s)
|
||||||
412 Line(s) of event code
|
412 Line(s) of event code
|
||||||
227 Unique line(s) of event code
|
227 Unique line(s) of event code
|
||||||
cardGrid2
|
cardMedia
|
||||||
52 Component(s)
|
59 Component(s)
|
||||||
689 Line(s) of event code
|
703 Line(s) of event code
|
||||||
382 Unique line(s) of event code
|
356 Unique line(s) of event code
|
||||||
cardEntities
|
cardEntities
|
||||||
67 Component(s)
|
67 Component(s)
|
||||||
1194 Line(s) of event code
|
1194 Line(s) of event code
|
||||||
@@ -98,5 +98,5 @@ screensaver2
|
|||||||
Total
|
Total
|
||||||
23 Page(s)
|
23 Page(s)
|
||||||
875 Component(s)
|
875 Component(s)
|
||||||
10556 Line(s) of event code
|
10568 Line(s) of event code
|
||||||
2450 Unique line(s) of event code
|
2450 Unique line(s) of event code
|
||||||
|
|||||||
@@ -976,6 +976,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1174,6 +1174,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1253,6 +1253,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
+++ /dev/fd/62 2023-10-14 14:36:40.102098093 +0000
|
||||||
+I/n2t-out/Program.s.txt
|
+I/n2t-out/Program.s.txt
|
||||||
++ HMI/US/portrait/n2t-out/Program.s.txt
|
++ HMI/US/portrait/n2t-out/Program.s.txt
|
||||||
+1 +12,11 @@
|
+1 +12,11 @@
|
||||||
|
|||||||
@@ -1424,6 +1424,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1853,6 +1853,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1741,6 +1741,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ cardChart
|
|||||||
33 Component(s)
|
33 Component(s)
|
||||||
437 Line(s) of event code
|
437 Line(s) of event code
|
||||||
296 Unique line(s) of event code
|
296 Unique line(s) of event code
|
||||||
cardGrid
|
cardGrid2
|
||||||
44 Component(s)
|
56 Component(s)
|
||||||
579 Line(s) of event code
|
748 Line(s) of event code
|
||||||
330 Unique line(s) of event code
|
410 Unique line(s) of event code
|
||||||
cardLChart
|
cardLChart
|
||||||
33 Component(s)
|
33 Component(s)
|
||||||
402 Line(s) of event code
|
402 Line(s) of event code
|
||||||
@@ -62,14 +62,14 @@ popupInSel
|
|||||||
34 Component(s)
|
34 Component(s)
|
||||||
621 Line(s) of event code
|
621 Line(s) of event code
|
||||||
297 Unique line(s) of event code
|
297 Unique line(s) of event code
|
||||||
|
cardGrid
|
||||||
|
44 Component(s)
|
||||||
|
583 Line(s) of event code
|
||||||
|
332 Unique line(s) of event code
|
||||||
cardAlarm
|
cardAlarm
|
||||||
43 Component(s)
|
43 Component(s)
|
||||||
500 Line(s) of event code
|
500 Line(s) of event code
|
||||||
273 Unique line(s) of event code
|
273 Unique line(s) of event code
|
||||||
cardMedia
|
|
||||||
59 Component(s)
|
|
||||||
699 Line(s) of event code
|
|
||||||
354 Unique line(s) of event code
|
|
||||||
cardThermo
|
cardThermo
|
||||||
57 Component(s)
|
57 Component(s)
|
||||||
540 Line(s) of event code
|
540 Line(s) of event code
|
||||||
@@ -90,13 +90,13 @@ cardEntities
|
|||||||
91 Component(s)
|
91 Component(s)
|
||||||
1666 Line(s) of event code
|
1666 Line(s) of event code
|
||||||
711 Unique line(s) of event code
|
711 Unique line(s) of event code
|
||||||
cardGrid2
|
cardMedia
|
||||||
56 Component(s)
|
59 Component(s)
|
||||||
744 Line(s) of event code
|
703 Line(s) of event code
|
||||||
408 Unique line(s) of event code
|
356 Unique line(s) of event code
|
||||||
|
|
||||||
Total
|
Total
|
||||||
23 Page(s)
|
23 Page(s)
|
||||||
890 Component(s)
|
890 Component(s)
|
||||||
11017 Line(s) of event code
|
11029 Line(s) of event code
|
||||||
2600 Unique line(s) of event code
|
2600 Unique line(s) of event code
|
||||||
|
|||||||
@@ -976,6 +976,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1273,6 +1273,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1253,6 +1253,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1424,6 +1424,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1710,6 +1710,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1741,6 +1741,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ popupNotify
|
|||||||
172 Unique line(s) of event code
|
172 Unique line(s) of event code
|
||||||
cardGrid
|
cardGrid
|
||||||
44 Component(s)
|
44 Component(s)
|
||||||
579 Line(s) of event code
|
583 Line(s) of event code
|
||||||
330 Unique line(s) of event code
|
332 Unique line(s) of event code
|
||||||
cardQR
|
cardQR
|
||||||
34 Component(s)
|
34 Component(s)
|
||||||
410 Line(s) of event code
|
410 Line(s) of event code
|
||||||
@@ -62,14 +62,10 @@ cardThermo
|
|||||||
57 Component(s)
|
57 Component(s)
|
||||||
540 Line(s) of event code
|
540 Line(s) of event code
|
||||||
319 Unique line(s) of event code
|
319 Unique line(s) of event code
|
||||||
cardGrid2
|
|
||||||
52 Component(s)
|
|
||||||
689 Line(s) of event code
|
|
||||||
382 Unique line(s) of event code
|
|
||||||
cardMedia
|
cardMedia
|
||||||
59 Component(s)
|
59 Component(s)
|
||||||
699 Line(s) of event code
|
703 Line(s) of event code
|
||||||
354 Unique line(s) of event code
|
356 Unique line(s) of event code
|
||||||
popupInSel
|
popupInSel
|
||||||
34 Component(s)
|
34 Component(s)
|
||||||
621 Line(s) of event code
|
621 Line(s) of event code
|
||||||
@@ -90,6 +86,10 @@ popupThermo
|
|||||||
44 Component(s)
|
44 Component(s)
|
||||||
523 Line(s) of event code
|
523 Line(s) of event code
|
||||||
276 Unique line(s) of event code
|
276 Unique line(s) of event code
|
||||||
|
cardGrid2
|
||||||
|
52 Component(s)
|
||||||
|
693 Line(s) of event code
|
||||||
|
384 Unique line(s) of event code
|
||||||
cardEntities
|
cardEntities
|
||||||
67 Component(s)
|
67 Component(s)
|
||||||
1194 Line(s) of event code
|
1194 Line(s) of event code
|
||||||
@@ -98,5 +98,5 @@ cardEntities
|
|||||||
Total
|
Total
|
||||||
23 Page(s)
|
23 Page(s)
|
||||||
878 Component(s)
|
878 Component(s)
|
||||||
10576 Line(s) of event code
|
10588 Line(s) of event code
|
||||||
2459 Unique line(s) of event code
|
2459 Unique line(s) of event code
|
||||||
|
|||||||
@@ -976,6 +976,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1174,6 +1174,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1253,6 +1253,10 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
|
if(tId.txt=="cardLChart")
|
||||||
|
{
|
||||||
|
page cardLChart
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -96,16 +96,17 @@ class LuiPagesGen(object):
|
|||||||
if state == "sunny":
|
if state == "sunny":
|
||||||
icon_color = 65504 #bright-yellow
|
icon_color = 65504 #bright-yellow
|
||||||
|
|
||||||
if "rgb_color" in attr:
|
if "rgb_color" in attr and attr.rgb_color:
|
||||||
color = attr.rgb_color
|
color = attr.rgb_color
|
||||||
if "brightness" in attr:
|
if "brightness" in attr and attr.brightness:
|
||||||
color = rgb_brightness(color, attr.brightness)
|
color = rgb_brightness(color, attr.brightness)
|
||||||
icon_color = rgb_dec565(color)
|
icon_color = rgb_dec565(color)
|
||||||
elif "brightness" in attr:
|
elif "brightness" in attr and attr.brightness:
|
||||||
color = rgb_brightness([253, 216, 53], attr.brightness)
|
color = rgb_brightness([253, 216, 53], attr.brightness)
|
||||||
icon_color = rgb_dec565(color)
|
icon_color = rgb_dec565(color)
|
||||||
return icon_color
|
return icon_color
|
||||||
|
|
||||||
|
|
||||||
def update_time(self, kwargs):
|
def update_time(self, kwargs):
|
||||||
time = datetime.datetime.now().strftime(self._config.get("timeFormat"))
|
time = datetime.datetime.now().strftime(self._config.get("timeFormat"))
|
||||||
addTemplate = self._config.get("timeAdditionalTemplate")
|
addTemplate = self._config.get("timeAdditionalTemplate")
|
||||||
@@ -418,7 +419,7 @@ class LuiPagesGen(object):
|
|||||||
font = 3
|
font = 3
|
||||||
elif isinstance(item.font, int):
|
elif isinstance(item.font, int):
|
||||||
font = item.font
|
font = item.font
|
||||||
icon_id += f'{icon_id}¬{font}'
|
icon_id = f'{icon_id}¬{font}'
|
||||||
return f"~{entityTypePanel}~{entityId}~{icon_id}~{color}~{name}~{value}"
|
return f"~{entityTypePanel}~{entityId}~{icon_id}~{color}~{name}~{value}"
|
||||||
|
|
||||||
def generate_entities_page(self, navigation, heading, items, cardType, tempUnit):
|
def generate_entities_page(self, navigation, heading, items, cardType, tempUnit):
|
||||||
@@ -787,13 +788,13 @@ class LuiPagesGen(object):
|
|||||||
if "onoff" not in entity.attributes.supported_color_modes:
|
if "onoff" not in entity.attributes.supported_color_modes:
|
||||||
brightness = 0
|
brightness = 0
|
||||||
if entity.state == "on":
|
if entity.state == "on":
|
||||||
if "brightness" in entity.attributes:
|
if "brightness" in entity.attributes and entity.attributes.brightness:
|
||||||
# scale 0-255 brightness from ha to 0-100
|
# scale 0-255 brightness from ha to 0-100
|
||||||
brightness = int(scale(entity.attributes.brightness,(0,255),(0,100)))
|
brightness = int(scale(entity.attributes.brightness,(0,255),(0,100)))
|
||||||
else:
|
else:
|
||||||
brightness = "disable"
|
brightness = "disable"
|
||||||
if "color_temp" in entity.attributes.supported_color_modes:
|
if "color_temp" in entity.attributes.supported_color_modes and entity.attributes.supported_color_modes:
|
||||||
if "color_temp" in entity.attributes:
|
if "color_temp" in entity.attributes and entity.attributes.color_temp:
|
||||||
# scale ha color temp range to 0-100
|
# scale ha color temp range to 0-100
|
||||||
color_temp = int(scale(entity.attributes.color_temp,(entity.attributes.min_mireds, entity.attributes.max_mireds),(0,100)))
|
color_temp = int(scale(entity.attributes.color_temp,(entity.attributes.min_mireds, entity.attributes.max_mireds),(0,100)))
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -57,8 +57,8 @@
|
|||||||
"comfort": "Komfort",
|
"comfort": "Komfort",
|
||||||
"eco": "Eko",
|
"eco": "Eko",
|
||||||
"home": "Doma",
|
"home": "Doma",
|
||||||
"none": "Žiadny",
|
"none": "Žiadna",
|
||||||
"sleep": "Pohotovostný režim"
|
"sleep": "Spánok"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"humidifier": {
|
"humidifier": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*-----------------------------------------------------------------------
|
/*-----------------------------------------------------------------------
|
||||||
TypeScript v4.3.1.5 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @TT-Tom / @Sternmiere / @Britzelpuf / @ravenS0ne
|
TypeScript v4.3.2.1 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @TT-Tom / @Sternmiere / @Britzelpuf / @ravenS0ne
|
||||||
- abgestimmt auf TFT 53 / v4.3.1 / BerryDriver 9 / Tasmota 13.1.0
|
- abgestimmt auf TFT 53 / v4.3.2 / BerryDriver 9 / Tasmota 13.2.0
|
||||||
@joBr99 Projekt: https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker
|
@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
|
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)
|
icon_mapping.ts: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/icon_mapping.ts (TypeScript muss in global liegen)
|
||||||
@@ -19,7 +19,7 @@ Achtung Änderung des Sonoff ESP-Temperatursensors
|
|||||||
!!! Bitte "SetOption146 1" in der Tasmota-Console ausführen !!!
|
!!! Bitte "SetOption146 1" in der Tasmota-Console ausführen !!!
|
||||||
************************************************************************************************
|
************************************************************************************************
|
||||||
In bestimmten Situationen kommt es vor, dass sich das Panel mit FlashNextion
|
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 Dowengrade
|
unter Tasmota > 12.2.0 nicht flashen lässt. Für den Fall ein Tasmota Downgrade
|
||||||
durchführen und FlashNextion wiederholen.
|
durchführen und FlashNextion wiederholen.
|
||||||
************************************************************************************************
|
************************************************************************************************
|
||||||
Ab Tasmota > 13.0.0 ist für ein Upgrade ggfs. eine Umpartitionierung erforderlich
|
Ab Tasmota > 13.0.0 ist für ein Upgrade ggfs. eine Umpartitionierung erforderlich
|
||||||
@@ -178,6 +178,10 @@ ReleaseNotes:
|
|||||||
- 03.10.2023 - v4.3.1.4 Removing the examples from the NSPanelTs.ts --> https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Page-%E2%80%90-Typen_How-2_Beispiele
|
- 03.10.2023 - v4.3.1.4 Removing the examples from the NSPanelTs.ts --> https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Page-%E2%80%90-Typen_How-2_Beispiele
|
||||||
- 03.10.2023 - v4.3.1.4 Delete NsPanelTs_without_Examples.ts
|
- 03.10.2023 - v4.3.1.4 Delete NsPanelTs_without_Examples.ts
|
||||||
- 12.10.2023 - v4.3.1.5 Fix Datapoint for Role timetable -> Attention use new script from TT-Tom https://github.com/tt-tom17/MyScripts/blob/main/Sonoff_NSPanel/Fahrplan_to_NSPanel.ts
|
- 12.10.2023 - v4.3.1.5 Fix Datapoint for Role timetable -> Attention use new script from TT-Tom https://github.com/tt-tom17/MyScripts/blob/main/Sonoff_NSPanel/Fahrplan_to_NSPanel.ts
|
||||||
|
- 19.10.2023 - v4.3.1.6 Add more Alias Device-Types to Navigation / Minor Fixes
|
||||||
|
- 22.10.2023 - v4.3.1.7 Fix CreateEntity (navigate) role 'light' and 'socket' and 'temperature'
|
||||||
|
- 30.10.2023 - v4.3.2 Upgrade TFT 53 / 4.3.2
|
||||||
|
- 30.10.2023 - v4.3.2.1 Fix formatDate/Date.parse with moment.js (Bugs in JS-Methodes)
|
||||||
|
|
||||||
Todo:
|
Todo:
|
||||||
- XX.XX.XXXX - v4.4.0 Change the bottomScreensaverEntity (rolling) if more than 6 entries are defined
|
- XX.XX.XXXX - v4.4.0 Change the bottomScreensaverEntity (rolling) if more than 6 entries are defined
|
||||||
@@ -270,7 +274,7 @@ Erforderliche Adapter:
|
|||||||
|
|
||||||
Upgrades in Konsole:
|
Upgrades in Konsole:
|
||||||
Tasmota BerryDriver : Backlog UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; Restart 1
|
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.3.1.tft
|
TFT EU STABLE Version : FlashNextion http://nspanel.pky.eu/lovelace-ui/github/nspanel-v4.3.2.tft
|
||||||
---------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -741,7 +745,7 @@ export const config = <Config> {
|
|||||||
ScreensaverEntity: 'accuweather.0.Daily.Day1.Sunrise',
|
ScreensaverEntity: 'accuweather.0.Daily.Day1.Sunrise',
|
||||||
ScreensaverEntityFactor: 1,
|
ScreensaverEntityFactor: 1,
|
||||||
ScreensaverEntityDecimalPlaces: 0,
|
ScreensaverEntityDecimalPlaces: 0,
|
||||||
ScreensaverEntityDateFormat: 'hh:mm', // like DD.MM or DD.MM.YY or YYYY/MM/DD or hh:mm
|
ScreensaverEntityDateFormat: { hour: '2-digit', minute: '2-digit' }, // Description at Wiki-Pages
|
||||||
ScreensaverEntityIconOn: 'weather-sunset-up',
|
ScreensaverEntityIconOn: 'weather-sunset-up',
|
||||||
ScreensaverEntityIconOff: null,
|
ScreensaverEntityIconOff: null,
|
||||||
ScreensaverEntityText: 'Sonne',
|
ScreensaverEntityText: 'Sonne',
|
||||||
@@ -871,9 +875,12 @@ export const config = <Config> {
|
|||||||
// _________________________________ Ab hier keine Konfiguration mehr _____________________________________
|
// _________________________________ Ab hier keine Konfiguration mehr _____________________________________
|
||||||
|
|
||||||
const request = require('request');
|
const request = require('request');
|
||||||
|
const moment = require('moment');
|
||||||
|
const parseFormat = require('moment-parseformat');
|
||||||
|
moment.locale(getState(NSPanel_Path + 'Config.locale').val);
|
||||||
|
|
||||||
//Desired Firmware
|
//Desired Firmware
|
||||||
const tft_version: string = 'v4.3.1';
|
const tft_version: string = 'v4.3.2';
|
||||||
const desired_display_firmware_version = 53;
|
const desired_display_firmware_version = 53;
|
||||||
const berry_driver_version = 9;
|
const berry_driver_version = 9;
|
||||||
const tasmotaOtaUrl: string = 'http://ota.tasmota.com/tasmota32/release/';
|
const tasmotaOtaUrl: string = 'http://ota.tasmota.com/tasmota32/release/';
|
||||||
@@ -972,7 +979,7 @@ CheckMQTTPorts();
|
|||||||
|
|
||||||
async function Init_Release() {
|
async function Init_Release() {
|
||||||
const FWVersion = [41,42,43,44,45,46,47,48,49,50,51,52,53,54,55];
|
const FWVersion = [41,42,43,44,45,46,47,48,49,50,51,52,53,54,55];
|
||||||
const FWRelease = ['3.3.1','3.4.0','3.5.0','3.5.X','3.6.0','3.7.3','3.8.0','3.8.3','3.9.4','4.0.5','4.1.4','4.2.1','4.3.1','4.4.0','4.5.0'];
|
const FWRelease = ['3.3.1','3.4.0','3.5.0','3.5.X','3.6.0','3.7.3','3.8.0','3.8.3','3.9.4','4.0.5','4.1.4','4.2.1','4.3.2','4.4.0','4.5.0'];
|
||||||
try {
|
try {
|
||||||
if (existsObject(NSPanel_Path + 'Display_Firmware.desiredVersion') == false) {
|
if (existsObject(NSPanel_Path + 'Display_Firmware.desiredVersion') == false) {
|
||||||
await createStateAsync(NSPanel_Path + 'Display_Firmware.desiredVersion', desired_display_firmware_version, { type: 'number' });
|
await createStateAsync(NSPanel_Path + 'Display_Firmware.desiredVersion', desired_display_firmware_version, { type: 'number' });
|
||||||
@@ -2956,9 +2963,9 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
|
|||||||
iconColor = getState(pageItem.id + '.COLORDEC').val;
|
iconColor = getState(pageItem.id + '.COLORDEC').val;
|
||||||
} else {
|
} else {
|
||||||
if (val === true || val === 'true') {
|
if (val === true || val === 'true') {
|
||||||
iconColor = GetIconColor(pageItem, false, useColors);
|
|
||||||
} else {
|
|
||||||
iconColor = GetIconColor(pageItem, true, useColors);
|
iconColor = GetIconColor(pageItem, true, useColors);
|
||||||
|
} else {
|
||||||
|
iconColor = GetIconColor(pageItem, false, useColors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (val === true || val === 'true') { iconId = iconId2 };
|
if (val === true || val === 'true') { iconId = iconId2 };
|
||||||
@@ -3005,6 +3012,77 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
|
|||||||
if (val === true || val === 'true') { iconId = iconId2 };
|
if (val === true || val === 'true') { iconId = iconId2 };
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'humidity':
|
||||||
|
|
||||||
|
case 'temperature':
|
||||||
|
|
||||||
|
case 'value.temperature':
|
||||||
|
|
||||||
|
case 'value.humidity':
|
||||||
|
|
||||||
|
case 'sensor.door':
|
||||||
|
|
||||||
|
case 'sensor.window':
|
||||||
|
|
||||||
|
case 'thermostat':
|
||||||
|
|
||||||
|
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : o.common.role == 'temperature' || o.common.role == 'value.temperature' || o.common.role == 'thermostat' ? Icons.GetIcon('thermometer') : Icons.GetIcon('information-outline');
|
||||||
|
|
||||||
|
let unit = '';
|
||||||
|
optVal = '0';
|
||||||
|
|
||||||
|
if (existsState(pageItem.id + '.ON_ACTUAL')) {
|
||||||
|
optVal = getState(pageItem.id + '.ON_ACTUAL').val;
|
||||||
|
unit = pageItem.unit !== undefined ? pageItem.unit : GetUnitOfMeasurement(pageItem.id + '.ON_ACTUAL');
|
||||||
|
} else if (existsState(pageItem.id + '.ACTUAL')) {
|
||||||
|
optVal = getState(pageItem.id + '.ACTUAL').val;
|
||||||
|
unit = pageItem.unit !== undefined ? pageItem.unit : GetUnitOfMeasurement(pageItem.id + '.ACTUAL');
|
||||||
|
}
|
||||||
|
|
||||||
|
iconColor = GetIconColor(pageItem, parseInt(optVal), useColors);
|
||||||
|
|
||||||
|
if (pageItem.colorScale != undefined) {
|
||||||
|
let iconvalmin = (pageItem.colorScale.val_min != undefined) ? pageItem.colorScale.val_min : 0 ;
|
||||||
|
let iconvalmax = (pageItem.colorScale.val_max != undefined) ? pageItem.colorScale.val_max : 100 ;
|
||||||
|
let iconvalbest = (pageItem.colorScale.val_best != undefined) ? pageItem.colorScale.val_best : iconvalmin ;
|
||||||
|
let valueScale = val;
|
||||||
|
|
||||||
|
if (iconvalmin == 0 && iconvalmax == 1) {
|
||||||
|
iconColor = (getState(pageItem.id).val == 1) ? rgb_dec565(colorScale0) : rgb_dec565(colorScale10);
|
||||||
|
} else {
|
||||||
|
if (iconvalbest == iconvalmin) {
|
||||||
|
valueScale = scale(valueScale,iconvalmin, iconvalmax, 10, 0);
|
||||||
|
} else {
|
||||||
|
if (valueScale < iconvalbest) {
|
||||||
|
valueScale = scale(valueScale,iconvalmin, iconvalbest, 0, 10);
|
||||||
|
} else if (valueScale > iconvalbest || iconvalbest != iconvalmin) {
|
||||||
|
valueScale = scale(valueScale,iconvalbest, iconvalmax, 10, 0);
|
||||||
|
} else {
|
||||||
|
valueScale = scale(valueScale,iconvalmin, iconvalmax, 10, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let valueScaletemp = (Math.round(valueScale)).toFixed();
|
||||||
|
iconColor = HandleColorScale(valueScaletemp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (existsState(pageItem.id + '.USERICON')) {
|
||||||
|
iconId = Icons.GetIcon(getState(pageItem.id + '.USERICON').val);
|
||||||
|
if (Debug) console.log('iconid von ' + pageItem.id + '.USERICON: ' + getState(pageItem.id + '.USERICON').val);
|
||||||
|
RegisterEntityWatcher(pageItem.id + '.USERICON');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pageItem.useValue) {
|
||||||
|
if (pageItem.fontSize != undefined) {
|
||||||
|
iconId = optVal + '¬' + pageItem.fontSize;
|
||||||
|
} else {
|
||||||
|
iconId = optVal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : existsState(pageItem.id + '.BUTTONTEXT') ? getState(pageItem.id + '.BUTTONTEXT').val : 'PRESS';
|
||||||
|
break;
|
||||||
|
|
||||||
case 'warning':
|
case 'warning':
|
||||||
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('gesture-tap-button');
|
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('gesture-tap-button');
|
||||||
iconColor = pageItem.onColor !== undefined ? GetIconColor(pageItem, true, useColors) : getState(pageItem.id + '.LEVEL').val;
|
iconColor = pageItem.onColor !== undefined ? GetIconColor(pageItem, true, useColors) : getState(pageItem.id + '.LEVEL').val;
|
||||||
@@ -3270,7 +3348,7 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
|
|||||||
case 'thermostat':
|
case 'thermostat':
|
||||||
type = 'text';
|
type = 'text';
|
||||||
|
|
||||||
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : o.common.role == 'value.temperature' || o.common.role == 'thermostat' ? Icons.GetIcon('thermometer') : Icons.GetIcon('information-outline');
|
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : o.common.role == 'temperature' || o.common.role == 'value.temperature' || o.common.role == 'thermostat' ? Icons.GetIcon('thermometer') : Icons.GetIcon('information-outline');
|
||||||
|
|
||||||
let unit = '';
|
let unit = '';
|
||||||
optVal = '0';
|
optVal = '0';
|
||||||
@@ -3283,10 +3361,6 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
|
|||||||
unit = pageItem.unit !== undefined ? pageItem.unit : GetUnitOfMeasurement(pageItem.id + '.ACTUAL');
|
unit = pageItem.unit !== undefined ? pageItem.unit : GetUnitOfMeasurement(pageItem.id + '.ACTUAL');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (o.common.role == 'value.temperature') {
|
|
||||||
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('thermometer');
|
|
||||||
}
|
|
||||||
|
|
||||||
iconColor = GetIconColor(pageItem, parseInt(optVal), useColors);
|
iconColor = GetIconColor(pageItem, parseInt(optVal), useColors);
|
||||||
|
|
||||||
if (pageItem.colorScale != undefined) {
|
if (pageItem.colorScale != undefined) {
|
||||||
@@ -3461,7 +3535,7 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
|
|||||||
let itemFahrzeug:string = getState(pageItem.id + '.VEHICLE').val;
|
let itemFahrzeug:string = getState(pageItem.id + '.VEHICLE').val;
|
||||||
let itemUhrzeit:string = getState(pageItem.id + '.ACTUAL').val;
|
let itemUhrzeit:string = getState(pageItem.id + '.ACTUAL').val;
|
||||||
let itemRichtung:string = getState(pageItem.id + '.DIRECTION').val;
|
let itemRichtung:string = getState(pageItem.id + '.DIRECTION').val;
|
||||||
let itemVerspätung:boolean = getState(pageItem.id + '.DELAY').val;
|
let itemVerspaetung:boolean = getState(pageItem.id + '.DELAY').val;
|
||||||
|
|
||||||
if (Icons.GetIcon(itemFahrzeug) != "") {
|
if (Icons.GetIcon(itemFahrzeug) != "") {
|
||||||
iconId = Icons.GetIcon(itemFahrzeug)
|
iconId = Icons.GetIcon(itemFahrzeug)
|
||||||
@@ -3469,7 +3543,7 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
|
|||||||
iconId=''
|
iconId=''
|
||||||
};
|
};
|
||||||
|
|
||||||
iconColor = (!itemVerspätung) ? rgb_dec565(colorScale0) : rgb_dec565(colorScale10);
|
iconColor = (!itemVerspaetung) ? rgb_dec565(colorScale0) : rgb_dec565(colorScale10);
|
||||||
|
|
||||||
if (Debug) console.log('CreateEntity Icon role timeTable ~' + type + '~' + itemRichtung + '~' + iconId + '~' + iconColor + '~' + itemRichtung + '~' + itemUhrzeit);
|
if (Debug) console.log('CreateEntity Icon role timeTable ~' + type + '~' + itemRichtung + '~' + iconId + '~' + iconColor + '~' + itemRichtung + '~' + itemUhrzeit);
|
||||||
return '~' + type + '~' + itemRichtung + '~' + iconId + '~' + iconColor + '~' + itemRichtung + '~' + itemUhrzeit;
|
return '~' + type + '~' + itemRichtung + '~' + iconId + '~' + iconColor + '~' + itemRichtung + '~' + itemUhrzeit;
|
||||||
@@ -3478,7 +3552,6 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
|
|||||||
if (Debug) console.log('CreateEntity Icon keine passende Rolle gefunden');
|
if (Debug) console.log('CreateEntity Icon keine passende Rolle gefunden');
|
||||||
return '~delete~~~~~';
|
return '~delete~~~~~';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (Debug) console.log('CreateEntity return ~delete~~~~~');
|
if (Debug) console.log('CreateEntity return ~delete~~~~~');
|
||||||
return '~delete~~~~~';
|
return '~delete~~~~~';
|
||||||
@@ -6851,8 +6924,15 @@ function HandleScreensaverUpdate(): void {
|
|||||||
}
|
}
|
||||||
else if (typeof(val) == 'string') {
|
else if (typeof(val) == 'string') {
|
||||||
iconColor = GetScreenSaverEntityColor(config.leftScreensaverEntity[i]);
|
iconColor = GetScreenSaverEntityColor(config.leftScreensaverEntity[i]);
|
||||||
if (!isNaN(Date.parse(val))) {
|
let pformat = parseFormat(val);
|
||||||
val = formatDate(getDateObject(val), config.leftScreensaverEntity[i].ScreensaverEntityDateFormat);
|
if (Debug) console.log('moments.js --> Datum ' + val + ' valid?: ' + moment(val, pformat, true).isValid());
|
||||||
|
if (moment(val, pformat, true).isValid()) {
|
||||||
|
let DatumZeit = moment(val, pformat).unix(); // Umwandlung in Unix Time-Stamp
|
||||||
|
if (config.leftScreensaverEntity[i].ScreensaverEntityDateFormat !== undefined) {
|
||||||
|
val = new Date(DatumZeit * 1000).toLocaleString(getState(NSPanel_Path + 'Config.locale').val, config.leftScreensaverEntity[i].ScreensaverEntityDateFormat);
|
||||||
|
} else {
|
||||||
|
val = new Date(DatumZeit * 1000).toLocaleString(getState(NSPanel_Path + 'Config.locale').val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6985,10 +7065,15 @@ function HandleScreensaverUpdate(): void {
|
|||||||
}
|
}
|
||||||
else if (typeof(val) == 'string') {
|
else if (typeof(val) == 'string') {
|
||||||
iconColor = GetScreenSaverEntityColor(config.bottomScreensaverEntity[4]);
|
iconColor = GetScreenSaverEntityColor(config.bottomScreensaverEntity[4]);
|
||||||
if (!isNaN(Date.parse(getState(config.bottomScreensaverEntity[4].ScreensaverEntity).val))) {
|
let pformat = parseFormat(val);
|
||||||
val = formatDate(getDateObject(getState(config.bottomScreensaverEntity[4].ScreensaverEntity).val), config.bottomScreensaverEntity[4].ScreensaverEntityDateFormat);
|
if (Debug) console.log('moments.js --> Datum ' + val + ' valid?: ' + moment(val, pformat, true).isValid());
|
||||||
} else {
|
if (moment(val, pformat, true).isValid()) {
|
||||||
val = getState(config.bottomScreensaverEntity[4].ScreensaverEntity).val;
|
let DatumZeit = moment(val, pformat).unix(); // Umwandlung in Unix Time-Stamp
|
||||||
|
if (config.bottomScreensaverEntity[4].ScreensaverEntityDateFormat !== undefined) {
|
||||||
|
val = new Date(DatumZeit * 1000).toLocaleString(getState(NSPanel_Path + 'Config.locale').val, config.bottomScreensaverEntity[4].ScreensaverEntityDateFormat);
|
||||||
|
} else {
|
||||||
|
val = new Date(DatumZeit * 1000).toLocaleString(getState(NSPanel_Path + 'Config.locale').val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (existsObject(config.bottomScreensaverEntity[4].ScreensaverEntityIconColor)) {
|
if (existsObject(config.bottomScreensaverEntity[4].ScreensaverEntityIconColor)) {
|
||||||
@@ -7034,10 +7119,18 @@ function HandleScreensaverUpdate(): void {
|
|||||||
}
|
}
|
||||||
else if (typeof(val) == 'string') {
|
else if (typeof(val) == 'string') {
|
||||||
iconColor = GetScreenSaverEntityColor(config.bottomScreensaverEntity[i]);
|
iconColor = GetScreenSaverEntityColor(config.bottomScreensaverEntity[i]);
|
||||||
if (!isNaN(Date.parse(val))) {
|
let pformat = parseFormat(val);
|
||||||
val = formatDate(getDateObject(val), config.bottomScreensaverEntity[i].ScreensaverEntityDateFormat);
|
if (Debug) console.log('moments.js --> Datum ' + val + ' valid?: ' + moment(val, pformat, true).isValid());
|
||||||
|
if (moment(val, pformat, true).isValid()) {
|
||||||
|
let DatumZeit = moment(val, pformat).unix(); // Umwandlung in Unix Time-Stamp
|
||||||
|
if (config.bottomScreensaverEntity[i].ScreensaverEntityDateFormat !== undefined) {
|
||||||
|
val = new Date(DatumZeit * 1000).toLocaleString(getState(NSPanel_Path + 'Config.locale').val, config.bottomScreensaverEntity[i].ScreensaverEntityDateFormat);
|
||||||
|
} else {
|
||||||
|
val = new Date(DatumZeit * 1000).toLocaleString(getState(NSPanel_Path + 'Config.locale').val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (existsObject(config.bottomScreensaverEntity[i].ScreensaverEntityIconColor)) {
|
if (existsObject(config.bottomScreensaverEntity[i].ScreensaverEntityIconColor)) {
|
||||||
iconColor = getState(config.bottomScreensaverEntity[i].ScreensaverEntityIconColor).val;
|
iconColor = getState(config.bottomScreensaverEntity[i].ScreensaverEntityIconColor).val;
|
||||||
}
|
}
|
||||||
@@ -8106,7 +8199,7 @@ type ScreenSaverElement = {
|
|||||||
ScreensaverEntity: string | null,
|
ScreensaverEntity: string | null,
|
||||||
ScreensaverEntityFactor: number | 1,
|
ScreensaverEntityFactor: number | 1,
|
||||||
ScreensaverEntityDecimalPlaces: number | 0,
|
ScreensaverEntityDecimalPlaces: number | 0,
|
||||||
ScreensaverEntityDateFormat: string | null,
|
ScreensaverEntityDateFormat: any | null,
|
||||||
ScreensaverEntityIconOn: string | null,
|
ScreensaverEntityIconOn: string | null,
|
||||||
ScreensaverEntityIconOff: string | null,
|
ScreensaverEntityIconOff: string | null,
|
||||||
ScreensaverEntityText: string | null,
|
ScreensaverEntityText: string | null,
|
||||||
|
|||||||
Reference in New Issue
Block a user