Compare commits

..

82 Commits

Author SHA1 Message Date
Johannes
8972263947 Update nspanel-lovelace-ui.py 2022-08-29 18:25:36 +02:00
Johannes
80efbe2974 Update card-entities.md 2022-08-29 18:20:25 +02:00
Johannes
6e26dd8543 Update card-grid.md 2022-08-29 18:20:12 +02:00
joBr99
78dd97f947 bump fw to 40 (add nextion2text) 2022-08-29 16:07:22 +00:00
Johannes
baf8771d4b bump fw to 40 2022-08-29 18:06:46 +02:00
Johannes
cdd590e685 fix fan popup on us versions 2022-08-29 18:05:38 +02:00
Johannes
25cbb731b1 Update pages.py 2022-08-29 17:58:44 +02:00
Johannes
2bd5c2c13c implements #382 2022-08-29 17:48:00 +02:00
Johannes
859efb04e0 Update config.yml 2022-08-29 16:47:42 +02:00
Johannes
c45e2e152c Update CODEOWNERS 2022-08-29 15:56:12 +02:00
Johannes
29bb2a536b Update controller.py 2022-08-29 15:24:15 +02:00
Johannes
477a1d448c Update README.md 2022-08-29 10:07:24 +02:00
Johannes
471acc12be Update iobroker-install.md 2022-08-28 17:20:06 +02:00
Armilar
9bbddcacfb Update README.md
New Tutorials
2022-08-28 16:11:52 +02:00
Armilar
642862cf18 v3.2.0: New Feature based on Code-Refactoring (ioBroker TypeScript) by klein0r
- pageItem with CIE (XY) parameters for ColorWheel (control for e.g. Deconz colors where Hue does not work)
- minute change (with 30 seconds delay) between data points and WeatherForecast in the screensaver
- Bug fix : TFT v:3.2.0 in GenerateDetailPage: Color-Language not via findLocales, because not included in language file
2022-08-28 15:57:26 +02:00
Armilar
7c82edfe9e v3.2.0: New Feature based on Code-Refactoring (ioBroker TypeScript) by klein0r
- minute change (with 30 seconds delay) between data points and WeatherForecast in the screensaver
- Bug fix : TFT v:3.2.0 in GenerateDetailPage: Color-Language not via findLocales, because not included in language file
2022-08-28 15:47:22 +02:00
Johannes
44f7924107 Update mkdocs.yml 2022-08-28 12:06:35 +02:00
Johannes
cf25444ab7 Update prepare_nspanel_ioBroker.md 2022-08-28 12:02:28 +02:00
Johannes
5c5c31db5a Fix link 2022-08-28 11:56:02 +02:00
Johannes
0fbea9ea4c Rename prepare_nspanel2.md to prepare_nspanel_ioBroker.md 2022-08-28 11:53:33 +02:00
Johannes
9a20090081 Update prepare_nspanel2.md 2022-08-28 11:52:51 +02:00
Johannes
3e283c5232 Update prepare_nspanel2.md 2022-08-28 11:45:56 +02:00
Johannes
4a63445afd Update prepare_nspanel.md 2022-08-28 11:45:30 +02:00
Johannes
d4c7fc7485 Update prepare_nspanel.md 2022-08-28 11:45:09 +02:00
Johannes
cb149fe654 Update prepare_nspanel2.md 2022-08-28 11:33:24 +02:00
Matthias Kleine
6cca37fc49 Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui 2022-08-27 19:59:40 +02:00
Matthias Kleine
be6bdb5c28 Code-Refactoring (ioBroker TypeScript) 2022-08-27 19:59:37 +02:00
joBr99
53bb748ea1 fix theme loop (add nextion2text) 2022-08-27 15:10:45 +00:00
Johannes
3d6f887527 fix theme loop 2022-08-27 17:10:17 +02:00
Matthias Kleine
0b9f7d23d6 Added links to ioBroker README 2022-08-27 12:28:57 +02:00
editter
b8d187a36c Change new line (\n) to add character return (\r\n) (#416)
On the US Panel for English when multiple entities are open the control panel would put everything on one line instead of adding a new line between each entity, this fix changes that.  I don't know if this is an issue for other regions/languages
2022-08-26 20:35:06 +02:00
Johannes
ee0f57ea02 Update pages.py 2022-08-25 23:16:40 +02:00
Johannes
affdce553c Merge branch 'main' of https://github.com/joBr99/nspanel-lovelace-ui 2022-08-25 23:03:53 +02:00
Johannes Braun
204994317a add icon mapping file for php 2022-08-25 23:03:37 +02:00
Johannes
86f049b7b7 Update CODEOWNERS 2022-08-25 21:51:01 +02:00
Johannes
9dfd212d91 fixes #415 2022-08-25 20:36:10 +02:00
Armilar
7862b89608 Update CODEOWNERS 2022-08-25 18:53:02 +02:00
Armilar
326d482146 Update CODEOWNERS 2022-08-25 18:51:52 +02:00
Johannes
16250ddb66 Update config.py 2022-08-25 18:23:27 +02:00
Johannes
d144f7e014 Merge branch 'main' of https://github.com/joBr99/nspanel-lovelace-ui 2022-08-24 23:50:38 +02:00
Johannes
e260b269f8 add us-l inverted tft #365 2022-08-24 23:50:34 +02:00
WM
377caddf55 Alarm Panel icon color with status entity (#411) 2022-08-24 18:51:52 +02:00
WM
7701f623b9 Possibility to overwrite in config supported_features of an Alarm Control Panel to resolve #352
Example:
```
    cards:
      - type: cardAlarm
        title: Alarm Test 1
        entity: alarm_control_panel.alarmo
        supportedFeatures: 14
```

* add docs for suportedModes
Co-authored-by: Johannes <johannes+develop+github@braun-rheingau.de>
2022-08-24 17:44:34 +02:00
Sylvain Garcia
83e3a6860d update doc assumed_state (#408) 2022-08-22 17:00:29 +02:00
Sylvain Garcia
10b6f7bc04 fix and improve assumed state 2022-08-22 15:08:40 +02:00
Johannes
8d994106fd Update README.md 2022-08-21 23:16:39 +02:00
Johannes
504c70cc78 Update notifications.md 2022-08-21 23:08:30 +02:00
Johannes
6c0519037e Update index.md 2022-08-21 22:57:14 +02:00
Johannes
bc7a1a6edf fix typo 2022-08-20 17:10:59 +02:00
Johannes
76254362d3 Merge branch 'main' of https://github.com/joBr99/nspanel-lovelace-ui 2022-08-20 16:03:36 +02:00
Johannes
a3941c36fc implement assumed state 2022-08-20 16:03:21 +02:00
Johannes
a4fb69ffad Update font-char.py 2022-08-18 11:16:57 +02:00
WM
f707382dd4 implements #287 #398 by @WhistleMaster
Add support for alarm_control_panel and sun
2022-08-17 22:03:35 +02:00
joBr99
d49a289449 fix bench txt (add nextion2text) 2022-08-17 15:05:11 +00:00
Johannes
65ede34678 fix bench txt 2022-08-17 17:04:33 +02:00
joBr99
8aa3742514 enable recmod on test page (add nextion2text) 2022-08-17 14:53:16 +00:00
Johannes
b084c58409 enable recmod on test page 2022-08-17 16:52:43 +02:00
joBr99
a11129b73b add ping command to test page (add nextion2text) 2022-08-17 14:27:22 +00:00
Johannes
a022a9bd96 add ping command to test page 2022-08-17 16:26:47 +02:00
Johannes
25a0585dc0 Update faq.md 2022-08-11 19:30:28 +02:00
Johannes
09ef8c28c8 add icon #393 2022-08-09 18:40:46 +02:00
Johannes
328cf1d8a0 add vac #393 2022-08-09 18:30:45 +02:00
Johannes
68753ba4b2 Merge branch 'main' of https://github.com/joBr99/nspanel-lovelace-ui 2022-08-08 18:17:30 +02:00
Johannes
ddbce578e4 add lookup table for entities 2022-08-08 18:17:24 +02:00
joBr99
1d8848d889 Merge branch 'main' of https://github.com/joBr99/nspanel-lovelace-ui (add nextion2text) 2022-08-07 21:12:15 +00:00
Johannes
bf7b315437 Merge branch 'main' of https://github.com/joBr99/nspanel-lovelace-ui 2022-08-07 23:11:35 +02:00
Johannes
c828fb51d3 fix fan detail page #391 2022-08-07 23:11:20 +02:00
Johannes
009175aca0 #391 change fan detail page icon to fan 2022-08-07 23:03:49 +02:00
Johannes
011ee6ae23 Update configure_mqtt.md 2022-08-06 22:35:48 +02:00
Johannes
4ea14c7c4a Update waitingforcontent.md 2022-08-04 00:03:31 +02:00
Johannes
82e045ac81 Update gen-chars.py 2022-08-03 17:23:46 +02:00
Johannes
c8c5bf6310 Update pages.py 2022-08-03 17:19:19 +02:00
Johannes
8e349d1452 fix #379 2022-08-01 19:49:27 +02:00
Johannes
8b41bfa066 Update config-overview.md 2022-08-01 18:15:56 +02:00
Johannes
5a93dca172 implements #380 2022-08-01 18:14:53 +02:00
Johannes
fd002dcc29 Update controller.py 2022-08-01 18:00:57 +02:00
Johannes
e35436a375 Update pages.py 2022-07-31 21:34:44 +02:00
Johannes
e72014e60e fix entities without name 2022-07-30 21:59:56 +02:00
Johannes
6c3049493e Update card-qr.md 2022-07-30 21:54:15 +02:00
Johannes
149f327408 Update card-grid.md 2022-07-30 21:53:34 +02:00
Johannes
75fad417a4 Update card-entities.md 2022-07-30 21:52:38 +02:00
Johannes
17648b3fd3 implement #301 2022-07-30 21:48:58 +02:00
56 changed files with 9823 additions and 1894 deletions

View File

@@ -3,3 +3,7 @@ contact_links:
- name: NsPanel Lovelace UI Docs
url: https://docs.nspanel.pky.eu
about: All the information related to flashing and configuration.
- name: IoBroker Forum
url: https://forum.iobroker.net/topic/50888/sonoff-nspanel
about: for questions related to the ioBroker Script, ask in the ioBroker Forum Thread

View File

@@ -52,3 +52,7 @@ _Make sure your have performed every step and checked the applicable boxes befor
```
### ADDITIONAL INFORMATION
_Add information about your setup here, if any. (For example docker version of AppDaemon instead of the HomeAssistant Add-on)_

View File

@@ -7,7 +7,7 @@ If you are changeing the page the nextion display will send and event to the esp
HomeAssistant / NodeRed -- MQTT -- Tasmota -- Nextion Screen
See the following picture to get an Idea for the messages send and recived from the screen during cycling though pages.
See the following picture to get an Idea for the messages send and recived from the screen during cycling though pages. Please note that the messages in the picutre are outdated, but it is still useful to understand the concept.
![message_flow](../doc-pics/message-flow.png)

View File

@@ -1,6 +1,6 @@
diff -bur HMI/n2t-out/Program.s.txt HMI/US/landscape/n2t-out/Program.s.txt
--- HMI/n2t-out/Program.s.txt 2022-07-23 14:02:48.223325770 +0000
+++ HMI/US/landscape/n2t-out/Program.s.txt 2022-07-23 14:02:49.219337687 +0000
--- HMI/n2t-out/Program.s.txt 2022-08-29 16:07:16.137625205 +0000
+++ HMI/US/landscape/n2t-out/Program.s.txt 2022-08-29 16:07:17.201614908 +0000
@@ -14,6 +14,3 @@
//color vars
int defaultFontColor=65535
@@ -9,8 +9,8 @@ diff -bur HMI/n2t-out/Program.s.txt HMI/US/landscape/n2t-out/Program.s.txt
- lcd_dev fffb 0002 0000 0020
- page pageStartup
diff -bur HMI/n2t-out/pageStartup.txt HMI/US/landscape/n2t-out/pageStartup.txt
--- HMI/n2t-out/pageStartup.txt 2022-07-23 14:02:48.223325770 +0000
+++ HMI/US/landscape/n2t-out/pageStartup.txt 2022-07-23 14:02:49.219337687 +0000
--- HMI/n2t-out/pageStartup.txt 2022-08-29 16:07:16.137625205 +0000
+++ HMI/US/landscape/n2t-out/pageStartup.txt 2022-08-29 16:07:17.201614908 +0000
@@ -177,7 +177,7 @@
recmod=1
bauds=115200
@@ -20,3 +20,126 @@ diff -bur HMI/n2t-out/pageStartup.txt HMI/US/landscape/n2t-out/pageStartup.txt
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
diff -bur HMI/n2t-out/pageTest.txt HMI/US/landscape/n2t-out/pageTest.txt
--- HMI/n2t-out/pageTest.txt 2022-08-29 16:07:16.137625205 +0000
+++ HMI/US/landscape/n2t-out/pageTest.txt 2022-08-29 16:07:17.201614908 +0000
@@ -13,36 +13,6 @@
Events
Preinitialize Event
vis p0,0
- recmod=1
- bauds=115200
-
-Variable (string) tInstruction
- Attributes
- Scope : local
- Text :
- Max. Text Size: 30
-
-Variable (string) strCommand
- Attributes
- Scope : local
- Text :
- Max. Text Size: 20
-
-Variable (string) tSend
- Attributes
- Scope : local
- Text :
- Max. Text Size: 40
-
-Text tBench
- Attributes
- Scope : local
- Dragging : 0
- Disable release event after dragging: 0
- Send Component ID : disabled
- Associated Keyboard : none
- Text :
- Max. Text Size : 20
Picture p0
Attributes
@@ -220,82 +190,3 @@
Touch Press Event
page cardQR
-Timer tmSerial
- Attributes
- Scope : local
- Period (ms): 50
- Enabled : yes
-
- Events
- Timer Event
- // data available
- if(usize>1)
- {
- bufferPos=0
- while(bufferPos<usize)
- {
- // check for 0x55 0xBB - Command Init Secuence
- if(u[bufferPos]==187&&u[bufferPos-1]==85)
- {
- //remove garbage at the start of the buffer if there's any to free buffer for command
- if(u[bufferPos]!=1)
- {
- udelete bufferPos-1
- }
- //instruction is now aligned with buffer, because we deleted garbage before instrcution
- //get length after init sequence (check if there are more than to bytes in buffer)
- if(3<usize)
- {
- // check if serial buffer has reached the announced length
- ucopy payloadLength,2,2,0
- // we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
- payloadLength+=3
- // payload length does also not contain crc, so we are adding another 2 bytes for crc
- payloadLength+=2
- if(payloadLength<usize)
- {
- // calculate crc
- crcrest 1,0xFFFF
- // u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
- //crcputu 3,u[2]
- // u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
- crcputu 0,payloadLength-1
- // get recived crc to be able to compare it
- ucopy recvCrc,payloadLength-1,2,0
- // compare crc with recived value
- if(crcval==recvCrc)
- {
- // crc is okay
- // here is the location where acual code should be
- // write command to variable strCommand
- ucopy strCommand.txt,4,payloadLength-5,0
- // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
- spstr strCommand.txt,tInstruction.txt,"~",0
- if(tInstruction.txt=="ping")
- {
- spstr strCommand.txt,tBench.txt,"~",1
- tSend.txt="pong,"+tBench.txt
- //send calc crc
- btlen tSend.txt,sys0
- crcrest 1,0xffff // reset CRC
- crcputh 55 bb
- crcputs sys0,2
- crcputs tSend.txt,0
- //send cmd
- printh 55 bb
- prints sys0,2
- prints tSend.txt,0
- prints crcval,2
- }
- // end of user code
- udelete payloadLength-1
- bufferPos=0
- }
- }
- }
- }
- // next character
- bufferPos++
- }
- }
-

View File

@@ -10,6 +10,10 @@ popupNotify
17 Component(s)
226 Line(s) of event code
143 Unique line(s) of event code
pageStartup
19 Component(s)
167 Line(s) of event code
122 Unique line(s) of event code
popupFan
20 Component(s)
236 Line(s) of event code
@@ -38,10 +42,6 @@ pageTest
14 Component(s)
14 Line(s) of event code
14 Unique line(s) of event code
pageStartup
19 Component(s)
167 Line(s) of event code
122 Unique line(s) of event code
screensaver
38 Component(s)
332 Line(s) of event code
@@ -63,4 +63,4 @@ Total
14 Page(s)
432 Component(s)
5141 Line(s) of event code
1351 Unique line(s) of event code
1352 Unique line(s) of event code

View File

@@ -402,7 +402,7 @@ Text tVersion
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 39
Text : 40
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0

View File

@@ -47,7 +47,7 @@ Page popupFan
prints crcval,2
vis hSpeed,0
popupFan.bco=defaultBcoColor
for(sys0=0;sys0<40;sys0++)
for(sys0=0;sys0<20;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
@@ -117,7 +117,7 @@ Text tEntity
Horizontal Alignment : left
Vertical Alignment : center
Input Type : character
Text : tEntity1
Text :
Max. Text Size : 25
Word wrap : disabled
Horizontal Spacing : 0
@@ -147,7 +147,7 @@ Text tIcon1
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 
Text :
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
@@ -177,7 +177,7 @@ Text t1
Horizontal Alignment : left
Vertical Alignment : center
Input Type : character
Text : Speed
Text :
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0

View File

@@ -152,7 +152,7 @@ Text tVersion
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 39
Text : 40
Max. Text Size : 10
Picture p0

View File

@@ -39,7 +39,7 @@ Page popupFan
prints crcval,2
vis hSpeed,0
popupFan.bco=defaultBcoColor
for(sys0=0;sys0<40;sys0++)
for(sys0=0;sys0<20;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
@@ -88,7 +88,7 @@ Text tEntity
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : tEntity1
Text :
Max. Text Size : 25
Text tIcon1
@@ -98,7 +98,7 @@ Text tIcon1
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 
Text :
Max. Text Size : 10
Text t1
@@ -108,7 +108,7 @@ Text t1
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : Speed
Text :
Max. Text Size : 50
Text tSend

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,6 +1,6 @@
diff -bur HMI/n2t-out/Program.s.txt HMI/US/portrait/n2t-out/Program.s.txt
--- HMI/n2t-out/Program.s.txt 2022-07-23 14:02:48.223325770 +0000
+++ HMI/US/portrait/n2t-out/Program.s.txt 2022-07-23 14:02:48.731331848 +0000
--- HMI/n2t-out/Program.s.txt 2022-08-29 16:07:16.137625205 +0000
+++ HMI/US/portrait/n2t-out/Program.s.txt 2022-08-29 16:07:16.677613901 +0000
@@ -14,6 +14,6 @@
//color vars
int defaultFontColor=65535
@@ -11,8 +11,8 @@ diff -bur HMI/n2t-out/Program.s.txt HMI/US/portrait/n2t-out/Program.s.txt
+ //lcd_dev fffb 0002 0000 0020
page pageStartup
diff -bur HMI/n2t-out/cardEntities.txt HMI/US/portrait/n2t-out/cardEntities.txt
--- HMI/n2t-out/cardEntities.txt 2022-07-23 14:02:48.227325818 +0000
+++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-07-23 14:02:48.731331848 +0000
--- HMI/n2t-out/cardEntities.txt 2022-08-29 16:07:16.141624865 +0000
+++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-08-29 16:07:16.677613901 +0000
@@ -65,6 +65,16 @@
vis nNum4,0
vis bPrev,0
@@ -458,8 +458,8 @@ diff -bur HMI/n2t-out/cardEntities.txt HMI/US/portrait/n2t-out/cardEntities.txt
if(tInstruction.txt=="pageType")
{
diff -bur HMI/n2t-out/pageStartup.txt HMI/US/portrait/n2t-out/pageStartup.txt
--- HMI/n2t-out/pageStartup.txt 2022-07-23 14:02:48.223325770 +0000
+++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-07-23 14:02:48.731331848 +0000
--- HMI/n2t-out/pageStartup.txt 2022-08-29 16:07:16.137625205 +0000
+++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-08-29 16:07:16.677613901 +0000
@@ -142,7 +142,7 @@
Disable release event after dragging: 0
Send Component ID : disabled
@@ -478,3 +478,126 @@ diff -bur HMI/n2t-out/pageStartup.txt HMI/US/portrait/n2t-out/pageStartup.txt
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
diff -bur HMI/n2t-out/pageTest.txt HMI/US/portrait/n2t-out/pageTest.txt
--- HMI/n2t-out/pageTest.txt 2022-08-29 16:07:16.137625205 +0000
+++ HMI/US/portrait/n2t-out/pageTest.txt 2022-08-29 16:07:16.677613901 +0000
@@ -13,36 +13,6 @@
Events
Preinitialize Event
vis p0,0
- recmod=1
- bauds=115200
-
-Variable (string) tInstruction
- Attributes
- Scope : local
- Text :
- Max. Text Size: 30
-
-Variable (string) strCommand
- Attributes
- Scope : local
- Text :
- Max. Text Size: 20
-
-Variable (string) tSend
- Attributes
- Scope : local
- Text :
- Max. Text Size: 40
-
-Text tBench
- Attributes
- Scope : local
- Dragging : 0
- Disable release event after dragging: 0
- Send Component ID : disabled
- Associated Keyboard : none
- Text :
- Max. Text Size : 20
Picture p0
Attributes
@@ -220,82 +190,3 @@
Touch Press Event
page cardQR
-Timer tmSerial
- Attributes
- Scope : local
- Period (ms): 50
- Enabled : yes
-
- Events
- Timer Event
- // data available
- if(usize>1)
- {
- bufferPos=0
- while(bufferPos<usize)
- {
- // check for 0x55 0xBB - Command Init Secuence
- if(u[bufferPos]==187&&u[bufferPos-1]==85)
- {
- //remove garbage at the start of the buffer if there's any to free buffer for command
- if(u[bufferPos]!=1)
- {
- udelete bufferPos-1
- }
- //instruction is now aligned with buffer, because we deleted garbage before instrcution
- //get length after init sequence (check if there are more than to bytes in buffer)
- if(3<usize)
- {
- // check if serial buffer has reached the announced length
- ucopy payloadLength,2,2,0
- // we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
- payloadLength+=3
- // payload length does also not contain crc, so we are adding another 2 bytes for crc
- payloadLength+=2
- if(payloadLength<usize)
- {
- // calculate crc
- crcrest 1,0xFFFF
- // u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
- //crcputu 3,u[2]
- // u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
- crcputu 0,payloadLength-1
- // get recived crc to be able to compare it
- ucopy recvCrc,payloadLength-1,2,0
- // compare crc with recived value
- if(crcval==recvCrc)
- {
- // crc is okay
- // here is the location where acual code should be
- // write command to variable strCommand
- ucopy strCommand.txt,4,payloadLength-5,0
- // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
- spstr strCommand.txt,tInstruction.txt,"~",0
- if(tInstruction.txt=="ping")
- {
- spstr strCommand.txt,tBench.txt,"~",1
- tSend.txt="pong,"+tBench.txt
- //send calc crc
- btlen tSend.txt,sys0
- crcrest 1,0xffff // reset CRC
- crcputh 55 bb
- crcputs sys0,2
- crcputs tSend.txt,0
- //send cmd
- printh 55 bb
- prints sys0,2
- prints tSend.txt,0
- prints crcval,2
- }
- // end of user code
- udelete payloadLength-1
- bufferPos=0
- }
- }
- }
- }
- // next character
- bufferPos++
- }
- }
-

View File

@@ -1,12 +1,12 @@
+++ HMI/US/portrait/diff-eu-version.txt 2022-07-23 14:02:48.743331992 +0000
+--- HMI/n2t-out/Program.s.txt 2022-07-23 14:02:48.223325770 +0000
++++ HMI/US/portrait/n2t-out/Program.s.txt 2022-07-23 14:02:48.731331848 +0000
+++ HMI/US/portrait/diff-eu-version.txt 2022-08-29 16:07:16.689613925 +0000
+--- HMI/n2t-out/Program.s.txt 2022-08-29 16:07:16.137625205 +0000
++++ HMI/US/portrait/n2t-out/Program.s.txt 2022-08-29 16:07:16.677613901 +0000
+@@ -14,6 +14,6 @@
+ //color vars
+ int defaultFontColor=65535
+ int defaultBcoColor=6371
+--- HMI/n2t-out/cardEntities.txt 2022-07-23 14:02:48.227325818 +0000
++++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-07-23 14:02:48.731331848 +0000
+--- HMI/n2t-out/cardEntities.txt 2022-08-29 16:07:16.141624865 +0000
++++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-08-29 16:07:16.677613901 +0000
+@@ -65,6 +65,16 @@
+ vis bPrev,0
+ vis bNext,0
@@ -33,5 +33,128 @@
++ spstr strCommand.txt,tTmp.txt,"~",32
++ covx tTmp.txt,sys0,0,0
++ btOnOff5.val=sys0
+--- HMI/n2t-out/pageStartup.txt 2022-07-23 14:02:48.223325770 +0000
++++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-07-23 14:02:48.731331848 +0000
+--- HMI/n2t-out/pageStartup.txt 2022-08-29 16:07:16.137625205 +0000
++++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-08-29 16:07:16.677613901 +0000
+diff -bur HMI/n2t-out/pageTest.txt HMI/US/portrait/n2t-out/pageTest.txt
+--- HMI/n2t-out/pageTest.txt 2022-08-29 16:07:16.137625205 +0000
++++ HMI/US/portrait/n2t-out/pageTest.txt 2022-08-29 16:07:16.677613901 +0000
+@@ -13,36 +13,6 @@
+ Events
+ Preinitialize Event
+ vis p0,0
+- recmod=1
+- bauds=115200
+-
+-Variable (string) tInstruction
+- Attributes
+- Scope : local
+- Text :
+- Max. Text Size: 30
+-
+-Variable (string) strCommand
+- Attributes
+- Scope : local
+- Text :
+- Max. Text Size: 20
+-
+-Variable (string) tSend
+- Attributes
+- Scope : local
+- Text :
+- Max. Text Size: 40
+-
+-Text tBench
+- Attributes
+- Scope : local
+- Dragging : 0
+- Disable release event after dragging: 0
+- Send Component ID : disabled
+- Associated Keyboard : none
+- Text :
+- Max. Text Size : 20
+
+ Picture p0
+ Attributes
+@@ -220,82 +190,3 @@
+ Touch Press Event
+ page cardQR
+
+-Timer tmSerial
+- Attributes
+- Scope : local
+- Period (ms): 50
+- Enabled : yes
+-
+- Events
+- Timer Event
+- // data available
+- if(usize>1)
+- {
+- bufferPos=0
+- while(bufferPos<usize)
+- {
+- // check for 0x55 0xBB - Command Init Secuence
+- if(u[bufferPos]==187&&u[bufferPos-1]==85)
+- {
+- //remove garbage at the start of the buffer if there's any to free buffer for command
+- if(u[bufferPos]!=1)
+- {
+- udelete bufferPos-1
+- }
+- //instruction is now aligned with buffer, because we deleted garbage before instrcution
+- //get length after init sequence (check if there are more than to bytes in buffer)
+- if(3<usize)
+- {
+- // check if serial buffer has reached the announced length
+- ucopy payloadLength,2,2,0
+- // we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
+- payloadLength+=3
+- // payload length does also not contain crc, so we are adding another 2 bytes for crc
+- payloadLength+=2
+- if(payloadLength<usize)
+- {
+- // calculate crc
+- crcrest 1,0xFFFF
+- // u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
+- //crcputu 3,u[2]
+- // u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
+- crcputu 0,payloadLength-1
+- // get recived crc to be able to compare it
+- ucopy recvCrc,payloadLength-1,2,0
+- // compare crc with recived value
+- if(crcval==recvCrc)
+- {
+- // crc is okay
+- // here is the location where acual code should be
+- // write command to variable strCommand
+- ucopy strCommand.txt,4,payloadLength-5,0
+- // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
+- spstr strCommand.txt,tInstruction.txt,"~",0
+- if(tInstruction.txt=="ping")
+- {
+- spstr strCommand.txt,tBench.txt,"~",1
+- tSend.txt="pong,"+tBench.txt
+- //send calc crc
+- btlen tSend.txt,sys0
+- crcrest 1,0xffff // reset CRC
+- crcputh 55 bb
+- crcputs sys0,2
+- crcputs tSend.txt,0
+- //send cmd
+- printh 55 bb
+- prints sys0,2
+- prints tSend.txt,0
+- prints crcval,2
+- }
+- // end of user code
+- udelete payloadLength-1
+- bufferPos=0
+- }
+- }
+- }
+- }
+- // next character
+- bufferPos++
+- }
+- }
+-

View File

@@ -18,18 +18,18 @@ popupLight
27 Component(s)
386 Line(s) of event code
211 Unique line(s) of event code
popupFan
20 Component(s)
236 Line(s) of event code
150 Unique line(s) of event code
cardMedia
34 Component(s)
388 Line(s) of event code
209 Unique line(s) of event code
pageStartup
19 Component(s)
167 Line(s) of event code
122 Unique line(s) of event code
cardMedia
34 Component(s)
388 Line(s) of event code
209 Unique line(s) of event code
popupFan
20 Component(s)
236 Line(s) of event code
150 Unique line(s) of event code
cardEntities
77 Component(s)
1348 Line(s) of event code
@@ -63,4 +63,4 @@ Total
14 Page(s)
444 Component(s)
5363 Line(s) of event code
1424 Unique line(s) of event code
1425 Unique line(s) of event code

View File

@@ -402,7 +402,7 @@ Text tVersion
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 39
Text : 40
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0

View File

@@ -47,7 +47,7 @@ Page popupFan
prints crcval,2
vis hSpeed,0
popupFan.bco=defaultBcoColor
for(sys0=0;sys0<40;sys0++)
for(sys0=0;sys0<20;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
@@ -117,7 +117,7 @@ Text tEntity
Horizontal Alignment : left
Vertical Alignment : center
Input Type : character
Text : tEntity1
Text :
Max. Text Size : 25
Word wrap : disabled
Horizontal Spacing : 0
@@ -147,7 +147,7 @@ Text tIcon1
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 
Text :
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
@@ -177,7 +177,7 @@ Text t1
Horizontal Alignment : left
Vertical Alignment : center
Input Type : character
Text : Speed
Text :
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0

View File

@@ -152,7 +152,7 @@ Text tVersion
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 39
Text : 40
Max. Text Size : 10
Picture p0

View File

@@ -39,7 +39,7 @@ Page popupFan
prints crcval,2
vis hSpeed,0
popupFan.bco=defaultBcoColor
for(sys0=0;sys0<40;sys0++)
for(sys0=0;sys0<20;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
@@ -88,7 +88,7 @@ Text tEntity
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : tEntity1
Text :
Max. Text Size : 25
Text tIcon1
@@ -98,7 +98,7 @@ Text tIcon1
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 
Text :
Max. Text Size : 10
Text t1
@@ -108,7 +108,7 @@ Text t1
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : Speed
Text :
Max. Text Size : 50
Text tSend

Binary file not shown.

Binary file not shown.

View File

@@ -48,15 +48,27 @@ export class IconsSelector {
""");
# write documentation file
#with open(os.path.join(__location__, "../..","icons.md"), 'w') as f:
# f.write("""
## Icons IDs
#This file contains the Icons IDs included in the display firmware, addressable via serial.
#
#MD Icon Name | Icon
#------------ | ----
#""")
# for icon in icon_metadata:
# val = icon["name"]
# f.write(f"mdi:{val} | ![{val}](https://raw.githubusercontent.com/Templarian/MaterialDesign-SVG/0aeb4d612644d80d9d1fe242f705f362985de5dc/svg/{val}.svg)\n")
# write mapping lib for python
with open(os.path.join(__location__, "../../../ip-symcon", "icon_mapping.php"), 'w') as f:
f.write("$icons = [\n")
for icon in icon_metadata:
iconchar = chr(int(icon['hex'], 16))
name = icon["name"]
f.write(f" \"{name}\" => \"{iconchar}\",\n")
f.write("];\n")
f.write("""
function get_icon($name) {
global $icons;
if (str_contains('text:', $name)) {
return str_replace('text:', "", $name);
}
$ma_name = str_replace('mdi:', "", $name);
if (array_key_exists($ma_name, $icons)) {
return $icons[$ma_name];
}else{
return $icons["alert-circle-outline"];
}
}
""")

View File

@@ -173,8 +173,6 @@ char_res_string += "鎖離狀出目外斷態輔用運判閉碼助啟執轉閒"
print("Out: ")
#print(char_res_string)
import json
# check if translations.py is covered
with open("test", 'r') as f: # open in readonly mode
unique_chars = set(f.read())

View File

@@ -226,28 +226,28 @@ used_items = [
"frontend.ui.card.light.color_temperature",
"frontend.ui.card.light.position",
"frontend.state_attributes.climate.hvac_action.cooling"
"frontend.state_attributes.climate.hvac_action.drying"
"frontend.state_attributes.climate.hvac_action.fan"
"frontend.state_attributes.climate.hvac_action.heating"
"frontend.state_attributes.climate.hvac_action.idle"
"frontend.state_attributes.climate.hvac_action.off"
"frontend.state_attributes.climate.hvac_action.cooling",
"frontend.state_attributes.climate.hvac_action.drying",
"frontend.state_attributes.climate.hvac_action.fan",
"frontend.state_attributes.climate.hvac_action.heating",
"frontend.state_attributes.climate.hvac_action.idle",
"frontend.state_attributes.climate.hvac_action.off",
"backend.component.climate.state._.off"
"backend.component.climate.state._.heat"
"backend.component.climate.state._.cool"
"backend.component.climate.state._.heat_cool"
"backend.component.climate.state._.auto"
"backend.component.climate.state._.dry"
"backend.component.climate.state._.fan_only"
"backend.component.climate.state._.off",
"backend.component.climate.state._.heat",
"backend.component.climate.state._.cool",
"backend.component.climate.state._.heat_cool",
"backend.component.climate.state._.auto",
"backend.component.climate.state._.dry",
"backend.component.climate.state._.fan_only",
"backend.component.climate.state._.heat"
"backend.component.climate.state._.heat",
"frontend.ui.card.alarm_control_panel.arm_home"
"frontend.ui.card.alarm_control_panel.arm_away"
"frontend.ui.card.alarm_control_panel.arm_night"
"frontend.ui.card.alarm_control_panel.arm_vacation"
"frontend.ui.card.alarm_control_panel.disarm"
"frontend.ui.card.alarm_control_panel.arm_home",
"frontend.ui.card.alarm_control_panel.arm_away",
"frontend.ui.card.alarm_control_panel.arm_night",
"frontend.ui.card.alarm_control_panel.arm_vacation",
"frontend.ui.card.alarm_control_panel.disarm",
"backend.component.binary_sensor.state._.off",
"backend.component.binary_sensor.state.battery.off",

View File

@@ -6,14 +6,18 @@ pageIcons
6 Component(s)
0 Line(s) of event code
0 Unique line(s) of event code
popupShutter
25 Component(s)
388 Line(s) of event code
211 Unique line(s) of event code
pageTest
19 Component(s)
64 Line(s) of event code
61 Unique line(s) of event code
pageStartup
19 Component(s)
167 Line(s) of event code
122 Unique line(s) of event code
popupShutter
25 Component(s)
388 Line(s) of event code
211 Unique line(s) of event code
screensaver
38 Component(s)
332 Line(s) of event code
@@ -34,10 +38,6 @@ cardGrid
42 Component(s)
462 Line(s) of event code
271 Unique line(s) of event code
pageTest
14 Component(s)
14 Line(s) of event code
14 Unique line(s) of event code
popupFan
20 Component(s)
236 Line(s) of event code
@@ -61,6 +61,6 @@ cardEntities
Total
14 Page(s)
432 Component(s)
5143 Line(s) of event code
1353 Unique line(s) of event code
437 Component(s)
5193 Line(s) of event code
1366 Unique line(s) of event code

View File

@@ -402,7 +402,7 @@ Text tVersion
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 39
Text : 40
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0

View File

@@ -21,6 +21,59 @@ Page pageTest
Events
Preinitialize Event
vis p0,0
recmod=1
bauds=115200
Variable (string) tInstruction
Attributes
ID : 16
Scope : local
Text :
Max. Text Size: 30
Variable (string) strCommand
Attributes
ID : 17
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
ID : 18
Scope : local
Text :
Max. Text Size: 40
Text tBench
Attributes
ID : 15
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 288
y coordinate : 90
Width : 152
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 65535
Font Color : 0
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text :
Max. Text Size : 20
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Picture p0
Attributes
@@ -47,8 +100,8 @@ Button b0
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 5
y coordinate : 12
x coordinate : 0
y coordinate : 0
Width : 100
Height : 50
Effect : load
@@ -119,8 +172,8 @@ Button b6
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 5
y coordinate : 64
x coordinate : 0
y coordinate : 49
Width : 100
Height : 50
Effect : load
@@ -155,8 +208,8 @@ Button b4
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 7
y coordinate : 120
x coordinate : 0
y coordinate : 96
Width : 100
Height : 50
Effect : load
@@ -191,8 +244,8 @@ Button b5
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 111
y coordinate : 12
x coordinate : 100
y coordinate : 0
Width : 100
Height : 50
Effect : load
@@ -227,8 +280,8 @@ Button b7
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 113
y coordinate : 72
x coordinate : 100
y coordinate : 49
Width : 100
Height : 50
Effect : load
@@ -300,8 +353,8 @@ Button b9
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 6
y coordinate : 175
x coordinate : 0
y coordinate : 146
Width : 100
Height : 50
Effect : load
@@ -336,8 +389,8 @@ Button b10
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 115
y coordinate : 128
x coordinate : 100
y coordinate : 98
Width : 100
Height : 50
Effect : load
@@ -372,8 +425,8 @@ Button b11
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 117
y coordinate : 184
x coordinate : 100
y coordinate : 145
Width : 100
Height : 50
Effect : load
@@ -445,7 +498,7 @@ Button b2
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 244
y coordinate : 195
Width : 100
Height : 50
Effect : load
@@ -472,3 +525,83 @@ Button b2
Touch Press Event
page cardQR
Timer tmSerial
Attributes
ID : 14
Scope : local
Period (ms): 50
Enabled : yes
Events
Timer Event
// data available
if(usize>1)
{
bufferPos=0
while(bufferPos<usize)
{
// check for 0x55 0xBB - Command Init Secuence
if(u[bufferPos]==187&&u[bufferPos-1]==85)
{
//remove garbage at the start of the buffer if there's any to free buffer for command
if(u[bufferPos]!=1)
{
udelete bufferPos-1
}
//instruction is now aligned with buffer, because we deleted garbage before instrcution
//get length after init sequence (check if there are more than to bytes in buffer)
if(3<usize)
{
// check if serial buffer has reached the announced length
ucopy payloadLength,2,2,0
// we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
payloadLength+=3
// payload length does also not contain crc, so we are adding another 2 bytes for crc
payloadLength+=2
if(payloadLength<usize)
{
// calculate crc
crcrest 1,0xFFFF
// u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
//crcputu 3,u[2]
// u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
crcputu 0,payloadLength-1
// get recived crc to be able to compare it
ucopy recvCrc,payloadLength-1,2,0
// compare crc with recived value
if(crcval==recvCrc)
{
// crc is okay
// here is the location where acual code should be
// write command to variable strCommand
ucopy strCommand.txt,4,payloadLength-5,0
// write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
spstr strCommand.txt,tInstruction.txt,"~",0
if(tInstruction.txt=="ping")
{
spstr strCommand.txt,tBench.txt,"~",1
tSend.txt="pong,"+tBench.txt
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
crcputh 55 bb
crcputs sys0,2
crcputs tSend.txt,0
//send cmd
printh 55 bb
prints sys0,2
prints tSend.txt,0
prints crcval,2
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
}

View File

@@ -47,7 +47,7 @@ Page popupFan
prints crcval,2
vis hSpeed,0
popupFan.bco=defaultBcoColor
for(sys0=0;sys0<40;sys0++)
for(sys0=0;sys0<20;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
@@ -117,7 +117,7 @@ Text tEntity
Horizontal Alignment : left
Vertical Alignment : center
Input Type : character
Text : tEntity1
Text :
Max. Text Size : 25
Word wrap : disabled
Horizontal Spacing : 0
@@ -147,7 +147,7 @@ Text tIcon1
Horizontal Alignment : center
Vertical Alignment : center
Input Type : character
Text : 
Text :
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
@@ -177,7 +177,7 @@ Text t1
Horizontal Alignment : left
Vertical Alignment : center
Input Type : character
Text : Speed
Text :
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0

View File

@@ -152,7 +152,7 @@ Text tVersion
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 39
Text : 40
Max. Text Size : 10
Picture p0

View File

@@ -13,6 +13,36 @@ Page pageTest
Events
Preinitialize Event
vis p0,0
recmod=1
bauds=115200
Variable (string) tInstruction
Attributes
Scope : local
Text :
Max. Text Size: 30
Variable (string) strCommand
Attributes
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
Scope : local
Text :
Max. Text Size: 40
Text tBench
Attributes
Scope : local
Dragging : 0
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text :
Max. Text Size : 20
Picture p0
Attributes
@@ -190,3 +220,82 @@ Button b2
Touch Press Event
page cardQR
Timer tmSerial
Attributes
Scope : local
Period (ms): 50
Enabled : yes
Events
Timer Event
// data available
if(usize>1)
{
bufferPos=0
while(bufferPos<usize)
{
// check for 0x55 0xBB - Command Init Secuence
if(u[bufferPos]==187&&u[bufferPos-1]==85)
{
//remove garbage at the start of the buffer if there's any to free buffer for command
if(u[bufferPos]!=1)
{
udelete bufferPos-1
}
//instruction is now aligned with buffer, because we deleted garbage before instrcution
//get length after init sequence (check if there are more than to bytes in buffer)
if(3<usize)
{
// check if serial buffer has reached the announced length
ucopy payloadLength,2,2,0
// we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
payloadLength+=3
// payload length does also not contain crc, so we are adding another 2 bytes for crc
payloadLength+=2
if(payloadLength<usize)
{
// calculate crc
crcrest 1,0xFFFF
// u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
//crcputu 3,u[2]
// u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
crcputu 0,payloadLength-1
// get recived crc to be able to compare it
ucopy recvCrc,payloadLength-1,2,0
// compare crc with recived value
if(crcval==recvCrc)
{
// crc is okay
// here is the location where acual code should be
// write command to variable strCommand
ucopy strCommand.txt,4,payloadLength-5,0
// write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
spstr strCommand.txt,tInstruction.txt,"~",0
if(tInstruction.txt=="ping")
{
spstr strCommand.txt,tBench.txt,"~",1
tSend.txt="pong,"+tBench.txt
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
crcputh 55 bb
crcputs sys0,2
crcputs tSend.txt,0
//send cmd
printh 55 bb
prints sys0,2
prints tSend.txt,0
prints crcval,2
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
}

View File

@@ -39,7 +39,7 @@ Page popupFan
prints crcval,2
vis hSpeed,0
popupFan.bco=defaultBcoColor
for(sys0=0;sys0<40;sys0++)
for(sys0=0;sys0<20;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
@@ -88,7 +88,7 @@ Text tEntity
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : tEntity1
Text :
Max. Text Size : 25
Text tIcon1
@@ -98,7 +98,7 @@ Text tIcon1
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 
Text :
Max. Text Size : 10
Text t1
@@ -108,7 +108,7 @@ Text t1
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : Speed
Text :
Max. Text Size : 50
Text tSend

Binary file not shown.

Binary file not shown.

View File

@@ -8,14 +8,17 @@ If you like this project consider buying me a pizza 🍕 <a href="https://paypal
NsPanel Lovelace UI is a Firmware for the nextion screen inside of NSPanel in the Design of [HomeAssistant](https://www.home-assistant.io/)'s Lovelace UI Design.
**Visit https://docs.nspanel.pky.eu/ for installation instructions and documentation of the configuration.**
Supported Home Automation Systems:
- [Home Assistant](https://docs.nspanel.pky.eu/prepare_nspanel/) - AppDaemon Backend
- [ioBroker](https://docs.nspanel.pky.eu/prepare_nspanel_ioBroker/) - 3rd-party Typescript Backend maintained by @britzelpuf and @Armilar
NsPanel needs to be flashed with Tasmota (or through a 3rd-party Component with ESPHome)
**EU Model and US Model supported (in portrait and landscape orientation)**
The content of the screen is controlled by an AppDaemon Python Script installed on your HomeAssistant Instance.
Or a TypeScript on your ioBroker Instance in case you are an ioBroker User.
NsPanel needs to be flashed with Tasmota (or upcoming with ESPHome)
![nspanel-rl](docs/img/nspanel-rl.png)
## Features

View File

@@ -1,5 +1,8 @@
import uuid
class Entity(object):
def __init__(self, entity_input_config):
self.uuid = f"uuid.{uuid.uuid4().hex}"
if type(entity_input_config) is not dict:
#self._ha_api.log("Config error, not a dict check your entity configs")
self.entityId = "error"
@@ -11,6 +14,7 @@ class Entity(object):
self.status = entity_input_config.get("status")
self.condState = entity_input_config.get("state")
self.condStateNot = entity_input_config.get("state_not")
self.assumedState = entity_input_config.get("assumed_state", False)
class Card(object):
def __init__(self, card_input_config, pos=None):
@@ -30,7 +34,7 @@ class Card(object):
self.id = f"{self.cardType}_{self.key}".replace(".","_").replace("~","_").replace(" ","_")
#self._ha_api.log(f"Created Card {self.cardType} with pos {pos} and id {self.id}")
def get_entity_list(self):
def get_entity_names(self):
entityIds = []
if self.entity is not None:
entityIds.append(self.entity.entityId)
@@ -50,6 +54,16 @@ class Card(object):
entityIds.append(val.get("entity"))
return entityIds
def get_entity_list(self):
entitys = []
if self.entity is not None:
entitys.append(self.entity)
else:
for e in self.entities:
entitys.append(e)
return entitys
class LuiBackendConfig(object):
def dict_recursive_update(self, source: dict, target: dict) -> dict:
@@ -75,7 +89,9 @@ class LuiBackendConfig(object):
'sleepTimeout': 20,
'sleepBrightness': 20,
'screenBrightness': 100,
'defaultBackgroundColor': "ha-dark",
'sleepTracking': None,
'sleepTrackingZones': ["not_home", "off"],
'sleepOverride': None,
'locale': "en_US",
'timeFormat': "%H:%M",
@@ -137,10 +153,13 @@ class LuiBackendConfig(object):
# parse screensaver
self._config_screensaver = Card(self.get("screensaver"))
# parsed hidden pages that can be accessed through navigate
# parse hidden pages that can be accessed through navigate
for card in self.get("hiddenCards"):
self._config_hidden_cards.append(Card(card))
# all entites sorted by generated key, to be able to use short identifiers
self._config_entites_table = {x.uuid: x for x in self.get_all_entitys()}
def get(self, name):
path = name.split(".")
value = self._config
@@ -157,12 +176,20 @@ class LuiBackendConfig(object):
return value
def get_all_entity_names(self):
entities = []
for card in self._config_cards:
entities.extend(card.get_entity_names())
for card in self._config_hidden_cards:
entities.extend(card.get_entity_names())
entities.extend(self._config_screensaver.get_entity_names())
return entities
def get_all_entitys(self):
entities = []
for card in self._config_cards:
entities.extend(card.get_entity_list())
for card in self._config_hidden_cards:
entities.extend(card.get_entity_list())
entities.extend(self._config_screensaver.get_entity_list())
return entities
def getCard(self, pos):

View File

@@ -95,7 +95,7 @@ class LuiController(object):
sleepBrightness = 0
brightness = self.calc_current_brightness(self._config.get("screenBrightness"))
if bst is not None and self._ha_api.entity_exists(bst) and self._ha_api.get_entity(bst).state in ["not_home", "off"]:
if bst is not None and self._ha_api.entity_exists(bst) and self._ha_api.get_entity(bst).state in self._config.get("sleepTrackingZones"):
self._ha_api.log(f"sleepTracking setting brightness to 0")
sleepBrightness = 0
@@ -137,15 +137,14 @@ class LuiController(object):
sorted_timesets = sorted(sleep_brightness_config, key=lambda d: self._ha_api.parse_time(d['time']))
# calc current screensaver brightness
found_current_dim_value = False
for index, timeset in enumerate(sorted_timesets):
self._ha_api.log("Current time %s", self._ha_api.get_now().time())
if self._ha_api.parse_time(timeset["time"]) > self._ha_api.get_now().time() and not found_current_dim_value:
# first time after current time, set dim value
current_screensaver_brightness = sorted_timesets[index-1]["value"]
self._ha_api.log("Setting dim value to %s", sorted_timesets[index-1])
for i in range(len(sorted_timesets)):
found = self._ha_api.now_is_between(sorted_timesets[i-1]['time'], sorted_timesets[i]['time'])
if found:
found_current_dim_value = True
current_screensaver_brightness = sorted_timesets[i-1]['value']
# still no dim value
if not found_current_dim_value:
self._ha_api.log("Chooseing %s as fallback", sorted_timesets[0])
current_screensaver_brightness = sorted_timesets[0]["value"]
return current_screensaver_brightness
@@ -158,8 +157,8 @@ class LuiController(object):
def state_change_callback(self, entity, attribute, old, new, kwargs):
self._ha_api.log(f"Got callback for: {entity}", level="DEBUG")
self._ha_api.log(f"Current page has the following items: {self._current_card.get_entity_list()}", level="DEBUG")
if entity in self._current_card.get_entity_list():
self._ha_api.log(f"Current page has the following items: {self._current_card.get_entity_names()}", level="DEBUG")
if entity in self._current_card.get_entity_names():
self._ha_api.log(f"Callback Entity is on current page: {entity}", level="DEBUG")
self._pages_gen.render_card(self._current_card, send_page_type=False)
# send detail page update, just in case
@@ -267,6 +266,10 @@ class LuiController(object):
if button_type == "button":
if entity_id.startswith('uuid'):
le = self._config._config_entites_table.get(entity_id)
entity_id = le.entityId
if entity_id.startswith('navigate'):
# internal for navigation to nested pages
dstCard = self._config.searchCard(entity_id)
@@ -280,7 +283,7 @@ class LuiController(object):
self._ha_api.get_entity(entity_id).call_service("turn_on")
elif entity_id.startswith('script'):
self._ha_api.get_entity(entity_id).call_service("turn_on")
elif entity_id.startswith('light') or entity_id.startswith('switch') or entity_id.startswith('input_boolean') or entity_id.startswith('automation'):
elif entity_id.startswith('light') or entity_id.startswith('switch') or entity_id.startswith('input_boolean') or entity_id.startswith('automation') or entity_id.startswith('fan'):
self._ha_api.get_entity(entity_id).call_service("toggle")
elif entity_id.startswith('lock'):
if self._ha_api.get_entity(entity_id).state == "locked":
@@ -289,6 +292,13 @@ class LuiController(object):
self._ha_api.get_entity(entity_id).call_service("lock")
elif entity_id.startswith('button') or entity_id.startswith('input_button'):
self._ha_api.get_entity(entity_id).call_service("press")
elif entity_id.startswith('input_select'):
self._ha_api.get_entity(entity_id).call_service("select_next")
elif entity_id.startswith('vacuum'):
if self._ha_api.get_entity(entity_id).state == "docked":
self._ha_api.get_entity(entity_id).call_service("start")
else:
self._ha_api.get_entity(entity_id).call_service("return_to_base")
# for media page
if button_type == "media-next":
@@ -347,6 +357,6 @@ class LuiController(object):
entity = self._ha_api.get_entity(entity_id)
if "open_sensors" in entity.attributes and entity.attributes.open_sensors is not None:
for e in entity.attributes.open_sensors:
msg += f"- {self._ha_api.get_entity(e).attributes.friendly_name}\n"
msg += f"- {self._ha_api.get_entity(e).attributes.friendly_name}\r\n"
self._pages_gen.send_message_page("opnSensorNotifyRes", "", msg, "", "")

View File

@@ -93,6 +93,8 @@ def map_to_mdi_name(ha_type, state=None, device_class="_", cardType=None):
return "lightbulb"
elif ha_type == "fan":
return "fan"
elif ha_type == "vacuum":
return "robot-vacuum"
elif ha_type == "input_boolean":
return "check-circle-outline" if state == "on" else "close-circle-outline"
elif ha_type == "cover":
@@ -113,6 +115,22 @@ def map_to_mdi_name(ha_type, state=None, device_class="_", cardType=None):
return sensor_mapping[device_class] if device_class in sensor_mapping else "alert-circle-outline"
elif ha_type == "alarm-arm-fail":
return "progress-alert"
elif ha_type == "alarm_control_panel":
if state == "disarmed":
return "shield-off"
if state == "armed_home":
return "shield-home"
if state == "armed_away":
return "shield-lock"
if state == "armed_night":
return "weather-night"
if state == "armed_vacation":
return "shield-airplane"
elif ha_type == "sun":
if state == "above_horizon":
return "weather-sunset-up"
if state == "below_horizon":
return "weather-sunset-down"
else:
return "alert-circle-outline"

View File

@@ -22,7 +22,7 @@ class LuiPagesGen(object):
self._locale = config.get("locale")
self._send_mqtt_msg = send_mqtt_msg
def get_entity_color(self, entity, overwrite=None):
def get_entity_color(self, entity, ha_type=None, overwrite=None):
if overwrite is not None:
if type(overwrite) is list:
return rgb_dec565(overwrite)
@@ -35,7 +35,19 @@ class LuiPagesGen(object):
attr = entity.attributes
default_color_on = rgb_dec565([253, 216, 53])
default_color_off = rgb_dec565([68, 115, 158])
icon_color = default_color_on if entity.state in ["on", "unlocked"] else default_color_off
icon_color = default_color_on if entity.state in ["on", "unlocked", "above_horizon"] else default_color_off
if ha_type == "alarm_control_panel":
if entity.state == "disarmed":
icon_color = rgb_dec565([13,160,53])
if entity.state == "armed_home":
icon_color = rgb_dec565([223,76,30])
if entity.state == "armed_away":
icon_color = rgb_dec565([223,76,30])
if entity.state == "armed_night":
icon_color = rgb_dec565([223,76,30])
if entity.state == "armed_vacation":
icon_color = rgb_dec565([223,76,30])
if "rgb_color" in attr:
color = attr.rgb_color
@@ -129,6 +141,25 @@ class LuiPagesGen(object):
entity = self._ha_api.get_entity(wOF.get("entity"))
up = name if name is not None else entity.attributes.friendly_name
icon = get_icon_id_ha("sensor", state=entity.state, device_class=entity.attributes.get("device_class", ""), overwrite=icon)
if "color" in wOF:
theme = {}
shift = int(self._config._config_screensaver.raw_config.get("alternativeLayout", False))
overwrite = wOF.get("color")
if type(overwrite) is list:
color = overwrite
if type(overwrite) is dict:
state = entity.state
for overwrite_state, overwrite_val in overwrite.items():
if overwrite_state == state:
color = overwrite_val
if i+shift == 1:
theme["tF1Icon"] = color
elif i+shift == 2:
theme["tF2Icon"] = color
elif i+shift == 3:
theme["tF3Icon"] = color
elif i+shift == 4:
theme["tF4Icon"] = color
unit_of_measurement = entity.attributes.get("unit_of_measurement", "")
down = f"{entity.state} {unit_of_measurement}"
weather_res+=f"~{up}~{icon}~{down}"
@@ -162,6 +193,7 @@ class LuiPagesGen(object):
icon = item.iconOverride
colorOverride = item.colorOverride
name = item.nameOverride
uuid = item.uuid
# type of the item is the string before the "." in the entityId
entityType = entityId.split(".")[0]
@@ -179,7 +211,7 @@ class LuiPagesGen(object):
if item.status is not None and self._ha_api.entity_exists(item.status):
status_entity = self._ha_api.get_entity(item.status)
icon_res = get_icon_id_ha(item.status.split(".")[0], state=status_entity.state, device_class=status_entity.attributes.get("device_class", "_"), overwrite=icon)
icon_color = self.get_entity_color(status_entity, overwrite=colorOverride)
icon_color = self.get_entity_color(status_entity, ha_type=item.status.split(".")[0], overwrite=colorOverride)
if item.status.startswith("sensor") and cardType == "cardGrid":
icon_res = status_entity.state[:4]
if icon_res[-1] == ".":
@@ -194,6 +226,10 @@ class LuiPagesGen(object):
name = name if name is not None else "conf name missing"
icon_res = get_icon_id(icon) if icon is not None else get_icon_id("alert-circle-outline")
return f"~text~{entityId}~{icon_res}~17299~{name}~{value}"
if entityType == "service":
icon_id = get_icon_id_ha("script", overwrite=icon)
text = get_translation(self._locale, "frontend.ui.card.script.run")
return f"~button~{uuid}~{icon_id}~17299~{name}~{text}"
if not self._ha_api.entity_exists(entityId):
return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~Not found check~ apps.yaml"
@@ -205,7 +241,7 @@ class LuiPagesGen(object):
if item.condStateNot is not None and item.condState != entity.state:
return ""
name = name if name is not None else entity.attributes.friendly_name
name = name if name is not None else entity.attributes.get("friendly_name","unknown")
if entityType == "cover":
device_class = entity.attributes.get("device_class", "window")
@@ -225,11 +261,11 @@ class LuiPagesGen(object):
else:
pos_status = pos
if bits & 0b00000001: # SUPPORT_OPEN
if pos != 100 and not (entity.state == "open" and pos == "disable"):
if ( pos != 100 and not (entity.state == "open" and pos == "disable") ) or item.assumedState:
icon_up_status = "enable"
icon_up = get_action_id_ha(ha_type=entityType, action="open", device_class=device_class)
if bits & 0b00000010: # SUPPORT_CLOSE
if pos != 0 and not (entity.state == "closed" and pos == "disable"):
if ( pos != 0 and not (entity.state == "closed" and pos == "disable") ) or item.assumedState:
icon_down_status = "enable"
icon_down = get_action_id_ha(ha_type=entityType, action="close", device_class=device_class)
if bits & 0b00001000: # SUPPORT_STOP
@@ -282,15 +318,36 @@ class LuiPagesGen(object):
icon_color = self.get_entity_color(entity, overwrite=colorOverride)
text = get_translation(self._locale, "frontend.ui.card.lock.lock") if entity.state == "unlocked" else get_translation(self._locale, "frontend.ui.card.lock.unlock")
return f"~button~{entityId}~{icon_id}~{icon_color}~{name}~{text}"
if entityType == "number":
icon_id = get_icon_id_ha("number", overwrite=icon)
if entityType in ["number", "input_number"]:
icon_id = get_icon_id_ha("number", state=entity.state, overwrite=icon)
min_v = entity.attributes.get("min", 0)
max_v = entity.attributes.get("max", 100)
return f"~number~{entityId}~{icon_id}~17299~{name}~{entity.state}|{min_v}|{max_v}"
if entityType == "input_text":
icon_id = get_icon_id_ha("input_text", overwrite=icon)
icon_id = get_icon_id_ha("input_text", state=entity.state, overwrite=icon)
value = entity.state
return f"~text~{entityId}~{icon_id}~17299~{name}~{value}"
if entityType == "input_select":
icon_id = get_icon_id_ha("button", state=entity.state, overwrite=icon)
text = entity.state
return f"~button~{entityId}~{icon_id}~17299~{name}~{text}"
if entityType == "vacuum":
icon_id = get_icon_id_ha("vacuum", state=entity.state, overwrite=icon)
if entity.state == "docked":
text = "Start"
else:
text = "Return"
return f"~button~{entityId}~{icon_id}~17299~{name}~{text}"
if entityType == "alarm_control_panel":
icon_color = self.get_entity_color(entity, ha_type=entityType, overwrite=colorOverride)
icon_id = get_icon_id_ha(entityType, state=entity.state, overwrite=icon)
text = get_translation(self._locale, f"frontend.state_badge.alarm_control_panel.{entity.state}")
return f"~text~{entityId}~{icon_id}~{icon_color}~{name}~{text}"
if entityType == "sun":
icon_color = self.get_entity_color(entity, overwrite=colorOverride)
icon_id = get_icon_id_ha(entityType, state=entity.state, overwrite=icon)
text = get_translation(self._locale, f"backend.component.sun.state._.{entity.state}")
return f"~text~{entityId}~{icon_id}~{icon_color}~{name}~{text}"
return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~unsupported~"
def generate_entities_page(self, navigation, heading, items, cardType):
@@ -409,7 +466,7 @@ class LuiPagesGen(object):
command = f"entityUpd~{heading}~{navigation}~{item}~{icon}~{title}~{author}~{volume}~{iconplaypause}~{source}~{speakerlist[:200]}~{onoffbutton}~{mediaBtn}"
self._send_mqtt_msg(command)
def generate_alarm_page(self, navigation, entity, alarmBtn):
def generate_alarm_page(self, navigation, entity, overwrite_supported_modes, alarmBtn):
item = entity.entityId
if not self._ha_api.entity_exists(item):
command = f"entityUpd~{item}~{navigation}~Not found~Not found~Check your~Check your~apps.~apps.~yaml~yaml~0~~0"
@@ -424,6 +481,7 @@ class LuiPagesGen(object):
icon = get_icon_id("shield-off")
if not entity.attributes.get("code_arm_required", False):
numpad = "disable"
if overwrite_supported_modes is None:
bits = entity.attributes.supported_features
if bits & 0b000001:
supported_modes.append("arm_home")
@@ -433,6 +491,8 @@ class LuiPagesGen(object):
supported_modes.append("arm_night")
if bits & 0b100000:
supported_modes.append("arm_vacation")
else:
supported_modes = overwrite_supported_modes
else:
supported_modes.append("disarm")
@@ -462,7 +522,7 @@ class LuiPagesGen(object):
#add button to show sensor state
add_btn = ""
if "open_sensors" in entity.attributes and entity.attributes.open_sensors is not None:
add_btn=f"{get_icon_id('progress-alert')}~{rgb_dec565([243,179,0])}~opnSensorNotify"
add_btn=f"{get_icon_id('progress-alert')}~{rgb_dec565([243,179,0])}~"
if alarmBtn is not None and type(alarmBtn) is dict:
entity = alarmBtn.get("entity")
iconnav = get_icon_id_ha("alarm-arm-fail", overwrite=alarmBtn.get("icon"))
@@ -518,7 +578,8 @@ class LuiPagesGen(object):
self.generate_media_page(navigation, card.title, card.entity, mediaBtn)
if card.cardType == "cardAlarm":
alarmBtn = card.raw_config.get("alarmControl")
self.generate_alarm_page(navigation, card.entity, alarmBtn)
overwrite_supported_modes = card.raw_config.get("supportedModes")
self.generate_alarm_page(navigation, card.entity, overwrite_supported_modes, alarmBtn)
if card.cardType == "screensaver":
theme = card.raw_config.get("theme")
self.update_screensaver_weather(theme)
@@ -594,11 +655,11 @@ class LuiPagesGen(object):
if bits & 0b00001111:
pos_translation = get_translation(self._locale, "frontend.ui.card.cover.position")
if bits & 0b00000001: # SUPPORT_OPEN
if pos != 100 and not (entity.state == "open" and pos == "disable"):
if ( pos != 100 and not (entity.state == "open" and pos == "disable") ):
icon_up_status = "enable"
icon_up = get_action_id_ha(ha_type=entityType, action="open", device_class=device_class)
if bits & 0b00000010: # SUPPORT_CLOSE
if pos != 0 and not (entity.state == "closed" and pos == "disable"):
if ( pos != 0 and not (entity.state == "closed" and pos == "disable") ):
icon_down_status = "enable"
icon_down = get_action_id_ha(ha_type=entityType, action="close", device_class=device_class)
#if bits & 0b00000100: # SUPPORT_SET_POSITION
@@ -633,14 +694,14 @@ class LuiPagesGen(object):
icon_color = self.get_entity_color(entity)
speed = entity.attributes.get("percentage")
speedMax = 100
if(speed == None):
if(speed is None):
speed = "disable"
else:
speed = round(entity.attributes.get("percentage")/entity.attributes.get("percentage_step"))
speedMax = int(100/entity.attributes.get("percentage_step"))
speed_translation = get_translation(self._locale, "frontend.ui.card.fan.speed")
self._send_mqtt_msg(f"entityUpdateDetail~{entity_id}~{get_icon_id('lightbulb')}~{icon_color}~{switch_val}~{speed}~{speedMax}~{speed_translation}")
self._send_mqtt_msg(f"entityUpdateDetail~{entity_id}~{get_icon_id('fan')}~{icon_color}~{switch_val}~{speed}~{speedMax}~{speed_translation}")
def send_message_page(self, ident, heading, msg, b1, b2):
self._send_mqtt_msg(f"pageType~popupNotify")

View File

@@ -24,8 +24,8 @@ class NsPanelLovelaceUIManager(hass.Hass):
controller = LuiController(self, cfg, send_mqtt_msg)
desired_display_firmware_version = 39
version = "v3.2.0"
desired_display_firmware_version = 40
version = "v3.3.0"
model = cfg.get("model")
if model == "us-l":

View File

@@ -18,3 +18,4 @@ key | optional | type | default | description
`entity` | False | string | `None` | contains the entity of the current card
`key` | True | string | `None` | Used by navigate items
`alarmControl` | True | complex | `None` | overwrites the action executed on pressing the left bottom icon, by default this button is used to show a list of open sensors on a failed attempt to arm.
`supportedModes` | True | list | `None` | Supply list of arm modes if you want to limit the modes on the card. Example `['arm_away', 'arm_night']`

View File

@@ -31,12 +31,16 @@ List of supported entitiy types for this page:
- sensor
- button
- number
- input_number
- scenes
- script
- input_button
- light
- input_text (read-only)
- input_select
- lock
- fan
- automation
- alarm
- sun
- iText

View File

@@ -37,11 +37,16 @@ List of supported entitiy types for this page:
- sensor
- button
- number
- input_number
- scenes
- script
- input_button
- light
- input_text (read-only)
- input_select
- lock
- fan
- automation
- alarm
- sun
- iText

View File

@@ -36,6 +36,7 @@ List of supported entitiy types for this page:
- scenes
- script
- input_button
- input_select
- light
- input_text (read-only)
- lock

View File

@@ -58,6 +58,7 @@ key | optional | type | default | description
`sleepBrightness` | True | integer/complex | `20` | Brightness for the screen on the screensaver, see example below for complex/scheduled config.
`screenBrightness` | True | integer/complex | `100` | Brightness for the screen during usage, config format is the same as sleepBrightness.
`sleepTracking` | True | string | None | Forces screensaver brightness to 0 in case entity state is not_home or off, can be a group, person or device_tracker entity.
`sleepTrackingZones` | True | list | `["not_home", "off"]` | Allows you to set your own states for sleepTracking
`sleepOverride` | True | complex | None | Allows overriding of the sleepBrightness if entity state is on, true or home. Overrides sleepBrightness but sleepTracking takes precedence.
`locale` | True | string | `en_US` | Used by babel to determinante Date format on screensaver, also used for localization.
`dateFormatBabel` | True | string | `full` | formatting options on https://babel.pocoo.org/en/latest/dates.html?highlight=name%20of%20day#date-fields

View File

@@ -11,9 +11,8 @@ Change the topic to something unique for your panel, you will need this topic la
# Configure MQTT Connection on AppDaemon
For the app to work you need a working MQTT Configuration in AppDaemon. Please add the configuration of your mqtt server, user and password to your existing `appdaemon.yaml`
For the app to work you need a working MQTT Configuration in AppDaemon. Please add the configuration of your mqtt server, user and password to your existing `appdaemon.yaml` Restart your AppDaemon Container (not HomeAssistant) after adding the MQTT Configuration.
NOTE: This are not the options of the AppDaemon Addon in Home Assistant.
You will find this file in the following location: `config/appdaemon/appdeamon.yaml`
```yaml

View File

@@ -15,6 +15,7 @@ key | optional | type | default | description
`state` | True | string | `None` | Only displayed if Entity state is equal to this value
`state_not` | True | string | `None` | Only displayed if Entity state is unequal to this value
`status` | True | string | `None` | Only valid for navigate items, adds a entity to track state for the icon
`assumed_state` | True | string | `None` | Only for cover items, up, down and stop buttons are always shown
## Override Icons or Names

View File

@@ -13,7 +13,7 @@ Your appdaemon mqtt config is wrong, check your appdaemon.yaml.
The log of your mqtt broker might give you additional information.
2. Check MQTT Configuration of Tasmota.
Your Tasmota device needs to connect sucessfully to your MQTT Broker, if you are in the waiting for content screen, the panel will send periodic messages to it's mqtt topic.
Your Tasmota device needs to connect sucessfully to your MQTT Broker, if you are in the waiting for content screen, the panel will send periodic messages to it's mqtt topic. Note that there is a minimum password length of 5 chars for the MQTT Connection in Tasmota.
3. Make sure that you are using the same topic in apps.yaml and in your tasmota configuration.
The examples in the docs ([MQTT Config](https://docs.nspanel.pky.eu/configure_mqtt/)) are an valid example (tasmota<>apps.yaml).

View File

@@ -14,7 +14,7 @@ Content of the screen is controlled by a AppDaemon Python Script installed on yo
Or an TypeScript on your ioBroker Instance in case you are an ioBroker User.
NsPanel needs to be flashed with Tasmota (or upcoming with ESPHome)
NsPanel needs to be flashed with Tasmota (or with the 3rd Party ESPHome Component from [@sairon](https://github.com/sairon/esphome-nspanel-lovelace-ui))
![nspanel-rl](img/nspanel-rl.png)

View File

@@ -2,3 +2,8 @@
The Backend for ioBroker is maintained by [britzelpuf](https://github.com/britzelpuf) and [armilar](https://github.com/armilar)
https://forum.iobroker.net/topic/50888/sonoff-nspanel/612
See the Readme in the ioBroker Folder for more details.
[iobroker ReadMe](https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker)

View File

@@ -75,4 +75,3 @@ nspanel_screensaver_notification:
mode: single
icon: mdi:message-badge
```

View File

@@ -1,6 +1,6 @@
# Flash Tasmota to your NSPanel
You need to connect to your nspanel via serial and flash tasmtoa [tasmota32-nspanel.bin](http://ota.tasmota.com/tasmota32/release/tasmota32-nspanel.bin) to your NSPanel.
You need to connect to your nspanel via serial and flash tasmota [tasmota32-nspanel.bin](http://ota.tasmota.com/tasmota32/release/tasmota32-nspanel.bin) to your NSPanel.
You can use the Tasmota Web Installer to do so. [Tasmota Web Installer](https://tasmota.github.io/install/)
Checkout Blakadders Template Repo for more information on flashing, do not use the autoexec.be from this page.

View File

@@ -1,11 +1,15 @@
# Flash Tasmota to your NSPanel
You need to connect to your nspanel via serial and flash tasmtoa [tasmota32-nspanel.bin](http://ota.tasmota.com/tasmota32/release/tasmota32-nspanel.bin) to your NSPanel.
You need to connect to your nspanel via serial and flash tasmota [tasmota32-nspanel.bin](http://ota.tasmota.com/tasmota32/release/tasmota32-nspanel.bin) to your NSPanel.
You can use the Tasmota Web Installer to do so. [Tasmota Web Installer](https://tasmota.github.io/install/)
Checkout Blakadders Template Repo for more information on flashing, do not use the autoexec.be from this page.
[NSPanel Page of the Tasmota Template Repository](https://templates.blakadder.com/sonoff_NSPanel.html)
If you prefer EspHome over Tasmota, you can use this thrid party esphome component, which is replacing tasmota and the berry driver of this project.
[ESPHome component](https://github.com/sairon/esphome-nspanel-lovelace-ui)
## Configure Tasmota Template for NSPanel
Configure the NSPanel template for Tasmota. (Go to Configuration and Configure Other and paste the template there, make sure to tick the activate checkbox)
@@ -38,14 +42,15 @@ US Version Portrait: `FlashNextion http://nspanel.pky.eu/lui-us-p-release.tft`
US Version Landscape: `FlashNextion http://nspanel.pky.eu/lui-us-l-release.tft`
<details>
<summary>Alternatively you can use your own webserver or the one build into HomeAssistant:</summary>
<summary>Alternatively you can use your own webserver:</summary>
<br>
Upload the nspanel.tft from the lastest release to a Webserver (for example www folder of Home Assistant) and execute the following command in Tasmota Console. (Development Version: [tft file from HMI folder](HMI/nspanel.tft))
Upload the nspanel.tft from the lastest release to a Webserver and execute the following command in Tasmota Console.
**Webserver must be HTTP, HTTPS is not supported, due to limitations of berry lang on tasmota**
`FlashNextion http://ip-address-of-your-homeassistant:8123/local/nspanel.tft`
`FlashNextion http://ip-address-of-your-webserver:8123/local/nspanel.tft`
</details>

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,11 @@
# NSPanel ioBroker Integration
## Tutorials
https://forum.iobroker.net/post/807730
## German Video Tutorial by haus-automatisierung.com
https://www.youtube.com/watch?v=ZPLJk2ZLo_8 - NSPanel mit Lovelace UI - so habe ich mir das vorgestellt!
## Features
- Thermostat Card
@@ -10,35 +16,35 @@
- Screensaver Page with Time, Date and Weather Information.
## Requirements
- ioBroker
- MQTT Broker/Client
- Javascript
- devices (default)
- [ioBroker](https://github.com/ioBroker/ioBroker)
- [MQTT adapter](https://github.com/ioBroker/ioBroker.mqtt) in server mode or configured as client with Mosquitto (or another MQTT broker)
- [JavaScript adapter](https://github.com/ioBroker/ioBroker.javascript)
- [Devices adapter](https://github.com/ioBroker/ioBroker.devices)
- [Accuweather adapter](https://github.com/iobroker-community-adapters/ioBroker.accuweather) for screensaver information
- all devices needs to be defined in the devices panel
- supported device roles are light, dimmer, blind, thermostat
## Note
Currently the names are pulled from the objects data field common.name.de.
If you use a different language please search and replace the "common.name.de" with your language.
Currently the names are pulled from the objects data field ``common.name.de``.
If you use a different language please search and replace the ``common.name.de`` with your language.
You can find this in the device raw settings.
## Installation
- Import this script into the ioBroker javascript instance and choose Typescript.
- Make sure the version of the adapter is not to old.
- Find the config variable and update to your needs.
- The format strings are not used right now.
- Make sure your device is connected with the mqtt instance. I didn't get it working with the sonoff adapter, but I didn't tried it too long.
- Create a state with a mqtt client or create one per hand. The mqtt adapter will not create the state CustomSend
- you only need to send a dummy message to cmnd/<yourPanel>/CustomSend
- then the state will be created
- Put the file icon_mapping.ts in the global folder
- Import this script into the ioBroker javascript instance and choose TypeScript. *Make sure the version of the adapter is not to old.*
- Find the config variable and update to your needs.
- Make sure your device is connected with the mqtt instance.
- Create the ``CustomSend`` state by
- sending a dummy message to ``cmnd/<yourPanel>/CustomSend`` (the mqtt adapter will create the object automatically)
- or create the object manually within ioBroker (expert mode required)
- Place the file ``icon_mapping.ts`` in a new script in the ``global`` folder (expert mode required)
## Hardware buttons
If you like you can add special pages for the buttons.
First you need to add this rule to Tasmota:
Add this rule to Tasmota:
```
Rule2 on Button1#state do Publish tele/%topic%/RESULT {"CustomRecv":"event,button1"} endon on Button2#state do Publish tele/%topic%/RESULT {"CustomRecv":"event,button2"} endon
@@ -46,38 +52,47 @@ Rule2
```
## Colors
You can define colors this way and use them later in the PageItem element
```
```js
const BatteryFull: RGB = { red: 96, green: 176, blue: 62 }
const BatteryEmpty: RGB = { red: 179, green: 45, blue: 25 }
```
## The config element in the script which needs to be configured
```
```ts
var config: Config = {
panelRecvTopic: "mqtt.0.tele.WzDisplay.RESULT", // This is the object where the panel send the data to.
panelSendTopic: "mqtt.0.cmnd.WzDisplay.CustomSend", // This is the object where data is send to the panel.
firstScreensaverEntity: { ScreensaverEntity: "alias.0.Wetter.HUMIDITY", ScreensaverEntityIcon: "water-percent", ScreensaverEntityText: "Luft", ScreensaverEntityUnitText: "%" },
panelRecvTopic: 'mqtt.0.tele.WzDisplay.RESULT', // Object to receive data from the panel
panelSendTopic: 'mqtt.0.cmnd.WzDisplay.CustomSend', // Object to send data to the panel
// Items which should be presented on the screensaver page
secondScreensaverEntity: { ScreensaverEntity: "alias.0.Wetter.PRECIPITATION_CHANCE", ScreensaverEntityIcon: "weather-pouring", ScreensaverEntityText: "Regen", ScreensaverEntityUnitText: "%" },
thirdScreensaverEntity: { ScreensaverEntity: "alias.0.Batterie.ACTUAL", ScreensaverEntityIcon: "battery-medium", ScreensaverEntityText: "Batterie", ScreensaverEntityUnitText: "%" },
fourthScreensaverEntity: { ScreensaverEntity: "alias.0.Pv.ACTUAL", ScreensaverEntityIcon: "solar-power", ScreensaverEntityText: "PV", ScreensaverEntityUnitText: "W" },
screenSaverDoubleClick: false, // Doubletouch needed for leaving screensaver.
firstScreensaverEntity: { ScreensaverEntity: 'alias.0.Wetter.HUMIDITY', ScreensaverEntityIcon: 'water-percent', ScreensaverEntityText: 'Luft', ScreensaverEntityUnitText: '%' },
secondScreensaverEntity: { ScreensaverEntity: 'alias.0.Wetter.PRECIPITATION_CHANCE', ScreensaverEntityIcon: 'weather-pouring', ScreensaverEntityText: 'Regen', ScreensaverEntityUnitText: '%' },
thirdScreensaverEntity: { ScreensaverEntity: 'alias.0.Batterie.ACTUAL', ScreensaverEntityIcon: 'battery-medium', ScreensaverEntityText: 'Batterie', ScreensaverEntityUnitText: '%' },
fourthScreensaverEntity: { ScreensaverEntity: 'alias.0.Pv.ACTUAL', ScreensaverEntityIcon: 'solar-power', ScreensaverEntityText: 'PV', ScreensaverEntityUnitText: 'W' },
screenSaverDoubleClick: false, // Double touch needed to leave screensaver
timeoutScreensaver: 15, // Timeout for screensaver
dimmode: 8, // Display dim
locale: "de_DE", // not used right now
timeFormat: "%H:%M", // not used right now
dateFormat: "%A, %d. %B %Y", // not used right now
weatherEntity: "alias.0.Wetter",
locale: 'de_DE', // not used right now
timeFormat: '%H:%M', // not used right now
dateFormat: '%A, %d. %B %Y', // not used right now
weatherEntity: 'alias.0.Wetter',
defaultColor: Off, // Default color of all elements
defaultOnColor: RGB, // Default on state color for items
defaultOffColor: RGB, // Default off state color for page
temperatureUnit: "°C", // Unit to append on temperature sensors
pages: [Wohnen, Strom,
temperatureUnit: '°C', // Unit to append on temperature sensors
pages: [
Wohnen,
Strom,
{
"type": "cardThermo",
"heading": "Thermostat",
"useColor": true,
"items": [<PageItem>{ id: "alias.0.WzNsPanel" }]
type: 'cardThermo',
heading: 'Thermostat',
useColor: true,
items:
[<PageItem>{ id: 'alias.0.WzNsPanel' }
]
}
],
button1Page: button1Page, // A cardEntities, cardThermo or nothing. This will be opened when pressing button1
@@ -86,7 +101,8 @@ var config: Config = {
```
The pageItem element:
```
```ts
type PageItem = {
id: string, // the element in ioBroker devices
icon: (string | undefined), // the icon which should be displayed instead of the default detected. (not implemented)
@@ -101,37 +117,37 @@ type PageItem = {
}
```
If you want you can create dedicated objects, so you don't need to declare them again. Then you can use tehm in the pages array and button pages.
```
var button1Page: PageGrid =
```ts
const button1Page: PageGrid =
{
"type": "cardGrid",
"heading": "Radio",
"useColor": true, // should colors be enabled on this page, can be overridden in PageItem
"items": [
<PageItem>{ id: "alias.0.Radio.NJoy" },
<PageItem>{ id: "alias.0.Radio.Delta_Radio" },
<PageItem>{ id: "alias.0.Radio.NDR2" },
type: 'cardGrid',
heading: 'Radio',
useColor: true, // should colors be enabled on this page, can be overridden in PageItem
items: [
<PageItem>{ id: 'alias.0.Radio.NJoy' },
<PageItem>{ id: 'alias.0.Radio.Delta_Radio' },
<PageItem>{ id: 'alias.0.Radio.NDR2' },
]
};
```
Pages array can look like this, so you can add the pages as object or define them in the array itself. This is up to you.
```
```ts
pages: [
button1Page,
{
"type": "cardEntities",
"heading": "Strom",
"useColor": true, // should colors be enabled on this page, can be overridden in PageItem
"items": [
<PageItem>{ id: "alias.0.Netz", icon: "flash", interpolateColor: true, offColor: BatteryFull, onColor: Red, minValue: -1000, maxValue: 1000 },
<PageItem>{ id: "alias.0.Hausverbrauch", icon: "flash", interpolateColor: true, offColor: BatteryFull, onColor: Red, maxValue: 1000 },
<PageItem>{ id: "alias.0.Pv", name: "Solar" ,icon: "solar-power", interpolateColor: true, offColor: Off, onColor: BatteryFull, maxValue: 1000 },
<PageItem>{ id: "alias.0.Batterie", icon: "battery-medium", interpolateColor: true, offColor: BatteryEmpty, onColor: BatteryFull }
type: 'cardEntities',
heading: 'Strom',
useColor: true, // should colors be enabled on this page, can be overridden in PageItem
items: [
<PageItem>{ id: 'alias.0.Netz', icon: 'flash', interpolateColor: true, offColor: BatteryFull, onColor: Red, minValue: -1000, maxValue: 1000 },
<PageItem>{ id: 'alias.0.Hausverbrauch', icon: 'flash', interpolateColor: true, offColor: BatteryFull, onColor: Red, maxValue: 1000 },
<PageItem>{ id: 'alias.0.Pv', name: 'Solar', icon: 'solar-power', interpolateColor: true, offColor: Off, onColor: BatteryFull, maxValue: 1000 },
<PageItem>{ id: 'alias.0.Batterie', icon: 'battery-medium', interpolateColor: true, offColor: BatteryEmpty, onColor: BatteryFull }
]
}]
}
];
```

6914
ip-symcon/icon_mapping.php Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -65,13 +65,13 @@ plugins:
nav:
- "Overview": index.md
- "Getting started (HA)":
- "Getting started (Home Assistant)":
- "First steps":
- "Prepare NsPanel": prepare_nspanel.md
- "Prepare Home Assistant": prepare_ha.md
- "Configure MQTT": configure_mqtt.md
- "FAQ": faq.md
- "Configuration - apps.yaml (HA)":
- "Configuration - apps.yaml (Home Assistant)":
- "Overview": config-overview.md
- "Screensaver": config-screensaver.md
- "Cards":
@@ -87,5 +87,5 @@ nav:
- "Physical Buttons": phys-btn.md
- "Getting started (ioBroker)":
- "Prepare NsPanel": prepare_nspanel2.md
- "Prepare NsPanel": prepare_nspanel_ioBroker.md
- "Prepare ioBroker": iobroker-install.md