mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-20 22:47:01 +01:00
Compare commits
75 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8972263947 | ||
|
|
80efbe2974 | ||
|
|
6e26dd8543 | ||
|
|
78dd97f947 | ||
|
|
baf8771d4b | ||
|
|
cdd590e685 | ||
|
|
25cbb731b1 | ||
|
|
2bd5c2c13c | ||
|
|
859efb04e0 | ||
|
|
c45e2e152c | ||
|
|
29bb2a536b | ||
|
|
477a1d448c | ||
|
|
471acc12be | ||
|
|
9bbddcacfb | ||
|
|
642862cf18 | ||
|
|
7c82edfe9e | ||
|
|
44f7924107 | ||
|
|
cf25444ab7 | ||
|
|
5c5c31db5a | ||
|
|
0fbea9ea4c | ||
|
|
9a20090081 | ||
|
|
3e283c5232 | ||
|
|
4a63445afd | ||
|
|
d4c7fc7485 | ||
|
|
cb149fe654 | ||
|
|
6cca37fc49 | ||
|
|
be6bdb5c28 | ||
|
|
53bb748ea1 | ||
|
|
3d6f887527 | ||
|
|
0b9f7d23d6 | ||
|
|
b8d187a36c | ||
|
|
ee0f57ea02 | ||
|
|
affdce553c | ||
|
|
204994317a | ||
|
|
86f049b7b7 | ||
|
|
9dfd212d91 | ||
|
|
7862b89608 | ||
|
|
326d482146 | ||
|
|
16250ddb66 | ||
|
|
d144f7e014 | ||
|
|
e260b269f8 | ||
|
|
377caddf55 | ||
|
|
7701f623b9 | ||
|
|
83e3a6860d | ||
|
|
10b6f7bc04 | ||
|
|
8d994106fd | ||
|
|
504c70cc78 | ||
|
|
6c0519037e | ||
|
|
bc7a1a6edf | ||
|
|
76254362d3 | ||
|
|
a3941c36fc | ||
|
|
a4fb69ffad | ||
|
|
f707382dd4 | ||
|
|
d49a289449 | ||
|
|
65ede34678 | ||
|
|
8aa3742514 | ||
|
|
b084c58409 | ||
|
|
a11129b73b | ||
|
|
a022a9bd96 | ||
|
|
25a0585dc0 | ||
|
|
09ef8c28c8 | ||
|
|
328cf1d8a0 | ||
|
|
68753ba4b2 | ||
|
|
ddbce578e4 | ||
|
|
1d8848d889 | ||
|
|
bf7b315437 | ||
|
|
c828fb51d3 | ||
|
|
009175aca0 | ||
|
|
011ee6ae23 | ||
|
|
4ea14c7c4a | ||
|
|
82e045ac81 | ||
|
|
c8c5bf6310 | ||
|
|
8e349d1452 | ||
|
|
8b41bfa066 | ||
|
|
5a93dca172 |
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -3,3 +3,7 @@ contact_links:
|
|||||||
- name: NsPanel Lovelace UI Docs
|
- name: NsPanel Lovelace UI Docs
|
||||||
url: https://docs.nspanel.pky.eu
|
url: https://docs.nspanel.pky.eu
|
||||||
about: All the information related to flashing and configuration.
|
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
|
||||||
|
|
||||||
|
|||||||
4
.github/ISSUE_TEMPLATE/waitingforcontent.md
vendored
4
.github/ISSUE_TEMPLATE/waitingforcontent.md
vendored
@@ -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)_
|
||||||
|
|||||||
@@ -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
|
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.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
diff -bur HMI/n2t-out/Program.s.txt HMI/US/landscape/n2t-out/Program.s.txt
|
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/n2t-out/Program.s.txt 2022-08-29 16:07:16.137625205 +0000
|
||||||
+++ HMI/US/landscape/n2t-out/Program.s.txt 2022-07-23 14:02:49.219337687 +0000
|
+++ HMI/US/landscape/n2t-out/Program.s.txt 2022-08-29 16:07:17.201614908 +0000
|
||||||
@@ -14,6 +14,3 @@
|
@@ -14,6 +14,3 @@
|
||||||
//color vars
|
//color vars
|
||||||
int defaultFontColor=65535
|
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
|
- lcd_dev fffb 0002 0000 0020
|
||||||
- page pageStartup
|
- page pageStartup
|
||||||
diff -bur HMI/n2t-out/pageStartup.txt HMI/US/landscape/n2t-out/pageStartup.txt
|
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/n2t-out/pageStartup.txt 2022-08-29 16:07:16.137625205 +0000
|
||||||
+++ HMI/US/landscape/n2t-out/pageStartup.txt 2022-07-23 14:02:49.219337687 +0000
|
+++ HMI/US/landscape/n2t-out/pageStartup.txt 2022-08-29 16:07:17.201614908 +0000
|
||||||
@@ -177,7 +177,7 @@
|
@@ -177,7 +177,7 @@
|
||||||
recmod=1
|
recmod=1
|
||||||
bauds=115200
|
bauds=115200
|
||||||
@@ -20,3 +20,126 @@ diff -bur HMI/n2t-out/pageStartup.txt HMI/US/landscape/n2t-out/pageStartup.txt
|
|||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
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++
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ popupNotify
|
|||||||
17 Component(s)
|
17 Component(s)
|
||||||
226 Line(s) of event code
|
226 Line(s) of event code
|
||||||
143 Unique 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
|
popupFan
|
||||||
20 Component(s)
|
20 Component(s)
|
||||||
236 Line(s) of event code
|
236 Line(s) of event code
|
||||||
@@ -38,10 +42,6 @@ pageTest
|
|||||||
14 Component(s)
|
14 Component(s)
|
||||||
14 Line(s) of event code
|
14 Line(s) of event code
|
||||||
14 Unique 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
|
screensaver
|
||||||
38 Component(s)
|
38 Component(s)
|
||||||
332 Line(s) of event code
|
332 Line(s) of event code
|
||||||
@@ -63,4 +63,4 @@ Total
|
|||||||
14 Page(s)
|
14 Page(s)
|
||||||
432 Component(s)
|
432 Component(s)
|
||||||
5141 Line(s) of event code
|
5141 Line(s) of event code
|
||||||
1351 Unique line(s) of event code
|
1352 Unique line(s) of event code
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ Text tVersion
|
|||||||
Horizontal Alignment : center
|
Horizontal Alignment : center
|
||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : 39
|
Text : 40
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ Page popupFan
|
|||||||
prints crcval,2
|
prints crcval,2
|
||||||
vis hSpeed,0
|
vis hSpeed,0
|
||||||
popupFan.bco=defaultBcoColor
|
popupFan.bco=defaultBcoColor
|
||||||
for(sys0=0;sys0<40;sys0++)
|
for(sys0=0;sys0<20;sys0++)
|
||||||
{
|
{
|
||||||
if(b[sys0].type==98||b[sys0].type==116)
|
if(b[sys0].type==98||b[sys0].type==116)
|
||||||
{
|
{
|
||||||
@@ -117,7 +117,7 @@ Text tEntity
|
|||||||
Horizontal Alignment : left
|
Horizontal Alignment : left
|
||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : tEntity1
|
Text :
|
||||||
Max. Text Size : 25
|
Max. Text Size : 25
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
@@ -147,7 +147,7 @@ Text tIcon1
|
|||||||
Horizontal Alignment : center
|
Horizontal Alignment : center
|
||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : î´
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
@@ -177,7 +177,7 @@ Text t1
|
|||||||
Horizontal Alignment : left
|
Horizontal Alignment : left
|
||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : Speed
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 50
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ Text tVersion
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text : 39
|
Text : 40
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
|
|
||||||
Picture p0
|
Picture p0
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ Page popupFan
|
|||||||
prints crcval,2
|
prints crcval,2
|
||||||
vis hSpeed,0
|
vis hSpeed,0
|
||||||
popupFan.bco=defaultBcoColor
|
popupFan.bco=defaultBcoColor
|
||||||
for(sys0=0;sys0<40;sys0++)
|
for(sys0=0;sys0<20;sys0++)
|
||||||
{
|
{
|
||||||
if(b[sys0].type==98||b[sys0].type==116)
|
if(b[sys0].type==98||b[sys0].type==116)
|
||||||
{
|
{
|
||||||
@@ -88,7 +88,7 @@ Text tEntity
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text : tEntity1
|
Text :
|
||||||
Max. Text Size : 25
|
Max. Text Size : 25
|
||||||
|
|
||||||
Text tIcon1
|
Text tIcon1
|
||||||
@@ -98,7 +98,7 @@ Text tIcon1
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text : î´
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
|
|
||||||
Text t1
|
Text t1
|
||||||
@@ -108,7 +108,7 @@ Text t1
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text : Speed
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 50
|
||||||
|
|
||||||
Text tSend
|
Text tSend
|
||||||
|
|||||||
BIN
HMI/US/landscape/nspanel_US_L-I.tft
Normal file
BIN
HMI/US/landscape/nspanel_US_L-I.tft
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
diff -bur HMI/n2t-out/Program.s.txt HMI/US/portrait/n2t-out/Program.s.txt
|
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/n2t-out/Program.s.txt 2022-08-29 16:07:16.137625205 +0000
|
||||||
+++ HMI/US/portrait/n2t-out/Program.s.txt 2022-07-23 14:02:48.731331848 +0000
|
+++ HMI/US/portrait/n2t-out/Program.s.txt 2022-08-29 16:07:16.677613901 +0000
|
||||||
@@ -14,6 +14,6 @@
|
@@ -14,6 +14,6 @@
|
||||||
//color vars
|
//color vars
|
||||||
int defaultFontColor=65535
|
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
|
+ //lcd_dev fffb 0002 0000 0020
|
||||||
page pageStartup
|
page pageStartup
|
||||||
diff -bur HMI/n2t-out/cardEntities.txt HMI/US/portrait/n2t-out/cardEntities.txt
|
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/n2t-out/cardEntities.txt 2022-08-29 16:07:16.141624865 +0000
|
||||||
+++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-07-23 14:02:48.731331848 +0000
|
+++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-08-29 16:07:16.677613901 +0000
|
||||||
@@ -65,6 +65,16 @@
|
@@ -65,6 +65,16 @@
|
||||||
vis nNum4,0
|
vis nNum4,0
|
||||||
vis bPrev,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")
|
if(tInstruction.txt=="pageType")
|
||||||
{
|
{
|
||||||
diff -bur HMI/n2t-out/pageStartup.txt HMI/US/portrait/n2t-out/pageStartup.txt
|
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/n2t-out/pageStartup.txt 2022-08-29 16:07:16.137625205 +0000
|
||||||
+++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-07-23 14:02:48.731331848 +0000
|
+++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-08-29 16:07:16.677613901 +0000
|
||||||
@@ -142,7 +142,7 @@
|
@@ -142,7 +142,7 @@
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
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
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
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++
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
+++ HMI/US/portrait/diff-eu-version.txt 2022-07-23 14:02:48.743331992 +0000
|
+++ HMI/US/portrait/diff-eu-version.txt 2022-08-29 16:07:16.689613925 +0000
|
||||||
+--- HMI/n2t-out/Program.s.txt 2022-07-23 14:02:48.223325770 +0000
|
+--- HMI/n2t-out/Program.s.txt 2022-08-29 16:07:16.137625205 +0000
|
||||||
++++ HMI/US/portrait/n2t-out/Program.s.txt 2022-07-23 14:02:48.731331848 +0000
|
++++ HMI/US/portrait/n2t-out/Program.s.txt 2022-08-29 16:07:16.677613901 +0000
|
||||||
+@@ -14,6 +14,6 @@
|
+@@ -14,6 +14,6 @@
|
||||||
+ //color vars
|
+ //color vars
|
||||||
+ int defaultFontColor=65535
|
+ int defaultFontColor=65535
|
||||||
+ int defaultBcoColor=6371
|
+ int defaultBcoColor=6371
|
||||||
+--- HMI/n2t-out/cardEntities.txt 2022-07-23 14:02:48.227325818 +0000
|
+--- HMI/n2t-out/cardEntities.txt 2022-08-29 16:07:16.141624865 +0000
|
||||||
++++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-07-23 14:02:48.731331848 +0000
|
++++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-08-29 16:07:16.677613901 +0000
|
||||||
+@@ -65,6 +65,16 @@
|
+@@ -65,6 +65,16 @@
|
||||||
+ vis bPrev,0
|
+ vis bPrev,0
|
||||||
+ vis bNext,0
|
+ vis bNext,0
|
||||||
@@ -33,5 +33,128 @@
|
|||||||
++ spstr strCommand.txt,tTmp.txt,"~",32
|
++ spstr strCommand.txt,tTmp.txt,"~",32
|
||||||
++ covx tTmp.txt,sys0,0,0
|
++ covx tTmp.txt,sys0,0,0
|
||||||
++ btOnOff5.val=sys0
|
++ btOnOff5.val=sys0
|
||||||
+--- HMI/n2t-out/pageStartup.txt 2022-07-23 14:02:48.223325770 +0000
|
+--- HMI/n2t-out/pageStartup.txt 2022-08-29 16:07:16.137625205 +0000
|
||||||
++++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-07-23 14:02:48.731331848 +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++
|
||||||
|
+- }
|
||||||
|
+- }
|
||||||
|
+-
|
||||||
|
|||||||
@@ -18,18 +18,18 @@ popupLight
|
|||||||
27 Component(s)
|
27 Component(s)
|
||||||
386 Line(s) of event code
|
386 Line(s) of event code
|
||||||
211 Unique 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
|
pageStartup
|
||||||
19 Component(s)
|
19 Component(s)
|
||||||
167 Line(s) of event code
|
167 Line(s) of event code
|
||||||
122 Unique 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
|
cardEntities
|
||||||
77 Component(s)
|
77 Component(s)
|
||||||
1348 Line(s) of event code
|
1348 Line(s) of event code
|
||||||
@@ -63,4 +63,4 @@ Total
|
|||||||
14 Page(s)
|
14 Page(s)
|
||||||
444 Component(s)
|
444 Component(s)
|
||||||
5363 Line(s) of event code
|
5363 Line(s) of event code
|
||||||
1424 Unique line(s) of event code
|
1425 Unique line(s) of event code
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ Text tVersion
|
|||||||
Horizontal Alignment : center
|
Horizontal Alignment : center
|
||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : 39
|
Text : 40
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ Page popupFan
|
|||||||
prints crcval,2
|
prints crcval,2
|
||||||
vis hSpeed,0
|
vis hSpeed,0
|
||||||
popupFan.bco=defaultBcoColor
|
popupFan.bco=defaultBcoColor
|
||||||
for(sys0=0;sys0<40;sys0++)
|
for(sys0=0;sys0<20;sys0++)
|
||||||
{
|
{
|
||||||
if(b[sys0].type==98||b[sys0].type==116)
|
if(b[sys0].type==98||b[sys0].type==116)
|
||||||
{
|
{
|
||||||
@@ -117,7 +117,7 @@ Text tEntity
|
|||||||
Horizontal Alignment : left
|
Horizontal Alignment : left
|
||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : tEntity1
|
Text :
|
||||||
Max. Text Size : 25
|
Max. Text Size : 25
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
@@ -147,7 +147,7 @@ Text tIcon1
|
|||||||
Horizontal Alignment : center
|
Horizontal Alignment : center
|
||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : î´
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
@@ -177,7 +177,7 @@ Text t1
|
|||||||
Horizontal Alignment : left
|
Horizontal Alignment : left
|
||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : Speed
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 50
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ Text tVersion
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text : 39
|
Text : 40
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
|
|
||||||
Picture p0
|
Picture p0
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ Page popupFan
|
|||||||
prints crcval,2
|
prints crcval,2
|
||||||
vis hSpeed,0
|
vis hSpeed,0
|
||||||
popupFan.bco=defaultBcoColor
|
popupFan.bco=defaultBcoColor
|
||||||
for(sys0=0;sys0<40;sys0++)
|
for(sys0=0;sys0<20;sys0++)
|
||||||
{
|
{
|
||||||
if(b[sys0].type==98||b[sys0].type==116)
|
if(b[sys0].type==98||b[sys0].type==116)
|
||||||
{
|
{
|
||||||
@@ -88,7 +88,7 @@ Text tEntity
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text : tEntity1
|
Text :
|
||||||
Max. Text Size : 25
|
Max. Text Size : 25
|
||||||
|
|
||||||
Text tIcon1
|
Text tIcon1
|
||||||
@@ -98,7 +98,7 @@ Text tIcon1
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text : î´
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
|
|
||||||
Text t1
|
Text t1
|
||||||
@@ -108,7 +108,7 @@ Text t1
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text : Speed
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 50
|
||||||
|
|
||||||
Text tSend
|
Text tSend
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -48,15 +48,27 @@ export class IconsSelector {
|
|||||||
|
|
||||||
""");
|
""");
|
||||||
|
|
||||||
# write documentation file
|
# write mapping lib for python
|
||||||
#with open(os.path.join(__location__, "../..","icons.md"), 'w') as f:
|
with open(os.path.join(__location__, "../../../ip-symcon", "icon_mapping.php"), 'w') as f:
|
||||||
# f.write("""
|
f.write("$icons = [\n")
|
||||||
## Icons IDs
|
for icon in icon_metadata:
|
||||||
#This file contains the Icons IDs included in the display firmware, addressable via serial.
|
iconchar = chr(int(icon['hex'], 16))
|
||||||
#
|
name = icon["name"]
|
||||||
#MD Icon Name | Icon
|
f.write(f" \"{name}\" => \"{iconchar}\",\n")
|
||||||
#------------ | ----
|
f.write("];\n")
|
||||||
#""")
|
f.write("""
|
||||||
# for icon in icon_metadata:
|
|
||||||
# val = icon["name"]
|
function get_icon($name) {
|
||||||
# f.write(f"mdi:{val} | \n")
|
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"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
""")
|
||||||
@@ -173,8 +173,6 @@ char_res_string += "鎖離狀出目外斷態輔用運判閉碼助啟執轉閒"
|
|||||||
print("Out: ")
|
print("Out: ")
|
||||||
#print(char_res_string)
|
#print(char_res_string)
|
||||||
|
|
||||||
import json
|
|
||||||
|
|
||||||
# check if translations.py is covered
|
# check if translations.py is covered
|
||||||
with open("test", 'r') as f: # open in readonly mode
|
with open("test", 'r') as f: # open in readonly mode
|
||||||
unique_chars = set(f.read())
|
unique_chars = set(f.read())
|
||||||
|
|||||||
@@ -226,28 +226,28 @@ used_items = [
|
|||||||
"frontend.ui.card.light.color_temperature",
|
"frontend.ui.card.light.color_temperature",
|
||||||
"frontend.ui.card.light.position",
|
"frontend.ui.card.light.position",
|
||||||
|
|
||||||
"frontend.state_attributes.climate.hvac_action.cooling"
|
"frontend.state_attributes.climate.hvac_action.cooling",
|
||||||
"frontend.state_attributes.climate.hvac_action.drying"
|
"frontend.state_attributes.climate.hvac_action.drying",
|
||||||
"frontend.state_attributes.climate.hvac_action.fan"
|
"frontend.state_attributes.climate.hvac_action.fan",
|
||||||
"frontend.state_attributes.climate.hvac_action.heating"
|
"frontend.state_attributes.climate.hvac_action.heating",
|
||||||
"frontend.state_attributes.climate.hvac_action.idle"
|
"frontend.state_attributes.climate.hvac_action.idle",
|
||||||
"frontend.state_attributes.climate.hvac_action.off"
|
"frontend.state_attributes.climate.hvac_action.off",
|
||||||
|
|
||||||
"backend.component.climate.state._.off"
|
"backend.component.climate.state._.off",
|
||||||
"backend.component.climate.state._.heat"
|
"backend.component.climate.state._.heat",
|
||||||
"backend.component.climate.state._.cool"
|
"backend.component.climate.state._.cool",
|
||||||
"backend.component.climate.state._.heat_cool"
|
"backend.component.climate.state._.heat_cool",
|
||||||
"backend.component.climate.state._.auto"
|
"backend.component.climate.state._.auto",
|
||||||
"backend.component.climate.state._.dry"
|
"backend.component.climate.state._.dry",
|
||||||
"backend.component.climate.state._.fan_only"
|
"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_home",
|
||||||
"frontend.ui.card.alarm_control_panel.arm_away"
|
"frontend.ui.card.alarm_control_panel.arm_away",
|
||||||
"frontend.ui.card.alarm_control_panel.arm_night"
|
"frontend.ui.card.alarm_control_panel.arm_night",
|
||||||
"frontend.ui.card.alarm_control_panel.arm_vacation"
|
"frontend.ui.card.alarm_control_panel.arm_vacation",
|
||||||
"frontend.ui.card.alarm_control_panel.disarm"
|
"frontend.ui.card.alarm_control_panel.disarm",
|
||||||
|
|
||||||
"backend.component.binary_sensor.state._.off",
|
"backend.component.binary_sensor.state._.off",
|
||||||
"backend.component.binary_sensor.state.battery.off",
|
"backend.component.binary_sensor.state.battery.off",
|
||||||
|
|||||||
@@ -6,14 +6,18 @@ pageIcons
|
|||||||
6 Component(s)
|
6 Component(s)
|
||||||
0 Line(s) of event code
|
0 Line(s) of event code
|
||||||
0 Unique line(s) of event code
|
0 Unique line(s) of event code
|
||||||
popupShutter
|
pageTest
|
||||||
25 Component(s)
|
19 Component(s)
|
||||||
388 Line(s) of event code
|
64 Line(s) of event code
|
||||||
211 Unique line(s) of event code
|
61 Unique line(s) of event code
|
||||||
pageStartup
|
pageStartup
|
||||||
19 Component(s)
|
19 Component(s)
|
||||||
167 Line(s) of event code
|
167 Line(s) of event code
|
||||||
122 Unique 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
|
screensaver
|
||||||
38 Component(s)
|
38 Component(s)
|
||||||
332 Line(s) of event code
|
332 Line(s) of event code
|
||||||
@@ -34,10 +38,6 @@ cardGrid
|
|||||||
42 Component(s)
|
42 Component(s)
|
||||||
462 Line(s) of event code
|
462 Line(s) of event code
|
||||||
271 Unique 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
|
popupFan
|
||||||
20 Component(s)
|
20 Component(s)
|
||||||
236 Line(s) of event code
|
236 Line(s) of event code
|
||||||
@@ -61,6 +61,6 @@ cardEntities
|
|||||||
|
|
||||||
Total
|
Total
|
||||||
14 Page(s)
|
14 Page(s)
|
||||||
432 Component(s)
|
437 Component(s)
|
||||||
5143 Line(s) of event code
|
5193 Line(s) of event code
|
||||||
1353 Unique line(s) of event code
|
1366 Unique line(s) of event code
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ Text tVersion
|
|||||||
Horizontal Alignment : center
|
Horizontal Alignment : center
|
||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : 39
|
Text : 40
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
|
|||||||
@@ -21,6 +21,59 @@ Page pageTest
|
|||||||
Events
|
Events
|
||||||
Preinitialize Event
|
Preinitialize Event
|
||||||
vis p0,0
|
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
|
Picture p0
|
||||||
Attributes
|
Attributes
|
||||||
@@ -47,8 +100,8 @@ Button b0
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 5
|
x coordinate : 0
|
||||||
y coordinate : 12
|
y coordinate : 0
|
||||||
Width : 100
|
Width : 100
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -119,8 +172,8 @@ Button b6
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 5
|
x coordinate : 0
|
||||||
y coordinate : 64
|
y coordinate : 49
|
||||||
Width : 100
|
Width : 100
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -155,8 +208,8 @@ Button b4
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 7
|
x coordinate : 0
|
||||||
y coordinate : 120
|
y coordinate : 96
|
||||||
Width : 100
|
Width : 100
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -191,8 +244,8 @@ Button b5
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 111
|
x coordinate : 100
|
||||||
y coordinate : 12
|
y coordinate : 0
|
||||||
Width : 100
|
Width : 100
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -227,8 +280,8 @@ Button b7
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 113
|
x coordinate : 100
|
||||||
y coordinate : 72
|
y coordinate : 49
|
||||||
Width : 100
|
Width : 100
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -300,8 +353,8 @@ Button b9
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 6
|
x coordinate : 0
|
||||||
y coordinate : 175
|
y coordinate : 146
|
||||||
Width : 100
|
Width : 100
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -336,8 +389,8 @@ Button b10
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 115
|
x coordinate : 100
|
||||||
y coordinate : 128
|
y coordinate : 98
|
||||||
Width : 100
|
Width : 100
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -372,8 +425,8 @@ Button b11
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 117
|
x coordinate : 100
|
||||||
y coordinate : 184
|
y coordinate : 145
|
||||||
Width : 100
|
Width : 100
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -445,7 +498,7 @@ Button b2
|
|||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 0
|
x coordinate : 0
|
||||||
y coordinate : 244
|
y coordinate : 195
|
||||||
Width : 100
|
Width : 100
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -472,3 +525,83 @@ Button b2
|
|||||||
Touch Press Event
|
Touch Press Event
|
||||||
page cardQR
|
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++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ Page popupFan
|
|||||||
prints crcval,2
|
prints crcval,2
|
||||||
vis hSpeed,0
|
vis hSpeed,0
|
||||||
popupFan.bco=defaultBcoColor
|
popupFan.bco=defaultBcoColor
|
||||||
for(sys0=0;sys0<40;sys0++)
|
for(sys0=0;sys0<20;sys0++)
|
||||||
{
|
{
|
||||||
if(b[sys0].type==98||b[sys0].type==116)
|
if(b[sys0].type==98||b[sys0].type==116)
|
||||||
{
|
{
|
||||||
@@ -117,7 +117,7 @@ Text tEntity
|
|||||||
Horizontal Alignment : left
|
Horizontal Alignment : left
|
||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : tEntity1
|
Text :
|
||||||
Max. Text Size : 25
|
Max. Text Size : 25
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
@@ -147,7 +147,7 @@ Text tIcon1
|
|||||||
Horizontal Alignment : center
|
Horizontal Alignment : center
|
||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : î´
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
@@ -177,7 +177,7 @@ Text t1
|
|||||||
Horizontal Alignment : left
|
Horizontal Alignment : left
|
||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : Speed
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 50
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ Text tVersion
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text : 39
|
Text : 40
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
|
|
||||||
Picture p0
|
Picture p0
|
||||||
|
|||||||
@@ -13,6 +13,36 @@ Page pageTest
|
|||||||
Events
|
Events
|
||||||
Preinitialize Event
|
Preinitialize Event
|
||||||
vis p0,0
|
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
|
Picture p0
|
||||||
Attributes
|
Attributes
|
||||||
@@ -190,3 +220,82 @@ Button b2
|
|||||||
Touch Press Event
|
Touch Press Event
|
||||||
page cardQR
|
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++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ Page popupFan
|
|||||||
prints crcval,2
|
prints crcval,2
|
||||||
vis hSpeed,0
|
vis hSpeed,0
|
||||||
popupFan.bco=defaultBcoColor
|
popupFan.bco=defaultBcoColor
|
||||||
for(sys0=0;sys0<40;sys0++)
|
for(sys0=0;sys0<20;sys0++)
|
||||||
{
|
{
|
||||||
if(b[sys0].type==98||b[sys0].type==116)
|
if(b[sys0].type==98||b[sys0].type==116)
|
||||||
{
|
{
|
||||||
@@ -88,7 +88,7 @@ Text tEntity
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text : tEntity1
|
Text :
|
||||||
Max. Text Size : 25
|
Max. Text Size : 25
|
||||||
|
|
||||||
Text tIcon1
|
Text tIcon1
|
||||||
@@ -98,7 +98,7 @@ Text tIcon1
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text : î´
|
Text :
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
|
|
||||||
Text t1
|
Text t1
|
||||||
@@ -108,7 +108,7 @@ Text t1
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text : Speed
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 50
|
||||||
|
|
||||||
Text tSend
|
Text tSend
|
||||||
|
|||||||
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
15
README.md
15
README.md
@@ -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.
|
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)**
|
**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)
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
|
import uuid
|
||||||
|
|
||||||
class Entity(object):
|
class Entity(object):
|
||||||
def __init__(self, entity_input_config):
|
def __init__(self, entity_input_config):
|
||||||
|
self.uuid = f"uuid.{uuid.uuid4().hex}"
|
||||||
if type(entity_input_config) is not dict:
|
if type(entity_input_config) is not dict:
|
||||||
#self._ha_api.log("Config error, not a dict check your entity configs")
|
#self._ha_api.log("Config error, not a dict check your entity configs")
|
||||||
self.entityId = "error"
|
self.entityId = "error"
|
||||||
@@ -11,6 +14,7 @@ class Entity(object):
|
|||||||
self.status = entity_input_config.get("status")
|
self.status = entity_input_config.get("status")
|
||||||
self.condState = entity_input_config.get("state")
|
self.condState = entity_input_config.get("state")
|
||||||
self.condStateNot = entity_input_config.get("state_not")
|
self.condStateNot = entity_input_config.get("state_not")
|
||||||
|
self.assumedState = entity_input_config.get("assumed_state", False)
|
||||||
|
|
||||||
class Card(object):
|
class Card(object):
|
||||||
def __init__(self, card_input_config, pos=None):
|
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.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}")
|
#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 = []
|
entityIds = []
|
||||||
if self.entity is not None:
|
if self.entity is not None:
|
||||||
entityIds.append(self.entity.entityId)
|
entityIds.append(self.entity.entityId)
|
||||||
@@ -50,6 +54,16 @@ class Card(object):
|
|||||||
entityIds.append(val.get("entity"))
|
entityIds.append(val.get("entity"))
|
||||||
return entityIds
|
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):
|
class LuiBackendConfig(object):
|
||||||
|
|
||||||
def dict_recursive_update(self, source: dict, target: dict) -> dict:
|
def dict_recursive_update(self, source: dict, target: dict) -> dict:
|
||||||
@@ -75,7 +89,9 @@ class LuiBackendConfig(object):
|
|||||||
'sleepTimeout': 20,
|
'sleepTimeout': 20,
|
||||||
'sleepBrightness': 20,
|
'sleepBrightness': 20,
|
||||||
'screenBrightness': 100,
|
'screenBrightness': 100,
|
||||||
|
'defaultBackgroundColor': "ha-dark",
|
||||||
'sleepTracking': None,
|
'sleepTracking': None,
|
||||||
|
'sleepTrackingZones': ["not_home", "off"],
|
||||||
'sleepOverride': None,
|
'sleepOverride': None,
|
||||||
'locale': "en_US",
|
'locale': "en_US",
|
||||||
'timeFormat': "%H:%M",
|
'timeFormat': "%H:%M",
|
||||||
@@ -137,10 +153,13 @@ class LuiBackendConfig(object):
|
|||||||
# parse screensaver
|
# parse screensaver
|
||||||
self._config_screensaver = Card(self.get("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"):
|
for card in self.get("hiddenCards"):
|
||||||
self._config_hidden_cards.append(Card(card))
|
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):
|
def get(self, name):
|
||||||
path = name.split(".")
|
path = name.split(".")
|
||||||
value = self._config
|
value = self._config
|
||||||
@@ -157,12 +176,20 @@ class LuiBackendConfig(object):
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
def get_all_entity_names(self):
|
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 = []
|
entities = []
|
||||||
for card in self._config_cards:
|
for card in self._config_cards:
|
||||||
entities.extend(card.get_entity_list())
|
entities.extend(card.get_entity_list())
|
||||||
for card in self._config_hidden_cards:
|
for card in self._config_hidden_cards:
|
||||||
entities.extend(card.get_entity_list())
|
entities.extend(card.get_entity_list())
|
||||||
entities.extend(self._config_screensaver.get_entity_list())
|
|
||||||
return entities
|
return entities
|
||||||
|
|
||||||
def getCard(self, pos):
|
def getCard(self, pos):
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class LuiController(object):
|
|||||||
sleepBrightness = 0
|
sleepBrightness = 0
|
||||||
brightness = self.calc_current_brightness(self._config.get("screenBrightness"))
|
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")
|
self._ha_api.log(f"sleepTracking setting brightness to 0")
|
||||||
sleepBrightness = 0
|
sleepBrightness = 0
|
||||||
|
|
||||||
@@ -157,8 +157,8 @@ class LuiController(object):
|
|||||||
|
|
||||||
def state_change_callback(self, entity, attribute, old, new, kwargs):
|
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"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")
|
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_list():
|
if entity in self._current_card.get_entity_names():
|
||||||
self._ha_api.log(f"Callback Entity is on current page: {entity}", level="DEBUG")
|
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)
|
self._pages_gen.render_card(self._current_card, send_page_type=False)
|
||||||
# send detail page update, just in case
|
# send detail page update, just in case
|
||||||
@@ -266,6 +266,10 @@ class LuiController(object):
|
|||||||
|
|
||||||
|
|
||||||
if button_type == "button":
|
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'):
|
if entity_id.startswith('navigate'):
|
||||||
# internal for navigation to nested pages
|
# internal for navigation to nested pages
|
||||||
dstCard = self._config.searchCard(entity_id)
|
dstCard = self._config.searchCard(entity_id)
|
||||||
@@ -279,7 +283,7 @@ class LuiController(object):
|
|||||||
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
||||||
elif entity_id.startswith('script'):
|
elif entity_id.startswith('script'):
|
||||||
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
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")
|
self._ha_api.get_entity(entity_id).call_service("toggle")
|
||||||
elif entity_id.startswith('lock'):
|
elif entity_id.startswith('lock'):
|
||||||
if self._ha_api.get_entity(entity_id).state == "locked":
|
if self._ha_api.get_entity(entity_id).state == "locked":
|
||||||
@@ -290,6 +294,11 @@ class LuiController(object):
|
|||||||
self._ha_api.get_entity(entity_id).call_service("press")
|
self._ha_api.get_entity(entity_id).call_service("press")
|
||||||
elif entity_id.startswith('input_select'):
|
elif entity_id.startswith('input_select'):
|
||||||
self._ha_api.get_entity(entity_id).call_service("select_next")
|
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
|
# for media page
|
||||||
if button_type == "media-next":
|
if button_type == "media-next":
|
||||||
@@ -348,6 +357,6 @@ class LuiController(object):
|
|||||||
entity = self._ha_api.get_entity(entity_id)
|
entity = self._ha_api.get_entity(entity_id)
|
||||||
if "open_sensors" in entity.attributes and entity.attributes.open_sensors is not None:
|
if "open_sensors" in entity.attributes and entity.attributes.open_sensors is not None:
|
||||||
for e in entity.attributes.open_sensors:
|
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, "", "")
|
self._pages_gen.send_message_page("opnSensorNotifyRes", "", msg, "", "")
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ def map_to_mdi_name(ha_type, state=None, device_class="_", cardType=None):
|
|||||||
return "lightbulb"
|
return "lightbulb"
|
||||||
elif ha_type == "fan":
|
elif ha_type == "fan":
|
||||||
return "fan"
|
return "fan"
|
||||||
|
elif ha_type == "vacuum":
|
||||||
|
return "robot-vacuum"
|
||||||
elif ha_type == "input_boolean":
|
elif ha_type == "input_boolean":
|
||||||
return "check-circle-outline" if state == "on" else "close-circle-outline"
|
return "check-circle-outline" if state == "on" else "close-circle-outline"
|
||||||
elif ha_type == "cover":
|
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"
|
return sensor_mapping[device_class] if device_class in sensor_mapping else "alert-circle-outline"
|
||||||
elif ha_type == "alarm-arm-fail":
|
elif ha_type == "alarm-arm-fail":
|
||||||
return "progress-alert"
|
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:
|
else:
|
||||||
return "alert-circle-outline"
|
return "alert-circle-outline"
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class LuiPagesGen(object):
|
|||||||
self._locale = config.get("locale")
|
self._locale = config.get("locale")
|
||||||
self._send_mqtt_msg = send_mqtt_msg
|
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 overwrite is not None:
|
||||||
if type(overwrite) is list:
|
if type(overwrite) is list:
|
||||||
return rgb_dec565(overwrite)
|
return rgb_dec565(overwrite)
|
||||||
@@ -35,7 +35,19 @@ class LuiPagesGen(object):
|
|||||||
attr = entity.attributes
|
attr = entity.attributes
|
||||||
default_color_on = rgb_dec565([253, 216, 53])
|
default_color_on = rgb_dec565([253, 216, 53])
|
||||||
default_color_off = rgb_dec565([68, 115, 158])
|
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:
|
if "rgb_color" in attr:
|
||||||
color = attr.rgb_color
|
color = attr.rgb_color
|
||||||
@@ -129,6 +141,25 @@ class LuiPagesGen(object):
|
|||||||
entity = self._ha_api.get_entity(wOF.get("entity"))
|
entity = self._ha_api.get_entity(wOF.get("entity"))
|
||||||
up = name if name is not None else entity.attributes.friendly_name
|
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)
|
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", "")
|
unit_of_measurement = entity.attributes.get("unit_of_measurement", "")
|
||||||
down = f"{entity.state} {unit_of_measurement}"
|
down = f"{entity.state} {unit_of_measurement}"
|
||||||
weather_res+=f"~{up}~{icon}~{down}"
|
weather_res+=f"~{up}~{icon}~{down}"
|
||||||
@@ -162,6 +193,7 @@ class LuiPagesGen(object):
|
|||||||
icon = item.iconOverride
|
icon = item.iconOverride
|
||||||
colorOverride = item.colorOverride
|
colorOverride = item.colorOverride
|
||||||
name = item.nameOverride
|
name = item.nameOverride
|
||||||
|
uuid = item.uuid
|
||||||
# type of the item is the string before the "." in the entityId
|
# type of the item is the string before the "." in the entityId
|
||||||
entityType = entityId.split(".")[0]
|
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):
|
if item.status is not None and self._ha_api.entity_exists(item.status):
|
||||||
status_entity = self._ha_api.get_entity(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_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(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":
|
if item.status.startswith("sensor") and cardType == "cardGrid":
|
||||||
icon_res = status_entity.state[:4]
|
icon_res = status_entity.state[:4]
|
||||||
if icon_res[-1] == ".":
|
if icon_res[-1] == ".":
|
||||||
@@ -194,6 +226,10 @@ class LuiPagesGen(object):
|
|||||||
name = name if name is not None else "conf name missing"
|
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")
|
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}"
|
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):
|
if not self._ha_api.entity_exists(entityId):
|
||||||
return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~Not found check~ apps.yaml"
|
return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~Not found check~ apps.yaml"
|
||||||
|
|
||||||
@@ -225,11 +261,11 @@ class LuiPagesGen(object):
|
|||||||
else:
|
else:
|
||||||
pos_status = pos
|
pos_status = pos
|
||||||
if bits & 0b00000001: # SUPPORT_OPEN
|
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_status = "enable"
|
||||||
icon_up = get_action_id_ha(ha_type=entityType, action="open", device_class=device_class)
|
icon_up = get_action_id_ha(ha_type=entityType, action="open", device_class=device_class)
|
||||||
if bits & 0b00000010: # SUPPORT_CLOSE
|
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_status = "enable"
|
||||||
icon_down = get_action_id_ha(ha_type=entityType, action="close", device_class=device_class)
|
icon_down = get_action_id_ha(ha_type=entityType, action="close", device_class=device_class)
|
||||||
if bits & 0b00001000: # SUPPORT_STOP
|
if bits & 0b00001000: # SUPPORT_STOP
|
||||||
@@ -295,6 +331,23 @@ class LuiPagesGen(object):
|
|||||||
icon_id = get_icon_id_ha("button", state=entity.state, overwrite=icon)
|
icon_id = get_icon_id_ha("button", state=entity.state, overwrite=icon)
|
||||||
text = entity.state
|
text = entity.state
|
||||||
return f"~button~{entityId}~{icon_id}~17299~{name}~{text}"
|
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~"
|
return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~unsupported~"
|
||||||
|
|
||||||
def generate_entities_page(self, navigation, heading, items, cardType):
|
def generate_entities_page(self, navigation, heading, items, cardType):
|
||||||
@@ -413,7 +466,7 @@ class LuiPagesGen(object):
|
|||||||
command = f"entityUpd~{heading}~{navigation}~{item}~{icon}~{title}~{author}~{volume}~{iconplaypause}~{source}~{speakerlist[:200]}~{onoffbutton}~{mediaBtn}"
|
command = f"entityUpd~{heading}~{navigation}~{item}~{icon}~{title}~{author}~{volume}~{iconplaypause}~{source}~{speakerlist[:200]}~{onoffbutton}~{mediaBtn}"
|
||||||
self._send_mqtt_msg(command)
|
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
|
item = entity.entityId
|
||||||
if not self._ha_api.entity_exists(item):
|
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"
|
command = f"entityUpd~{item}~{navigation}~Not found~Not found~Check your~Check your~apps.~apps.~yaml~yaml~0~~0"
|
||||||
@@ -428,6 +481,7 @@ class LuiPagesGen(object):
|
|||||||
icon = get_icon_id("shield-off")
|
icon = get_icon_id("shield-off")
|
||||||
if not entity.attributes.get("code_arm_required", False):
|
if not entity.attributes.get("code_arm_required", False):
|
||||||
numpad = "disable"
|
numpad = "disable"
|
||||||
|
if overwrite_supported_modes is None:
|
||||||
bits = entity.attributes.supported_features
|
bits = entity.attributes.supported_features
|
||||||
if bits & 0b000001:
|
if bits & 0b000001:
|
||||||
supported_modes.append("arm_home")
|
supported_modes.append("arm_home")
|
||||||
@@ -437,6 +491,8 @@ class LuiPagesGen(object):
|
|||||||
supported_modes.append("arm_night")
|
supported_modes.append("arm_night")
|
||||||
if bits & 0b100000:
|
if bits & 0b100000:
|
||||||
supported_modes.append("arm_vacation")
|
supported_modes.append("arm_vacation")
|
||||||
|
else:
|
||||||
|
supported_modes = overwrite_supported_modes
|
||||||
else:
|
else:
|
||||||
supported_modes.append("disarm")
|
supported_modes.append("disarm")
|
||||||
|
|
||||||
@@ -466,7 +522,7 @@ class LuiPagesGen(object):
|
|||||||
#add button to show sensor state
|
#add button to show sensor state
|
||||||
add_btn = ""
|
add_btn = ""
|
||||||
if "open_sensors" in entity.attributes and entity.attributes.open_sensors is not None:
|
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:
|
if alarmBtn is not None and type(alarmBtn) is dict:
|
||||||
entity = alarmBtn.get("entity")
|
entity = alarmBtn.get("entity")
|
||||||
iconnav = get_icon_id_ha("alarm-arm-fail", overwrite=alarmBtn.get("icon"))
|
iconnav = get_icon_id_ha("alarm-arm-fail", overwrite=alarmBtn.get("icon"))
|
||||||
@@ -522,7 +578,8 @@ class LuiPagesGen(object):
|
|||||||
self.generate_media_page(navigation, card.title, card.entity, mediaBtn)
|
self.generate_media_page(navigation, card.title, card.entity, mediaBtn)
|
||||||
if card.cardType == "cardAlarm":
|
if card.cardType == "cardAlarm":
|
||||||
alarmBtn = card.raw_config.get("alarmControl")
|
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":
|
if card.cardType == "screensaver":
|
||||||
theme = card.raw_config.get("theme")
|
theme = card.raw_config.get("theme")
|
||||||
self.update_screensaver_weather(theme)
|
self.update_screensaver_weather(theme)
|
||||||
@@ -598,11 +655,11 @@ class LuiPagesGen(object):
|
|||||||
if bits & 0b00001111:
|
if bits & 0b00001111:
|
||||||
pos_translation = get_translation(self._locale, "frontend.ui.card.cover.position")
|
pos_translation = get_translation(self._locale, "frontend.ui.card.cover.position")
|
||||||
if bits & 0b00000001: # SUPPORT_OPEN
|
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_status = "enable"
|
||||||
icon_up = get_action_id_ha(ha_type=entityType, action="open", device_class=device_class)
|
icon_up = get_action_id_ha(ha_type=entityType, action="open", device_class=device_class)
|
||||||
if bits & 0b00000010: # SUPPORT_CLOSE
|
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_status = "enable"
|
||||||
icon_down = get_action_id_ha(ha_type=entityType, action="close", device_class=device_class)
|
icon_down = get_action_id_ha(ha_type=entityType, action="close", device_class=device_class)
|
||||||
#if bits & 0b00000100: # SUPPORT_SET_POSITION
|
#if bits & 0b00000100: # SUPPORT_SET_POSITION
|
||||||
@@ -637,14 +694,14 @@ class LuiPagesGen(object):
|
|||||||
icon_color = self.get_entity_color(entity)
|
icon_color = self.get_entity_color(entity)
|
||||||
speed = entity.attributes.get("percentage")
|
speed = entity.attributes.get("percentage")
|
||||||
speedMax = 100
|
speedMax = 100
|
||||||
if(speed == None):
|
if(speed is None):
|
||||||
speed = "disable"
|
speed = "disable"
|
||||||
else:
|
else:
|
||||||
speed = round(entity.attributes.get("percentage")/entity.attributes.get("percentage_step"))
|
speed = round(entity.attributes.get("percentage")/entity.attributes.get("percentage_step"))
|
||||||
speedMax = int(100/entity.attributes.get("percentage_step"))
|
speedMax = int(100/entity.attributes.get("percentage_step"))
|
||||||
|
|
||||||
speed_translation = get_translation(self._locale, "frontend.ui.card.fan.speed")
|
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):
|
def send_message_page(self, ident, heading, msg, b1, b2):
|
||||||
self._send_mqtt_msg(f"pageType~popupNotify")
|
self._send_mqtt_msg(f"pageType~popupNotify")
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ class NsPanelLovelaceUIManager(hass.Hass):
|
|||||||
|
|
||||||
controller = LuiController(self, cfg, send_mqtt_msg)
|
controller = LuiController(self, cfg, send_mqtt_msg)
|
||||||
|
|
||||||
desired_display_firmware_version = 38
|
desired_display_firmware_version = 40
|
||||||
version = "v3.1.0"
|
version = "v3.3.0"
|
||||||
|
|
||||||
model = cfg.get("model")
|
model = cfg.get("model")
|
||||||
if model == "us-l":
|
if model == "us-l":
|
||||||
|
|||||||
@@ -18,3 +18,4 @@ key | optional | type | default | description
|
|||||||
`entity` | False | string | `None` | contains the entity of the current card
|
`entity` | False | string | `None` | contains the entity of the current card
|
||||||
`key` | True | string | `None` | Used by navigate items
|
`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.
|
`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']`
|
||||||
|
|||||||
@@ -41,4 +41,6 @@ List of supported entitiy types for this page:
|
|||||||
- lock
|
- lock
|
||||||
- fan
|
- fan
|
||||||
- automation
|
- automation
|
||||||
|
- alarm
|
||||||
|
- sun
|
||||||
- iText
|
- iText
|
||||||
|
|||||||
@@ -47,4 +47,6 @@ List of supported entitiy types for this page:
|
|||||||
- lock
|
- lock
|
||||||
- fan
|
- fan
|
||||||
- automation
|
- automation
|
||||||
|
- alarm
|
||||||
|
- sun
|
||||||
- iText
|
- iText
|
||||||
|
|||||||
@@ -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.
|
`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.
|
`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.
|
`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.
|
`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.
|
`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
|
`dateFormatBabel` | True | string | `full` | formatting options on https://babel.pocoo.org/en/latest/dates.html?highlight=name%20of%20day#date-fields
|
||||||
|
|||||||
@@ -11,9 +11,8 @@ Change the topic to something unique for your panel, you will need this topic la
|
|||||||
|
|
||||||
# Configure MQTT Connection on AppDaemon
|
# 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`
|
You will find this file in the following location: `config/appdaemon/appdeamon.yaml`
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ key | optional | type | default | description
|
|||||||
`state` | True | string | `None` | Only displayed if Entity state is equal to this value
|
`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
|
`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
|
`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
|
## Override Icons or Names
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
The log of your mqtt broker might give you additional information.
|
||||||
|
|
||||||
2. Check MQTT Configuration of Tasmota.
|
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.
|
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).
|
The examples in the docs ([MQTT Config](https://docs.nspanel.pky.eu/configure_mqtt/)) are an valid example (tasmota<>apps.yaml).
|
||||||
|
|||||||
@@ -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.
|
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))
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,8 @@
|
|||||||
The Backend for ioBroker is maintained by [britzelpuf](https://github.com/britzelpuf) and [armilar](https://github.com/armilar)
|
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
|
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)
|
||||||
|
|
||||||
|
|||||||
@@ -75,4 +75,3 @@ nspanel_screensaver_notification:
|
|||||||
mode: single
|
mode: single
|
||||||
icon: mdi:message-badge
|
icon: mdi:message-badge
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Flash Tasmota to your NSPanel
|
# 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/)
|
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.
|
Checkout Blakadders Template Repo for more information on flashing, do not use the autoexec.be from this page.
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
# Flash Tasmota to your NSPanel
|
# 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/)
|
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.
|
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)
|
[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 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)
|
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`
|
US Version Landscape: `FlashNextion http://nspanel.pky.eu/lui-us-l-release.tft`
|
||||||
|
|
||||||
|
|
||||||
<details>
|
<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>
|
<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**
|
**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>
|
</details>
|
||||||
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,11 @@
|
|||||||
# NSPanel ioBroker Integration
|
# 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
|
## Features
|
||||||
|
|
||||||
- Thermostat Card
|
- Thermostat Card
|
||||||
@@ -10,35 +16,35 @@
|
|||||||
- Screensaver Page with Time, Date and Weather Information.
|
- Screensaver Page with Time, Date and Weather Information.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
- ioBroker
|
|
||||||
- MQTT Broker/Client
|
- [ioBroker](https://github.com/ioBroker/ioBroker)
|
||||||
- Javascript
|
- [MQTT adapter](https://github.com/ioBroker/ioBroker.mqtt) in server mode or configured as client with Mosquitto (or another MQTT broker)
|
||||||
- devices (default)
|
- [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
|
- all devices needs to be defined in the devices panel
|
||||||
- supported device roles are light, dimmer, blind, thermostat
|
|
||||||
|
|
||||||
## Note
|
## 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.
|
You can find this in the device raw settings.
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## 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
|
## Hardware buttons
|
||||||
|
|
||||||
If you like you can add special pages for the 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
|
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
|
## Colors
|
||||||
|
|
||||||
You can define colors this way and use them later in the PageItem element
|
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 BatteryFull: RGB = { red: 96, green: 176, blue: 62 }
|
||||||
const BatteryEmpty: RGB = { red: 179, green: 45, blue: 25 }
|
const BatteryEmpty: RGB = { red: 179, green: 45, blue: 25 }
|
||||||
```
|
```
|
||||||
|
|
||||||
## The config element in the script which needs to be configured
|
## The config element in the script which needs to be configured
|
||||||
```
|
|
||||||
|
```ts
|
||||||
var config: Config = {
|
var config: Config = {
|
||||||
panelRecvTopic: "mqtt.0.tele.WzDisplay.RESULT", // This is the object where the panel send the data to.
|
panelRecvTopic: 'mqtt.0.tele.WzDisplay.RESULT', // Object to receive data from the panel
|
||||||
panelSendTopic: "mqtt.0.cmnd.WzDisplay.CustomSend", // This is the object where data is send to the panel.
|
panelSendTopic: 'mqtt.0.cmnd.WzDisplay.CustomSend', // Object to send data to the panel
|
||||||
firstScreensaverEntity: { ScreensaverEntity: "alias.0.Wetter.HUMIDITY", ScreensaverEntityIcon: "water-percent", ScreensaverEntityText: "Luft", ScreensaverEntityUnitText: "%" },
|
|
||||||
// Items which should be presented on the screensaver page
|
// Items which should be presented on the screensaver page
|
||||||
secondScreensaverEntity: { ScreensaverEntity: "alias.0.Wetter.PRECIPITATION_CHANCE", ScreensaverEntityIcon: "weather-pouring", ScreensaverEntityText: "Regen", ScreensaverEntityUnitText: "%" },
|
firstScreensaverEntity: { ScreensaverEntity: 'alias.0.Wetter.HUMIDITY', ScreensaverEntityIcon: 'water-percent', ScreensaverEntityText: 'Luft', ScreensaverEntityUnitText: '%' },
|
||||||
thirdScreensaverEntity: { ScreensaverEntity: "alias.0.Batterie.ACTUAL", ScreensaverEntityIcon: "battery-medium", ScreensaverEntityText: "Batterie", ScreensaverEntityUnitText: "%" },
|
secondScreensaverEntity: { ScreensaverEntity: 'alias.0.Wetter.PRECIPITATION_CHANCE', ScreensaverEntityIcon: 'weather-pouring', ScreensaverEntityText: 'Regen', ScreensaverEntityUnitText: '%' },
|
||||||
fourthScreensaverEntity: { ScreensaverEntity: "alias.0.Pv.ACTUAL", ScreensaverEntityIcon: "solar-power", ScreensaverEntityText: "PV", ScreensaverEntityUnitText: "W" },
|
thirdScreensaverEntity: { ScreensaverEntity: 'alias.0.Batterie.ACTUAL', ScreensaverEntityIcon: 'battery-medium', ScreensaverEntityText: 'Batterie', ScreensaverEntityUnitText: '%' },
|
||||||
screenSaverDoubleClick: false, // Doubletouch needed for leaving screensaver.
|
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
|
timeoutScreensaver: 15, // Timeout for screensaver
|
||||||
dimmode: 8, // Display dim
|
dimmode: 8, // Display dim
|
||||||
locale: "de_DE", // not used right now
|
locale: 'de_DE', // not used right now
|
||||||
timeFormat: "%H:%M", // not used right now
|
timeFormat: '%H:%M', // not used right now
|
||||||
dateFormat: "%A, %d. %B %Y", // not used right now
|
dateFormat: '%A, %d. %B %Y', // not used right now
|
||||||
weatherEntity: "alias.0.Wetter",
|
weatherEntity: 'alias.0.Wetter',
|
||||||
defaultColor: Off, // Default color of all elements
|
defaultColor: Off, // Default color of all elements
|
||||||
defaultOnColor: RGB, // Default on state color for items
|
defaultOnColor: RGB, // Default on state color for items
|
||||||
defaultOffColor: RGB, // Default off state color for page
|
defaultOffColor: RGB, // Default off state color for page
|
||||||
temperatureUnit: "°C", // Unit to append on temperature sensors
|
temperatureUnit: '°C', // Unit to append on temperature sensors
|
||||||
pages: [Wohnen, Strom,
|
pages: [
|
||||||
|
Wohnen,
|
||||||
|
Strom,
|
||||||
{
|
{
|
||||||
"type": "cardThermo",
|
type: 'cardThermo',
|
||||||
"heading": "Thermostat",
|
heading: 'Thermostat',
|
||||||
"useColor": true,
|
useColor: true,
|
||||||
"items": [<PageItem>{ id: "alias.0.WzNsPanel" }]
|
items:
|
||||||
|
[<PageItem>{ id: 'alias.0.WzNsPanel' }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
button1Page: button1Page, // A cardEntities, cardThermo or nothing. This will be opened when pressing button1
|
button1Page: button1Page, // A cardEntities, cardThermo or nothing. This will be opened when pressing button1
|
||||||
@@ -86,7 +101,8 @@ var config: Config = {
|
|||||||
```
|
```
|
||||||
|
|
||||||
The pageItem element:
|
The pageItem element:
|
||||||
```
|
|
||||||
|
```ts
|
||||||
type PageItem = {
|
type PageItem = {
|
||||||
id: string, // the element in ioBroker devices
|
id: string, // the element in ioBroker devices
|
||||||
icon: (string | undefined), // the icon which should be displayed instead of the default detected. (not implemented)
|
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.
|
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.
|
||||||
|
|
||||||
```
|
```ts
|
||||||
var button1Page: PageGrid =
|
const button1Page: PageGrid =
|
||||||
{
|
{
|
||||||
"type": "cardGrid",
|
type: 'cardGrid',
|
||||||
"heading": "Radio",
|
heading: 'Radio',
|
||||||
"useColor": true, // should colors be enabled on this page, can be overridden in PageItem
|
useColor: true, // should colors be enabled on this page, can be overridden in PageItem
|
||||||
"items": [
|
items: [
|
||||||
<PageItem>{ id: "alias.0.Radio.NJoy" },
|
<PageItem>{ id: 'alias.0.Radio.NJoy' },
|
||||||
<PageItem>{ id: "alias.0.Radio.Delta_Radio" },
|
<PageItem>{ id: 'alias.0.Radio.Delta_Radio' },
|
||||||
<PageItem>{ id: "alias.0.Radio.NDR2" },
|
<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.
|
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: [
|
pages: [
|
||||||
button1Page,
|
button1Page,
|
||||||
{
|
{
|
||||||
"type": "cardEntities",
|
type: 'cardEntities',
|
||||||
"heading": "Strom",
|
heading: 'Strom',
|
||||||
"useColor": true, // should colors be enabled on this page, can be overridden in PageItem
|
useColor: true, // should colors be enabled on this page, can be overridden in PageItem
|
||||||
"items": [
|
items: [
|
||||||
<PageItem>{ id: "alias.0.Netz", icon: "flash", interpolateColor: true, offColor: BatteryFull, onColor: Red, minValue: -1000, maxValue: 1000 },
|
<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.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.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 }
|
<PageItem>{ id: 'alias.0.Batterie', icon: 'battery-medium', interpolateColor: true, offColor: BatteryEmpty, onColor: BatteryFull }
|
||||||
]
|
]
|
||||||
}]
|
}
|
||||||
|
];
|
||||||
```
|
```
|
||||||
|
|||||||
6914
ip-symcon/icon_mapping.php
Normal file
6914
ip-symcon/icon_mapping.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -65,13 +65,13 @@ plugins:
|
|||||||
|
|
||||||
nav:
|
nav:
|
||||||
- "Overview": index.md
|
- "Overview": index.md
|
||||||
- "Getting started (HA)":
|
- "Getting started (Home Assistant)":
|
||||||
- "First steps":
|
- "First steps":
|
||||||
- "Prepare NsPanel": prepare_nspanel.md
|
- "Prepare NsPanel": prepare_nspanel.md
|
||||||
- "Prepare Home Assistant": prepare_ha.md
|
- "Prepare Home Assistant": prepare_ha.md
|
||||||
- "Configure MQTT": configure_mqtt.md
|
- "Configure MQTT": configure_mqtt.md
|
||||||
- "FAQ": faq.md
|
- "FAQ": faq.md
|
||||||
- "Configuration - apps.yaml (HA)":
|
- "Configuration - apps.yaml (Home Assistant)":
|
||||||
- "Overview": config-overview.md
|
- "Overview": config-overview.md
|
||||||
- "Screensaver": config-screensaver.md
|
- "Screensaver": config-screensaver.md
|
||||||
- "Cards":
|
- "Cards":
|
||||||
@@ -87,5 +87,5 @@ nav:
|
|||||||
- "Physical Buttons": phys-btn.md
|
- "Physical Buttons": phys-btn.md
|
||||||
|
|
||||||
- "Getting started (ioBroker)":
|
- "Getting started (ioBroker)":
|
||||||
- "Prepare NsPanel": prepare_nspanel2.md
|
- "Prepare NsPanel": prepare_nspanel_ioBroker.md
|
||||||
- "Prepare ioBroker": iobroker-install.md
|
- "Prepare ioBroker": iobroker-install.md
|
||||||
|
|||||||
Reference in New Issue
Block a user