Compare commits

..

76 Commits

Author SHA1 Message Date
Johannes
847546893f Update controller.py 2023-08-23 18:47:45 +02:00
Johannes
11106eb778 Update pages.py 2023-08-23 18:34:16 +02:00
Johannes
cf1acdefff Update pages.py #946 2023-08-23 18:30:33 +02:00
Armilar
5a07523a86 v4.2.0.2 - Add cardGrid2
* Add cardGrid2
2023-08-23 12:32:07 +02:00
Armilar
affb663579 v4.2.0.2 - Add cardGrid2
* Add cardGrid2
2023-08-23 12:32:01 +02:00
Armilar
d2695d993e v4.2.0.1 - Update NsPanelTs_without_Examples.ts
* v4.2.0    Upgrade TFT 52 / 4.2.0
 * v4.2.0    Add new alias state for iconcolor and buttontext for icon for subpages
* v4.2.0.1  Add iconArray to Alias "Klimaanlage" (airCondition)
2023-08-22 15:19:27 +02:00
Armilar
b3b24d4b8d v4.2.0.1 - Update NsPanelTs.ts
* v4.2.0    Upgrade TFT 52 / 4.2.0
 * v4.2.0    Add new alias state for iconcolor and buttontext for icon for subpages
* v4.2.0.1  Add iconArray to Alias "Klimaanlage" (airCondition)
2023-08-22 15:19:21 +02:00
Armilar
690a8f4279 v4.2.0 - Merge pull request #961 from tt-tom17/main
* v4.2.0 - upgrade 52 / 4.2.0
* Add new alias state for iconcolor and buttontext for icon for subpages
* Add Alias role 'warnings' for icon for subpages
2023-08-22 09:15:16 +02:00
Armilar
040119963a v4.2.0
* Update 52 / 4.2.0
* Add new alias state for iconcolor and buttontext for icon for subpages
* Add Alias role 'warnings' for icon for subpages
2023-08-22 09:07:00 +02:00
Armilar
fe44b008af v4.2.0
* Update 52 / 4.2.0
* Add new alias state for iconcolor and buttontext for icon for subpages
* Add Alias role 'warnings' for icon for subpages
2023-08-22 09:02:40 +02:00
Thomas
7d2503c66b v4.2.0
- Add new alias state for iconcolor and buttontext for icon for subpages
- Add Alias role 'warnings' for icon for subpages
2023-08-21 23:44:23 +02:00
Johannes
f0edaa36fb Update nspanel-lovelace-ui.py 2023-08-20 15:53:34 +02:00
joBr99
6d41c16eda add feature flag for new sliders 2023-08-20 15:43:20 +02:00
joBr99
337657fede fixes #955 2023-08-20 15:24:06 +02:00
joBr99
652dd0b157 fixes #933 (add nextion2text) 2023-08-20 13:07:23 +00:00
joBr99
e580333560 fixes #933 2023-08-20 15:03:27 +02:00
joBr99
8407171efb sync us-l 2023-08-20 14:50:48 +02:00
joBr99
291102971a Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui (add nextion2text) 2023-08-20 12:42:36 +00:00
joBr99
a1104b8f81 Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui 2023-08-20 14:39:27 +02:00
joBr99
48e9d2c8a3 sync us-l 2023-08-20 14:39:20 +02:00
joBr99
306a189d79 fixes #957 (add nextion2text) 2023-08-20 12:32:17 +00:00
joBr99
98b40de8dc fixes #957 2023-08-20 14:27:54 +02:00
Armilar
2355ce9c82 Merge pull request #956 from kuckuckmann/main-2
Create Index-Jumpmenue_inSelpopup.xml
2023-08-17 00:11:05 +02:00
kuckuckmann
d743eb00db Create Index-Jumpmenue_inSelpopup.xml
Blockly Skript für das inSelpopup für das Index-Jumpmenü.
2023-08-16 22:07:11 +02:00
Armilar
c725defd30 Merge pull request #953 from kuckuckmann/main-1
Create ShellyDuo_inkl_InSel.xml
2023-08-14 22:53:53 +02:00
kuckuckmann
3b297607ff Create ShellyDuo_inkl_InSel.xml
Script for Wiki
2023-08-14 22:49:38 +02:00
Armilar
bb9e6b3799 Update v4.1.4.4 NsPanelTs.ts
- 12.08.2023 - v4.1.4    Upgrade TFT 51 / 4.1.4
- 12.08.2023 - v4.1.4.1  Fix Label CANCEL for popupTimer
- 12.08.2023 - v4.1.4.1  Fix TypeScript Error (JS-Adapter > 7.1.X) by Gargano
- 12.08.2023 - v4.1.4.1  CardGRid with maxItems = 8
- 12.08.2023 - v4.1.4.2  Add onStop function() to Schedules
- 13.08.2023 - v4.1.4.3  Add InSel to popUpLight
- 13.08.2023 - v4.1.4.4  Add Parameter inSel_ChoiceState to InSel to show/hide Focus
2023-08-13 23:28:01 +02:00
Armilar
7f73e28861 Update v4.1.4.4 NsPanelTs_without_Examples.ts
- 12.08.2023 - v4.1.4    Upgrade TFT 51 / 4.1.4
- 12.08.2023 - v4.1.4.1  Fix Label CANCEL for popupTimer
- 12.08.2023 - v4.1.4.1  Fix TypeScript Error (JS-Adapter > 7.1.X) by Gargano
- 12.08.2023 - v4.1.4.1  CardGRid with maxItems = 8
- 12.08.2023 - v4.1.4.2  Add onStop function() to Schedules
- 13.08.2023 - v4.1.4.3  Add InSel to popUpLight
- 13.08.2023 - v4.1.4.4  Add Parameter inSel_ChoiceState to InSel to show/hide Focus
2023-08-13 23:27:54 +02:00
Armilar
d81fc9e278 Update v4.1.4.3 NsPanelTs.ts
- 12.08.2023 - v4.1.4    Upgrade TFT 51 / 4.1.4
- 12.08.2023 - v4.1.4.1  Fix Label CANCEL for popupTimer
- 12.08.2023 - v4.1.4.1  Fix TypeScript Error (JS-Adapter > 7.1.X) by Gargano
- 12.08.2023 - v4.1.4.1  CardGRid with maxItems = 8
- 12.08.2023 - v4.1.4.2  Add onStop function() to Schedules
- 12.08.2023 - v4.1.4.3  Add InSel to popUpLight
2023-08-13 22:44:25 +02:00
Armilar
f4fa14eb16 Update v4.1.4.3 NsPanelTs_without_Examples.ts
- 12.08.2023 - v4.1.4    Upgrade TFT 51 / 4.1.4
- 12.08.2023 - v4.1.4.1  Fix Label CANCEL for popupTimer
- 12.08.2023 - v4.1.4.1  Fix TypeScript Error (JS-Adapter > 7.1.X) by Gargano
- 12.08.2023 - v4.1.4.1  CardGRid with maxItems = 8
- 12.08.2023 - v4.1.4.2  Add onStop function() to Schedules
- 12.08.2023 - v4.1.4.3  Add InSel to popUpLight
2023-08-13 22:44:02 +02:00
Armilar
5652387869 Update 4.1.4.2 NsPanelTs_without_Examples.ts
- 12.08.2023 - v4.1.4    Upgrade TFT 51 / 4.1.4
- 12.08.2023 - v4.1.4.1  Fix Label CANCEL for popupTimer
- 12.08.2023 - v4.1.4.1  Fix TypeScript Error (JS-Adapter > 7.1.X) by Gargano
 - 12.08.2023 - v4.1.4.1  CardGRid with maxItems = 8
 - 12.08.2023 - v4.1.4.2  Add onStop function() to Schedules
        
 - Todo       - v4.1.4.3  Add InSel to popUpLight
2023-08-12 22:03:37 +02:00
Armilar
cbd5a084af Update NsPanelTs.ts
- 12.08.2023 - v4.1.4    Upgrade TFT 51 / 4.1.4
- 12.08.2023 - v4.1.4.1  Fix Label CANCEL for popupTimer
- 12.08.2023 - v4.1.4.1  Fix TypeScript Error (JS-Adapter > 7.1.X) by Gargano
 - 12.08.2023 - v4.1.4.1  CardGRid with maxItems = 8
 - 12.08.2023 - v4.1.4.2  Add onStop function() to Schedules
        
 - Todo       - v4.1.4.3  Add InSel to popUpLight
2023-08-12 22:03:32 +02:00
Armilar
80a881c980 Update 4.1.4.1 NsPanelTs.ts
- 12.08.2023 - v4.1.4    Upgrade TFT 51 / 4.1.4
- 12.08.2023 - v4.1.4.1  Fix Label CANCEL for popupTimer
- 12.08.2023 - v4.1.4.1  Fix TypeScript Error (JS-Adapter > 7.1.X) by Gargano
- 12.08.2023 - v4.1.4.1  CardGRid with maxItems = 8
        
- Todo       - v4.1.4.2  Add InSel to popUpLight
- Todo       - v4.1.4.2  Add onStop (function() to Schedules
2023-08-12 14:39:06 +02:00
Armilar
7d58066448 Update Update 4.1.4.1 NsPanelTs_without_Examples.ts
- 12.08.2023 - v4.1.4    Upgrade TFT 51 / 4.1.4
- 12.08.2023 - v4.1.4.1  Fix Label CANCEL for popupTimer
- 12.08.2023 - v4.1.4.1  Fix TypeScript Error (JS-Adapter > 7.1.X) by Gargano
- 12.08.2023 - v4.1.4.1  CardGRid with maxItems = 8
        
- Todo       - v4.1.4.2  Add InSel to popUpLight
- Todo       - v4.1.4.2  Add onStop (function() to Schedules
2023-08-12 14:38:58 +02:00
joBr99
63cce74dbe Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui (add nextion2text) 2023-08-08 20:49:12 +00:00
joBr99
f4db5490ed Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui 2023-08-08 22:44:19 +02:00
joBr99
e8713881b6 set popupNotify permanent to 1 year 2023-08-08 22:44:09 +02:00
joBr99
43d21a4b6b Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui (add nextion2text) 2023-08-08 19:45:40 +00:00
joBr99
ce0215c1d2 Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui 2023-08-08 21:41:39 +02:00
joBr99
498b90ad77 upd 2023-08-08 21:41:22 +02:00
Johannes
66cd7341c9 fixes #936 2023-08-08 19:38:34 +02:00
Johannes
cfbfd8c3e0 Disable detail update for now #945 2023-08-06 22:34:03 +02:00
joBr99
65a381cbac increase cooldown detail update & sync (add nextion2text) 2023-08-06 20:32:44 +00:00
joBr99
4a94526244 increase cooldown detail update & sync 2023-08-06 22:28:03 +02:00
joBr99
442f8ccdf0 fixes #949 2023-08-06 22:20:41 +02:00
joBr99
1b57cdbe62 Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui (add nextion2text) 2023-07-31 16:25:33 +00:00
joBr99
3ddef89431 Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui 2023-07-31 18:20:22 +02:00
joBr99
3f416ade44 hide new sliders behind feature flag 2023-07-31 18:20:08 +02:00
Armilar
832c9cd241 Merge pull request #944 from fre4242/main
Improved screensaver advanced icon handling: option to load from iobroker object
2023-07-30 22:02:56 +02:00
Armilar
2aa1e222aa Update NsPanelTs_without_Examples.ts
v4.0.5.15 - Improved screensaverAdvanced icon handling: option to load from iobroker object #944
2023-07-30 21:59:51 +02:00
Armilar
ec15e56728 Update NsPanelTs.ts
v4.0.5.15 - Improved screensaverAdvanced icon handling: option to load from iobroker object #944
2023-07-30 21:59:01 +02:00
fre4242
26cce9ac13 Improved screensaverAdvanced icon handling: option to load from iobroker object 2023-07-30 20:09:26 +02:00
Jan Čermák
8850e1d8cb fix cover tilt setting in AppDaemon backend (#939) 2023-07-24 21:43:02 +02:00
Marek
06174d3912 added ui card button translation #937 (#938)
Co-authored-by: Marek Vrana <m.vrana@cid.com>
2023-07-21 21:42:57 +02:00
joBr99
75d652e402 Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui (add nextion2text) 2023-06-23 18:14:55 +00:00
joBr99
893714d569 Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui 2023-06-23 20:10:42 +02:00
joBr99
fd7448c61d fixed #909 2023-06-23 20:10:13 +02:00
Johannes
6b04938a8a fixes #926 2023-06-14 15:32:08 +02:00
Johannes
35af3a778f fixes #925 2023-06-13 18:55:40 +02:00
joBr99
23beb90591 fixes #923 #922 #917 2023-06-11 00:58:15 +02:00
joBr99
e40017c66e Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui (add nextion2text) 2023-06-01 14:52:57 +00:00
joBr99
e94c57344a Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui 2023-06-01 16:48:58 +02:00
joBr99
df3105ac2b fixes #915 2023-06-01 16:48:51 +02:00
joBr99
04f7d026f4 add missing link from cardPower to cardLchart #907 (add nextion2text) 2023-05-23 19:26:00 +00:00
joBr99
f462780c08 add missing link from cardPower to cardLchart #907 2023-05-23 21:21:37 +02:00
Johannes
b7de710de5 Update pages.py 2023-05-21 13:47:48 +02:00
Johannes
e8cc170c0c Update pages.py 2023-05-21 13:45:10 +02:00
Johannes
94d0d176e5 Update controller.py 2023-05-21 13:43:49 +02:00
Johannes
c9222a9484 Update controller.py
fixes #900
2023-05-21 09:56:15 +02:00
joBr99
5d02de6b6d update us-l tft files (add nextion2text) 2023-05-21 07:42:50 +00:00
joBr99
0c3bcf07c3 update us-l tft files 2023-05-21 09:37:44 +02:00
Johannes
9ed8bfc702 fixed #899 2023-05-21 01:18:58 +02:00
Johannes
b3d9883b19 Update README.md 2023-05-20 18:00:29 +02:00
Johannes
a0af621e7d Update README.md 2023-05-20 17:54:49 +02:00
Gerrit
2812dd302c Update README.md (#866)
Added Table of Contents
2023-05-20 17:52:12 +02:00
joBr99
b2b945c6ed update pics 2023-05-20 17:19:39 +02:00
85 changed files with 7917 additions and 1424 deletions

View File

@@ -6,6 +6,24 @@ Messages to the Panel can be send through the Command `CustomSend`, which is imp
You can issue this command through MQTT by sending messages to the `cmnd/XXX/CustomSend` Topic.
Messages from the Panel are send to the `tele/XXX/RESULT` Topic, encoded in json `{"CustomRecv":"message_from_screen"}`
# Table of contents
- [Startup](#startup)
- [Some preperation before we are acually navigating away:](#some-preperation-before-we-are-acually-navigating-away)
- [Navigate from the startup page to the screensaver, by sending this command to the CustomSend Topic.](#navigate-from-the-startup-page-to-the-screensaver-by-sending-this-command-to-the-customsend-topic)
- [Exit Screensaver](#exit-screensaver)
- [Messages to Nextion Display](#messages-to-nextion-display)
- [General Commands, implemented on all pages](#general-commands-implemented-on-all-pages)
- [screensaver page](#screensaver-page)
- [cardEntities Page](#cardentities-page)
- [cardGrid Page](#cardgrid-page)
- [cardMedia](#cardmedia)
- [cardThermo](#cardthermo)
- [cardAlarm](#cardalarm)
- [cardQR](#cardqr)
- [cardPower](#cardpower)
## Startup
On startup the panel will send `{"CustomRecv":"event,startup,39,eu"}` every few seconds.
@@ -94,9 +112,6 @@ change the page type:
### screensaver page
Example default layout: `weatherUpdate~~~A~21130~~-0.7C~~~B~63469~Sat~3.6C~~~C~35957~Sun~3.9C~~~D~31728~Mon~4.3C~~~E~35957~Tue~3.6C`
Example alternative layout: `weatherUpdate~~~A~21130~~-0.7C~~~B~63469~Sat~3.6C~~~C~35957~Sun~3.9C~~~D~31728~Mon~4.3C~~~E~35957~Tue~3.6C~~~F~21130~~23.6C`
<table>
<thead>
<tr>

View File

@@ -2,13 +2,13 @@
+++ HMI/US/landscape/n2t-out
│ --- HMI/n2t-out/Program.s.txt
├── +++ HMI/US/landscape/n2t-out/Program.s.txt
│ @@ -11,10 +11,10 @@
│ // dim value
│ int dimValue=40
│ @@ -13,10 +13,10 @@
│ int dimValueNormal=100
│ //color vars
│ int defaultFontColor=65535
│ int defaultBcoColor=6371
│ //feature flags
│ int featNewSliders=0
│ // fix touch offset
│ - lcd_dev fffb 0002 0000 0020
│ + //lcd_dev fffb 0002 0000 0020
@@ -33,6 +33,27 @@
│ crcputs sys0,2
│ crcputs tSend.txt,0
│ //send cmd
│ @@ -275,20 +275,14 @@
│ }
│ // get font color
│ spstr strCommand.txt,tTmp.txt,"~",4
│ if(tTmp.txt!="")
│ {
│ covx tTmp.txt,defaultFontColor,0,0
│ }
│ - // get feature flag popup
│ - spstr strCommand.txt,tTmp.txt,"~",5
│ - if(tTmp.txt!="")
│ - {
│ - covx tTmp.txt,featNewSliders,0,0
│ - }
│ }
│ if(tInstruction.txt=="timeout")
│ {
│ //set timeout to global var
│ spstr strCommand.txt,tTmp.txt,"~",1
│ covx tTmp.txt,sleepTimeout,0,0
│ }
│ --- HMI/n2t-out/screensaver.txt
├── +++ HMI/US/landscape/n2t-out/screensaver.txt
│ @@ -28,17 +28,14 @@

View File

@@ -14,6 +14,8 @@ Program.s
//color vars
int defaultFontColor=65535
int defaultBcoColor=6371
//feature flags
int featNewSliders=0
// fix touch offset
//lcd_dev fffb 0002 0000 0020
printh 00 00 00 ff ff ff 88 ff ff ff//Output power on information to serial port

View File

@@ -1856,8 +1856,13 @@ Hotspot m0
}
if(type1.txt=="light")
{
//popupLight.tEntity.txt=tEntity1.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type1.txt=="fan")
{
@@ -1899,8 +1904,13 @@ Hotspot m1
}
if(type2.txt=="light")
{
//popupLight.tEntity.txt=tEntity2.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type2.txt=="fan")
{
@@ -1942,8 +1952,13 @@ Hotspot m2
}
if(type3.txt=="light")
{
//popupLight.tEntity.txt=tEntity3.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type3.txt=="fan")
{
@@ -1985,8 +2000,13 @@ Hotspot m3
}
if(type4.txt=="light")
{
//popupLight.tEntity.txt=tEntity4.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type4.txt=="fan")
{

View File

@@ -259,7 +259,7 @@ Text tEntity4
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 16
x coordinate : 22
y coordinate : 274
Width : 140
Height : 30
@@ -1052,7 +1052,13 @@ Timer tmLP
Timer Event
if(tTmp.txt=="light")
{
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(tTmp.txt=="fan")
{

View File

@@ -991,26 +991,26 @@ Button bEntity7
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type6.txt
pageIcons.tTmp1.txt=tEntity6.txt
pageIcons.tTmp2.txt=entn6.txt
pageIcons.tTmp3.txt=bEntity6.txt
if(type6.txt=="shutter")
tTmp.txt=type7.txt
pageIcons.tTmp1.txt=tEntity7.txt
pageIcons.tTmp2.txt=entn7.txt
pageIcons.tTmp3.txt=bEntity7.txt
if(type7.txt=="shutter")
{
page popupShutter
}
if(type6.txt=="input_sel")
if(type7.txt=="input_sel")
{
page popupInSel
}
if(type6.txt=="timer")
if(type7.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
tSend.txt="event,buttonPress2,"+entn7.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -1057,26 +1057,26 @@ Button bEntity8
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type6.txt
pageIcons.tTmp1.txt=tEntity6.txt
pageIcons.tTmp2.txt=entn6.txt
pageIcons.tTmp3.txt=bEntity6.txt
if(type6.txt=="shutter")
tTmp.txt=type8.txt
pageIcons.tTmp1.txt=tEntity8.txt
pageIcons.tTmp2.txt=entn8.txt
pageIcons.tTmp3.txt=bEntity8.txt
if(type8.txt=="shutter")
{
page popupShutter
}
if(type6.txt=="input_sel")
if(type8.txt=="input_sel")
{
page popupInSel
}
if(type6.txt=="timer")
if(type8.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
tSend.txt="event,buttonPress2,"+entn8.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -1274,7 +1274,13 @@ Timer tmLP
Timer Event
if(tTmp.txt=="light")
{
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(tTmp.txt=="fan")
{

View File

@@ -1652,6 +1652,10 @@ Timer tmSerial
{
page cardChart
}
if(tId.txt=="cardLChart")
{
page cardLChart
}
}
if(tInstruction.txt=="time")
{

View File

@@ -1,7 +1,7 @@
Program.s
0 Component(s)
13 Line(s) of event code
13 Unique line(s) of event code
14 Line(s) of event code
14 Unique line(s) of event code
popupThermo
44 Component(s)
523 Line(s) of event code
@@ -10,18 +10,14 @@ pageIcons
7 Component(s)
0 Line(s) of event code
0 Unique line(s) of event code
popupNotify
19 Component(s)
267 Line(s) of event code
172 Unique line(s) of event code
popupTimer
42 Component(s)
516 Line(s) of event code
257 Unique line(s) of event code
popupLight
23 Component(s)
410 Line(s) of event code
209 Unique line(s) of event code
pageStartup
20 Component(s)
193 Line(s) of event code
135 Unique line(s) of event code
cardChart
33 Component(s)
437 Line(s) of event code
@@ -30,10 +26,10 @@ popupInSel
34 Component(s)
621 Line(s) of event code
297 Unique line(s) of event code
pageStartup
20 Component(s)
193 Line(s) of event code
135 Unique line(s) of event code
popupNotify
19 Component(s)
267 Line(s) of event code
172 Unique line(s) of event code
pageTest
26 Component(s)
68 Line(s) of event code
@@ -54,18 +50,18 @@ cardAlarm
43 Component(s)
500 Line(s) of event code
273 Unique line(s) of event code
cardGrid
44 Component(s)
523 Line(s) of event code
295 Unique line(s) of event code
popupLightNew
23 Component(s)
412 Line(s) of event code
209 Unique line(s) of event code
screensaver
46 Component(s)
435 Line(s) of event code
309 Unique line(s) of event code
cardGrid2
52 Component(s)
611 Line(s) of event code
319 Unique line(s) of event code
cardPower
54 Component(s)
531 Line(s) of event code
349 Unique line(s) of event code
cardLChart
33 Component(s)
402 Line(s) of event code
@@ -78,21 +74,29 @@ cardMedia
59 Component(s)
649 Line(s) of event code
322 Unique line(s) of event code
screensaver2
58 Component(s)
348 Line(s) of event code
245 Unique line(s) of event code
cardPower
54 Component(s)
527 Line(s) of event code
347 Unique line(s) of event code
cardGrid2
52 Component(s)
617 Line(s) of event code
338 Unique line(s) of event code
popupLight
28 Component(s)
412 Line(s) of event code
227 Unique line(s) of event code
cardGrid
44 Component(s)
529 Line(s) of event code
298 Unique line(s) of event code
cardEntities
67 Component(s)
1170 Line(s) of event code
532 Unique line(s) of event code
1194 Line(s) of event code
535 Unique line(s) of event code
screensaver2
58 Component(s)
352 Line(s) of event code
247 Unique line(s) of event code
Total
22 Page(s)
847 Component(s)
9920 Line(s) of event code
2360 Unique line(s) of event code
23 Page(s)
875 Component(s)
10379 Line(s) of event code
2407 Unique line(s) of event code

View File

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

View File

@@ -24,12 +24,13 @@ Page popupLight
tEntity.txt=pageIcons.tTmp1.txt
//get entity id
entn.txt=pageIcons.tTmp2.txt
tIcon1.txt=pageIcons.tTmp3.txt
vis p0,0
vis tSend,0
vis tTmp,0
vis tInstruction,0
vis tId,0
vis bEffect,0
vis hBrightness,0
//page open event
// event,pageOpenDetail,typeOfPage,tEntityName
// craft command
@@ -46,16 +47,16 @@ Page popupLight
prints tSend.txt,0
prints crcval,2
//disable brightness by default
//vis t1,0
//vis t2,0
vis hBrightness,1
vis t1,0
vis t2,0
vis hBrightness,0
//disable color temp by default
//vis t4,0
//vis t3,0
vis t4,0
vis t3,0
vis hTempSlider,0
//disable color wheel components by default
vis bColor,0
//vis t0,0
vis t0,0
vis pColorWheel,0
//vis t0,0
popupLight.bco=defaultBcoColor
@@ -74,83 +75,115 @@ Page popupLight
}
if(defaultBcoColor==0)
{
hBrightness.pic=24
hBrightness.pic1=25
hBrightness.pic2=15
hTempSlider.pic=16
hTempSlider.pic1=16
hTempSlider.pic1=17
hTempSlider.pic2=15
}
Postinitialize Event
fill hBrightness.x,hBrightness.y,100,250,defaultBcoColor
Variable (int32) col
Attributes
ID : 18
Scope: local
Value: 65504
Variable (string) entn
Attributes
ID : 11
ID : 20
Scope : local
Text :
Max. Text Size: 80
Variable (int32) mode
Attributes
ID : 13
ID : 22
Scope: local
Value: 1
Variable (int32) mode_temp
Attributes
ID : 14
ID : 23
Scope: local
Value: 0
Variable (string) strCommand
Attributes
ID : 9
ID : 16
Scope : local
Text :
Max. Text Size: 500
Variable (string) tId
Attributes
ID : 20
Scope : local
Text :
Max. Text Size: 20
Variable (string) tInstruction
Attributes
ID : 19
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
ID : 16
ID : 26
Scope : local
Text :
Max. Text Size: 200
Variable (string) tTmp
Text t0
Attributes
ID : 21
Scope : local
Text :
Max. Text Size: 80
Text tEntity
Attributes
ID : 2
ID : 24
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 108
y coordinate : 21
Width : 263
x coordinate : 9
y coordinate : 80
Width : 64
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: left
Vertical Alignment : center
Input Type : character
Text : Color
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t1
Attributes
ID : 6
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 10
y coordinate : 226
Width : 211
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: left
Vertical Alignment : center
Input Type : character
Text : Brightness
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t2
Attributes
ID : 9
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 10
y coordinate : 267
Width : 45
Height : 30
Effect : load
Effect Priority : 0
@@ -160,25 +193,244 @@ Text tEntity
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 65535
Font Color : 40147
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t3
Attributes
ID : 10
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 10
y coordinate : 181
Width : 45
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 40147
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t4
Attributes
ID : 11
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 9
y coordinate : 143
Width : 242
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: left
Vertical Alignment : center
Input Type : character
Text : Temperature
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tEntity
Attributes
ID : 3
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 92
y coordinate : 21
Width : 263
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: left
Vertical Alignment : center
Input Type : character
Text : tEntity1
Max. Text Size : 25
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Picture pColorWheel
Text tIcon1
Attributes
ID : 4
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 11
y coordinate : 21
Width : 45
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 17299
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tId
Attributes
ID : 18
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 100
y coordinate : 290
Width : 100
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
Text tInstruction
Attributes
ID : 17
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 290
Width : 100
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
Text tTmp
Attributes
ID : 12
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 406
y coordinate : 277
Width : 34
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 : 80
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Picture p0
Attributes
ID : 1
Scope : local
Dragging : 0
Send Component ID: disabled
Opacity : 127
x coordinate : 249
y coordinate : 105
x coordinate : 0
y coordinate : 0
Width : 480
Height : 320
Effect : load
Effect Priority : 0
Effect Time : 300
Picture ID : 0
Picture pColorWheel
Attributes
ID : 2
Scope : local
Dragging : 0
Send Component ID: disabled
Opacity : 127
x coordinate : 167
y coordinate : 69
Width : 160
Height : 160
Effect : load
@@ -216,44 +468,30 @@ Picture pColorWheel
Slider hBrightness
Attributes
ID : 4
ID : 7
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 105
y coordinate : 64
Width : 100
Height : 250
x coordinate : 61
y coordinate : 261
Width : 335
Height : 43
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : vertical
Direction : horizontal
Fill : image
Cursor width : auto
Cursor height : 1
Back. Picture ID : 65535
Slided Back. Picture ID: 65535
Cursor height : 255
Back. Picture ID : 5
Slided Back. Picture ID: 4
Position : 50
Upper range limit : 100
Lower range limit : 0
Events
Touch Release Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
@@ -274,24 +512,24 @@ Slider hBrightness
Slider hTempSlider
Attributes
ID : 10
ID : 19
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 279
y coordinate : 64
Width : 100
Height : 250
x coordinate : 61
y coordinate : 178
Width : 335
Height : 44
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : vertical
Direction : horizontal
Fill : image
Cursor width : auto
Cursor height : 255
Back. Picture ID : 7
Slided Back. Picture ID: 7
Back. Picture ID : 22
Slided Back. Picture ID: 23
Position : 50
Upper range limit : 100
Lower range limit : 0
@@ -318,12 +556,12 @@ Slider hTempSlider
Button b0
Attributes
ID : 3
ID : 5
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 413
x coordinate : 397
y coordinate : 8
Width : 50
Height : 50
@@ -364,13 +602,13 @@ Button b0
Button bColor
Attributes
ID : 12
ID : 21
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 30
y coordinate : 146
x coordinate : 93
y coordinate : 68
Width : 50
Height : 50
Effect : load
@@ -401,8 +639,8 @@ Button bColor
//enable color wheel
vis pColorWheel,1
//disable color temp
//vis t4,0
//vis t3,0
vis t4,0
vis t3,0
vis hTempSlider,0
}else
{
@@ -412,21 +650,21 @@ Button bColor
if(mode_temp.val==1)
{
//enable color temp
//vis t4,1
//vis t3,1
vis t4,1
vis t3,1
vis hTempSlider,1
}
}
Button bEffect
Attributes
ID : 17
ID : 27
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 30
y coordinate : 213
x coordinate : 396
y coordinate : 95
Width : 50
Height : 50
Effect : load
@@ -453,17 +691,18 @@ Button bEffect
Touch Press Event
pageIcons.tTmp1.txt=tEntity.txt
pageIcons.tTmp2.txt=entn.txt
pageIcons.tTmp3.txt=tIcon1.txt
page popupInSel
Dual-state Button btOnOff1
Attributes
ID : 5
ID : 8
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 30
y coordinate : 77
x coordinate : 341
y coordinate : 95
Width : 50
Height : 50
Effect : load
@@ -502,43 +741,18 @@ Dual-state Button btOnOff1
Timer tmCooldown
Attributes
ID : 15
ID : 25
Scope : local
Period (ms): 100
Period (ms): 300
Enabled : no
Events
Timer Event
tmCooldown.en=0
Timer tmDrawCooldown
Attributes
ID : 22
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
Timer tmSerial
Attributes
ID : 8
ID : 15
Scope : local
Period (ms): 50
Enabled : yes
@@ -593,12 +807,11 @@ Timer tmSerial
{
// change icon
//spstr strCommand.txt,tIcon1.txt,"~",2
//vis tIcon1,1
vis tIcon1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",3
covx tTmp.txt,sys0,0,0
col.val=sys0
//tEntity.pco=sys0
tIcon1.pco=sys0
// get Button State
spstr strCommand.txt,tTmp.txt,"~",4
covx tTmp.txt,sys0,0,0
@@ -607,26 +820,27 @@ Timer tmSerial
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt=="disable")
{
//vis t1,0
//vis t2,0
vis t1,0
vis t2,0
vis hBrightness,0
}else
{
//vis t1,1
//vis t2,1
vis t1,1
vis t2,1
vis hBrightness,1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
tmDrawCooldown.en=1
tmDrawCooldown.tim=500
if(tmCooldown.en==0)
{
hBrightness.val=sys0
}
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6
if(tTmp.txt=="disable")
{
vis hTempSlider,0
//vis t3,0
//vis t4,0
vis t3,0
vis t4,0
mode_temp.val=0
// mode == 1 is temp controls currently shown
if(mode.val==1)
@@ -649,8 +863,8 @@ Timer tmSerial
{
mode_temp.val=1
vis hTempSlider,1
//vis t3,1
//vis t4,1
vis t3,1
vis t4,1
if(tmCooldown.en==0)
{
covx tTmp.txt,sys0,0,0
@@ -669,12 +883,12 @@ Timer tmSerial
// disable -> isn't supported
if(tTmp.txt=="disable")
{
//vis t0,0
vis t0,0
vis bColor,0
vis pColorWheel,0
}else
{
//vis t0,1
vis t0,1
//only enable bColor button if color temp is also supported
if(mode_temp.val==1)
{
@@ -686,11 +900,11 @@ Timer tmSerial
}
}
// set t0 Color (Localization)
//spstr strCommand.txt,t0.txt,"~",8
spstr strCommand.txt,t0.txt,"~",8
// set t4 Temperature (Localization)
//spstr strCommand.txt,t4.txt,"~",9
spstr strCommand.txt,t4.txt,"~",9
// set t1 Brightness (Localization)
//spstr strCommand.txt,t1.txt,"~",10
spstr strCommand.txt,t1.txt,"~",10
// activate effect button
spstr strCommand.txt,tTmp.txt,"~",11
if(tTmp.txt=="enable")
@@ -825,7 +1039,7 @@ Timer tmSerial
Timer tmSleep
Attributes
ID : 7
ID : 14
Scope : local
Period (ms): 1000
Enabled : yes
@@ -845,7 +1059,7 @@ Timer tmSleep
TouchCap tc0
Attributes
ID : 6
ID : 13
Scope: local
Value: 0

View File

@@ -0,0 +1,855 @@
Page popupLightNew
Attributes
ID : 0
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
Width : 480
Effect : load
Effect Priority : 0
Effect Time : 300
Locked : no
Swide up page ID : disabled
Swide down page ID : disabled
Swide left page ID : disabled
Swide right page ID: disabled
Fill : solid color
Back. Color : 6371
Events
Preinitialize Event
dim=dimValueNormal
//get entitiy name
tEntity.txt=pageIcons.tTmp1.txt
//get entity id
entn.txt=pageIcons.tTmp2.txt
vis tSend,0
vis tTmp,0
vis tInstruction,0
vis tId,0
vis bEffect,0
vis hBrightness,0
//page open event
// event,pageOpenDetail,typeOfPage,tEntityName
// craft command
tSend.txt="event,pageOpenDetail,popupLight,"+entn.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
//disable brightness by default
//vis t1,0
//vis t2,0
vis hBrightness,1
//disable color temp by default
//vis t4,0
//vis t3,0
vis hTempSlider,0
//disable color wheel components by default
vis bColor,0
//vis t0,0
vis pColorWheel,0
//vis t0,0
popupLightNew.bco=defaultBcoColor
for(sys0=0;sys0<27;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
b[sys0].bco=defaultBcoColor
b[sys0].pco=defaultFontColor
}
if(b[sys0].type==53&&defaultBcoColor==0)
{
b[sys0].pic=10
b[sys0].pic2=11
}
}
if(defaultBcoColor==0)
{
hTempSlider.pic=16
hTempSlider.pic1=16
}
Postinitialize Event
fill hBrightness.x,hBrightness.y,100,250,defaultBcoColor
Variable (int32) col
Attributes
ID : 18
Scope: local
Value: 65504
Variable (string) entn
Attributes
ID : 11
Scope : local
Text :
Max. Text Size: 80
Variable (int32) mode
Attributes
ID : 13
Scope: local
Value: 1
Variable (int32) mode_temp
Attributes
ID : 14
Scope: local
Value: 0
Variable (string) strCommand
Attributes
ID : 9
Scope : local
Text :
Max. Text Size: 500
Variable (string) tId
Attributes
ID : 20
Scope : local
Text :
Max. Text Size: 20
Variable (string) tInstruction
Attributes
ID : 19
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
ID : 16
Scope : local
Text :
Max. Text Size: 200
Variable (string) tTmp
Attributes
ID : 21
Scope : local
Text :
Max. Text Size: 80
Text tEntity
Attributes
ID : 2
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 92
y coordinate : 21
Width : 263
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : tEntity1
Max. Text Size : 25
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Picture pColorWheel
Attributes
ID : 1
Scope : local
Dragging : 0
Send Component ID: disabled
Opacity : 127
x coordinate : 233
y coordinate : 105
Width : 160
Height : 160
Effect : load
Effect Priority : 0
Effect Time : 300
Picture ID : 3
Events
Touch Press Event
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",colorWheel,"
sys0=tch0
sys0=sys0-pColorWheel.x
covx sys0,tTmp.txt,0,0
tSend.txt+=tTmp.txt
tSend.txt+="|"
sys0=tch1
sys0=sys0-pColorWheel.y
covx sys0,tTmp.txt,0,0
tSend.txt+=tTmp.txt
tSend.txt+="|"
covx pColorWheel.h,tTmp.txt,0,0
tSend.txt+=tTmp.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
Slider hBrightness
Attributes
ID : 4
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 89
y coordinate : 64
Width : 100
Height : 250
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : vertical
Fill : image
Cursor width : auto
Cursor height : 1
Back. Picture ID : 65535
Slided Back. Picture ID: 65535
Position : 50
Upper range limit : 100
Lower range limit : 0
Events
Touch Release Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",brightnessSlider,"
covx hBrightness.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Slider hTempSlider
Attributes
ID : 10
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 263
y coordinate : 64
Width : 100
Height : 250
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : vertical
Fill : image
Cursor width : auto
Cursor height : 255
Back. Picture ID : 7
Slided Back. Picture ID: 7
Position : 50
Upper range limit : 100
Lower range limit : 0
Events
Touch Release Event
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",colorTempSlider,"
covx hTempSlider.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Button b0
Attributes
ID : 3
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 397
y coordinate : 8
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed): 65535
Back. Color (Pressed) : 14823
Font Color (Unpressed) : 65535
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
tSend.txt="event,buttonPress2,popupLight,bExit"
//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
Button bColor
Attributes
ID : 12
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 14
y coordinate : 146
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed): 65535
Back. Color (Pressed) : 14823
Font Color (Unpressed) : 65535
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
if(mode.val==1)
{
mode.val=0
//enable color wheel
vis pColorWheel,1
//disable color temp
//vis t4,0
//vis t3,0
vis hTempSlider,0
}else
{
mode.val=1
//disable color wheel
vis pColorWheel,0
if(mode_temp.val==1)
{
//enable color temp
//vis t4,1
//vis t3,1
vis hTempSlider,1
}
}
Button bEffect
Attributes
ID : 17
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 14
y coordinate : 213
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed): 65535
Back. Color (Pressed) : 14823
Font Color (Unpressed) : 65535
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
pageIcons.tTmp1.txt=tEntity.txt
pageIcons.tTmp2.txt=entn.txt
page popupInSel
Dual-state Button btOnOff1
Attributes
ID : 5
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 14
y coordinate : 77
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : image
Font ID : 0
Background Picture ID (Unpressed): 1
Back. Picture ID (Pressed) : 2
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text :
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
covx btOnOff1.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Timer tmCooldown
Attributes
ID : 15
Scope : local
Period (ms): 300
Enabled : no
Events
Timer Event
tmCooldown.en=0
Timer tmDrawCooldown
Attributes
ID : 22
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
Timer tmSerial
Attributes
ID : 8
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
spstr strCommand.txt,tTmp.txt,"~",1
if(tInstruction.txt=="entityUpdateDetail"&&entn.txt==tTmp.txt)
{
// change icon
//spstr strCommand.txt,tIcon1.txt,"~",2
//vis tIcon1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",3
covx tTmp.txt,sys0,0,0
col.val=sys0
//tEntity.pco=sys0
// get Button State
spstr strCommand.txt,tTmp.txt,"~",4
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
// get Brightness value
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt=="disable")
{
//vis t1,0
//vis t2,0
vis hBrightness,0
}else
{
//vis t1,1
//vis t2,1
vis hBrightness,1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
tmDrawCooldown.en=1
tmDrawCooldown.tim=500
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6
if(tTmp.txt=="disable")
{
vis hTempSlider,0
//vis t3,0
//vis t4,0
mode_temp.val=0
// mode == 1 is temp controls currently shown
if(mode.val==1)
{
// switch mode
click bColor,1
click bColor,0
}
}else if(tTmp.txt=="unknown") // temp supported, but not in color mode
{
mode_temp.val=1
// mode == 1 is temp controls currently shown
if(mode.val==1)
{
// switch mode
click bColor,1
click bColor,0
}
}else
{
mode_temp.val=1
vis hTempSlider,1
//vis t3,1
//vis t4,1
if(tmCooldown.en==0)
{
covx tTmp.txt,sys0,0,0
hTempSlider.val=sys0
}
// mode == 0 is rgb controls currently shown
if(mode.val==0)
{
// switch mode
click bColor,1
click bColor,0
}
}
// get Color value
spstr strCommand.txt,tTmp.txt,"~",7
// disable -> isn't supported
if(tTmp.txt=="disable")
{
//vis t0,0
vis bColor,0
vis pColorWheel,0
}else
{
//vis t0,1
//only enable bColor button if color temp is also supported
if(mode_temp.val==1)
{
vis bColor,1
}
if(mode.val==0)
{
vis pColorWheel,1
}
}
// set t0 Color (Localization)
//spstr strCommand.txt,t0.txt,"~",8
// set t4 Temperature (Localization)
//spstr strCommand.txt,t4.txt,"~",9
// set t1 Brightness (Localization)
//spstr strCommand.txt,t1.txt,"~",10
// activate effect button
spstr strCommand.txt,tTmp.txt,"~",11
if(tTmp.txt=="enable")
{
vis bEffect,1
}else
{
vis bEffect,0
}
}
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,dimValue,0,0
// get value normal
spstr strCommand.txt,tTmp.txt,"~",2
covx tTmp.txt,dimValueNormal,0,0
dim=dimValueNormal
// get background color
spstr strCommand.txt,tTmp.txt,"~",3
if(tTmp.txt!="")
{
covx tTmp.txt,defaultBcoColor,0,0
}
// get font color
spstr strCommand.txt,tTmp.txt,"~",4
if(tTmp.txt!="")
{
covx tTmp.txt,defaultFontColor,0,0
}
}
if(tInstruction.txt=="timeout")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,sleepTimeout,0,0
}
if(tInstruction.txt=="pageType")
{
//command format pageType,specialPageName
//write name of speical page to tId
spstr strCommand.txt,tId.txt,"~",1
//save second arg if there's one
spstr strCommand.txt,tTmp.txt,"~",2
//save third arg if there's one
spstr strCommand.txt,pageIcons.tTmp2.txt,"~",3
spstr strCommand.txt,pageIcons.tTmp3.txt,"~",4
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
udelete payloadLength-1
bufferPos=0
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="screensaver")
{
page screensaver
}
if(tId.txt=="cardEntities")
{
page cardEntities
}
if(tId.txt=="cardGrid")
{
page cardGrid
}
if(tId.txt=="cardGrid2")
{
page cardGrid2
}
if(tId.txt=="popupLight")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupLight
}
if(tId.txt=="popupShutter")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupShutter
}
if(tId.txt=="popupNotify")
{
page popupNotify
}
if(tId.txt=="cardThermo")
{
page cardThermo
}
if(tId.txt=="cardMedia")
{
page cardMedia
}
if(tId.txt=="cardAlarm")
{
page cardAlarm
}
if(tId.txt=="cardQR")
{
page cardQR
}
if(tId.txt=="cardPower")
{
page cardPower
}
if(tId.txt=="cardChart")
{
page cardChart
}
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
}
Timer tmSleep
Attributes
ID : 7
Scope : local
Period (ms): 1000
Enabled : yes
Events
Timer Event
if(sleepTimeout!=0)
{
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
sleepValue=0
click b0,1
click b0,0
}
}
TouchCap tc0
Attributes
ID : 6
Scope: local
Value: 0
Events
Touch Press Event
sleepValue=0

View File

@@ -581,7 +581,7 @@ Timer tmSerial
covx tTmp.txt,defaultFontColor,0,0
}
}
if(tInstruction.txt=="timeout")
if(tInstruction.txt=="timeout2")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1

View File

@@ -1617,6 +1617,10 @@ Timer tmSerial
{
page cardChart
}
if(tId.txt=="cardLChart")
{
page cardLChart
}
}
if(tInstruction.txt=="timeout")
{

View File

@@ -14,6 +14,8 @@ Program.s
//color vars
int defaultFontColor=65535
int defaultBcoColor=6371
//feature flags
int featNewSliders=0
// fix touch offset
//lcd_dev fffb 0002 0000 0020
printh 00 00 00 ff ff ff 88 ff ff ff//Output power on information to serial port

View File

@@ -965,8 +965,13 @@ Hotspot m0
}
if(type1.txt=="light")
{
//popupLight.tEntity.txt=tEntity1.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type1.txt=="fan")
{
@@ -999,8 +1004,13 @@ Hotspot m1
}
if(type2.txt=="light")
{
//popupLight.tEntity.txt=tEntity2.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type2.txt=="fan")
{
@@ -1033,8 +1043,13 @@ Hotspot m2
}
if(type3.txt=="light")
{
//popupLight.tEntity.txt=tEntity3.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type3.txt=="fan")
{
@@ -1067,8 +1082,13 @@ Hotspot m3
}
if(type4.txt=="light")
{
//popupLight.tEntity.txt=tEntity4.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type4.txt=="fan")
{

View File

@@ -605,7 +605,13 @@ Timer tmLP
Timer Event
if(tTmp.txt=="light")
{
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(tTmp.txt=="fan")
{

View File

@@ -559,26 +559,26 @@ Button bEntity7
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type6.txt
pageIcons.tTmp1.txt=tEntity6.txt
pageIcons.tTmp2.txt=entn6.txt
pageIcons.tTmp3.txt=bEntity6.txt
if(type6.txt=="shutter")
tTmp.txt=type7.txt
pageIcons.tTmp1.txt=tEntity7.txt
pageIcons.tTmp2.txt=entn7.txt
pageIcons.tTmp3.txt=bEntity7.txt
if(type7.txt=="shutter")
{
page popupShutter
}
if(type6.txt=="input_sel")
if(type7.txt=="input_sel")
{
page popupInSel
}
if(type6.txt=="timer")
if(type7.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
tSend.txt="event,buttonPress2,"+entn7.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -603,26 +603,26 @@ Button bEntity8
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type6.txt
pageIcons.tTmp1.txt=tEntity6.txt
pageIcons.tTmp2.txt=entn6.txt
pageIcons.tTmp3.txt=bEntity6.txt
if(type6.txt=="shutter")
tTmp.txt=type8.txt
pageIcons.tTmp1.txt=tEntity8.txt
pageIcons.tTmp2.txt=entn8.txt
pageIcons.tTmp3.txt=bEntity8.txt
if(type8.txt=="shutter")
{
page popupShutter
}
if(type6.txt=="input_sel")
if(type8.txt=="input_sel")
{
page popupInSel
}
if(type6.txt=="timer")
if(type8.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
tSend.txt="event,buttonPress2,"+entn8.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -739,7 +739,13 @@ Timer tmLP
Timer Event
if(tTmp.txt=="light")
{
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(tTmp.txt=="fan")
{

View File

@@ -964,6 +964,10 @@ Timer tmSerial
{
page cardChart
}
if(tId.txt=="cardLChart")
{
page cardLChart
}
}
if(tInstruction.txt=="time")
{

View File

@@ -145,7 +145,7 @@ Text tVersion
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 51
Text : 52
Max. Text Size : 10
Picture p0

View File

@@ -16,12 +16,13 @@ Page popupLight
tEntity.txt=pageIcons.tTmp1.txt
//get entity id
entn.txt=pageIcons.tTmp2.txt
tIcon1.txt=pageIcons.tTmp3.txt
vis p0,0
vis tSend,0
vis tTmp,0
vis tInstruction,0
vis tId,0
vis bEffect,0
vis hBrightness,0
//page open event
// event,pageOpenDetail,typeOfPage,tEntityName
// craft command
@@ -38,16 +39,16 @@ Page popupLight
prints tSend.txt,0
prints crcval,2
//disable brightness by default
//vis t1,0
//vis t2,0
vis hBrightness,1
vis t1,0
vis t2,0
vis hBrightness,0
//disable color temp by default
//vis t4,0
//vis t3,0
vis t4,0
vis t3,0
vis hTempSlider,0
//disable color wheel components by default
vis bColor,0
//vis t0,0
vis t0,0
vis pColorWheel,0
//vis t0,0
popupLight.bco=defaultBcoColor
@@ -66,18 +67,14 @@ Page popupLight
}
if(defaultBcoColor==0)
{
hBrightness.pic=24
hBrightness.pic1=25
hBrightness.pic2=15
hTempSlider.pic=16
hTempSlider.pic1=16
hTempSlider.pic1=17
hTempSlider.pic2=15
}
Postinitialize Event
fill hBrightness.x,hBrightness.y,100,250,defaultBcoColor
Variable (int32) col
Attributes
Scope: local
Value: 65504
Variable (string) entn
Attributes
Scope : local
@@ -100,29 +97,56 @@ Variable (string) strCommand
Text :
Max. Text Size: 500
Variable (string) tId
Attributes
Scope : local
Text :
Max. Text Size: 20
Variable (string) tInstruction
Attributes
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
Scope : local
Text :
Max. Text Size: 200
Variable (string) tTmp
Text t0
Attributes
Scope : local
Text :
Max. Text Size: 80
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Color
Max. Text Size : 50
Text t1
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Brightness
Max. Text Size : 50
Text t2
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 
Max. Text Size : 10
Text t3
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 
Max. Text Size : 10
Text t4
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Temperature
Max. Text Size : 50
Text tEntity
Attributes
@@ -133,6 +157,48 @@ Text tEntity
Text : tEntity1
Max. Text Size : 25
Text tIcon1
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 
Max. Text Size : 10
Text tId
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 20
Text tInstruction
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 20
Text tTmp
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 80
Picture p0
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
Picture pColorWheel
Attributes
Scope : local
@@ -178,20 +244,6 @@ Slider hBrightness
Events
Touch Release Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
@@ -280,8 +332,8 @@ Button bColor
//enable color wheel
vis pColorWheel,1
//disable color temp
//vis t4,0
//vis t3,0
vis t4,0
vis t3,0
vis hTempSlider,0
}else
{
@@ -291,8 +343,8 @@ Button bColor
if(mode_temp.val==1)
{
//enable color temp
//vis t4,1
//vis t3,1
vis t4,1
vis t3,1
vis hTempSlider,1
}
}
@@ -310,6 +362,7 @@ Button bEffect
Touch Press Event
pageIcons.tTmp1.txt=tEntity.txt
pageIcons.tTmp2.txt=entn.txt
pageIcons.tTmp3.txt=tIcon1.txt
page popupInSel
Dual-state Button btOnOff1
@@ -342,37 +395,13 @@ Dual-state Button btOnOff1
Timer tmCooldown
Attributes
Scope : local
Period (ms): 100
Period (ms): 300
Enabled : no
Events
Timer Event
tmCooldown.en=0
Timer tmDrawCooldown
Attributes
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
Timer tmSerial
Attributes
Scope : local
@@ -429,12 +458,11 @@ Timer tmSerial
{
// change icon
//spstr strCommand.txt,tIcon1.txt,"~",2
//vis tIcon1,1
vis tIcon1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",3
covx tTmp.txt,sys0,0,0
col.val=sys0
//tEntity.pco=sys0
tIcon1.pco=sys0
// get Button State
spstr strCommand.txt,tTmp.txt,"~",4
covx tTmp.txt,sys0,0,0
@@ -443,26 +471,27 @@ Timer tmSerial
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt=="disable")
{
//vis t1,0
//vis t2,0
vis t1,0
vis t2,0
vis hBrightness,0
}else
{
//vis t1,1
//vis t2,1
vis t1,1
vis t2,1
vis hBrightness,1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
tmDrawCooldown.en=1
tmDrawCooldown.tim=500
if(tmCooldown.en==0)
{
hBrightness.val=sys0
}
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6
if(tTmp.txt=="disable")
{
vis hTempSlider,0
//vis t3,0
//vis t4,0
vis t3,0
vis t4,0
mode_temp.val=0
// mode == 1 is temp controls currently shown
if(mode.val==1)
@@ -485,8 +514,8 @@ Timer tmSerial
{
mode_temp.val=1
vis hTempSlider,1
//vis t3,1
//vis t4,1
vis t3,1
vis t4,1
if(tmCooldown.en==0)
{
covx tTmp.txt,sys0,0,0
@@ -505,12 +534,12 @@ Timer tmSerial
// disable -> isn't supported
if(tTmp.txt=="disable")
{
//vis t0,0
vis t0,0
vis bColor,0
vis pColorWheel,0
}else
{
//vis t0,1
vis t0,1
//only enable bColor button if color temp is also supported
if(mode_temp.val==1)
{
@@ -522,11 +551,11 @@ Timer tmSerial
}
}
// set t0 Color (Localization)
//spstr strCommand.txt,t0.txt,"~",8
spstr strCommand.txt,t0.txt,"~",8
// set t4 Temperature (Localization)
//spstr strCommand.txt,t4.txt,"~",9
spstr strCommand.txt,t4.txt,"~",9
// set t1 Brightness (Localization)
//spstr strCommand.txt,t1.txt,"~",10
spstr strCommand.txt,t1.txt,"~",10
// activate effect button
spstr strCommand.txt,tTmp.txt,"~",11
if(tTmp.txt=="enable")

View File

@@ -0,0 +1,689 @@
Page popupLightNew
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Locked : no
Swide up page ID : disabled
Swide down page ID : disabled
Swide left page ID : disabled
Swide right page ID: disabled
Events
Preinitialize Event
dim=dimValueNormal
//get entitiy name
tEntity.txt=pageIcons.tTmp1.txt
//get entity id
entn.txt=pageIcons.tTmp2.txt
vis tSend,0
vis tTmp,0
vis tInstruction,0
vis tId,0
vis bEffect,0
vis hBrightness,0
//page open event
// event,pageOpenDetail,typeOfPage,tEntityName
// craft command
tSend.txt="event,pageOpenDetail,popupLight,"+entn.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
//disable brightness by default
//vis t1,0
//vis t2,0
vis hBrightness,1
//disable color temp by default
//vis t4,0
//vis t3,0
vis hTempSlider,0
//disable color wheel components by default
vis bColor,0
//vis t0,0
vis pColorWheel,0
//vis t0,0
popupLightNew.bco=defaultBcoColor
for(sys0=0;sys0<27;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
b[sys0].bco=defaultBcoColor
b[sys0].pco=defaultFontColor
}
if(b[sys0].type==53&&defaultBcoColor==0)
{
b[sys0].pic=10
b[sys0].pic2=11
}
}
if(defaultBcoColor==0)
{
hTempSlider.pic=16
hTempSlider.pic1=16
}
Postinitialize Event
fill hBrightness.x,hBrightness.y,100,250,defaultBcoColor
Variable (int32) col
Attributes
Scope: local
Value: 65504
Variable (string) entn
Attributes
Scope : local
Text :
Max. Text Size: 80
Variable (int32) mode
Attributes
Scope: local
Value: 1
Variable (int32) mode_temp
Attributes
Scope: local
Value: 0
Variable (string) strCommand
Attributes
Scope : local
Text :
Max. Text Size: 500
Variable (string) tId
Attributes
Scope : local
Text :
Max. Text Size: 20
Variable (string) tInstruction
Attributes
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
Scope : local
Text :
Max. Text Size: 200
Variable (string) tTmp
Attributes
Scope : local
Text :
Max. Text Size: 80
Text tEntity
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : tEntity1
Max. Text Size : 25
Picture pColorWheel
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Press Event
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",colorWheel,"
sys0=tch0
sys0=sys0-pColorWheel.x
covx sys0,tTmp.txt,0,0
tSend.txt+=tTmp.txt
tSend.txt+="|"
sys0=tch1
sys0=sys0-pColorWheel.y
covx sys0,tTmp.txt,0,0
tSend.txt+=tTmp.txt
tSend.txt+="|"
covx pColorWheel.h,tTmp.txt,0,0
tSend.txt+=tTmp.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
Slider hBrightness
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
Position : 50
Upper range limit: 100
Lower range limit: 0
Events
Touch Release Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",brightnessSlider,"
covx hBrightness.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Slider hTempSlider
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
Position : 50
Upper range limit: 100
Lower range limit: 0
Events
Touch Release Event
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",colorTempSlider,"
covx hTempSlider.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Button b0
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text : 
Max. Text Size : 10
Events
Touch Press Event
tSend.txt="event,buttonPress2,popupLight,bExit"
//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
Button bColor
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text : 
Max. Text Size : 10
Events
Touch Press Event
if(mode.val==1)
{
mode.val=0
//enable color wheel
vis pColorWheel,1
//disable color temp
//vis t4,0
//vis t3,0
vis hTempSlider,0
}else
{
mode.val=1
//disable color wheel
vis pColorWheel,0
if(mode_temp.val==1)
{
//enable color temp
//vis t4,1
//vis t3,1
vis hTempSlider,1
}
}
Button bEffect
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text : 
Max. Text Size : 10
Events
Touch Press Event
pageIcons.tTmp1.txt=tEntity.txt
pageIcons.tTmp2.txt=entn.txt
page popupInSel
Dual-state Button btOnOff1
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text :
Max. Text Size : 10
Events
Touch Press Event
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
covx btOnOff1.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Timer tmCooldown
Attributes
Scope : local
Period (ms): 300
Enabled : no
Events
Timer Event
tmCooldown.en=0
Timer tmDrawCooldown
Attributes
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
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
spstr strCommand.txt,tTmp.txt,"~",1
if(tInstruction.txt=="entityUpdateDetail"&&entn.txt==tTmp.txt)
{
// change icon
//spstr strCommand.txt,tIcon1.txt,"~",2
//vis tIcon1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",3
covx tTmp.txt,sys0,0,0
col.val=sys0
//tEntity.pco=sys0
// get Button State
spstr strCommand.txt,tTmp.txt,"~",4
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
// get Brightness value
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt=="disable")
{
//vis t1,0
//vis t2,0
vis hBrightness,0
}else
{
//vis t1,1
//vis t2,1
vis hBrightness,1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
tmDrawCooldown.en=1
tmDrawCooldown.tim=500
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6
if(tTmp.txt=="disable")
{
vis hTempSlider,0
//vis t3,0
//vis t4,0
mode_temp.val=0
// mode == 1 is temp controls currently shown
if(mode.val==1)
{
// switch mode
click bColor,1
click bColor,0
}
}else if(tTmp.txt=="unknown") // temp supported, but not in color mode
{
mode_temp.val=1
// mode == 1 is temp controls currently shown
if(mode.val==1)
{
// switch mode
click bColor,1
click bColor,0
}
}else
{
mode_temp.val=1
vis hTempSlider,1
//vis t3,1
//vis t4,1
if(tmCooldown.en==0)
{
covx tTmp.txt,sys0,0,0
hTempSlider.val=sys0
}
// mode == 0 is rgb controls currently shown
if(mode.val==0)
{
// switch mode
click bColor,1
click bColor,0
}
}
// get Color value
spstr strCommand.txt,tTmp.txt,"~",7
// disable -> isn't supported
if(tTmp.txt=="disable")
{
//vis t0,0
vis bColor,0
vis pColorWheel,0
}else
{
//vis t0,1
//only enable bColor button if color temp is also supported
if(mode_temp.val==1)
{
vis bColor,1
}
if(mode.val==0)
{
vis pColorWheel,1
}
}
// set t0 Color (Localization)
//spstr strCommand.txt,t0.txt,"~",8
// set t4 Temperature (Localization)
//spstr strCommand.txt,t4.txt,"~",9
// set t1 Brightness (Localization)
//spstr strCommand.txt,t1.txt,"~",10
// activate effect button
spstr strCommand.txt,tTmp.txt,"~",11
if(tTmp.txt=="enable")
{
vis bEffect,1
}else
{
vis bEffect,0
}
}
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,dimValue,0,0
// get value normal
spstr strCommand.txt,tTmp.txt,"~",2
covx tTmp.txt,dimValueNormal,0,0
dim=dimValueNormal
// get background color
spstr strCommand.txt,tTmp.txt,"~",3
if(tTmp.txt!="")
{
covx tTmp.txt,defaultBcoColor,0,0
}
// get font color
spstr strCommand.txt,tTmp.txt,"~",4
if(tTmp.txt!="")
{
covx tTmp.txt,defaultFontColor,0,0
}
}
if(tInstruction.txt=="timeout")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,sleepTimeout,0,0
}
if(tInstruction.txt=="pageType")
{
//command format pageType,specialPageName
//write name of speical page to tId
spstr strCommand.txt,tId.txt,"~",1
//save second arg if there's one
spstr strCommand.txt,tTmp.txt,"~",2
//save third arg if there's one
spstr strCommand.txt,pageIcons.tTmp2.txt,"~",3
spstr strCommand.txt,pageIcons.tTmp3.txt,"~",4
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
udelete payloadLength-1
bufferPos=0
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="screensaver")
{
page screensaver
}
if(tId.txt=="cardEntities")
{
page cardEntities
}
if(tId.txt=="cardGrid")
{
page cardGrid
}
if(tId.txt=="cardGrid2")
{
page cardGrid2
}
if(tId.txt=="popupLight")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupLight
}
if(tId.txt=="popupShutter")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupShutter
}
if(tId.txt=="popupNotify")
{
page popupNotify
}
if(tId.txt=="cardThermo")
{
page cardThermo
}
if(tId.txt=="cardMedia")
{
page cardMedia
}
if(tId.txt=="cardAlarm")
{
page cardAlarm
}
if(tId.txt=="cardQR")
{
page cardQR
}
if(tId.txt=="cardPower")
{
page cardPower
}
if(tId.txt=="cardChart")
{
page cardChart
}
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
}
Timer tmSleep
Attributes
Scope : local
Period (ms): 1000
Enabled : yes
Events
Timer Event
if(sleepTimeout!=0)
{
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
sleepValue=0
click b0,1
click b0,0
}
}
TouchCap tc0
Attributes
Scope: local
Value: 0
Events
Touch Press Event
sleepValue=0

View File

@@ -352,7 +352,7 @@ Timer tmSerial
covx tTmp.txt,defaultFontColor,0,0
}
}
if(tInstruction.txt=="timeout")
if(tInstruction.txt=="timeout2")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1

View File

@@ -804,6 +804,10 @@ Timer tmSerial
{
page cardChart
}
if(tId.txt=="cardLChart")
{
page cardLChart
}
}
if(tInstruction.txt=="timeout")
{

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -2,14 +2,14 @@
+++ HMI/US/portrait/n2t-out
│ --- HMI/n2t-out/Program.s.txt
├── +++ HMI/US/portrait/n2t-out/Program.s.txt
│ @@ -10,11 +10,11 @@
│ int sleepValue=0
│ // dim value
│ @@ -12,11 +12,11 @@
│ int dimValue=40
│ int dimValueNormal=100
│ //color vars
│ int defaultFontColor=65535
│ int defaultBcoColor=6371
│ //feature flags
│ int featNewSliders=0
│ - // fix touch offset
│ - lcd_dev fffb 0002 0000 0020
│ + // fix touch offset (Removed for US version)
@@ -65,54 +65,54 @@
│ Scope : local
│ Text :
│ - Max. Text Size: 80
│ + Max. Text Size: 65
│ + Max. Text Size: 64
│ Variable (string) entn2
│ Attributes
│ Scope : local
│ Text :
│ - Max. Text Size: 80
│ + Max. Text Size: 65
│ + Max. Text Size: 64
│ Variable (string) entn3
│ Attributes
│ Scope : local
│ Text :
│ - Max. Text Size: 80
│ + Max. Text Size: 65
│ + Max. Text Size: 64
│ Variable (string) entn4
│ Attributes
│ Scope : local
│ Text :
│ - Max. Text Size: 80
│ + Max. Text Size: 65
│ + Max. Text Size: 64
│ +
│ +Variable (string) entn5
│ + Attributes
│ + Scope : local
│ + Text :
│ + Max. Text Size: 65
│ + Max. Text Size: 64
│ +
│ +Variable (string) entn6
│ + Attributes
│ + Scope : local
│ + Text :
│ + Max. Text Size: 65
│ + Max. Text Size: 64
│ Variable (string) nent1
│ Attributes
│ Scope : local
│ Text :
│ - Max. Text Size: 80
│ + Max. Text Size: 40
│ + Max. Text Size: 38
│ Variable (string) nent2
│ Attributes
│ Scope : local
│ Text :
│ - Max. Text Size: 80
│ + Max. Text Size: 40
│ + Max. Text Size: 38
│ Variable (string) strCommand
│ Attributes
@@ -290,9 +290,9 @@
│ +
│ + Events
│ + Touch Release Event
│ + nNum5.val=hSlider5.val
│ + nNum6.val=hSlider6.val
│ + tSend.txt="event,buttonPress2,"+entn6.txt+",number-set,"
│ + covx nNum5.val,tTmp.txt,0,0
│ + covx nNum6.val,tTmp.txt,0,0
│ + tSend.txt+=tTmp.txt
│ + //send calc crc
│ + btlen tSend.txt,sys0
@@ -611,7 +611,7 @@
│ + Events
│ + Touch Press Event
│ + tSend.txt="event,buttonPress2,"+entn6.txt+",OnOff,"
│ + covx btOnOff5.val,tTmp.txt,0,0
│ + covx btOnOff6.val,tTmp.txt,0,0
│ + tSend.txt+=tTmp.txt
│ + //send calc crc
│ + btlen tSend.txt,sys0
@@ -632,7 +632,7 @@
│ Send Component ID: disabled
│ Events
│ @@ -1079,14 +1473,82 @@
│ @@ -1099,14 +1493,92 @@
│ page popupInSel
│ }
│ if(type4.txt=="timer")
@@ -658,8 +658,13 @@
│ + }
│ + if(type5.txt=="light")
│ + {
│ + //popupLight.tEntity.txt=tEntity5.txt
│ + page popupLight
│ + if(featNewSliders==1)
│ + {
│ + page popupLightNew
│ + }else
│ + {
│ + page popupLight
│ + }
│ + }
│ + if(type5.txt=="fan")
│ + {
@@ -692,8 +697,13 @@
│ + }
│ + if(type6.txt=="light")
│ + {
│ + //popupLight.tEntity.txt=tEntity5.txt
│ + page popupLight
│ + if(featNewSliders==1)
│ + {
│ + page popupLightNew
│ + }else
│ + {
│ + page popupLight
│ + }
│ + }
│ + if(type6.txt=="fan")
│ + {
@@ -715,7 +725,7 @@
│ Send Component ID: disabled
│ Events
│ @@ -1810,14 +2272,312 @@
│ @@ -1830,14 +2302,312 @@
│ covx tTmp.txt,sys0,0,0
│ hSlider4.minval=sys0
│ //third value is max value
@@ -1126,34 +1136,46 @@
│ Send Component ID : disabled
│ Associated Keyboard: none
│ Text :
│ @@ -555,14 +578,58 @@
State : unpressed
Text : 
Max. Text Size : 10
│ @@ -631,14 +654,58 @@
crcputs tSend.txt,0
//send cmd
printh 55 bb
│ prints sys0,2
│ prints tSend.txt,0
│ prints crcval,2
Events
Touch Press Event
tmLP.en=1
│ + tTmp.txt=type2.txt
│ + pageIcons.tTmp1.txt=tEntity2.txt
│ + pageIcons.tTmp2.txt=entn2.txt
│ + pageIcons.tTmp3.txt=bEntity2.txt
│ + if(type2.txt=="shutter")
+Button bEntity9
+ Attributes
+ Scope : local
│ + Dragging : 0
│ + Send Component ID: disabled
│ + State : unpressed
│ + Text : 
│ + Max. Text Size : 10
│ +
│ + Events
│ + Touch Press Event
│ + tmLP.en=1
│ + tTmp.txt=type9.txt
│ + pageIcons.tTmp1.txt=tEntity9.txt
│ + pageIcons.tTmp2.txt=entn9.txt
│ + pageIcons.tTmp3.txt=bEntity9.txt
│ + if(type9.txt=="shutter")
│ + {
│ + page popupShutter
│ + }
│ + if(type2.txt=="input_sel")
│ + if(type9.txt=="input_sel")
│ + {
│ + page popupInSel
│ + }
│ + if(type2.txt=="timer")
│ + if(type9.txt=="timer")
│ + {
│ + page popupTimer
│ + }
│ +
│ + Touch Release Event
│ + tmLP.en=0
│ + tSend.txt="event,buttonPress2,"+entn2.txt+",button"
│ + tSend.txt="event,buttonPress2,"+entn9.txt+",button"
│ + //send calc crc
│ + btlen tSend.txt,sys0
│ + crcrest 1,0xffff // reset CRC
@@ -1166,43 +1188,14 @@
│ + prints tSend.txt,0
│ + prints crcval,2
│ +
+Button bEntity8
│ + Attributes
│ + Scope : local
│ + Dragging : 0
│ + Send Component ID: disabled
│ + State : unpressed
│ + Text : 
│ + Max. Text Size : 10
│ +
│ + Events
│ + Touch Press Event
│ + tmLP.en=1
│ tTmp.txt=type6.txt
│ pageIcons.tTmp1.txt=tEntity6.txt
│ pageIcons.tTmp2.txt=entn6.txt
│ pageIcons.tTmp3.txt=bEntity6.txt
│ if(type6.txt=="shutter")
│ {
│ page popupShutter
│ @@ -587,15 +654,15 @@
│ crcputs tSend.txt,0
│ //send cmd
│ printh 55 bb
│ prints sys0,2
│ prints tSend.txt,0
│ prints crcval,2
│ -Button bEntity8
│ +Button bEntity9
Button bNext
│ Attributes
│ Scope : local
│ Dragging : 0
│ Send Component ID: disabled
│ State : unpressed
│ Text : 
Max. Text Size : 10
│ @@ -999,14 +1066,35 @@
│ Text : 
@@ -1005,14 +1072,35 @@
│ spstr strCommand.txt,tTmp.txt,"~",59
│ covx tTmp.txt,sys0,0,0
│ bEntity8.pco=sys0
@@ -1565,6 +1558,23 @@
│ Scope : local
│ Period (ms): 50
│ Enabled : yes
│ @@ -962,15 +938,15 @@
│ }
│ if(tId.txt=="cardChart")
│ {
│ page cardChart
│ }
│ if(tId.txt=="cardLChart")
│ {
│ - page cardLChart
│ + page cardChart
│ }
│ }
│ if(tInstruction.txt=="time")
│ {
│ // get set time to global variable
│ spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
│ }
│ --- HMI/n2t-out/pageStartup.txt
├── +++ HMI/US/portrait/n2t-out/pageStartup.txt
│ @@ -34,20 +34,14 @@
@@ -1622,6 +1632,82 @@
│ crcputs sys0,2
│ crcputs tSend.txt,0
│ //send cmd
│ @@ -282,15 +276,15 @@
│ // get feature flag popup
│ spstr strCommand.txt,tTmp.txt,"~",5
│ if(tTmp.txt!="")
│ {
│ covx tTmp.txt,featNewSliders,0,0
│ }
│ }
│ - if(tInstruction.txt=="timeout")
│ + if(tInstruction.txt=="timeout2")
│ {
│ //set timeout to global var
│ spstr strCommand.txt,tTmp.txt,"~",1
│ covx tTmp.txt,sleepTimeout,0,0
│ }
│ if(tInstruction.txt=="pageType")
│ {
│ --- HMI/n2t-out/popupLight.txt
├── +++ HMI/US/portrait/n2t-out/popupLight.txt
│ @@ -48,33 +48,33 @@
│ vis hTempSlider,0
│ //disable color wheel components by default
│ vis bColor,0
│ vis t0,0
│ vis pColorWheel,0
│ //vis t0,0
│ popupLight.bco=defaultBcoColor
│ - for(sys0=0;sys0<27;sys0++)
│ + for(sys0=0;sys0<28;sys0++)
│ {
│ if(b[sys0].type==98||b[sys0].type==116)
│ {
│ b[sys0].bco=defaultBcoColor
│ b[sys0].pco=defaultFontColor
│ }
│ if(b[sys0].type==53&&defaultBcoColor==0)
│ {
│ b[sys0].pic=10
│ b[sys0].pic2=11
│ }
│ }
│ if(defaultBcoColor==0)
│ {
│ - hBrightness.pic=24
│ - hBrightness.pic1=25
│ + hBrightness.pic=14
│ + hBrightness.pic1=13
│ hBrightness.pic2=15
│ - hTempSlider.pic=16
│ + hTempSlider.pic=23
│ hTempSlider.pic1=17
│ hTempSlider.pic2=15
│ }
│ Variable (string) entn
│ Attributes
│ Scope : local
│ --- HMI/n2t-out/popupNotify.txt
├── +++ HMI/US/portrait/n2t-out/popupNotify.txt
│ @@ -348,15 +348,15 @@
│ // get font color
│ spstr strCommand.txt,tTmp.txt,"~",4
│ if(tTmp.txt!="")
│ {
│ covx tTmp.txt,defaultFontColor,0,0
│ }
│ }
│ - if(tInstruction.txt=="timeout2")
│ + if(tInstruction.txt=="timeout")
│ {
│ //set timeout to global var
│ spstr strCommand.txt,tTmp.txt,"~",1
│ covx tTmp.txt,sleepTimeout,0,0
│ }
│ if(tInstruction.txt=="exitPopup")
│ {
│ --- HMI/n2t-out/screensaver.txt
├── +++ HMI/US/portrait/n2t-out/screensaver.txt
│ @@ -28,17 +28,14 @@

View File

@@ -1,7 +1,9 @@
+++ /dev/fd/62 2023-05-20 14:50:34.059646337 +0000
+++ /dev/fd/62 2023-08-20 13:07:13.304519211 +0000
+I/n2t-out/Program.s.txt
++ HMI/US/portrait/n2t-out/Program.s.txt
+1 +10,11 @@
+1 +12,11 @@
+eature flags
+ featNewSliders=0
+nth 00 00 00 ff ff ff 88 ff ff ff//Output power on information to serial port
+I/n2t-out/cardEntities.txt
++ HMI/US/portrait/n2t-out/cardEntities.txt
@@ -29,42 +31,42 @@
+ Scope : local
+ Text :
+ Max. Text Size: 80
+ Max. Text Size: 65
+ Max. Text Size: 64
+
+e (string) entn2
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 80
+ Max. Text Size: 65
+ Max. Text Size: 64
+
+e (string) entn3
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 80
+ Max. Text Size: 65
+ Max. Text Size: 65
+ Max. Text Size: 65
+ Max. Text Size: 64
+ Max. Text Size: 64
+ Max. Text Size: 64
+
+e (string) entn6
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 65
+ Max. Text Size: 64
+
+e (string) nent1
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 80
+ Max. Text Size: 40
+ Max. Text Size: 38
+
+e (string) nent2
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 40
+ Max. Text Size: 80
+ Max. Text Size: 38
+14 +185,26 @@
+e (string) type6
+ributes
@@ -174,9 +176,9 @@
+
+nts
+ Touch Release Event
+ nNum5.val=hSlider5.val
+ nNum6.val=hSlider6.val
+ tSend.txt="event,buttonPress2,"+entn6.txt+",number-set,"
+ covx nNum5.val,tTmp.txt,0,0
+ covx nNum6.val,tTmp.txt,0,0
+ tSend.txt+=tTmp.txt
+ //send calc crc
+ btlen tSend.txt,sys0
@@ -358,7 +360,7 @@
+nts
+ Touch Press Event
+ tSend.txt="event,buttonPress2,"+entn6.txt+",OnOff,"
+ covx btOnOff5.val,tTmp.txt,0,0
+ covx btOnOff6.val,tTmp.txt,0,0
+ tSend.txt+=tTmp.txt
+ //send calc crc
+ btlen tSend.txt,sys0
@@ -376,13 +378,20 @@
+ Dragging : 0
+ Send Component ID: disabled
+nts
+,14 +1473,82 @@
+,14 +1493,92 @@
+ page popupInSel
+ if(type4.txt=="timer")
+ page popupTimer
+ Scope : local
+ Dragging : 0
+ Send Component ID: disabled
+ if(featNewSliders==1)
+ {
+ page popupLightNew
+ }else
+ {
+ page popupLight
+ }
+ if(type5.txt=="timer")
+ {
+ page popupTimer
@@ -406,8 +415,13 @@
+ }
+ if(type6.txt=="light")
+ {
+ //popupLight.tEntity.txt=tEntity5.txt
+ page popupLight
+ if(featNewSliders==1)
+ {
+ page popupLightNew
+ }else
+ {
+ page popupLight
+ }
+ }
+ if(type6.txt=="fan")
+ {
@@ -425,7 +439,7 @@
+ Dragging : 0
+ Send Component ID: disabled
+nts
+,14 +2272,312 @@
+,14 +2302,312 @@
+ spstr strCommand.txt,type5.txt,"~",38
+ spstr strCommand.txt,entn5.txt,"~",39
+ spstr strCommand.txt,tIcon5.txt,"~",40
@@ -586,13 +600,6 @@
+ covx tTmp.txt,sys0,0,0
+ hSlider6.maxval=sys0
+ }
+ }
+ if(tInstruction.txt=="pageType")
+ {
+ sleepValue=0
+ //command format pageType,specialPageName
+ //write name of speical page to tId
+ spstr strCommand.txt,tId.txt,"~",1
+I/n2t-out/cardGrid2.txt
++ HMI/US/portrait/n2t-out/cardGrid2.txt
+6 +25,28 @@
@@ -691,7 +698,19 @@
+ Send Component ID : disabled
+ Associated Keyboard: none
+ Text :
+14 +578,58 @@
+14 +654,58 @@
+ crcputs tSend.txt,0
+ //send cmd
+ printh 55 bb
+ prints sys0,2
+ prints tSend.txt,0
+ prints crcval,2
+
+bEntity9
+ributes
+ Scope : local
+ Dragging : 0
+ Send Component ID: disabled
+ State : unpressed
+ Text : 
+ Max. Text Size : 10
@@ -699,26 +718,26 @@
+nts
+ Touch Press Event
+ tmLP.en=1
+ tTmp.txt=type2.txt
+ pageIcons.tTmp1.txt=tEntity2.txt
+ pageIcons.tTmp2.txt=entn2.txt
+ pageIcons.tTmp3.txt=bEntity2.txt
+ if(type2.txt=="shutter")
+ tTmp.txt=type9.txt
+ pageIcons.tTmp1.txt=tEntity9.txt
+ pageIcons.tTmp2.txt=entn9.txt
+ pageIcons.tTmp3.txt=bEntity9.txt
+ if(type9.txt=="shutter")
+ {
+ page popupShutter
+ }
+ if(type2.txt=="input_sel")
+ if(type9.txt=="input_sel")
+ {
+ page popupInSel
+ }
+ if(type2.txt=="timer")
+ if(type9.txt=="timer")
+ {
+ page popupTimer
+ }
+
+ Touch Release Event
+ tmLP.en=0
+ tSend.txt="event,buttonPress2,"+entn2.txt+",button"
+ tSend.txt="event,buttonPress2,"+entn9.txt+",button"
+ //send calc crc
+ btlen tSend.txt,sys0
+ crcrest 1,0xffff // reset CRC
@@ -731,43 +750,14 @@
+ prints tSend.txt,0
+ prints crcval,2
+
+bEntity8
+bNext
+ributes
+ Scope : local
+ Dragging : 0
+ Send Component ID: disabled
+ State : unpressed
+ Text : 
+ Max. Text Size : 10
+
+nts
+ Touch Press Event
+ tmLP.en=1
+ tTmp.txt=type6.txt
+ pageIcons.tTmp1.txt=tEntity6.txt
+ pageIcons.tTmp2.txt=entn6.txt
+ pageIcons.tTmp3.txt=bEntity6.txt
+ if(type6.txt=="shutter")
+ {
+ page popupShutter
+15 +654,15 @@
+ crcputs tSend.txt,0
+ //send cmd
+ printh 55 bb
+ prints sys0,2
+ prints tSend.txt,0
+ prints crcval,2
+
+bEntity8
+bEntity9
+ributes
+ Scope : local
+ Dragging : 0
+ Send Component ID: disabled
+ State : unpressed
+ Text : 
+ Max. Text Size : 10
+14 +1066,35 @@
+ Text : 
+,14 +1072,35 @@
+ spstr strCommand.txt,tTmp.txt,"~",59
+ covx tTmp.txt,sys0,0,0
+ bEntity8.pco=sys0
@@ -796,6 +786,13 @@
+ spstr strCommand.txt,tEntity9.txt,"~",66
+ vis tEntity9,1
+ }
+ }
+ if(tInstruction.txt=="pageType")
+ {
+ sleepValue=0
+ //command format pageType,specialPageName
+ //write name of speical page to tId
+ spstr strCommand.txt,tId.txt,"~",1
+I/n2t-out/cardPower.txt
++ HMI/US/portrait/n2t-out/cardPower.txt
+6 +45,16 @@
@@ -1123,6 +1120,23 @@
+ Scope : local
+ Period (ms): 50
+ Enabled : yes
+15 +938,15 @@
+ }
+ if(tId.txt=="cardChart")
+ {
+ page cardChart
+ }
+ if(tId.txt=="cardLChart")
+ {
+ page cardLChart
+ page cardChart
+ }
+ }
+ if(tInstruction.txt=="time")
+ {
+ // get set time to global variable
+ spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
+ }
+I/n2t-out/pageStartup.txt
++ HMI/US/portrait/n2t-out/pageStartup.txt
+0 +34,14 @@
@@ -1160,6 +1174,82 @@
+ Send Component ID : disabled
+15 +158,15 @@
+ Max. Text Size : 10
+15 +276,15 @@
+ // get feature flag popup
+ spstr strCommand.txt,tTmp.txt,"~",5
+ if(tTmp.txt!="")
+ {
+ covx tTmp.txt,featNewSliders,0,0
+ }
+ }
+ if(tInstruction.txt=="timeout")
+ if(tInstruction.txt=="timeout2")
+ {
+ //set timeout to global var
+ spstr strCommand.txt,tTmp.txt,"~",1
+ covx tTmp.txt,sleepTimeout,0,0
+ }
+ if(tInstruction.txt=="pageType")
+ {
+I/n2t-out/popupLight.txt
++ HMI/US/portrait/n2t-out/popupLight.txt
+3 +48,33 @@
+ vis hTempSlider,0
+ //disable color wheel components by default
+ vis bColor,0
+ vis t0,0
+ vis pColorWheel,0
+ //vis t0,0
+ popupLight.bco=defaultBcoColor
+ for(sys0=0;sys0<27;sys0++)
+ for(sys0=0;sys0<28;sys0++)
+ {
+ if(b[sys0].type==98||b[sys0].type==116)
+ {
+ b[sys0].bco=defaultBcoColor
+ b[sys0].pco=defaultFontColor
+ }
+ if(b[sys0].type==53&&defaultBcoColor==0)
+ {
+ b[sys0].pic=10
+ b[sys0].pic2=11
+ }
+ }
+ if(defaultBcoColor==0)
+ {
+ hBrightness.pic=24
+ hBrightness.pic1=25
+ hBrightness.pic=14
+ hBrightness.pic1=13
+ hBrightness.pic2=15
+ hTempSlider.pic=16
+ hTempSlider.pic=23
+ hTempSlider.pic1=17
+ hTempSlider.pic2=15
+ }
+
+e (string) entn
+ributes
+ Scope : local
+I/n2t-out/popupNotify.txt
++ HMI/US/portrait/n2t-out/popupNotify.txt
+15 +348,15 @@
+ // get font color
+ spstr strCommand.txt,tTmp.txt,"~",4
+ if(tTmp.txt!="")
+ {
+ covx tTmp.txt,defaultFontColor,0,0
+ }
+ }
+ if(tInstruction.txt=="timeout2")
+ if(tInstruction.txt=="timeout")
+ {
+ //set timeout to global var
+ spstr strCommand.txt,tTmp.txt,"~",1
+ covx tTmp.txt,sleepTimeout,0,0
+ }
+ if(tInstruction.txt=="exitPopup")
+ {
+I/n2t-out/screensaver.txt
++ HMI/US/portrait/n2t-out/screensaver.txt
+7 +28,14 @@

View File

@@ -14,6 +14,8 @@ Program.s
//color vars
int defaultFontColor=65535
int defaultBcoColor=6371
//feature flags
int featNewSliders=0
// fix touch offset (Removed for US version)
//lcd_dev fffb 0002 0000 0020
printh 00 00 00 ff ff ff 88 ff ff ff//Output power on information to serial port

View File

@@ -118,56 +118,56 @@ Variable (string) entn1
ID : 48
Scope : local
Text :
Max. Text Size: 65
Max. Text Size: 64
Variable (string) entn2
Attributes
ID : 49
Scope : local
Text :
Max. Text Size: 65
Max. Text Size: 64
Variable (string) entn3
Attributes
ID : 50
Scope : local
Text :
Max. Text Size: 65
Max. Text Size: 64
Variable (string) entn4
Attributes
ID : 51
Scope : local
Text :
Max. Text Size: 65
Max. Text Size: 64
Variable (string) entn5
Attributes
ID : 61
Scope : local
Text :
Max. Text Size: 65
Max. Text Size: 64
Variable (string) entn6
Attributes
ID : 88
Scope : local
Text :
Max. Text Size: 65
Max. Text Size: 64
Variable (string) nent1
Attributes
ID : 90
Scope : local
Text :
Max. Text Size: 40
Max. Text Size: 38
Variable (string) nent2
Attributes
ID : 89
Scope : local
Text :
Max. Text Size: 40
Max. Text Size: 38
Variable (string) strCommand
Attributes
@@ -1115,9 +1115,9 @@ Slider hSlider6
Events
Touch Release Event
nNum5.val=hSlider5.val
nNum6.val=hSlider6.val
tSend.txt="event,buttonPress2,"+entn6.txt+",number-set,"
covx nNum5.val,tTmp.txt,0,0
covx nNum6.val,tTmp.txt,0,0
tSend.txt+=tTmp.txt
//send calc crc
btlen tSend.txt,sys0
@@ -2577,7 +2577,7 @@ Dual-state Button btOnOff6
Events
Touch Press Event
tSend.txt="event,buttonPress2,"+entn6.txt+",OnOff,"
covx btOnOff5.val,tTmp.txt,0,0
covx btOnOff6.val,tTmp.txt,0,0
tSend.txt+=tTmp.txt
//send calc crc
btlen tSend.txt,sys0
@@ -2618,8 +2618,13 @@ Hotspot m0
}
if(type1.txt=="light")
{
//popupLight.tEntity.txt=tEntity1.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type1.txt=="fan")
{
@@ -2661,8 +2666,13 @@ Hotspot m1
}
if(type2.txt=="light")
{
//popupLight.tEntity.txt=tEntity2.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type2.txt=="fan")
{
@@ -2704,8 +2714,13 @@ Hotspot m2
}
if(type3.txt=="light")
{
//popupLight.tEntity.txt=tEntity3.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type3.txt=="fan")
{
@@ -2747,8 +2762,13 @@ Hotspot m3
}
if(type4.txt=="light")
{
//popupLight.tEntity.txt=tEntity4.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type4.txt=="fan")
{
@@ -2790,8 +2810,13 @@ Hotspot m4
}
if(type5.txt=="light")
{
//popupLight.tEntity.txt=tEntity5.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type5.txt=="fan")
{
@@ -2833,8 +2858,13 @@ Hotspot m5
}
if(type6.txt=="light")
{
//popupLight.tEntity.txt=tEntity5.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type6.txt=="fan")
{

View File

@@ -1052,7 +1052,13 @@ Timer tmLP
Timer Event
if(tTmp.txt=="light")
{
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(tTmp.txt=="fan")
{

View File

@@ -1036,26 +1036,26 @@ Button bEntity7
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type2.txt
pageIcons.tTmp1.txt=tEntity2.txt
pageIcons.tTmp2.txt=entn2.txt
pageIcons.tTmp3.txt=bEntity2.txt
if(type2.txt=="shutter")
tTmp.txt=type7.txt
pageIcons.tTmp1.txt=tEntity7.txt
pageIcons.tTmp2.txt=entn7.txt
pageIcons.tTmp3.txt=bEntity7.txt
if(type7.txt=="shutter")
{
page popupShutter
}
if(type2.txt=="input_sel")
if(type7.txt=="input_sel")
{
page popupInSel
}
if(type2.txt=="timer")
if(type7.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn2.txt+",button"
tSend.txt="event,buttonPress2,"+entn7.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -1102,26 +1102,26 @@ Button bEntity8
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type6.txt
pageIcons.tTmp1.txt=tEntity6.txt
pageIcons.tTmp2.txt=entn6.txt
pageIcons.tTmp3.txt=bEntity6.txt
if(type6.txt=="shutter")
tTmp.txt=type8.txt
pageIcons.tTmp1.txt=tEntity8.txt
pageIcons.tTmp2.txt=entn8.txt
pageIcons.tTmp3.txt=bEntity8.txt
if(type8.txt=="shutter")
{
page popupShutter
}
if(type6.txt=="input_sel")
if(type8.txt=="input_sel")
{
page popupInSel
}
if(type6.txt=="timer")
if(type8.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
tSend.txt="event,buttonPress2,"+entn8.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -1168,26 +1168,26 @@ Button bEntity9
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type6.txt
pageIcons.tTmp1.txt=tEntity6.txt
pageIcons.tTmp2.txt=entn6.txt
pageIcons.tTmp3.txt=bEntity6.txt
if(type6.txt=="shutter")
tTmp.txt=type9.txt
pageIcons.tTmp1.txt=tEntity9.txt
pageIcons.tTmp2.txt=entn9.txt
pageIcons.tTmp3.txt=bEntity9.txt
if(type9.txt=="shutter")
{
page popupShutter
}
if(type6.txt=="input_sel")
if(type9.txt=="input_sel")
{
page popupInSel
}
if(type6.txt=="timer")
if(type9.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
tSend.txt="event,buttonPress2,"+entn9.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -1385,7 +1385,13 @@ Timer tmLP
Timer Event
if(tTmp.txt=="light")
{
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(tTmp.txt=="fan")
{

View File

@@ -1514,6 +1514,10 @@ Timer tmSerial
{
page cardChart
}
if(tId.txt=="cardLChart")
{
page cardChart
}
}
if(tInstruction.txt=="time")
{

View File

@@ -1,7 +1,7 @@
Program.s
0 Component(s)
13 Line(s) of event code
13 Unique line(s) of event code
14 Line(s) of event code
14 Unique line(s) of event code
pageIcons
7 Component(s)
0 Line(s) of event code
@@ -14,22 +14,26 @@ popupNotify
19 Component(s)
267 Line(s) of event code
172 Unique line(s) of event code
cardGrid
44 Component(s)
529 Line(s) of event code
298 Unique line(s) of event code
popupTimer
42 Component(s)
516 Line(s) of event code
257 Unique line(s) of event code
cardGrid2
56 Component(s)
657 Line(s) of event code
332 Unique line(s) of event code
popupLight
28 Component(s)
412 Line(s) of event code
227 Unique line(s) of event code
popupFan
27 Component(s)
355 Line(s) of event code
206 Unique line(s) of event code
pageStartup
19 Component(s)
193 Line(s) of event code
135 Unique line(s) of event code
popupLightNew
23 Component(s)
412 Line(s) of event code
209 Unique line(s) of event code
cardChart
33 Component(s)
437 Line(s) of event code
@@ -42,10 +46,10 @@ cardLChart
33 Component(s)
402 Line(s) of event code
266 Unique line(s) of event code
popupLight
23 Component(s)
410 Line(s) of event code
209 Unique line(s) of event code
pageStartup
19 Component(s)
198 Line(s) of event code
137 Unique line(s) of event code
popupShutter
25 Component(s)
402 Line(s) of event code
@@ -62,22 +66,14 @@ popupInSel
34 Component(s)
621 Line(s) of event code
297 Unique line(s) of event code
cardGrid
44 Component(s)
523 Line(s) of event code
295 Unique line(s) of event code
cardGrid2
56 Component(s)
663 Line(s) of event code
359 Unique line(s) of event code
cardAlarm
43 Component(s)
500 Line(s) of event code
273 Unique line(s) of event code
cardPower
54 Component(s)
521 Line(s) of event code
341 Unique line(s) of event code
screensaver2
58 Component(s)
348 Line(s) of event code
245 Unique line(s) of event code
cardThermo
57 Component(s)
540 Line(s) of event code
@@ -86,13 +82,21 @@ screensaver
46 Component(s)
429 Line(s) of event code
306 Unique line(s) of event code
cardPower
54 Component(s)
525 Line(s) of event code
342 Unique line(s) of event code
screensaver2
58 Component(s)
352 Line(s) of event code
247 Unique line(s) of event code
cardEntities
91 Component(s)
1630 Line(s) of event code
705 Unique line(s) of event code
1666 Line(s) of event code
711 Unique line(s) of event code
Total
22 Page(s)
862 Component(s)
10360 Line(s) of event code
2492 Unique line(s) of event code
23 Page(s)
890 Component(s)
10836 Line(s) of event code
2553 Unique line(s) of event code

View File

@@ -389,7 +389,7 @@ Text tVersion
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : 51
Text : 52
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
@@ -568,8 +568,14 @@ Timer tmSerial
{
covx tTmp.txt,defaultFontColor,0,0
}
// get feature flag popup
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt!="")
{
covx tTmp.txt,featNewSliders,0,0
}
}
if(tInstruction.txt=="timeout")
if(tInstruction.txt=="timeout2")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1

View File

@@ -24,12 +24,13 @@ Page popupLight
tEntity.txt=pageIcons.tTmp1.txt
//get entity id
entn.txt=pageIcons.tTmp2.txt
tIcon1.txt=pageIcons.tTmp3.txt
vis p0,0
vis tSend,0
vis tTmp,0
vis tInstruction,0
vis tId,0
vis bEffect,0
vis hBrightness,0
//page open event
// event,pageOpenDetail,typeOfPage,tEntityName
// craft command
@@ -46,20 +47,20 @@ Page popupLight
prints tSend.txt,0
prints crcval,2
//disable brightness by default
//vis t1,0
//vis t2,0
vis hBrightness,1
vis t1,0
vis t2,0
vis hBrightness,0
//disable color temp by default
//vis t4,0
//vis t3,0
vis t4,0
vis t3,0
vis hTempSlider,0
//disable color wheel components by default
vis bColor,0
//vis t0,0
vis t0,0
vis pColorWheel,0
//vis t0,0
popupLight.bco=defaultBcoColor
for(sys0=0;sys0<27;sys0++)
for(sys0=0;sys0<28;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
@@ -74,83 +75,115 @@ Page popupLight
}
if(defaultBcoColor==0)
{
hTempSlider.pic=16
hTempSlider.pic1=16
hBrightness.pic=14
hBrightness.pic1=13
hBrightness.pic2=15
hTempSlider.pic=23
hTempSlider.pic1=17
hTempSlider.pic2=15
}
Postinitialize Event
fill hBrightness.x,hBrightness.y,100,250,defaultBcoColor
Variable (int32) col
Attributes
ID : 18
Scope: local
Value: 65504
Variable (string) entn
Attributes
ID : 11
ID : 20
Scope : local
Text :
Max. Text Size: 80
Variable (int32) mode
Attributes
ID : 13
ID : 22
Scope: local
Value: 1
Variable (int32) mode_temp
Attributes
ID : 14
ID : 23
Scope: local
Value: 0
Variable (string) strCommand
Attributes
ID : 9
ID : 16
Scope : local
Text :
Max. Text Size: 500
Variable (string) tId
Attributes
ID : 20
Scope : local
Text :
Max. Text Size: 20
Variable (string) tInstruction
Attributes
ID : 19
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
ID : 16
ID : 26
Scope : local
Text :
Max. Text Size: 200
Variable (string) tTmp
Text t0
Attributes
ID : 21
Scope : local
Text :
Max. Text Size: 80
Text tEntity
Attributes
ID : 2
ID : 24
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 19
y coordinate : 21
Width : 224
x coordinate : 12
y coordinate : 57
Width : 141
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: left
Vertical Alignment : center
Input Type : character
Text : Color
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t1
Attributes
ID : 6
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 60
y coordinate : 374
Width : 251
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: left
Vertical Alignment : center
Input Type : character
Text : Brightness
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t2
Attributes
ID : 9
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 10
y coordinate : 374
Width : 45
Height : 30
Effect : load
Effect Priority : 0
@@ -160,31 +193,250 @@ Text tEntity
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 65535
Font Color : 40147
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t3
Attributes
ID : 10
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 10
y coordinate : 267
Width : 45
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 40147
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t4
Attributes
ID : 11
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 60
y coordinate : 266
Width : 250
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: left
Vertical Alignment : center
Input Type : character
Text : Temperature
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tEntity
Attributes
ID : 3
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 60
y coordinate : 21
Width : 200
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: left
Vertical Alignment : center
Input Type : character
Text : tEntity1
Max. Text Size : 25
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Picture pColorWheel
Text tIcon1
Attributes
ID : 4
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 11
y coordinate : 21
Width : 45
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 17299
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tId
Attributes
ID : 18
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 100
y coordinate : 450
Width : 100
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
Text tInstruction
Attributes
ID : 17
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 450
Width : 100
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
Text tTmp
Attributes
ID : 12
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 282
y coordinate : 446
Width : 34
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 : 80
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Picture p0
Attributes
ID : 1
Scope : local
Dragging : 0
Send Component ID: disabled
Opacity : 127
x coordinate : 150
y coordinate : 168
Width : 160
Height : 160
x coordinate : 0
y coordinate : 1
Width : 319
Height : 479
Effect : load
Effect Priority : 0
Effect Time : 300
Picture ID : 3
Picture ID : 0
Picture pColorWheel
Attributes
ID : 2
Scope : local
Dragging : 0
Send Component ID: disabled
Opacity : 127
x coordinate : 67
y coordinate : 89
Width : 245
Height : 245
Effect : load
Effect Priority : 0
Effect Time : 300
Picture ID : 20
Events
Touch Press Event
@@ -216,44 +468,30 @@ Picture pColorWheel
Slider hBrightness
Attributes
ID : 4
ID : 7
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 25
y coordinate : 127
Width : 100
Height : 250
x coordinate : 12
y coordinate : 409
Width : 300
Height : 44
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : vertical
Direction : horizontal
Fill : image
Cursor width : auto
Cursor height : 1
Back. Picture ID : 65535
Slided Back. Picture ID: 65535
Cursor height : 255
Back. Picture ID : 5
Slided Back. Picture ID: 4
Position : 50
Upper range limit : 100
Lower range limit : 0
Events
Touch Release Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
@@ -274,24 +512,24 @@ Slider hBrightness
Slider hTempSlider
Attributes
ID : 10
ID : 19
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 187
y coordinate : 127
Width : 100
Height : 250
x coordinate : 12
y coordinate : 304
Width : 300
Height : 44
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : vertical
Direction : horizontal
Fill : image
Cursor width : auto
Cursor height : 255
Back. Picture ID : 7
Slided Back. Picture ID: 7
Back. Picture ID : 21
Slided Back. Picture ID: 22
Position : 50
Upper range limit : 100
Lower range limit : 0
@@ -318,13 +556,13 @@ Slider hTempSlider
Button b0
Attributes
ID : 3
ID : 5
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 256
y coordinate : 12
x coordinate : 266
y coordinate : 14
Width : 50
Height : 50
Effect : load
@@ -364,13 +602,13 @@ Button b0
Button bColor
Attributes
ID : 12
ID : 21
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 134
y coordinate : 407
x coordinate : 12
y coordinate : 89
Width : 50
Height : 50
Effect : load
@@ -401,8 +639,8 @@ Button bColor
//enable color wheel
vis pColorWheel,1
//disable color temp
//vis t4,0
//vis t3,0
vis t4,0
vis t3,0
vis hTempSlider,0
}else
{
@@ -412,21 +650,21 @@ Button bColor
if(mode_temp.val==1)
{
//enable color temp
//vis t4,1
//vis t3,1
vis t4,1
vis t3,1
vis hTempSlider,1
}
}
Button bEffect
Attributes
ID : 17
ID : 27
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 60
y coordinate : 407
x coordinate : 12
y coordinate : 195
Width : 50
Height : 50
Effect : load
@@ -453,17 +691,18 @@ Button bEffect
Touch Press Event
pageIcons.tTmp1.txt=tEntity.txt
pageIcons.tTmp2.txt=entn.txt
pageIcons.tTmp3.txt=tIcon1.txt
page popupInSel
Dual-state Button btOnOff1
Attributes
ID : 5
ID : 8
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 208
y coordinate : 407
x coordinate : 12
y coordinate : 142
Width : 50
Height : 50
Effect : load
@@ -502,43 +741,18 @@ Dual-state Button btOnOff1
Timer tmCooldown
Attributes
ID : 15
ID : 25
Scope : local
Period (ms): 100
Period (ms): 300
Enabled : no
Events
Timer Event
tmCooldown.en=0
Timer tmDrawCooldown
Attributes
ID : 22
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
Timer tmSerial
Attributes
ID : 8
ID : 15
Scope : local
Period (ms): 50
Enabled : yes
@@ -593,12 +807,11 @@ Timer tmSerial
{
// change icon
//spstr strCommand.txt,tIcon1.txt,"~",2
//vis tIcon1,1
vis tIcon1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",3
covx tTmp.txt,sys0,0,0
col.val=sys0
//tEntity.pco=sys0
tIcon1.pco=sys0
// get Button State
spstr strCommand.txt,tTmp.txt,"~",4
covx tTmp.txt,sys0,0,0
@@ -607,26 +820,27 @@ Timer tmSerial
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt=="disable")
{
//vis t1,0
//vis t2,0
vis t1,0
vis t2,0
vis hBrightness,0
}else
{
//vis t1,1
//vis t2,1
vis t1,1
vis t2,1
vis hBrightness,1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
tmDrawCooldown.en=1
tmDrawCooldown.tim=500
if(tmCooldown.en==0)
{
hBrightness.val=sys0
}
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6
if(tTmp.txt=="disable")
{
vis hTempSlider,0
//vis t3,0
//vis t4,0
vis t3,0
vis t4,0
mode_temp.val=0
// mode == 1 is temp controls currently shown
if(mode.val==1)
@@ -649,8 +863,8 @@ Timer tmSerial
{
mode_temp.val=1
vis hTempSlider,1
//vis t3,1
//vis t4,1
vis t3,1
vis t4,1
if(tmCooldown.en==0)
{
covx tTmp.txt,sys0,0,0
@@ -669,12 +883,12 @@ Timer tmSerial
// disable -> isn't supported
if(tTmp.txt=="disable")
{
//vis t0,0
vis t0,0
vis bColor,0
vis pColorWheel,0
}else
{
//vis t0,1
vis t0,1
//only enable bColor button if color temp is also supported
if(mode_temp.val==1)
{
@@ -686,11 +900,11 @@ Timer tmSerial
}
}
// set t0 Color (Localization)
//spstr strCommand.txt,t0.txt,"~",8
spstr strCommand.txt,t0.txt,"~",8
// set t4 Temperature (Localization)
//spstr strCommand.txt,t4.txt,"~",9
spstr strCommand.txt,t4.txt,"~",9
// set t1 Brightness (Localization)
//spstr strCommand.txt,t1.txt,"~",10
spstr strCommand.txt,t1.txt,"~",10
// activate effect button
spstr strCommand.txt,tTmp.txt,"~",11
if(tTmp.txt=="enable")
@@ -825,7 +1039,7 @@ Timer tmSerial
Timer tmSleep
Attributes
ID : 7
ID : 14
Scope : local
Period (ms): 1000
Enabled : yes
@@ -845,7 +1059,7 @@ Timer tmSleep
TouchCap tc0
Attributes
ID : 6
ID : 13
Scope: local
Value: 0

View File

@@ -0,0 +1,855 @@
Page popupLightNew
Attributes
ID : 0
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
Width : 320
Effect : load
Effect Priority : 0
Effect Time : 300
Locked : no
Swide up page ID : disabled
Swide down page ID : disabled
Swide left page ID : disabled
Swide right page ID: disabled
Fill : solid color
Back. Color : 6371
Events
Preinitialize Event
dim=dimValueNormal
//get entitiy name
tEntity.txt=pageIcons.tTmp1.txt
//get entity id
entn.txt=pageIcons.tTmp2.txt
vis tSend,0
vis tTmp,0
vis tInstruction,0
vis tId,0
vis bEffect,0
vis hBrightness,0
//page open event
// event,pageOpenDetail,typeOfPage,tEntityName
// craft command
tSend.txt="event,pageOpenDetail,popupLight,"+entn.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
//disable brightness by default
//vis t1,0
//vis t2,0
vis hBrightness,1
//disable color temp by default
//vis t4,0
//vis t3,0
vis hTempSlider,0
//disable color wheel components by default
vis bColor,0
//vis t0,0
vis pColorWheel,0
//vis t0,0
popupLightNew.bco=defaultBcoColor
for(sys0=0;sys0<27;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
b[sys0].bco=defaultBcoColor
b[sys0].pco=defaultFontColor
}
if(b[sys0].type==53&&defaultBcoColor==0)
{
b[sys0].pic=10
b[sys0].pic2=11
}
}
if(defaultBcoColor==0)
{
hTempSlider.pic=16
hTempSlider.pic1=16
}
Postinitialize Event
fill hBrightness.x,hBrightness.y,100,250,defaultBcoColor
Variable (int32) col
Attributes
ID : 18
Scope: local
Value: 65504
Variable (string) entn
Attributes
ID : 11
Scope : local
Text :
Max. Text Size: 80
Variable (int32) mode
Attributes
ID : 13
Scope: local
Value: 1
Variable (int32) mode_temp
Attributes
ID : 14
Scope: local
Value: 0
Variable (string) strCommand
Attributes
ID : 9
Scope : local
Text :
Max. Text Size: 500
Variable (string) tId
Attributes
ID : 20
Scope : local
Text :
Max. Text Size: 20
Variable (string) tInstruction
Attributes
ID : 19
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
ID : 16
Scope : local
Text :
Max. Text Size: 200
Variable (string) tTmp
Attributes
ID : 21
Scope : local
Text :
Max. Text Size: 80
Text tEntity
Attributes
ID : 2
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 19
y coordinate : 21
Width : 224
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : tEntity1
Max. Text Size : 25
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Picture pColorWheel
Attributes
ID : 1
Scope : local
Dragging : 0
Send Component ID: disabled
Opacity : 127
x coordinate : 150
y coordinate : 168
Width : 160
Height : 160
Effect : load
Effect Priority : 0
Effect Time : 300
Picture ID : 3
Events
Touch Press Event
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",colorWheel,"
sys0=tch0
sys0=sys0-pColorWheel.x
covx sys0,tTmp.txt,0,0
tSend.txt+=tTmp.txt
tSend.txt+="|"
sys0=tch1
sys0=sys0-pColorWheel.y
covx sys0,tTmp.txt,0,0
tSend.txt+=tTmp.txt
tSend.txt+="|"
covx pColorWheel.h,tTmp.txt,0,0
tSend.txt+=tTmp.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
Slider hBrightness
Attributes
ID : 4
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 25
y coordinate : 127
Width : 100
Height : 250
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : vertical
Fill : image
Cursor width : auto
Cursor height : 1
Back. Picture ID : 65535
Slided Back. Picture ID: 65535
Position : 50
Upper range limit : 100
Lower range limit : 0
Events
Touch Release Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",brightnessSlider,"
covx hBrightness.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Slider hTempSlider
Attributes
ID : 10
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 187
y coordinate : 127
Width : 100
Height : 250
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : vertical
Fill : image
Cursor width : auto
Cursor height : 255
Back. Picture ID : 7
Slided Back. Picture ID: 7
Position : 50
Upper range limit : 100
Lower range limit : 0
Events
Touch Release Event
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",colorTempSlider,"
covx hTempSlider.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Button b0
Attributes
ID : 3
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 256
y coordinate : 12
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed): 65535
Back. Color (Pressed) : 14823
Font Color (Unpressed) : 65535
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
tSend.txt="event,buttonPress2,popupLight,bExit"
//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
Button bColor
Attributes
ID : 12
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 134
y coordinate : 407
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed): 65535
Back. Color (Pressed) : 14823
Font Color (Unpressed) : 65535
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
if(mode.val==1)
{
mode.val=0
//enable color wheel
vis pColorWheel,1
//disable color temp
//vis t4,0
//vis t3,0
vis hTempSlider,0
}else
{
mode.val=1
//disable color wheel
vis pColorWheel,0
if(mode_temp.val==1)
{
//enable color temp
//vis t4,1
//vis t3,1
vis hTempSlider,1
}
}
Button bEffect
Attributes
ID : 17
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 60
y coordinate : 407
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed): 65535
Back. Color (Pressed) : 14823
Font Color (Unpressed) : 65535
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
pageIcons.tTmp1.txt=tEntity.txt
pageIcons.tTmp2.txt=entn.txt
page popupInSel
Dual-state Button btOnOff1
Attributes
ID : 5
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 208
y coordinate : 407
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : image
Font ID : 0
Background Picture ID (Unpressed): 1
Back. Picture ID (Pressed) : 2
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text :
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
covx btOnOff1.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Timer tmCooldown
Attributes
ID : 15
Scope : local
Period (ms): 300
Enabled : no
Events
Timer Event
tmCooldown.en=0
Timer tmDrawCooldown
Attributes
ID : 22
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
Timer tmSerial
Attributes
ID : 8
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
spstr strCommand.txt,tTmp.txt,"~",1
if(tInstruction.txt=="entityUpdateDetail"&&entn.txt==tTmp.txt)
{
// change icon
//spstr strCommand.txt,tIcon1.txt,"~",2
//vis tIcon1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",3
covx tTmp.txt,sys0,0,0
col.val=sys0
//tEntity.pco=sys0
// get Button State
spstr strCommand.txt,tTmp.txt,"~",4
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
// get Brightness value
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt=="disable")
{
//vis t1,0
//vis t2,0
vis hBrightness,0
}else
{
//vis t1,1
//vis t2,1
vis hBrightness,1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
tmDrawCooldown.en=1
tmDrawCooldown.tim=500
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6
if(tTmp.txt=="disable")
{
vis hTempSlider,0
//vis t3,0
//vis t4,0
mode_temp.val=0
// mode == 1 is temp controls currently shown
if(mode.val==1)
{
// switch mode
click bColor,1
click bColor,0
}
}else if(tTmp.txt=="unknown") // temp supported, but not in color mode
{
mode_temp.val=1
// mode == 1 is temp controls currently shown
if(mode.val==1)
{
// switch mode
click bColor,1
click bColor,0
}
}else
{
mode_temp.val=1
vis hTempSlider,1
//vis t3,1
//vis t4,1
if(tmCooldown.en==0)
{
covx tTmp.txt,sys0,0,0
hTempSlider.val=sys0
}
// mode == 0 is rgb controls currently shown
if(mode.val==0)
{
// switch mode
click bColor,1
click bColor,0
}
}
// get Color value
spstr strCommand.txt,tTmp.txt,"~",7
// disable -> isn't supported
if(tTmp.txt=="disable")
{
//vis t0,0
vis bColor,0
vis pColorWheel,0
}else
{
//vis t0,1
//only enable bColor button if color temp is also supported
if(mode_temp.val==1)
{
vis bColor,1
}
if(mode.val==0)
{
vis pColorWheel,1
}
}
// set t0 Color (Localization)
//spstr strCommand.txt,t0.txt,"~",8
// set t4 Temperature (Localization)
//spstr strCommand.txt,t4.txt,"~",9
// set t1 Brightness (Localization)
//spstr strCommand.txt,t1.txt,"~",10
// activate effect button
spstr strCommand.txt,tTmp.txt,"~",11
if(tTmp.txt=="enable")
{
vis bEffect,1
}else
{
vis bEffect,0
}
}
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,dimValue,0,0
// get value normal
spstr strCommand.txt,tTmp.txt,"~",2
covx tTmp.txt,dimValueNormal,0,0
dim=dimValueNormal
// get background color
spstr strCommand.txt,tTmp.txt,"~",3
if(tTmp.txt!="")
{
covx tTmp.txt,defaultBcoColor,0,0
}
// get font color
spstr strCommand.txt,tTmp.txt,"~",4
if(tTmp.txt!="")
{
covx tTmp.txt,defaultFontColor,0,0
}
}
if(tInstruction.txt=="timeout")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,sleepTimeout,0,0
}
if(tInstruction.txt=="pageType")
{
//command format pageType,specialPageName
//write name of speical page to tId
spstr strCommand.txt,tId.txt,"~",1
//save second arg if there's one
spstr strCommand.txt,tTmp.txt,"~",2
//save third arg if there's one
spstr strCommand.txt,pageIcons.tTmp2.txt,"~",3
spstr strCommand.txt,pageIcons.tTmp3.txt,"~",4
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
udelete payloadLength-1
bufferPos=0
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="screensaver")
{
page screensaver
}
if(tId.txt=="cardEntities")
{
page cardEntities
}
if(tId.txt=="cardGrid")
{
page cardGrid
}
if(tId.txt=="cardGrid2")
{
page cardGrid2
}
if(tId.txt=="popupLight")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupLight
}
if(tId.txt=="popupShutter")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupShutter
}
if(tId.txt=="popupNotify")
{
page popupNotify
}
if(tId.txt=="cardThermo")
{
page cardThermo
}
if(tId.txt=="cardMedia")
{
page cardMedia
}
if(tId.txt=="cardAlarm")
{
page cardAlarm
}
if(tId.txt=="cardQR")
{
page cardQR
}
if(tId.txt=="cardPower")
{
page cardPower
}
if(tId.txt=="cardChart")
{
page cardChart
}
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
}
Timer tmSleep
Attributes
ID : 7
Scope : local
Period (ms): 1000
Enabled : yes
Events
Timer Event
if(sleepTimeout!=0)
{
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
sleepValue=0
click b0,1
click b0,0
}
}
TouchCap tc0
Attributes
ID : 6
Scope: local
Value: 0
Events
Touch Press Event
sleepValue=0

View File

@@ -1617,6 +1617,10 @@ Timer tmSerial
{
page cardChart
}
if(tId.txt=="cardLChart")
{
page cardLChart
}
}
if(tInstruction.txt=="timeout")
{

View File

@@ -14,6 +14,8 @@ Program.s
//color vars
int defaultFontColor=65535
int defaultBcoColor=6371
//feature flags
int featNewSliders=0
// fix touch offset (Removed for US version)
//lcd_dev fffb 0002 0000 0020
printh 00 00 00 ff ff ff 88 ff ff ff//Output power on information to serial port

View File

@@ -109,49 +109,49 @@ Variable (string) entn1
Attributes
Scope : local
Text :
Max. Text Size: 65
Max. Text Size: 64
Variable (string) entn2
Attributes
Scope : local
Text :
Max. Text Size: 65
Max. Text Size: 64
Variable (string) entn3
Attributes
Scope : local
Text :
Max. Text Size: 65
Max. Text Size: 64
Variable (string) entn4
Attributes
Scope : local
Text :
Max. Text Size: 65
Max. Text Size: 64
Variable (string) entn5
Attributes
Scope : local
Text :
Max. Text Size: 65
Max. Text Size: 64
Variable (string) entn6
Attributes
Scope : local
Text :
Max. Text Size: 65
Max. Text Size: 64
Variable (string) nent1
Attributes
Scope : local
Text :
Max. Text Size: 40
Max. Text Size: 38
Variable (string) nent2
Attributes
Scope : local
Text :
Max. Text Size: 40
Max. Text Size: 38
Variable (string) strCommand
Attributes
@@ -545,9 +545,9 @@ Slider hSlider6
Events
Touch Release Event
nNum5.val=hSlider5.val
nNum6.val=hSlider6.val
tSend.txt="event,buttonPress2,"+entn6.txt+",number-set,"
covx nNum5.val,tTmp.txt,0,0
covx nNum6.val,tTmp.txt,0,0
tSend.txt+=tTmp.txt
//send calc crc
btlen tSend.txt,sys0
@@ -1327,7 +1327,7 @@ Dual-state Button btOnOff6
Events
Touch Press Event
tSend.txt="event,buttonPress2,"+entn6.txt+",OnOff,"
covx btOnOff5.val,tTmp.txt,0,0
covx btOnOff6.val,tTmp.txt,0,0
tSend.txt+=tTmp.txt
//send calc crc
btlen tSend.txt,sys0
@@ -1359,8 +1359,13 @@ Hotspot m0
}
if(type1.txt=="light")
{
//popupLight.tEntity.txt=tEntity1.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type1.txt=="fan")
{
@@ -1393,8 +1398,13 @@ Hotspot m1
}
if(type2.txt=="light")
{
//popupLight.tEntity.txt=tEntity2.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type2.txt=="fan")
{
@@ -1427,8 +1437,13 @@ Hotspot m2
}
if(type3.txt=="light")
{
//popupLight.tEntity.txt=tEntity3.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type3.txt=="fan")
{
@@ -1461,8 +1476,13 @@ Hotspot m3
}
if(type4.txt=="light")
{
//popupLight.tEntity.txt=tEntity4.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type4.txt=="fan")
{
@@ -1495,8 +1515,13 @@ Hotspot m4
}
if(type5.txt=="light")
{
//popupLight.tEntity.txt=tEntity5.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type5.txt=="fan")
{
@@ -1529,8 +1554,13 @@ Hotspot m5
}
if(type6.txt=="light")
{
//popupLight.tEntity.txt=tEntity5.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type6.txt=="fan")
{

View File

@@ -605,7 +605,13 @@ Timer tmLP
Timer Event
if(tTmp.txt=="light")
{
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(tTmp.txt=="fan")
{

View File

@@ -582,26 +582,26 @@ Button bEntity7
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type2.txt
pageIcons.tTmp1.txt=tEntity2.txt
pageIcons.tTmp2.txt=entn2.txt
pageIcons.tTmp3.txt=bEntity2.txt
if(type2.txt=="shutter")
tTmp.txt=type7.txt
pageIcons.tTmp1.txt=tEntity7.txt
pageIcons.tTmp2.txt=entn7.txt
pageIcons.tTmp3.txt=bEntity7.txt
if(type7.txt=="shutter")
{
page popupShutter
}
if(type2.txt=="input_sel")
if(type7.txt=="input_sel")
{
page popupInSel
}
if(type2.txt=="timer")
if(type7.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn2.txt+",button"
tSend.txt="event,buttonPress2,"+entn7.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -626,26 +626,26 @@ Button bEntity8
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type6.txt
pageIcons.tTmp1.txt=tEntity6.txt
pageIcons.tTmp2.txt=entn6.txt
pageIcons.tTmp3.txt=bEntity6.txt
if(type6.txt=="shutter")
tTmp.txt=type8.txt
pageIcons.tTmp1.txt=tEntity8.txt
pageIcons.tTmp2.txt=entn8.txt
pageIcons.tTmp3.txt=bEntity8.txt
if(type8.txt=="shutter")
{
page popupShutter
}
if(type6.txt=="input_sel")
if(type8.txt=="input_sel")
{
page popupInSel
}
if(type6.txt=="timer")
if(type8.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
tSend.txt="event,buttonPress2,"+entn8.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -670,26 +670,26 @@ Button bEntity9
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type6.txt
pageIcons.tTmp1.txt=tEntity6.txt
pageIcons.tTmp2.txt=entn6.txt
pageIcons.tTmp3.txt=bEntity6.txt
if(type6.txt=="shutter")
tTmp.txt=type9.txt
pageIcons.tTmp1.txt=tEntity9.txt
pageIcons.tTmp2.txt=entn9.txt
pageIcons.tTmp3.txt=bEntity9.txt
if(type9.txt=="shutter")
{
page popupShutter
}
if(type6.txt=="input_sel")
if(type9.txt=="input_sel")
{
page popupInSel
}
if(type6.txt=="timer")
if(type9.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
tSend.txt="event,buttonPress2,"+entn9.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -806,7 +806,13 @@ Timer tmLP
Timer Event
if(tTmp.txt=="light")
{
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(tTmp.txt=="fan")
{

View File

@@ -940,6 +940,10 @@ Timer tmSerial
{
page cardChart
}
if(tId.txt=="cardLChart")
{
page cardChart
}
}
if(tInstruction.txt=="time")
{

View File

@@ -139,7 +139,7 @@ Text tVersion
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 51
Text : 52
Max. Text Size : 10
Picture p0
@@ -273,8 +273,14 @@ Timer tmSerial
{
covx tTmp.txt,defaultFontColor,0,0
}
// get feature flag popup
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt!="")
{
covx tTmp.txt,featNewSliders,0,0
}
}
if(tInstruction.txt=="timeout")
if(tInstruction.txt=="timeout2")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1

View File

@@ -16,12 +16,13 @@ Page popupLight
tEntity.txt=pageIcons.tTmp1.txt
//get entity id
entn.txt=pageIcons.tTmp2.txt
tIcon1.txt=pageIcons.tTmp3.txt
vis p0,0
vis tSend,0
vis tTmp,0
vis tInstruction,0
vis tId,0
vis bEffect,0
vis hBrightness,0
//page open event
// event,pageOpenDetail,typeOfPage,tEntityName
// craft command
@@ -38,20 +39,20 @@ Page popupLight
prints tSend.txt,0
prints crcval,2
//disable brightness by default
//vis t1,0
//vis t2,0
vis hBrightness,1
vis t1,0
vis t2,0
vis hBrightness,0
//disable color temp by default
//vis t4,0
//vis t3,0
vis t4,0
vis t3,0
vis hTempSlider,0
//disable color wheel components by default
vis bColor,0
//vis t0,0
vis t0,0
vis pColorWheel,0
//vis t0,0
popupLight.bco=defaultBcoColor
for(sys0=0;sys0<27;sys0++)
for(sys0=0;sys0<28;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
@@ -66,18 +67,14 @@ Page popupLight
}
if(defaultBcoColor==0)
{
hTempSlider.pic=16
hTempSlider.pic1=16
hBrightness.pic=14
hBrightness.pic1=13
hBrightness.pic2=15
hTempSlider.pic=23
hTempSlider.pic1=17
hTempSlider.pic2=15
}
Postinitialize Event
fill hBrightness.x,hBrightness.y,100,250,defaultBcoColor
Variable (int32) col
Attributes
Scope: local
Value: 65504
Variable (string) entn
Attributes
Scope : local
@@ -100,29 +97,56 @@ Variable (string) strCommand
Text :
Max. Text Size: 500
Variable (string) tId
Attributes
Scope : local
Text :
Max. Text Size: 20
Variable (string) tInstruction
Attributes
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
Scope : local
Text :
Max. Text Size: 200
Variable (string) tTmp
Text t0
Attributes
Scope : local
Text :
Max. Text Size: 80
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Color
Max. Text Size : 50
Text t1
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Brightness
Max. Text Size : 50
Text t2
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 
Max. Text Size : 10
Text t3
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 
Max. Text Size : 10
Text t4
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Temperature
Max. Text Size : 50
Text tEntity
Attributes
@@ -133,6 +157,48 @@ Text tEntity
Text : tEntity1
Max. Text Size : 25
Text tIcon1
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 
Max. Text Size : 10
Text tId
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 20
Text tInstruction
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 20
Text tTmp
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 80
Picture p0
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
Picture pColorWheel
Attributes
Scope : local
@@ -178,20 +244,6 @@ Slider hBrightness
Events
Touch Release Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
@@ -280,8 +332,8 @@ Button bColor
//enable color wheel
vis pColorWheel,1
//disable color temp
//vis t4,0
//vis t3,0
vis t4,0
vis t3,0
vis hTempSlider,0
}else
{
@@ -291,8 +343,8 @@ Button bColor
if(mode_temp.val==1)
{
//enable color temp
//vis t4,1
//vis t3,1
vis t4,1
vis t3,1
vis hTempSlider,1
}
}
@@ -310,6 +362,7 @@ Button bEffect
Touch Press Event
pageIcons.tTmp1.txt=tEntity.txt
pageIcons.tTmp2.txt=entn.txt
pageIcons.tTmp3.txt=tIcon1.txt
page popupInSel
Dual-state Button btOnOff1
@@ -342,37 +395,13 @@ Dual-state Button btOnOff1
Timer tmCooldown
Attributes
Scope : local
Period (ms): 100
Period (ms): 300
Enabled : no
Events
Timer Event
tmCooldown.en=0
Timer tmDrawCooldown
Attributes
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
Timer tmSerial
Attributes
Scope : local
@@ -429,12 +458,11 @@ Timer tmSerial
{
// change icon
//spstr strCommand.txt,tIcon1.txt,"~",2
//vis tIcon1,1
vis tIcon1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",3
covx tTmp.txt,sys0,0,0
col.val=sys0
//tEntity.pco=sys0
tIcon1.pco=sys0
// get Button State
spstr strCommand.txt,tTmp.txt,"~",4
covx tTmp.txt,sys0,0,0
@@ -443,26 +471,27 @@ Timer tmSerial
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt=="disable")
{
//vis t1,0
//vis t2,0
vis t1,0
vis t2,0
vis hBrightness,0
}else
{
//vis t1,1
//vis t2,1
vis t1,1
vis t2,1
vis hBrightness,1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
tmDrawCooldown.en=1
tmDrawCooldown.tim=500
if(tmCooldown.en==0)
{
hBrightness.val=sys0
}
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6
if(tTmp.txt=="disable")
{
vis hTempSlider,0
//vis t3,0
//vis t4,0
vis t3,0
vis t4,0
mode_temp.val=0
// mode == 1 is temp controls currently shown
if(mode.val==1)
@@ -485,8 +514,8 @@ Timer tmSerial
{
mode_temp.val=1
vis hTempSlider,1
//vis t3,1
//vis t4,1
vis t3,1
vis t4,1
if(tmCooldown.en==0)
{
covx tTmp.txt,sys0,0,0
@@ -505,12 +534,12 @@ Timer tmSerial
// disable -> isn't supported
if(tTmp.txt=="disable")
{
//vis t0,0
vis t0,0
vis bColor,0
vis pColorWheel,0
}else
{
//vis t0,1
vis t0,1
//only enable bColor button if color temp is also supported
if(mode_temp.val==1)
{
@@ -522,11 +551,11 @@ Timer tmSerial
}
}
// set t0 Color (Localization)
//spstr strCommand.txt,t0.txt,"~",8
spstr strCommand.txt,t0.txt,"~",8
// set t4 Temperature (Localization)
//spstr strCommand.txt,t4.txt,"~",9
spstr strCommand.txt,t4.txt,"~",9
// set t1 Brightness (Localization)
//spstr strCommand.txt,t1.txt,"~",10
spstr strCommand.txt,t1.txt,"~",10
// activate effect button
spstr strCommand.txt,tTmp.txt,"~",11
if(tTmp.txt=="enable")

View File

@@ -0,0 +1,689 @@
Page popupLightNew
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Locked : no
Swide up page ID : disabled
Swide down page ID : disabled
Swide left page ID : disabled
Swide right page ID: disabled
Events
Preinitialize Event
dim=dimValueNormal
//get entitiy name
tEntity.txt=pageIcons.tTmp1.txt
//get entity id
entn.txt=pageIcons.tTmp2.txt
vis tSend,0
vis tTmp,0
vis tInstruction,0
vis tId,0
vis bEffect,0
vis hBrightness,0
//page open event
// event,pageOpenDetail,typeOfPage,tEntityName
// craft command
tSend.txt="event,pageOpenDetail,popupLight,"+entn.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
//disable brightness by default
//vis t1,0
//vis t2,0
vis hBrightness,1
//disable color temp by default
//vis t4,0
//vis t3,0
vis hTempSlider,0
//disable color wheel components by default
vis bColor,0
//vis t0,0
vis pColorWheel,0
//vis t0,0
popupLightNew.bco=defaultBcoColor
for(sys0=0;sys0<27;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
b[sys0].bco=defaultBcoColor
b[sys0].pco=defaultFontColor
}
if(b[sys0].type==53&&defaultBcoColor==0)
{
b[sys0].pic=10
b[sys0].pic2=11
}
}
if(defaultBcoColor==0)
{
hTempSlider.pic=16
hTempSlider.pic1=16
}
Postinitialize Event
fill hBrightness.x,hBrightness.y,100,250,defaultBcoColor
Variable (int32) col
Attributes
Scope: local
Value: 65504
Variable (string) entn
Attributes
Scope : local
Text :
Max. Text Size: 80
Variable (int32) mode
Attributes
Scope: local
Value: 1
Variable (int32) mode_temp
Attributes
Scope: local
Value: 0
Variable (string) strCommand
Attributes
Scope : local
Text :
Max. Text Size: 500
Variable (string) tId
Attributes
Scope : local
Text :
Max. Text Size: 20
Variable (string) tInstruction
Attributes
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
Scope : local
Text :
Max. Text Size: 200
Variable (string) tTmp
Attributes
Scope : local
Text :
Max. Text Size: 80
Text tEntity
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : tEntity1
Max. Text Size : 25
Picture pColorWheel
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Press Event
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",colorWheel,"
sys0=tch0
sys0=sys0-pColorWheel.x
covx sys0,tTmp.txt,0,0
tSend.txt+=tTmp.txt
tSend.txt+="|"
sys0=tch1
sys0=sys0-pColorWheel.y
covx sys0,tTmp.txt,0,0
tSend.txt+=tTmp.txt
tSend.txt+="|"
covx pColorWheel.h,tTmp.txt,0,0
tSend.txt+=tTmp.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
Slider hBrightness
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
Position : 50
Upper range limit: 100
Lower range limit: 0
Events
Touch Release Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",brightnessSlider,"
covx hBrightness.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Slider hTempSlider
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
Position : 50
Upper range limit: 100
Lower range limit: 0
Events
Touch Release Event
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",colorTempSlider,"
covx hTempSlider.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Button b0
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text : 
Max. Text Size : 10
Events
Touch Press Event
tSend.txt="event,buttonPress2,popupLight,bExit"
//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
Button bColor
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text : 
Max. Text Size : 10
Events
Touch Press Event
if(mode.val==1)
{
mode.val=0
//enable color wheel
vis pColorWheel,1
//disable color temp
//vis t4,0
//vis t3,0
vis hTempSlider,0
}else
{
mode.val=1
//disable color wheel
vis pColorWheel,0
if(mode_temp.val==1)
{
//enable color temp
//vis t4,1
//vis t3,1
vis hTempSlider,1
}
}
Button bEffect
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text : 
Max. Text Size : 10
Events
Touch Press Event
pageIcons.tTmp1.txt=tEntity.txt
pageIcons.tTmp2.txt=entn.txt
page popupInSel
Dual-state Button btOnOff1
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text :
Max. Text Size : 10
Events
Touch Press Event
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
covx btOnOff1.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Timer tmCooldown
Attributes
Scope : local
Period (ms): 300
Enabled : no
Events
Timer Event
tmCooldown.en=0
Timer tmDrawCooldown
Attributes
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
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
spstr strCommand.txt,tTmp.txt,"~",1
if(tInstruction.txt=="entityUpdateDetail"&&entn.txt==tTmp.txt)
{
// change icon
//spstr strCommand.txt,tIcon1.txt,"~",2
//vis tIcon1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",3
covx tTmp.txt,sys0,0,0
col.val=sys0
//tEntity.pco=sys0
// get Button State
spstr strCommand.txt,tTmp.txt,"~",4
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
// get Brightness value
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt=="disable")
{
//vis t1,0
//vis t2,0
vis hBrightness,0
}else
{
//vis t1,1
//vis t2,1
vis hBrightness,1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
tmDrawCooldown.en=1
tmDrawCooldown.tim=500
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6
if(tTmp.txt=="disable")
{
vis hTempSlider,0
//vis t3,0
//vis t4,0
mode_temp.val=0
// mode == 1 is temp controls currently shown
if(mode.val==1)
{
// switch mode
click bColor,1
click bColor,0
}
}else if(tTmp.txt=="unknown") // temp supported, but not in color mode
{
mode_temp.val=1
// mode == 1 is temp controls currently shown
if(mode.val==1)
{
// switch mode
click bColor,1
click bColor,0
}
}else
{
mode_temp.val=1
vis hTempSlider,1
//vis t3,1
//vis t4,1
if(tmCooldown.en==0)
{
covx tTmp.txt,sys0,0,0
hTempSlider.val=sys0
}
// mode == 0 is rgb controls currently shown
if(mode.val==0)
{
// switch mode
click bColor,1
click bColor,0
}
}
// get Color value
spstr strCommand.txt,tTmp.txt,"~",7
// disable -> isn't supported
if(tTmp.txt=="disable")
{
//vis t0,0
vis bColor,0
vis pColorWheel,0
}else
{
//vis t0,1
//only enable bColor button if color temp is also supported
if(mode_temp.val==1)
{
vis bColor,1
}
if(mode.val==0)
{
vis pColorWheel,1
}
}
// set t0 Color (Localization)
//spstr strCommand.txt,t0.txt,"~",8
// set t4 Temperature (Localization)
//spstr strCommand.txt,t4.txt,"~",9
// set t1 Brightness (Localization)
//spstr strCommand.txt,t1.txt,"~",10
// activate effect button
spstr strCommand.txt,tTmp.txt,"~",11
if(tTmp.txt=="enable")
{
vis bEffect,1
}else
{
vis bEffect,0
}
}
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,dimValue,0,0
// get value normal
spstr strCommand.txt,tTmp.txt,"~",2
covx tTmp.txt,dimValueNormal,0,0
dim=dimValueNormal
// get background color
spstr strCommand.txt,tTmp.txt,"~",3
if(tTmp.txt!="")
{
covx tTmp.txt,defaultBcoColor,0,0
}
// get font color
spstr strCommand.txt,tTmp.txt,"~",4
if(tTmp.txt!="")
{
covx tTmp.txt,defaultFontColor,0,0
}
}
if(tInstruction.txt=="timeout")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,sleepTimeout,0,0
}
if(tInstruction.txt=="pageType")
{
//command format pageType,specialPageName
//write name of speical page to tId
spstr strCommand.txt,tId.txt,"~",1
//save second arg if there's one
spstr strCommand.txt,tTmp.txt,"~",2
//save third arg if there's one
spstr strCommand.txt,pageIcons.tTmp2.txt,"~",3
spstr strCommand.txt,pageIcons.tTmp3.txt,"~",4
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
udelete payloadLength-1
bufferPos=0
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="screensaver")
{
page screensaver
}
if(tId.txt=="cardEntities")
{
page cardEntities
}
if(tId.txt=="cardGrid")
{
page cardGrid
}
if(tId.txt=="cardGrid2")
{
page cardGrid2
}
if(tId.txt=="popupLight")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupLight
}
if(tId.txt=="popupShutter")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupShutter
}
if(tId.txt=="popupNotify")
{
page popupNotify
}
if(tId.txt=="cardThermo")
{
page cardThermo
}
if(tId.txt=="cardMedia")
{
page cardMedia
}
if(tId.txt=="cardAlarm")
{
page cardAlarm
}
if(tId.txt=="cardQR")
{
page cardQR
}
if(tId.txt=="cardPower")
{
page cardPower
}
if(tId.txt=="cardChart")
{
page cardChart
}
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
}
Timer tmSleep
Attributes
Scope : local
Period (ms): 1000
Enabled : yes
Events
Timer Event
if(sleepTimeout!=0)
{
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
sleepValue=0
click b0,1
click b0,0
}
}
TouchCap tc0
Attributes
Scope: local
Value: 0
Events
Touch Press Event
sleepValue=0

View File

@@ -804,6 +804,10 @@ Timer tmSerial
{
page cardChart
}
if(tId.txt=="cardLChart")
{
page cardLChart
}
}
if(tInstruction.txt=="timeout")
{

Binary file not shown.

Binary file not shown.

View File

@@ -14,6 +14,8 @@ Program.s
//color vars
int defaultFontColor=65535
int defaultBcoColor=6371
//feature flags
int featNewSliders=0
// fix touch offset
lcd_dev fffb 0002 0000 0020
printh 00 00 00 ff ff ff 88 ff ff ff//Output power on information to serial port

View File

@@ -1856,8 +1856,13 @@ Hotspot m0
}
if(type1.txt=="light")
{
//popupLight.tEntity.txt=tEntity1.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type1.txt=="fan")
{
@@ -1899,8 +1904,13 @@ Hotspot m1
}
if(type2.txt=="light")
{
//popupLight.tEntity.txt=tEntity2.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type2.txt=="fan")
{
@@ -1942,8 +1952,13 @@ Hotspot m2
}
if(type3.txt=="light")
{
//popupLight.tEntity.txt=tEntity3.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type3.txt=="fan")
{
@@ -1985,8 +2000,13 @@ Hotspot m3
}
if(type4.txt=="light")
{
//popupLight.tEntity.txt=tEntity4.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type4.txt=="fan")
{

View File

@@ -1052,7 +1052,13 @@ Timer tmLP
Timer Event
if(tTmp.txt=="light")
{
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(tTmp.txt=="fan")
{

View File

@@ -991,26 +991,26 @@ Button bEntity7
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type6.txt
pageIcons.tTmp1.txt=tEntity6.txt
pageIcons.tTmp2.txt=entn6.txt
pageIcons.tTmp3.txt=bEntity6.txt
if(type6.txt=="shutter")
tTmp.txt=type7.txt
pageIcons.tTmp1.txt=tEntity7.txt
pageIcons.tTmp2.txt=entn7.txt
pageIcons.tTmp3.txt=bEntity7.txt
if(type7.txt=="shutter")
{
page popupShutter
}
if(type6.txt=="input_sel")
if(type7.txt=="input_sel")
{
page popupInSel
}
if(type6.txt=="timer")
if(type7.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
tSend.txt="event,buttonPress2,"+entn7.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -1057,26 +1057,26 @@ Button bEntity8
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type6.txt
pageIcons.tTmp1.txt=tEntity6.txt
pageIcons.tTmp2.txt=entn6.txt
pageIcons.tTmp3.txt=bEntity6.txt
if(type6.txt=="shutter")
tTmp.txt=type8.txt
pageIcons.tTmp1.txt=tEntity8.txt
pageIcons.tTmp2.txt=entn8.txt
pageIcons.tTmp3.txt=bEntity8.txt
if(type8.txt=="shutter")
{
page popupShutter
}
if(type6.txt=="input_sel")
if(type8.txt=="input_sel")
{
page popupInSel
}
if(type6.txt=="timer")
if(type8.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
tSend.txt="event,buttonPress2,"+entn8.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -1274,7 +1274,13 @@ Timer tmLP
Timer Event
if(tTmp.txt=="light")
{
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(tTmp.txt=="fan")
{

View File

@@ -1652,6 +1652,10 @@ Timer tmSerial
{
page cardChart
}
if(tId.txt=="cardLChart")
{
page cardLChart
}
}
if(tInstruction.txt=="time")
{

View File

@@ -1,7 +1,7 @@
Program.s
0 Component(s)
14 Line(s) of event code
14 Unique line(s) of event code
15 Line(s) of event code
15 Unique line(s) of event code
pageIcons
7 Component(s)
0 Line(s) of event code
@@ -18,30 +18,26 @@ popupFan
27 Component(s)
355 Line(s) of event code
206 Unique line(s) of event code
popupLight
23 Component(s)
410 Line(s) of event code
209 Unique line(s) of event code
popupShutter
25 Component(s)
402 Line(s) of event code
220 Unique line(s) of event code
cardGrid
44 Component(s)
523 Line(s) of event code
295 Unique line(s) of event code
popupLightNew
23 Component(s)
412 Line(s) of event code
209 Unique line(s) of event code
popupNotify
19 Component(s)
267 Line(s) of event code
172 Unique line(s) of event code
cardPower
54 Component(s)
527 Line(s) of event code
347 Unique line(s) of event code
cardGrid
44 Component(s)
529 Line(s) of event code
298 Unique line(s) of event code
pageStartup
20 Component(s)
193 Line(s) of event code
135 Unique line(s) of event code
198 Line(s) of event code
137 Unique line(s) of event code
cardQR
34 Component(s)
410 Line(s) of event code
@@ -50,22 +46,26 @@ cardChart
33 Component(s)
437 Line(s) of event code
296 Unique line(s) of event code
screensaver2
59 Component(s)
362 Line(s) of event code
255 Unique line(s) of event code
cardAlarm
43 Component(s)
500 Line(s) of event code
273 Unique line(s) of event code
screensaver
47 Component(s)
444 Line(s) of event code
316 Unique line(s) of event code
popupLight
28 Component(s)
412 Line(s) of event code
227 Unique line(s) of event code
cardThermo
57 Component(s)
540 Line(s) of event code
319 Unique line(s) of event code
screensaver2
59 Component(s)
358 Line(s) of event code
253 Unique line(s) of event code
cardGrid2
52 Component(s)
617 Line(s) of event code
338 Unique line(s) of event code
cardMedia
59 Component(s)
649 Line(s) of event code
@@ -74,10 +74,14 @@ popupInSel
34 Component(s)
621 Line(s) of event code
297 Unique line(s) of event code
cardGrid2
52 Component(s)
611 Line(s) of event code
319 Unique line(s) of event code
cardPower
54 Component(s)
531 Line(s) of event code
349 Unique line(s) of event code
screensaver
47 Component(s)
444 Line(s) of event code
316 Unique line(s) of event code
popupTimer
42 Component(s)
516 Line(s) of event code
@@ -88,11 +92,11 @@ popupThermo
276 Unique line(s) of event code
cardEntities
67 Component(s)
1170 Line(s) of event code
532 Unique line(s) of event code
1194 Line(s) of event code
535 Unique line(s) of event code
Total
22 Page(s)
850 Component(s)
9940 Line(s) of event code
2369 Unique line(s) of event code
23 Page(s)
878 Component(s)
10404 Line(s) of event code
2417 Unique line(s) of event code

View File

@@ -396,7 +396,7 @@ Text tVersion
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : 51
Text : 52
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
@@ -575,6 +575,12 @@ Timer tmSerial
{
covx tTmp.txt,defaultFontColor,0,0
}
// get feature flag popup
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt!="")
{
covx tTmp.txt,featNewSliders,0,0
}
}
if(tInstruction.txt=="timeout")
{

View File

@@ -24,12 +24,13 @@ Page popupLight
tEntity.txt=pageIcons.tTmp1.txt
//get entity id
entn.txt=pageIcons.tTmp2.txt
tIcon1.txt=pageIcons.tTmp3.txt
vis p0,0
vis tSend,0
vis tTmp,0
vis tInstruction,0
vis tId,0
vis bEffect,0
vis hBrightness,0
//page open event
// event,pageOpenDetail,typeOfPage,tEntityName
// craft command
@@ -46,16 +47,16 @@ Page popupLight
prints tSend.txt,0
prints crcval,2
//disable brightness by default
//vis t1,0
//vis t2,0
vis hBrightness,1
vis t1,0
vis t2,0
vis hBrightness,0
//disable color temp by default
//vis t4,0
//vis t3,0
vis t4,0
vis t3,0
vis hTempSlider,0
//disable color wheel components by default
vis bColor,0
//vis t0,0
vis t0,0
vis pColorWheel,0
//vis t0,0
popupLight.bco=defaultBcoColor
@@ -74,76 +75,195 @@ Page popupLight
}
if(defaultBcoColor==0)
{
hBrightness.pic=24
hBrightness.pic1=25
hBrightness.pic2=15
hTempSlider.pic=16
hTempSlider.pic1=16
hTempSlider.pic1=17
hTempSlider.pic2=15
}
Postinitialize Event
fill hBrightness.x,hBrightness.y,100,250,defaultBcoColor
Variable (int32) col
Attributes
ID : 18
Scope: local
Value: 65504
Variable (string) entn
Attributes
ID : 11
ID : 20
Scope : local
Text :
Max. Text Size: 80
Variable (int32) mode
Attributes
ID : 13
ID : 22
Scope: local
Value: 1
Variable (int32) mode_temp
Attributes
ID : 14
ID : 23
Scope: local
Value: 0
Variable (string) strCommand
Attributes
ID : 9
ID : 16
Scope : local
Text :
Max. Text Size: 500
Variable (string) tId
Attributes
ID : 20
Scope : local
Text :
Max. Text Size: 20
Variable (string) tInstruction
Attributes
ID : 19
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
ID : 16
ID : 26
Scope : local
Text :
Max. Text Size: 200
Variable (string) tTmp
Text t0
Attributes
ID : 21
Scope : local
Text :
Max. Text Size: 80
ID : 24
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 9
y coordinate : 80
Width : 64
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: left
Vertical Alignment : center
Input Type : character
Text : Color
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t1
Attributes
ID : 6
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 10
y coordinate : 226
Width : 211
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: left
Vertical Alignment : center
Input Type : character
Text : Brightness
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t2
Attributes
ID : 9
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 10
y coordinate : 267
Width : 45
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 40147
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t3
Attributes
ID : 10
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 10
y coordinate : 181
Width : 45
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 40147
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text t4
Attributes
ID : 11
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 9
y coordinate : 143
Width : 242
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: left
Vertical Alignment : center
Input Type : character
Text : Temperature
Max. Text Size : 50
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tEntity
Attributes
ID : 2
ID : 3
Scope : local
Dragging : 0
Send Component ID : disabled
@@ -158,10 +278,10 @@ Text tEntity
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 2
Font ID : 0
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: center
Horizontal Alignment: left
Vertical Alignment : center
Input Type : character
Text : tEntity1
@@ -170,15 +290,147 @@ Text tEntity
Horizontal Spacing : 0
Vertical Spacing : 0
Picture pColorWheel
Text tIcon1
Attributes
ID : 4
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 11
y coordinate : 21
Width : 45
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 1
Back. Color : 6371
Font Color : 17299
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Text tId
Attributes
ID : 18
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 100
y coordinate : 290
Width : 100
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
Text tInstruction
Attributes
ID : 17
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 290
Width : 100
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
Text tTmp
Attributes
ID : 12
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 406
y coordinate : 277
Width : 34
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 : 80
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Picture p0
Attributes
ID : 1
Scope : local
Dragging : 0
Send Component ID: disabled
Opacity : 127
x coordinate : 233
y coordinate : 105
x coordinate : 0
y coordinate : 0
Width : 480
Height : 320
Effect : load
Effect Priority : 0
Effect Time : 300
Picture ID : 0
Picture pColorWheel
Attributes
ID : 2
Scope : local
Dragging : 0
Send Component ID: disabled
Opacity : 127
x coordinate : 167
y coordinate : 69
Width : 160
Height : 160
Effect : load
@@ -216,44 +468,30 @@ Picture pColorWheel
Slider hBrightness
Attributes
ID : 4
ID : 7
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 89
y coordinate : 64
Width : 100
Height : 250
x coordinate : 61
y coordinate : 261
Width : 335
Height : 43
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : vertical
Direction : horizontal
Fill : image
Cursor width : auto
Cursor height : 1
Back. Picture ID : 65535
Slided Back. Picture ID: 65535
Cursor height : 255
Back. Picture ID : 5
Slided Back. Picture ID: 4
Position : 50
Upper range limit : 100
Lower range limit : 0
Events
Touch Release Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
@@ -274,24 +512,24 @@ Slider hBrightness
Slider hTempSlider
Attributes
ID : 10
ID : 19
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 263
y coordinate : 64
Width : 100
Height : 250
x coordinate : 61
y coordinate : 178
Width : 335
Height : 44
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : vertical
Direction : horizontal
Fill : image
Cursor width : auto
Cursor height : 255
Back. Picture ID : 7
Slided Back. Picture ID: 7
Back. Picture ID : 22
Slided Back. Picture ID: 23
Position : 50
Upper range limit : 100
Lower range limit : 0
@@ -318,7 +556,7 @@ Slider hTempSlider
Button b0
Attributes
ID : 3
ID : 5
Scope : local
Dragging : 0
Send Component ID : disabled
@@ -364,13 +602,13 @@ Button b0
Button bColor
Attributes
ID : 12
ID : 21
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 14
y coordinate : 146
x coordinate : 93
y coordinate : 68
Width : 50
Height : 50
Effect : load
@@ -401,8 +639,8 @@ Button bColor
//enable color wheel
vis pColorWheel,1
//disable color temp
//vis t4,0
//vis t3,0
vis t4,0
vis t3,0
vis hTempSlider,0
}else
{
@@ -412,21 +650,21 @@ Button bColor
if(mode_temp.val==1)
{
//enable color temp
//vis t4,1
//vis t3,1
vis t4,1
vis t3,1
vis hTempSlider,1
}
}
Button bEffect
Attributes
ID : 17
ID : 27
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 14
y coordinate : 213
x coordinate : 396
y coordinate : 95
Width : 50
Height : 50
Effect : load
@@ -453,17 +691,18 @@ Button bEffect
Touch Press Event
pageIcons.tTmp1.txt=tEntity.txt
pageIcons.tTmp2.txt=entn.txt
pageIcons.tTmp3.txt=tIcon1.txt
page popupInSel
Dual-state Button btOnOff1
Attributes
ID : 5
ID : 8
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 14
y coordinate : 77
x coordinate : 341
y coordinate : 95
Width : 50
Height : 50
Effect : load
@@ -502,43 +741,18 @@ Dual-state Button btOnOff1
Timer tmCooldown
Attributes
ID : 15
ID : 25
Scope : local
Period (ms): 100
Period (ms): 300
Enabled : no
Events
Timer Event
tmCooldown.en=0
Timer tmDrawCooldown
Attributes
ID : 22
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
Timer tmSerial
Attributes
ID : 8
ID : 15
Scope : local
Period (ms): 50
Enabled : yes
@@ -593,12 +807,11 @@ Timer tmSerial
{
// change icon
//spstr strCommand.txt,tIcon1.txt,"~",2
//vis tIcon1,1
vis tIcon1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",3
covx tTmp.txt,sys0,0,0
col.val=sys0
//tEntity.pco=sys0
tIcon1.pco=sys0
// get Button State
spstr strCommand.txt,tTmp.txt,"~",4
covx tTmp.txt,sys0,0,0
@@ -607,26 +820,27 @@ Timer tmSerial
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt=="disable")
{
//vis t1,0
//vis t2,0
vis t1,0
vis t2,0
vis hBrightness,0
}else
{
//vis t1,1
//vis t2,1
vis t1,1
vis t2,1
vis hBrightness,1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
tmDrawCooldown.en=1
tmDrawCooldown.tim=500
if(tmCooldown.en==0)
{
hBrightness.val=sys0
}
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6
if(tTmp.txt=="disable")
{
vis hTempSlider,0
//vis t3,0
//vis t4,0
vis t3,0
vis t4,0
mode_temp.val=0
// mode == 1 is temp controls currently shown
if(mode.val==1)
@@ -649,8 +863,8 @@ Timer tmSerial
{
mode_temp.val=1
vis hTempSlider,1
//vis t3,1
//vis t4,1
vis t3,1
vis t4,1
if(tmCooldown.en==0)
{
covx tTmp.txt,sys0,0,0
@@ -669,12 +883,12 @@ Timer tmSerial
// disable -> isn't supported
if(tTmp.txt=="disable")
{
//vis t0,0
vis t0,0
vis bColor,0
vis pColorWheel,0
}else
{
//vis t0,1
vis t0,1
//only enable bColor button if color temp is also supported
if(mode_temp.val==1)
{
@@ -686,11 +900,11 @@ Timer tmSerial
}
}
// set t0 Color (Localization)
//spstr strCommand.txt,t0.txt,"~",8
spstr strCommand.txt,t0.txt,"~",8
// set t4 Temperature (Localization)
//spstr strCommand.txt,t4.txt,"~",9
spstr strCommand.txt,t4.txt,"~",9
// set t1 Brightness (Localization)
//spstr strCommand.txt,t1.txt,"~",10
spstr strCommand.txt,t1.txt,"~",10
// activate effect button
spstr strCommand.txt,tTmp.txt,"~",11
if(tTmp.txt=="enable")
@@ -825,7 +1039,7 @@ Timer tmSerial
Timer tmSleep
Attributes
ID : 7
ID : 14
Scope : local
Period (ms): 1000
Enabled : yes
@@ -845,7 +1059,7 @@ Timer tmSleep
TouchCap tc0
Attributes
ID : 6
ID : 13
Scope: local
Value: 0

View File

@@ -0,0 +1,855 @@
Page popupLightNew
Attributes
ID : 0
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
Width : 480
Effect : load
Effect Priority : 0
Effect Time : 300
Locked : no
Swide up page ID : disabled
Swide down page ID : disabled
Swide left page ID : disabled
Swide right page ID: disabled
Fill : solid color
Back. Color : 6371
Events
Preinitialize Event
dim=dimValueNormal
//get entitiy name
tEntity.txt=pageIcons.tTmp1.txt
//get entity id
entn.txt=pageIcons.tTmp2.txt
vis tSend,0
vis tTmp,0
vis tInstruction,0
vis tId,0
vis bEffect,0
vis hBrightness,0
//page open event
// event,pageOpenDetail,typeOfPage,tEntityName
// craft command
tSend.txt="event,pageOpenDetail,popupLight,"+entn.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
//disable brightness by default
//vis t1,0
//vis t2,0
vis hBrightness,1
//disable color temp by default
//vis t4,0
//vis t3,0
vis hTempSlider,0
//disable color wheel components by default
vis bColor,0
//vis t0,0
vis pColorWheel,0
//vis t0,0
popupLightNew.bco=defaultBcoColor
for(sys0=0;sys0<27;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
b[sys0].bco=defaultBcoColor
b[sys0].pco=defaultFontColor
}
if(b[sys0].type==53&&defaultBcoColor==0)
{
b[sys0].pic=10
b[sys0].pic2=11
}
}
if(defaultBcoColor==0)
{
hTempSlider.pic=16
hTempSlider.pic1=16
}
Postinitialize Event
fill hBrightness.x,hBrightness.y,100,250,defaultBcoColor
Variable (int32) col
Attributes
ID : 18
Scope: local
Value: 65504
Variable (string) entn
Attributes
ID : 11
Scope : local
Text :
Max. Text Size: 80
Variable (int32) mode
Attributes
ID : 13
Scope: local
Value: 1
Variable (int32) mode_temp
Attributes
ID : 14
Scope: local
Value: 0
Variable (string) strCommand
Attributes
ID : 9
Scope : local
Text :
Max. Text Size: 500
Variable (string) tId
Attributes
ID : 20
Scope : local
Text :
Max. Text Size: 20
Variable (string) tInstruction
Attributes
ID : 19
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
ID : 16
Scope : local
Text :
Max. Text Size: 200
Variable (string) tTmp
Attributes
ID : 21
Scope : local
Text :
Max. Text Size: 80
Text tEntity
Attributes
ID : 2
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 92
y coordinate : 21
Width : 263
Height : 30
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Associated Keyboard : none
Font ID : 2
Back. Color : 6371
Font Color : 65535
Horizontal Alignment: center
Vertical Alignment : center
Input Type : character
Text : tEntity1
Max. Text Size : 25
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Picture pColorWheel
Attributes
ID : 1
Scope : local
Dragging : 0
Send Component ID: disabled
Opacity : 127
x coordinate : 233
y coordinate : 105
Width : 160
Height : 160
Effect : load
Effect Priority : 0
Effect Time : 300
Picture ID : 3
Events
Touch Press Event
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",colorWheel,"
sys0=tch0
sys0=sys0-pColorWheel.x
covx sys0,tTmp.txt,0,0
tSend.txt+=tTmp.txt
tSend.txt+="|"
sys0=tch1
sys0=sys0-pColorWheel.y
covx sys0,tTmp.txt,0,0
tSend.txt+=tTmp.txt
tSend.txt+="|"
covx pColorWheel.h,tTmp.txt,0,0
tSend.txt+=tTmp.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
Slider hBrightness
Attributes
ID : 4
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 89
y coordinate : 64
Width : 100
Height : 250
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : vertical
Fill : image
Cursor width : auto
Cursor height : 1
Back. Picture ID : 65535
Slided Back. Picture ID: 65535
Position : 50
Upper range limit : 100
Lower range limit : 0
Events
Touch Release Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",brightnessSlider,"
covx hBrightness.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Slider hTempSlider
Attributes
ID : 10
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 263
y coordinate : 64
Width : 100
Height : 250
Effect : load
Effect Priority : 0
Effect Time : 300
Direction : vertical
Fill : image
Cursor width : auto
Cursor height : 255
Back. Picture ID : 7
Slided Back. Picture ID: 7
Position : 50
Upper range limit : 100
Lower range limit : 0
Events
Touch Release Event
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",colorTempSlider,"
covx hTempSlider.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Button b0
Attributes
ID : 3
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 397
y coordinate : 8
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed): 65535
Back. Color (Pressed) : 14823
Font Color (Unpressed) : 65535
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
tSend.txt="event,buttonPress2,popupLight,bExit"
//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
Button bColor
Attributes
ID : 12
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 14
y coordinate : 146
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed): 65535
Back. Color (Pressed) : 14823
Font Color (Unpressed) : 65535
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
if(mode.val==1)
{
mode.val=0
//enable color wheel
vis pColorWheel,1
//disable color temp
//vis t4,0
//vis t3,0
vis hTempSlider,0
}else
{
mode.val=1
//disable color wheel
vis pColorWheel,0
if(mode_temp.val==1)
{
//enable color temp
//vis t4,1
//vis t3,1
vis hTempSlider,1
}
}
Button bEffect
Attributes
ID : 17
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 14
y coordinate : 213
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : solid color
Style : flat
Font ID : 1
Back. Color : 6371
Back. Picture ID (Pressed): 65535
Back. Color (Pressed) : 14823
Font Color (Unpressed) : 65535
Font Color (Pressed) : 65535
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text : 
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
pageIcons.tTmp1.txt=tEntity.txt
pageIcons.tTmp2.txt=entn.txt
page popupInSel
Dual-state Button btOnOff1
Attributes
ID : 5
Scope : local
Dragging : 0
Send Component ID : disabled
Opacity : 127
x coordinate : 14
y coordinate : 77
Width : 50
Height : 50
Effect : load
Effect Priority : 0
Effect Time : 300
Fill : image
Font ID : 0
Background Picture ID (Unpressed): 1
Back. Picture ID (Pressed) : 2
Horizontal Alignment : center
Vertical Alignment : center
State : unpressed
Text :
Max. Text Size : 10
Word wrap : disabled
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Press Event
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
covx btOnOff1.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Timer tmCooldown
Attributes
ID : 15
Scope : local
Period (ms): 300
Enabled : no
Events
Timer Event
tmCooldown.en=0
Timer tmDrawCooldown
Attributes
ID : 22
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
Timer tmSerial
Attributes
ID : 8
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
spstr strCommand.txt,tTmp.txt,"~",1
if(tInstruction.txt=="entityUpdateDetail"&&entn.txt==tTmp.txt)
{
// change icon
//spstr strCommand.txt,tIcon1.txt,"~",2
//vis tIcon1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",3
covx tTmp.txt,sys0,0,0
col.val=sys0
//tEntity.pco=sys0
// get Button State
spstr strCommand.txt,tTmp.txt,"~",4
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
// get Brightness value
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt=="disable")
{
//vis t1,0
//vis t2,0
vis hBrightness,0
}else
{
//vis t1,1
//vis t2,1
vis hBrightness,1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
tmDrawCooldown.en=1
tmDrawCooldown.tim=500
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6
if(tTmp.txt=="disable")
{
vis hTempSlider,0
//vis t3,0
//vis t4,0
mode_temp.val=0
// mode == 1 is temp controls currently shown
if(mode.val==1)
{
// switch mode
click bColor,1
click bColor,0
}
}else if(tTmp.txt=="unknown") // temp supported, but not in color mode
{
mode_temp.val=1
// mode == 1 is temp controls currently shown
if(mode.val==1)
{
// switch mode
click bColor,1
click bColor,0
}
}else
{
mode_temp.val=1
vis hTempSlider,1
//vis t3,1
//vis t4,1
if(tmCooldown.en==0)
{
covx tTmp.txt,sys0,0,0
hTempSlider.val=sys0
}
// mode == 0 is rgb controls currently shown
if(mode.val==0)
{
// switch mode
click bColor,1
click bColor,0
}
}
// get Color value
spstr strCommand.txt,tTmp.txt,"~",7
// disable -> isn't supported
if(tTmp.txt=="disable")
{
//vis t0,0
vis bColor,0
vis pColorWheel,0
}else
{
//vis t0,1
//only enable bColor button if color temp is also supported
if(mode_temp.val==1)
{
vis bColor,1
}
if(mode.val==0)
{
vis pColorWheel,1
}
}
// set t0 Color (Localization)
//spstr strCommand.txt,t0.txt,"~",8
// set t4 Temperature (Localization)
//spstr strCommand.txt,t4.txt,"~",9
// set t1 Brightness (Localization)
//spstr strCommand.txt,t1.txt,"~",10
// activate effect button
spstr strCommand.txt,tTmp.txt,"~",11
if(tTmp.txt=="enable")
{
vis bEffect,1
}else
{
vis bEffect,0
}
}
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,dimValue,0,0
// get value normal
spstr strCommand.txt,tTmp.txt,"~",2
covx tTmp.txt,dimValueNormal,0,0
dim=dimValueNormal
// get background color
spstr strCommand.txt,tTmp.txt,"~",3
if(tTmp.txt!="")
{
covx tTmp.txt,defaultBcoColor,0,0
}
// get font color
spstr strCommand.txt,tTmp.txt,"~",4
if(tTmp.txt!="")
{
covx tTmp.txt,defaultFontColor,0,0
}
}
if(tInstruction.txt=="timeout")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,sleepTimeout,0,0
}
if(tInstruction.txt=="pageType")
{
//command format pageType,specialPageName
//write name of speical page to tId
spstr strCommand.txt,tId.txt,"~",1
//save second arg if there's one
spstr strCommand.txt,tTmp.txt,"~",2
//save third arg if there's one
spstr strCommand.txt,pageIcons.tTmp2.txt,"~",3
spstr strCommand.txt,pageIcons.tTmp3.txt,"~",4
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
udelete payloadLength-1
bufferPos=0
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="screensaver")
{
page screensaver
}
if(tId.txt=="cardEntities")
{
page cardEntities
}
if(tId.txt=="cardGrid")
{
page cardGrid
}
if(tId.txt=="cardGrid2")
{
page cardGrid2
}
if(tId.txt=="popupLight")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupLight
}
if(tId.txt=="popupShutter")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupShutter
}
if(tId.txt=="popupNotify")
{
page popupNotify
}
if(tId.txt=="cardThermo")
{
page cardThermo
}
if(tId.txt=="cardMedia")
{
page cardMedia
}
if(tId.txt=="cardAlarm")
{
page cardAlarm
}
if(tId.txt=="cardQR")
{
page cardQR
}
if(tId.txt=="cardPower")
{
page cardPower
}
if(tId.txt=="cardChart")
{
page cardChart
}
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
}
Timer tmSleep
Attributes
ID : 7
Scope : local
Period (ms): 1000
Enabled : yes
Events
Timer Event
if(sleepTimeout!=0)
{
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
sleepValue=0
click b0,1
click b0,0
}
}
TouchCap tc0
Attributes
ID : 6
Scope: local
Value: 0
Events
Touch Press Event
sleepValue=0

View File

@@ -581,7 +581,7 @@ Timer tmSerial
covx tTmp.txt,defaultFontColor,0,0
}
}
if(tInstruction.txt=="timeout")
if(tInstruction.txt=="timeout2")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1

View File

@@ -1661,6 +1661,10 @@ Timer tmSerial
{
page cardChart
}
if(tId.txt=="cardLChart")
{
page cardLChart
}
}
if(tInstruction.txt=="timeout")
{

View File

@@ -14,6 +14,8 @@ Program.s
//color vars
int defaultFontColor=65535
int defaultBcoColor=6371
//feature flags
int featNewSliders=0
// fix touch offset
lcd_dev fffb 0002 0000 0020
printh 00 00 00 ff ff ff 88 ff ff ff//Output power on information to serial port

View File

@@ -965,8 +965,13 @@ Hotspot m0
}
if(type1.txt=="light")
{
//popupLight.tEntity.txt=tEntity1.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type1.txt=="fan")
{
@@ -999,8 +1004,13 @@ Hotspot m1
}
if(type2.txt=="light")
{
//popupLight.tEntity.txt=tEntity2.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type2.txt=="fan")
{
@@ -1033,8 +1043,13 @@ Hotspot m2
}
if(type3.txt=="light")
{
//popupLight.tEntity.txt=tEntity3.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type3.txt=="fan")
{
@@ -1067,8 +1082,13 @@ Hotspot m3
}
if(type4.txt=="light")
{
//popupLight.tEntity.txt=tEntity4.txt
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(type4.txt=="fan")
{

View File

@@ -605,7 +605,13 @@ Timer tmLP
Timer Event
if(tTmp.txt=="light")
{
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(tTmp.txt=="fan")
{

View File

@@ -559,26 +559,26 @@ Button bEntity7
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type6.txt
pageIcons.tTmp1.txt=tEntity6.txt
pageIcons.tTmp2.txt=entn6.txt
pageIcons.tTmp3.txt=bEntity6.txt
if(type6.txt=="shutter")
tTmp.txt=type7.txt
pageIcons.tTmp1.txt=tEntity7.txt
pageIcons.tTmp2.txt=entn7.txt
pageIcons.tTmp3.txt=bEntity7.txt
if(type7.txt=="shutter")
{
page popupShutter
}
if(type6.txt=="input_sel")
if(type7.txt=="input_sel")
{
page popupInSel
}
if(type6.txt=="timer")
if(type7.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
tSend.txt="event,buttonPress2,"+entn7.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -603,26 +603,26 @@ Button bEntity8
Events
Touch Press Event
tmLP.en=1
tTmp.txt=type6.txt
pageIcons.tTmp1.txt=tEntity6.txt
pageIcons.tTmp2.txt=entn6.txt
pageIcons.tTmp3.txt=bEntity6.txt
if(type6.txt=="shutter")
tTmp.txt=type8.txt
pageIcons.tTmp1.txt=tEntity8.txt
pageIcons.tTmp2.txt=entn8.txt
pageIcons.tTmp3.txt=bEntity8.txt
if(type8.txt=="shutter")
{
page popupShutter
}
if(type6.txt=="input_sel")
if(type8.txt=="input_sel")
{
page popupInSel
}
if(type6.txt=="timer")
if(type8.txt=="timer")
{
page popupTimer
}
Touch Release Event
tmLP.en=0
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
tSend.txt="event,buttonPress2,"+entn8.txt+",button"
//send calc crc
btlen tSend.txt,sys0
crcrest 1,0xffff // reset CRC
@@ -739,7 +739,13 @@ Timer tmLP
Timer Event
if(tTmp.txt=="light")
{
page popupLight
if(featNewSliders==1)
{
page popupLightNew
}else
{
page popupLight
}
}
if(tTmp.txt=="fan")
{

View File

@@ -964,6 +964,10 @@ Timer tmSerial
{
page cardChart
}
if(tId.txt=="cardLChart")
{
page cardLChart
}
}
if(tInstruction.txt=="time")
{

View File

@@ -145,7 +145,7 @@ Text tVersion
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 51
Text : 52
Max. Text Size : 10
Picture p0
@@ -279,6 +279,12 @@ Timer tmSerial
{
covx tTmp.txt,defaultFontColor,0,0
}
// get feature flag popup
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt!="")
{
covx tTmp.txt,featNewSliders,0,0
}
}
if(tInstruction.txt=="timeout")
{

View File

@@ -16,12 +16,13 @@ Page popupLight
tEntity.txt=pageIcons.tTmp1.txt
//get entity id
entn.txt=pageIcons.tTmp2.txt
tIcon1.txt=pageIcons.tTmp3.txt
vis p0,0
vis tSend,0
vis tTmp,0
vis tInstruction,0
vis tId,0
vis bEffect,0
vis hBrightness,0
//page open event
// event,pageOpenDetail,typeOfPage,tEntityName
// craft command
@@ -38,16 +39,16 @@ Page popupLight
prints tSend.txt,0
prints crcval,2
//disable brightness by default
//vis t1,0
//vis t2,0
vis hBrightness,1
vis t1,0
vis t2,0
vis hBrightness,0
//disable color temp by default
//vis t4,0
//vis t3,0
vis t4,0
vis t3,0
vis hTempSlider,0
//disable color wheel components by default
vis bColor,0
//vis t0,0
vis t0,0
vis pColorWheel,0
//vis t0,0
popupLight.bco=defaultBcoColor
@@ -66,18 +67,14 @@ Page popupLight
}
if(defaultBcoColor==0)
{
hBrightness.pic=24
hBrightness.pic1=25
hBrightness.pic2=15
hTempSlider.pic=16
hTempSlider.pic1=16
hTempSlider.pic1=17
hTempSlider.pic2=15
}
Postinitialize Event
fill hBrightness.x,hBrightness.y,100,250,defaultBcoColor
Variable (int32) col
Attributes
Scope: local
Value: 65504
Variable (string) entn
Attributes
Scope : local
@@ -100,29 +97,56 @@ Variable (string) strCommand
Text :
Max. Text Size: 500
Variable (string) tId
Attributes
Scope : local
Text :
Max. Text Size: 20
Variable (string) tInstruction
Attributes
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
Scope : local
Text :
Max. Text Size: 200
Variable (string) tTmp
Text t0
Attributes
Scope : local
Text :
Max. Text Size: 80
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Color
Max. Text Size : 50
Text t1
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Brightness
Max. Text Size : 50
Text t2
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 
Max. Text Size : 10
Text t3
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 
Max. Text Size : 10
Text t4
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Temperature
Max. Text Size : 50
Text tEntity
Attributes
@@ -133,6 +157,48 @@ Text tEntity
Text : tEntity1
Max. Text Size : 25
Text tIcon1
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 
Max. Text Size : 10
Text tId
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 20
Text tInstruction
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 20
Text tTmp
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 80
Picture p0
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
Picture pColorWheel
Attributes
Scope : local
@@ -178,20 +244,6 @@ Slider hBrightness
Events
Touch Release Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
@@ -280,8 +332,8 @@ Button bColor
//enable color wheel
vis pColorWheel,1
//disable color temp
//vis t4,0
//vis t3,0
vis t4,0
vis t3,0
vis hTempSlider,0
}else
{
@@ -291,8 +343,8 @@ Button bColor
if(mode_temp.val==1)
{
//enable color temp
//vis t4,1
//vis t3,1
vis t4,1
vis t3,1
vis hTempSlider,1
}
}
@@ -310,6 +362,7 @@ Button bEffect
Touch Press Event
pageIcons.tTmp1.txt=tEntity.txt
pageIcons.tTmp2.txt=entn.txt
pageIcons.tTmp3.txt=tIcon1.txt
page popupInSel
Dual-state Button btOnOff1
@@ -342,37 +395,13 @@ Dual-state Button btOnOff1
Timer tmCooldown
Attributes
Scope : local
Period (ms): 100
Period (ms): 300
Enabled : no
Events
Timer Event
tmCooldown.en=0
Timer tmDrawCooldown
Attributes
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
Timer tmSerial
Attributes
Scope : local
@@ -429,12 +458,11 @@ Timer tmSerial
{
// change icon
//spstr strCommand.txt,tIcon1.txt,"~",2
//vis tIcon1,1
vis tIcon1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",3
covx tTmp.txt,sys0,0,0
col.val=sys0
//tEntity.pco=sys0
tIcon1.pco=sys0
// get Button State
spstr strCommand.txt,tTmp.txt,"~",4
covx tTmp.txt,sys0,0,0
@@ -443,26 +471,27 @@ Timer tmSerial
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt=="disable")
{
//vis t1,0
//vis t2,0
vis t1,0
vis t2,0
vis hBrightness,0
}else
{
//vis t1,1
//vis t2,1
vis t1,1
vis t2,1
vis hBrightness,1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
tmDrawCooldown.en=1
tmDrawCooldown.tim=500
if(tmCooldown.en==0)
{
hBrightness.val=sys0
}
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6
if(tTmp.txt=="disable")
{
vis hTempSlider,0
//vis t3,0
//vis t4,0
vis t3,0
vis t4,0
mode_temp.val=0
// mode == 1 is temp controls currently shown
if(mode.val==1)
@@ -485,8 +514,8 @@ Timer tmSerial
{
mode_temp.val=1
vis hTempSlider,1
//vis t3,1
//vis t4,1
vis t3,1
vis t4,1
if(tmCooldown.en==0)
{
covx tTmp.txt,sys0,0,0
@@ -505,12 +534,12 @@ Timer tmSerial
// disable -> isn't supported
if(tTmp.txt=="disable")
{
//vis t0,0
vis t0,0
vis bColor,0
vis pColorWheel,0
}else
{
//vis t0,1
vis t0,1
//only enable bColor button if color temp is also supported
if(mode_temp.val==1)
{
@@ -522,11 +551,11 @@ Timer tmSerial
}
}
// set t0 Color (Localization)
//spstr strCommand.txt,t0.txt,"~",8
spstr strCommand.txt,t0.txt,"~",8
// set t4 Temperature (Localization)
//spstr strCommand.txt,t4.txt,"~",9
spstr strCommand.txt,t4.txt,"~",9
// set t1 Brightness (Localization)
//spstr strCommand.txt,t1.txt,"~",10
spstr strCommand.txt,t1.txt,"~",10
// activate effect button
spstr strCommand.txt,tTmp.txt,"~",11
if(tTmp.txt=="enable")

View File

@@ -0,0 +1,689 @@
Page popupLightNew
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Locked : no
Swide up page ID : disabled
Swide down page ID : disabled
Swide left page ID : disabled
Swide right page ID: disabled
Events
Preinitialize Event
dim=dimValueNormal
//get entitiy name
tEntity.txt=pageIcons.tTmp1.txt
//get entity id
entn.txt=pageIcons.tTmp2.txt
vis tSend,0
vis tTmp,0
vis tInstruction,0
vis tId,0
vis bEffect,0
vis hBrightness,0
//page open event
// event,pageOpenDetail,typeOfPage,tEntityName
// craft command
tSend.txt="event,pageOpenDetail,popupLight,"+entn.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
//disable brightness by default
//vis t1,0
//vis t2,0
vis hBrightness,1
//disable color temp by default
//vis t4,0
//vis t3,0
vis hTempSlider,0
//disable color wheel components by default
vis bColor,0
//vis t0,0
vis pColorWheel,0
//vis t0,0
popupLightNew.bco=defaultBcoColor
for(sys0=0;sys0<27;sys0++)
{
if(b[sys0].type==98||b[sys0].type==116)
{
b[sys0].bco=defaultBcoColor
b[sys0].pco=defaultFontColor
}
if(b[sys0].type==53&&defaultBcoColor==0)
{
b[sys0].pic=10
b[sys0].pic2=11
}
}
if(defaultBcoColor==0)
{
hTempSlider.pic=16
hTempSlider.pic1=16
}
Postinitialize Event
fill hBrightness.x,hBrightness.y,100,250,defaultBcoColor
Variable (int32) col
Attributes
Scope: local
Value: 65504
Variable (string) entn
Attributes
Scope : local
Text :
Max. Text Size: 80
Variable (int32) mode
Attributes
Scope: local
Value: 1
Variable (int32) mode_temp
Attributes
Scope: local
Value: 0
Variable (string) strCommand
Attributes
Scope : local
Text :
Max. Text Size: 500
Variable (string) tId
Attributes
Scope : local
Text :
Max. Text Size: 20
Variable (string) tInstruction
Attributes
Scope : local
Text :
Max. Text Size: 20
Variable (string) tSend
Attributes
Scope : local
Text :
Max. Text Size: 200
Variable (string) tTmp
Attributes
Scope : local
Text :
Max. Text Size: 80
Text tEntity
Attributes
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : tEntity1
Max. Text Size : 25
Picture pColorWheel
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Press Event
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",colorWheel,"
sys0=tch0
sys0=sys0-pColorWheel.x
covx sys0,tTmp.txt,0,0
tSend.txt+=tTmp.txt
tSend.txt+="|"
sys0=tch1
sys0=sys0-pColorWheel.y
covx sys0,tTmp.txt,0,0
tSend.txt+=tTmp.txt
tSend.txt+="|"
covx pColorWheel.h,tTmp.txt,0,0
tSend.txt+=tTmp.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
Slider hBrightness
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
Position : 50
Upper range limit: 100
Lower range limit: 0
Events
Touch Release Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",brightnessSlider,"
covx hBrightness.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Slider hTempSlider
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
Position : 50
Upper range limit: 100
Lower range limit: 0
Events
Touch Release Event
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+",colorTempSlider,"
covx hTempSlider.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Button b0
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text : 
Max. Text Size : 10
Events
Touch Press Event
tSend.txt="event,buttonPress2,popupLight,bExit"
//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
Button bColor
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text : 
Max. Text Size : 10
Events
Touch Press Event
if(mode.val==1)
{
mode.val=0
//enable color wheel
vis pColorWheel,1
//disable color temp
//vis t4,0
//vis t3,0
vis hTempSlider,0
}else
{
mode.val=1
//disable color wheel
vis pColorWheel,0
if(mode_temp.val==1)
{
//enable color temp
//vis t4,1
//vis t3,1
vis hTempSlider,1
}
}
Button bEffect
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text : 
Max. Text Size : 10
Events
Touch Press Event
pageIcons.tTmp1.txt=tEntity.txt
pageIcons.tTmp2.txt=entn.txt
page popupInSel
Dual-state Button btOnOff1
Attributes
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text :
Max. Text Size : 10
Events
Touch Press Event
//craft command
tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
covx btOnOff1.val,tTmp.txt,0,0
tSend.txt+=tTmp.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
Timer tmCooldown
Attributes
Scope : local
Period (ms): 300
Enabled : no
Events
Timer Event
tmCooldown.en=0
Timer tmDrawCooldown
Attributes
Scope : local
Period (ms): 500
Enabled : no
Events
Timer Event
//draw black background
fill hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,8484
//draw draw colored bar at the position of the current brightness value
fill hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,col.val
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
//paint corner
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.h,7,8484,0,0,0,3,"a"
}
//paint corners
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"a"
xstr hBrightness.x,hBrightness.y+hBrightness.h-15,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
tmDrawCooldown.en=0
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
spstr strCommand.txt,tTmp.txt,"~",1
if(tInstruction.txt=="entityUpdateDetail"&&entn.txt==tTmp.txt)
{
// change icon
//spstr strCommand.txt,tIcon1.txt,"~",2
//vis tIcon1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",3
covx tTmp.txt,sys0,0,0
col.val=sys0
//tEntity.pco=sys0
// get Button State
spstr strCommand.txt,tTmp.txt,"~",4
covx tTmp.txt,sys0,0,0
btOnOff1.val=sys0
// get Brightness value
spstr strCommand.txt,tTmp.txt,"~",5
if(tTmp.txt=="disable")
{
//vis t1,0
//vis t2,0
vis hBrightness,0
}else
{
//vis t1,1
//vis t2,1
vis hBrightness,1
covx tTmp.txt,sys0,0,0
hBrightness.val=sys0
tmDrawCooldown.en=1
tmDrawCooldown.tim=500
}
// get ColorTemp value
spstr strCommand.txt,tTmp.txt,"~",6
if(tTmp.txt=="disable")
{
vis hTempSlider,0
//vis t3,0
//vis t4,0
mode_temp.val=0
// mode == 1 is temp controls currently shown
if(mode.val==1)
{
// switch mode
click bColor,1
click bColor,0
}
}else if(tTmp.txt=="unknown") // temp supported, but not in color mode
{
mode_temp.val=1
// mode == 1 is temp controls currently shown
if(mode.val==1)
{
// switch mode
click bColor,1
click bColor,0
}
}else
{
mode_temp.val=1
vis hTempSlider,1
//vis t3,1
//vis t4,1
if(tmCooldown.en==0)
{
covx tTmp.txt,sys0,0,0
hTempSlider.val=sys0
}
// mode == 0 is rgb controls currently shown
if(mode.val==0)
{
// switch mode
click bColor,1
click bColor,0
}
}
// get Color value
spstr strCommand.txt,tTmp.txt,"~",7
// disable -> isn't supported
if(tTmp.txt=="disable")
{
//vis t0,0
vis bColor,0
vis pColorWheel,0
}else
{
//vis t0,1
//only enable bColor button if color temp is also supported
if(mode_temp.val==1)
{
vis bColor,1
}
if(mode.val==0)
{
vis pColorWheel,1
}
}
// set t0 Color (Localization)
//spstr strCommand.txt,t0.txt,"~",8
// set t4 Temperature (Localization)
//spstr strCommand.txt,t4.txt,"~",9
// set t1 Brightness (Localization)
//spstr strCommand.txt,t1.txt,"~",10
// activate effect button
spstr strCommand.txt,tTmp.txt,"~",11
if(tTmp.txt=="enable")
{
vis bEffect,1
}else
{
vis bEffect,0
}
}
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,dimValue,0,0
// get value normal
spstr strCommand.txt,tTmp.txt,"~",2
covx tTmp.txt,dimValueNormal,0,0
dim=dimValueNormal
// get background color
spstr strCommand.txt,tTmp.txt,"~",3
if(tTmp.txt!="")
{
covx tTmp.txt,defaultBcoColor,0,0
}
// get font color
spstr strCommand.txt,tTmp.txt,"~",4
if(tTmp.txt!="")
{
covx tTmp.txt,defaultFontColor,0,0
}
}
if(tInstruction.txt=="timeout")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,sleepTimeout,0,0
}
if(tInstruction.txt=="pageType")
{
//command format pageType,specialPageName
//write name of speical page to tId
spstr strCommand.txt,tId.txt,"~",1
//save second arg if there's one
spstr strCommand.txt,tTmp.txt,"~",2
//save third arg if there's one
spstr strCommand.txt,pageIcons.tTmp2.txt,"~",3
spstr strCommand.txt,pageIcons.tTmp3.txt,"~",4
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
udelete payloadLength-1
bufferPos=0
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="screensaver")
{
page screensaver
}
if(tId.txt=="cardEntities")
{
page cardEntities
}
if(tId.txt=="cardGrid")
{
page cardGrid
}
if(tId.txt=="cardGrid2")
{
page cardGrid2
}
if(tId.txt=="popupLight")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupLight
}
if(tId.txt=="popupShutter")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupShutter
}
if(tId.txt=="popupNotify")
{
page popupNotify
}
if(tId.txt=="cardThermo")
{
page cardThermo
}
if(tId.txt=="cardMedia")
{
page cardMedia
}
if(tId.txt=="cardAlarm")
{
page cardAlarm
}
if(tId.txt=="cardQR")
{
page cardQR
}
if(tId.txt=="cardPower")
{
page cardPower
}
if(tId.txt=="cardChart")
{
page cardChart
}
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
}
Timer tmSleep
Attributes
Scope : local
Period (ms): 1000
Enabled : yes
Events
Timer Event
if(sleepTimeout!=0)
{
sleepValue+=1
if(sleepTimeout<=sleepValue)
{
sleepValue=0
click b0,1
click b0,0
}
}
TouchCap tc0
Attributes
Scope: local
Value: 0
Events
Touch Press Event
sleepValue=0

View File

@@ -352,7 +352,7 @@ Timer tmSerial
covx tTmp.txt,defaultFontColor,0,0
}
}
if(tInstruction.txt=="timeout")
if(tInstruction.txt=="timeout2")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1

View File

@@ -828,6 +828,10 @@ Timer tmSerial
{
page cardChart
}
if(tId.txt=="cardLChart")
{
page cardLChart
}
}
if(tInstruction.txt=="timeout")
{

Binary file not shown.

Binary file not shown.

View File

@@ -26,8 +26,8 @@ NsPanel needs to be flashed with Tasmota (or through a 3rd-party Component with
## Features
- Entities Page with support for cover, switch, input_boolean, binary_sensor, sensor, button, number, scenes, script, input_button and light, input_text (read-only), lock, fan and automation
- Grid Page with support for cover, switch, input_boolean, button, scenes, light, lock and automation
- Entities Page with support for cover, switch, input_boolean, binary_sensor, sensor, button, number, scenes, script, input_button and light, input_text (read-only), lock, fan, timer and automation
- Grid Page with support for cover, switch, input_boolean, button, scenes, light, lock, timer and automation
- Detail Pages for Lights (Brightness, Temperature and Color of the Light) and Covers (Position)
- Thermostat Page
- Media Player Card
@@ -42,11 +42,11 @@ To control the panel and update it with content from HomeAssistant, there is an
See the following picture to get an idea of the look of this firmware for NSPanel.
![screens](doc-pics/screens.png)
![screens](docs/img/screens.png)
Some (not all) screenshots from the US Portrait Version:
![screens-us-p](doc-pics/screens-us-p.png)
![screens-us-p](docs/img/screens-us-p.png)
## Documentation

View File

@@ -126,6 +126,7 @@ class LuiBackendConfig(object):
'sleepBrightness': 20,
'screenBrightness': 100,
'defaultBackgroundColor': "ha-dark",
'featureExperimentalSliders': False,
'sleepTracking': None,
'sleepTrackingZones': ["not_home", "off"],
'sleepOverride': None,

View File

@@ -85,7 +85,11 @@ class LuiController(object):
elif type(defaultBackgroundColor) is list:
dbc = rgb_dec565(defaultBackgroundColor)
self._send_mqtt_msg(f"dimmode~{sleepBrightness}~{brightness}~{dbc}")
featureExperimentalSliders=0
if self._config.get("featureExperimentalSliders"):
featureExperimentalSliders=1
self._send_mqtt_msg(f"dimmode~{sleepBrightness}~{brightness}~{dbc}~~{featureExperimentalSliders}")
def calc_current_brightness(self, sleep_brightness_config):
current_screensaver_brightness = 20
@@ -145,8 +149,8 @@ class LuiController(object):
items = self._config.get_all_entity_names()
apis.ha_api.log(f"gtest123: {items}")
prefixes = ("navigate.")
items = [x for x in items if not x.startswith(prefixes)]
prefixes = ("navigate.", "delete", "iText")
items = [x for x in items if not (x is None or x.startswith(prefixes))]
apis.ha_api.log(f"Registering callbacks for the following items: {items}")
for item in items:
if apis.ha_api.entity_exists(item):
@@ -160,21 +164,22 @@ class LuiController(object):
res_uuid = "uuid.notfound"
if entity in sum(entities_on_card.values(), []):
for uuid, names in entities_on_card.items():
apis.ha_api.log(f"test124 items: {entities_on_card.items()} names: {names}")
#apis.ha_api.log(f"test124 items: {entities_on_card.items()} names: {names}")
#apis.ha_api.log(f"State change callback matched for entity on current page: {names}")
if entity in names:
res_uuid = uuid
#apis.ha_api.log(f"Callback Entity is on current page: {entity}")
self._pages_gen.render_card(self._current_card, send_page_type=False)
# send detail page update, just in case
if self._current_card.cardType in ["cardGrid", "cardEntities", "cardMedia"]:
if self._current_card.cardType in ["cardGrid", "cardGrid2", "cardEntities", "cardMedia"]:
if entity.startswith("light"):
self._pages_gen.generate_light_detail_page(res_uuid)
if entity.startswith("cover"):
self._pages_gen.generate_shutter_detail_page(entity)
if entity.startswith("fan"):
self._pages_gen.generate_fan_detail_page(entity)
if entity.startswith("input_select"):
if entity.startswith("input_select") or entity.startswith("select"):
self._pages_gen.generate_input_select_detail_page(entity)
if entity.startswith("media_player"):
self._pages_gen.generate_input_select_detail_page(entity)
@@ -274,7 +279,7 @@ class LuiController(object):
apis.ha_api.get_entity(entity_id).call_service("close_cover_tilt")
if button_type == "tiltSlider":
pos = int(value)
apis.ha_api.get_entity(entity_id).call_service("set_cover_tilt_position", position=pos)
apis.ha_api.get_entity(entity_id).call_service("set_cover_tilt_position", tilt_position=pos)
if button_type == "button":

View File

@@ -178,7 +178,10 @@ class LuiPagesGen(object):
name = apis.ha_api.render_template(item.nameOverride)
# type of the item is the string before the "." in the entityId
entityType = entityId.split(".")[0]
if entityId is not None:
entityType = entityId.split(".")[0]
else:
entityType = "delete"
apis.ha_api.log(f"Generating item for {entityId} with type {entityType}", level="DEBUG")
@@ -195,8 +198,8 @@ class LuiPagesGen(object):
return ""
if item.condStateNot is not None and item.condStateNot == state:
return ""
if item.condTemplate is not None and apis.ha_api.render_template(item.condTemplate):
return ""
if item.condTemplate is not None and apis.ha_api.render_template(item.condTemplate):
return ""
# Internal types
if entityType == "delete":
@@ -209,7 +212,7 @@ class LuiPagesGen(object):
if status_entity:
icon_res = get_icon_ha(item.status, overwrite=icon)
icon_color = self.get_entity_color(status_entity, ha_type=item.status.split(".")[0], overwrite=colorOverride)
if item.status.startswith("sensor") and cardType == "cardGrid" and item.iconOverride is None:
if item.status.startswith("sensor") and (cardType == "cardGrid" or cardType == "cardGrid2") and item.iconOverride is None:
icon_res = status_entity.state[:4]
if icon_res[-1] == ".":
icon_res = icon_res[:-1]
@@ -233,7 +236,7 @@ class LuiPagesGen(object):
if status_entity:
icon_id = get_icon_ha(item.status, overwrite=icon)
icon_color = self.get_entity_color(status_entity, ha_type=item.status.split(".")[0], overwrite=colorOverride)
if item.status.startswith("sensor") and cardType == "cardGrid" and item.iconOverride is None:
if item.status.startswith("sensor") and (cardType == "cardGrid" or cardType == "cardGrid2") and item.iconOverride is None:
icon_id = status_entity.state[:4]
if icon_id[-1] == ".":
icon_id = icon_id[:-1]
@@ -296,7 +299,7 @@ class LuiPagesGen(object):
value = entity.state
# limit value to 4 chars on us-p
if self._config.get("model") == "us-p":
if self._config.get("model") == "us-p" and cardType == "cardEntities":
value = entity.state[:4]
if value[-1] == ".":
value = value[:-1]
@@ -306,7 +309,7 @@ class LuiPagesGen(object):
value = value + unit_of_measurement
if entityType == "binary_sensor":
value = get_translation(self._locale, f"backend.component.binary_sensor.state.{device_class}.{entity.state}")
if cardType == "cardGrid" and entityType == "sensor" and icon is None:
if (cardType == "cardGrid" or cardType == "cardGrid2") and entityType == "sensor" and icon is None:
icon_id = entity.state[:4]
if icon_id[-1] == ".":
icon_id = icon_id[:-1]
@@ -373,10 +376,10 @@ class LuiPagesGen(object):
global babel_spec
if babel_spec is not None:
dateformat = "E" if item.nameOverride is None else item.nameOverride
name = babel.dates.format_datetime(fdate, dateformat, locale=self._locale)
name = babel.dates.format_datetime(fdate.astimezone(), dateformat, locale=self._locale)
else:
dateformat = "%a" if item.nameOverride is None else item.nameOverride
name = fdate.strftime(dateformat)
name = fdate.astimezone().strftime(dateformat)
icon_id = get_icon_ha(entityId, stateOverwrite=entity.attributes.forecast[item.stype]['condition'])
value = f'{entity.attributes.forecast[item.stype].get("temperature", "")}{unit}'
color = self.get_entity_color(entity, ha_type=entityType, stateOverwrite=entity.attributes.forecast[item.stype]['condition'], overwrite=colorOverride)
@@ -387,7 +390,10 @@ class LuiPagesGen(object):
# Overwrite for value
ovalue = item.value
if ovalue is not None:
value = apis.ha_api.render_template(ovalue)
splitted_string = ovalue.rpartition('}')
template_string = f"{splitted_string[0]}{splitted_string[1]}"
templates_result = apis.ha_api.render_template(template_string)
value = f"{templates_result}{splitted_string[2]}"
if self._locale == "he_IL" and any("\u0590" <= c <= "\u05EA" for c in name):
name = name[::-1]
# use uuid instead for some types and probably expand on this in future

View File

@@ -516,6 +516,9 @@
"last_triggered": "Naposledy spustené",
"trigger": "Spustiť akcie"
},
"button": {
"press": "stlač"
},
"camera": {
"not_available": "Obrázok nie je k dispozícii"
},

View File

@@ -27,14 +27,14 @@ class NsPanelLovelaceUIManager(hass.Hass):
controller = LuiController(cfg, mqttsend.send_mqtt_msg)
desired_tasmota_driver_version = 8
desired_display_firmware_version = 51
version = "v4.1.1"
desired_display_firmware_version = 52
version = "v4.2.0"
model = cfg.get("model")
if model == "us-l":
desired_display_firmware_url = cfg._config.get("displayURL-US-L", f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-us-l-{version}.tft")
elif model == "us-p":
desired_display_firmware_url = cfg._config.get("displayURL-US-L", f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-us-p-{version}.tft")
desired_display_firmware_url = cfg._config.get("displayURL-US-P", f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-us-p-{version}.tft")
else:
desired_display_firmware_url = cfg._config.get("displayURL-EU", f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-{version}.tft")
desired_tasmota_driver_url = cfg._config.get("berryURL", "https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be")

BIN
docs/img/popupLight.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 KiB

After

Width:  |  Height:  |  Size: 346 KiB

View File

@@ -2,4 +2,4 @@
Checkout [README](https://github.com/joBr99/nspanel-lovelace-ui/blob/main/README.md) for detailed Instructions.
![screens](doc-pics/screens.png)
![screens](docs/img/screens.png)

View File

@@ -0,0 +1,73 @@
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="8.MeiSf}G,~KvGdz(Y[*">VAR_JSON</variable>
</variables>
<block type="on" id="HKT1p7BI4woOVmm17T8m" x="-613" y="-87">
<field name="OID">0_userdata.0.NSPanelOwn.Index_Panel_0</field>
<field name="CONDITION">any</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="variables_set" id="r1+[uN0%M;-wa|l`%v6G">
<field name="VAR" id="8.MeiSf}G,~KvGdz(Y[*">VAR_JSON</field>
<value name="VALUE">
<block type="text" id="ju}XvP0?t2=24ucjUz7m">
<field name="TEXT"></field>
</block>
</value>
<next>
<block type="text_append" id="Q}NVo%Ty,+r`UfRxS={%" inline="false">
<field name="VAR" id="8.MeiSf}G,~KvGdz(Y[*">VAR_JSON</field>
<value name="TEXT">
<shadow type="text" id="fX~KkbKvyq8jGR8z2i-g">
<field name="TEXT"></field>
</shadow>
<block type="text_join" id="SCPmp{Y5SLU-hG{0R#-v">
<mutation items="3"></mutation>
<value name="ADD0">
<block type="text" id="AH4evE[%N4=aL,#[Jv*2">
<field name="TEXT">{"pagetype": "page", "pageId": </field>
</block>
</value>
<value name="ADD1">
<block type="on_source" id=",hw],YkR(T-J4%ID7zT^">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="ADD2">
<block type="text" id="FHXU)xy3L$KsU0:_SnTT">
<field name="TEXT">}</field>
</block>
</value>
</block>
</value>
<next>
<block type="control" id="FqLcGX!aLp~ZPS;al0Eq">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.NSPanel.1.PageNavi</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="variables_get" id="jA(/eL:E0n!XK6LF(s+i">
<field name="VAR" id="8.MeiSf}G,~KvGdz(Y[*">VAR_JSON</field>
</block>
</value>
<next>
<block type="debug" id="VrBlp!NGe/!s#*A=[+;e">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="FdI3^B=0$R!A-U}A95_u">
<field name="TEXT">test</field>
</shadow>
<block type="variables_get" id="#Wi?__q?}F5PyH=^Wg8N">
<field name="VAR" id="8.MeiSf}G,~KvGdz(Y[*">VAR_JSON</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</xml>

View File

@@ -0,0 +1,80 @@
<xml xmlns="https://developers.google.com/blockly/xml">
<block type="on_ext" id="9wNX|e1Wa60!I31/|Aof" x="913" y="63">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="~B8g0Vza1w3gwwUhg-XE">
<field name="oid">0_userdata.0.NSPanelOwn.ShellyDuo01</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="controls_if" id="2y2I?U.?._?Rs8VVTg8s">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="wd}~gZNYgMWH;Vpyt.Z!">
<field name="OP">EQ</field>
<value name="A">
<block type="on_source" id="I5I|Z_(%zsp.Tt/^{MXJ">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="math_number" id="_}(Q_GkaH$I2Ed4Hh$cS">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="!vF}Wk3uRk!VIa@alREh">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">shelly.0.SHCB-1#3494546E9445#1.Sys.deviceMode</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="1S}JM+$=zl|.zMfSo15r">
<field name="TEXT">color</field>
</block>
</value>
</block>
</statement>
<statement name="ELSE">
<block type="control" id="g=*}TwhDS]r^Zh(2{K/.">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">shelly.0.SHCB-1#3494546E9445#1.Sys.deviceMode</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="=8fpx/Lj~EFU=mD!y3rp">
<field name="TEXT">white</field>
</block>
</value>
</block>
</statement>
</block>
</statement>
<next>
<block type="on_ext" id="lBx%I5ZiCY@{8lAQrv|t">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="/{L5e|w2A:u!Co672?8w">
<field name="oid">shelly.0.SHCB-1#3494546E9445#1.lights.brightness</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="control" id="~%_(9UX1b5y]D6wSHo6L">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">shelly.0.SHCB-1#3494546E9445#1.lights.gain</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="on_source" id="E?2yJP9CJB0]:9a!GAt6">
<field name="ATTR">state.val</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</xml>

View File

@@ -1,6 +1,6 @@
/*-----------------------------------------------------------------------
TypeScript v4.0.5.14 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom
- abgestimmt auf TFT 50 / v4.0.5 / BerryDriver 8 / Tasmota 12.5.0
TypeScript v4.2.0.2 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @TT-Tom / @Sternmiere / @Britzelpuf / @ravenS0ne
- abgestimmt auf TFT 52 / v4.2.0 / BerryDriver 8 / Tasmota 13.1.0
@joBr99 Projekt: https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker
NsPanelTs.ts (dieses TypeScript in ioBroker) Stable: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/NsPanelTs.ts
icon_mapping.ts: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/icon_mapping.ts (TypeScript muss in global liegen)
@@ -16,6 +16,9 @@ In bestimmten Situationen kommt es vor, dass sich das Panel mit FlashNextion
unter Tasmota > 12.2.0 nicht flashen lässt. Für den Fall ein Tasmota Dowengrade
durchführen und FlashNextion wiederholen.
*******************************************************************************
Ab Tasmota > 13.0.0 ist für ein Upgrade ggfs. eine Umpartitionierung erforderlich
https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Tasmota-FAQ#3-tasmota-update-probleme
*******************************************************************************
ReleaseNotes:
Bugfixes und Erweiterungen:
@@ -138,6 +141,18 @@ ReleaseNotes:
- 02.05.2023 - v4.0.5.12 Add new Function Debug mode from script activatable via panel
- 02.05.2023 - v4.0.5.13 Fix Problems with weather-instances-number !="0" #876
- 02.05.2023 - v4.0.5.14 Fix: Remove empty log statements #883
- 30.07.2023 - v4.0.5.15 Improved screensaverAdvanced icon handling: option to load from iobroker object #944
- 12.08.2023 - v4.1.4 Upgrade TFT 51 / 4.1.4
- 12.08.2023 - v4.1.4.1 Fix Label CANCEL for popupTimer
- 12.08.2023 - v4.1.4.1 Fix TypeScript Error (JS-Adapter > 7.1.X) by Gargano
- 12.08.2023 - v4.1.4.1 CardGRid with maxItems = 8
- 12.08.2023 - v4.1.4.2 Add onStop function() to Schedules
- 13.08.2023 - v4.1.4.3 Add InSel to popUpLight
- 13.08.2023 - v4.1.4.4 Add Parameter inSel_ChoiceState to InSel to show/hide Focus
- 21.08.2023 - v4.2.0 Upgrade TFT 52 / 4.2.0
- 21.08.2023 - v4.2.0 Add new alias state for iconcolor and buttontext for icon for subpages
- 22.08.2023 - v4.2.0.1 Add iconArray to Alias "Klimaanlage" (airCondition)
- 23.08.2023 - v4.2.0.2 Add CardGrid2 with maxItems = 8
***********************************************************************************************************
* Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObect" gesetzt sein! *
@@ -155,6 +170,7 @@ Mögliche Seiten-Ansichten:
(die 4 kleineren Icons können als Wetter-Vorschau + 4Tage (Symbol + Höchsttemperatur) oder zur Anzeige definierter Infos konfiguriert werden)
cardEntities Page - 4 vertikale angeordnete Steuerelemente - auch als Subpage
cardGrid Page - 6 horizontal angeordnete Steuerelemente in 2 Reihen a 3 Steuerelemente - auch als Subpage
cardGrid2 Page - 8 horizontal angeordnete Steuerelemente in 2 Reihen a 4 Steuerelemente - auch als Subpage
cardThermo Page - Thermostat mit Solltemperatur, Isttemperatur, Mode - Weitere Eigenschaften können im Alias definiert werden
cardMedia Page - Mediaplayer - Ausnahme: Alias sollte mit Alias-Manager automatisch über Alexa-Verzeichnis Player angelegt werden
cardAlarm Page - Alarmseite mit Zustand und Tastenfeld
@@ -227,7 +243,7 @@ Erforderliche Adapter:
Upgrades in Konsole:
Tasmota BerryDriver : Backlog UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; Restart 1
TFT EU STABLE Version : FlashNextion http://nspanel.pky.eu/lovelace-ui/github/nspanel-v4.0.5.tft
TFT EU STABLE Version : FlashNextion http://nspanel.pky.eu/lovelace-ui/github/nspanel-v4.2.0.tft
---------------------------------------------------------------------------------------
*/
@@ -466,7 +482,7 @@ let Subpages_1 = <PageEntities>
'heading': 'Test Subpages',
'useColor': true,
'items': [
<PageItem>{ navigate: true, id: null, targetPage: 'Abfall', onColor: White, name: 'Abfallkalender'},
<PageItem>{ navigate: true, id: 'alias.0.NSPanel_1.Abfall.event1', targetPage: 'Abfall', name: 'Abfallkalender'},
<PageItem>{ navigate: true, id: null, targetPage: 'WLAN', onColor: White, name: 'Gäste WLAN'},
]
};
@@ -498,9 +514,9 @@ let Subpages_1 = <PageEntities>
'items': [<PageItem>{ id: 'alias.0.NSPanel_1.Guest_Wifi', hidePassword: false }]
};
let Buero_Seite_2 = <PageGrid>
let Buero_Seite_2 = <PageGrid2>
{
'type': 'cardGrid',
'type': 'cardGrid2',
'heading': 'Büro 2',
'useColor': true,
'items': [
@@ -510,7 +526,7 @@ let Buero_Seite_2 = <PageGrid>
<PageItem>{ id: 'alias.0.NSPanel_1.Luftreiniger', icon: 'power', offColor: MSRed, onColor: MSGreen},
<PageItem>{ id: 'alias.0.NSPanel_1.TestBlind', icon: 'projector-screen', onColor: White, name: 'Beamer', secondRow: 'auch Text'},
<PageItem>{ id: 'alias.0.NSPanel_1.Kippfenster', useValue: true },
//PageItem>{ id: 'alias.0.NSPanel_1.Radio.Bob', icon: 'play', onColor: White, name: 'TuneIn'}
<PageItem>{ id: 'alias.0.NSPanel_1.Radio.Bob', icon: 'play', onColor: White, name: 'TuneIn'}
]
};
@@ -671,6 +687,7 @@ let Buero_Klimaanlage = <PageThermo>
minValue: 50,
maxValue: 250,
stepValue: 5,
iconArray: ['power-standby','air-conditioner','snowflake','fire','alpha-e-circle-outline','fan','water-percent','swap-vertical-bold'],
popupThermoMode1: ['Auto','0','1','2','3'],
popupThermoMode2: ['Auto','0','1','2','3','4','5'],
popupThermoMode3: ['Auto','Manual','Boost',],
@@ -681,6 +698,21 @@ let Buero_Klimaanlage = <PageThermo>
}]
};
let Pool_Waermepumpe = <PageThermo>
{
'type': 'cardThermo',
'heading': 'Pool Wärmepumpe',
'useColor': true,
'items': [<PageItem>{
id: 'alias.0.NSPanel_1.Pool_Waermepumpe',
minValue: 100,
maxValue: 300,
stepValue: 5,
iconArray: ['power-standby','alpha-a-circle-outline','snowflake','fire'],
//iconArray: ['power-standby','air-conditioner','snowflake','fire','alpha-e-circle-outline','fan','water-percent','swap-vertical-bold'],
}]
};
let Buero_Alarm = <PageAlarm>
{
'type': 'cardAlarm',
@@ -1328,8 +1360,8 @@ export const config = <Config> {
const request = require('request');
//Desired Firmware
const tft_version: string = 'v4.0.5';
const desired_display_firmware_version = 50;
const tft_version: string = 'v4.2.0';
const desired_display_firmware_version = 52;
const berry_driver_version = 8;
const tasmotaOtaUrl: string = 'http://ota.tasmota.com/tasmota32/release/';
@@ -1340,9 +1372,22 @@ let bgColorScrSaver: number = 0;
let globalTracklist: any;
let weatherAdapterInstanceNumber: number = 0;
let scheduleInitDimModeDay: any;
let scheduleInitDimModeNight: any;
onStop (function scriptStop () {
if (scheduleSendTime!=null) clearSchedule(scheduleSendTime);
if (scheduleSendDate!=null) clearSchedule(scheduleSendDate);
if (scheduleSwichScreensaver!=null) clearSchedule(scheduleSwichScreensaver);
if (scheduleStartup!=null) clearSchedule(scheduleStartup);
if (scheduleCheckUpdates!=null) clearSchedule(scheduleCheckUpdates);
if (scheduleInitDimModeDay!=null) clearSchedule(scheduleInitDimModeDay);
if (scheduleInitDimModeNight!=null) clearSchedule(scheduleInitDimModeNight);
}, 1000);
async function Init_Release() {
const FWVersion = [41,42,43,44,45,46,47,48,49,50,51,52]
const FWRelease = ['3.3.1','3.4.0','3.5.0','3.5.X','3.6.0','3.7.3','3.8.0','3.8.3','3.9.4','4.0.5','4.1.0','4.2.0']
const FWVersion = [41,42,43,44,45,46,47,48,49,50,51,52,53]
const FWRelease = ['3.3.1','3.4.0','3.5.0','3.5.X','3.6.0','3.7.3','3.8.0','3.8.3','3.9.4','4.0.5','4.1.4','4.2.0','4.3.0']
try {
if (existsObject(NSPanel_Path + 'Display_Firmware.desiredVersion') == false) {
await createStateAsync(NSPanel_Path + 'Display_Firmware.desiredVersion', desired_display_firmware_version, { type: 'number' });
@@ -2021,6 +2066,7 @@ InitWeatherForecast();
async function InitDimmode() {
try {
// Screensaver nachts auf dunkel ("brightnessNight: z.B. 2") oder aus ("brightnessNight:0")
if (!existsState(NSPanel_Path + 'NSPanel_Dimmode_brightnessDay')) {
await createStateAsync(NSPanel_Path + 'NSPanel_Dimmode_brightnessDay', <iobJS.StateCommon>{ type: 'number' });
@@ -2066,12 +2112,12 @@ async function InitDimmode() {
};
// timeDimMode Day
schedule({ hour: getState(NSPanel_Path + 'NSPanel_Dimmode_hourDay').val, minute: 0 }, () => {
scheduleInitDimModeDay = schedule({ hour: getState(NSPanel_Path + 'NSPanel_Dimmode_hourDay').val, minute: 0 }, () => {
ScreensaverDimmode(timeDimMode);
});
// timeDimMode Night
schedule({ hour: getState(NSPanel_Path + 'NSPanel_Dimmode_hourNight').val, minute: 0 }, () => {
scheduleInitDimModeNight = schedule({ hour: getState(NSPanel_Path + 'NSPanel_Dimmode_hourNight').val, minute: 0 }, () => {
ScreensaverDimmode(timeDimMode);
});
@@ -2204,7 +2250,7 @@ let pageId = 0;
let activePage = undefined;
//Uhrzeit an NSPanel senden
schedule('* * * * *', () => {
let scheduleSendTime = schedule('* * * * *', () => {
try {
SendTime();
HandleScreensaverUpdate();
@@ -2214,7 +2260,7 @@ schedule('* * * * *', () => {
});
//Wechsel zwischen Screensaver Entities und WeatherForecast
schedule('*/' + getState(NSPanel_Path + 'ScreensaverInfo.entityChangeTime').val + ' * * * * *', () => {
let scheduleSwichScreensaver = schedule('*/' + getState(NSPanel_Path + 'ScreensaverInfo.entityChangeTime').val + ' * * * * *', () => {
try {
//WeatherForecast true/false Umschaltung verzögert
if (getState(NSPanel_Path + "ScreensaverInfo.popupNotifyHeading").val == '' && getState(NSPanel_Path + "ScreensaverInfo.popupNotifyText").val == '' && getState(NSPanel_Path + "ScreensaverInfo.weatherForecast").val == true && getState(NSPanel_Path + "ScreensaverInfo.weatherForecastTimer").val == true) {
@@ -2273,17 +2319,17 @@ on({id: [].concat(config.weatherEntity + '.TEMP')
}
});
schedule('0 * * * *', () => {
let scheduleSendDate = schedule('0 * * * *', () => {
SendDate();
});
// 3:30 Uhr Startup durchführen und aktuelle TFT-Version empfangen
schedule({ hour: 3, minute: 30 }, async () => {
let scheduleStartup = schedule({ hour: 3, minute: 30 }, async () => {
await setStateAsync(config.panelSendTopic, 'pageType~pageStartup');
});
// Updates vergleichen aktuell alle 12 Stunden
schedule('{"time":{"start":"00:00","end":"23:59","mode":"hours","interval":12},"period":{"days":1}}', () => {
let scheduleCheckUpdates = schedule('{"time":{"start":"00:00","end":"23:59","mode":"hours","interval":12},"period":{"days":1}}', () => {
get_tasmota_status0();
get_panel_update_data();
check_updates();
@@ -3038,6 +3084,9 @@ function GeneratePage(page: Page): void {
case 'cardGrid':
SendToPanel(GenerateGridPage(<PageGrid>page));
break;
case 'cardGrid2':
SendToPanel(GenerateGridPage2(<PageGrid2>page));
break;
case 'cardMedia':
useMediaEvents = true;
SendToPanel(GenerateMediaPage(<PageMedia>page));
@@ -3168,6 +3217,16 @@ function GenerateGridPage(page: PageGrid): Payload[] {
}
}
function GenerateGridPage2(page: PageGrid2): Payload[] {
try {
let out_msgs: Array<Payload> = [{ payload: 'pageType~cardGrid2' }];
out_msgs.push({ payload: GeneratePageElements(page) });
return out_msgs;
} catch (err) {
console.warn('error at function GenerateGridPage2: ' + err.message);
}
}
function GeneratePageElements(page: Page): string {
try {
activePage = page;
@@ -3204,6 +3263,9 @@ function GeneratePageElements(page: Page): string {
case 'cardGrid':
maxItems = 6;
break;
case 'cardGrid2':
maxItems = 8;
break;
}
let pageData = 'entityUpd~' + page.heading + '~' + GetNavigationString(pageId);
@@ -3229,6 +3291,7 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
}
let name: string;
let buttonText: string = 'PRESS';
let type: string;
// ioBroker
@@ -3290,78 +3353,101 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
if (pageItem.navigate) {
if (pageItem.id == null && pageItem.targetPage != undefined){
let buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : 'PRESS';
if (pageItem.id == null && pageItem.targetPage != undefined) {
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : 'PRESS';
type = 'button';
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('gesture-tap-button');
iconColor = GetIconColor(pageItem, true, useColors);
if (Debug) console.log('CreateEntity statisch Icon Navi ~' + type + '~' + 'navigate.' + pageItem.targetPage + '~' + iconId + '~' + iconColor + '~' + pageItem.name + '~' + buttonText)
return '~' + type + '~' + 'navigate.' + pageItem.targetPage + '~' + iconId + '~' + iconColor + '~' + pageItem.name + '~' + buttonText;
} else if (pageItem.id != null && pageItem.targetPage != undefined){
let buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : 'PRESS';
} else if (pageItem.id != null && pageItem.targetPage != undefined) {
type = 'button';
switch (o.common.role) {
case 'socket':
case 'light':
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : o.common.role == 'socket' ? Icons.GetIcon('power-socket-de') : Icons.GetIcon('lightbulb');
iconId2 = pageItem.icon2 !== undefined ? Icons.GetIcon(pageItem.icon2) : o.common.role == 'socket' ? Icons.GetIcon('power-socket-de') : Icons.GetIcon('lightbulb');
optVal = '0';
iconId2 = pageItem.icon2 !== undefined ? Icons.GetIcon(pageItem.icon2) : iconId;
if (val === true || val === 'true') {
optVal = '1';
iconColor = GetIconColor(pageItem, true, useColors);
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : existsState(pageItem.id + '.BUTTONTEXT') ? getState(pageItem.id + '.BUTTONTEXT').val : 'PRESS';
if (existsState(pageItem.id + '.COLORDEC')) {
iconColor = getState(pageItem.id + '.COLORDEC').val;
} else {
iconColor = GetIconColor(pageItem, false, useColors);
if (pageItem.icon !== undefined) {
if (pageItem.icon2 !== undefined) {
iconId = iconId2;
}
}
}
break;
case 'blind':
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('window-open');
iconColor = GetIconColor(pageItem, existsState(pageItem.id + '.ACTUAL') ? getState(pageItem.id + '.ACTUAL').val : true, useColors);
break;
case 'door':
case 'window':
if (existsState(pageItem.id + '.ACTUAL')) {
if (getState(pageItem.id + '.ACTUAL').val) {
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : o.common.role == 'door' ? Icons.GetIcon('door-open') : Icons.GetIcon('window-open-variant');
if (val === true || val === 'true') {
iconColor = GetIconColor(pageItem, false, useColors);
} else {
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : o.common.role == 'door' ? Icons.GetIcon('door-closed') : Icons.GetIcon('window-closed-variant');
iconColor = GetIconColor(pageItem, true, useColors);
}
}
if (val === true || val === 'true') { iconId = iconId2 };
break;
case 'blind':
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('window-open');
iconColor = existsState(pageItem.id + '.COLORDEC') ? getState(pageItem.id + '.COLORDEC').val : GetIconColor(pageItem, existsState(pageItem.id + '.ACTUAL') ? getState(pageItem.id + '.ACTUAL').val : true, useColors);
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : existsState(pageItem.id + '.BUTTONTEXT') ? getState(pageItem.id + '.BUTTONTEXT').val : 'PRESS';
break;
case 'door':
case 'window':
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : o.common.role == 'door' ? Icons.GetIcon('door-open') : Icons.GetIcon('window-open-variant');
iconId2 = pageItem.icon2 !== undefined ? Icons.GetIcon(pageItem.icon2) : o.common.role == 'door' ? Icons.GetIcon('door-closed') : Icons.GetIcon('window-closed-variant');
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : existsState(pageItem.id + '.BUTTONTEXT') ? getState(pageItem.id + '.BUTTONTEXT').val : 'PRESS';
if (existsState(pageItem.id + '.COLORDEC')) {
iconColor = getState(pageItem.id + '.COLORDEC').val;
} else {
if (val === true || val === 'true') {
iconColor = GetIconColor(pageItem, false, useColors);
} else {
iconColor = GetIconColor(pageItem, true, useColors);
}
}
if (val === true || val === 'true') { iconId = iconId2 };
break;
case 'info':
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('gesture-tap-button');
iconId2 = pageItem.icon2 !== undefined ? Icons.GetIcon(pageItem.icon2) : Icons.GetIcon('gesture-tap-button');
iconColor = GetIconColor(pageItem, true, useColors);
if (val === true || val === 'true') {
iconColor = GetIconColor(pageItem, true, useColors);
iconId2 = pageItem.icon2 !== undefined ? Icons.GetIcon(pageItem.icon2) : iconId;
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : existsState(pageItem.id + '.BUTTONTEXT') ? getState(pageItem.id + '.BUTTONTEXT').val : 'PRESS';
if (existsState(pageItem.id + '.COLORDEC')) {
iconColor = getState(pageItem.id + '.COLORDEC').val;
} else {
iconColor = GetIconColor(pageItem, false, useColors);
if (pageItem.icon !== undefined) {
if (pageItem.icon2 !== undefined) {
iconId = iconId2;
}
if (val === true || val === 'true') {
iconColor = GetIconColor(pageItem, false, useColors);
} else {
iconColor = GetIconColor(pageItem, true, useColors);
}
};
}
if (val === true || val === 'true') { iconId = iconId2 };
break;
case 'warning':
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('gesture-tap-button');
iconColor = pageItem.onColor !== undefined ? GetIconColor(pageItem, true, useColors) : getState(pageItem.id + '.LEVEL').val;
name = pageItem.name !== undefined ? pageItem.name : getState(pageItem.id + '.INFO').val;
break;
default:
return '~delete~~~~~';
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : existsState(pageItem.id + '.BUTTONTEXT') ? getState(pageItem.id + '.BUTTONTEXT').val : 'PRESS';
iconColor = pageItem.onColor !== undefined ? GetIconColor(pageItem, true, useColors) : existsState(pageItem.id + '.COLORDEC') ? getState(pageItem.id + '.COLORDEC').val : 65535;
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('gesture-tap-button');
break;
// return '~delete~~~~~';
}
if (Debug) console.log('CreateEntity Dynamische Icon Navi ~' + type + '~' + 'navigate.' + pageItem.targetPage + '~' + iconId + '~' + iconColor + '~' + name + '~' + buttonText)
return '~' + type + '~' + 'navigate.' + pageItem.targetPage + '~' + iconId + '~' + iconColor + '~' + name + '~' + buttonText;
} else {
type = 'button';
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('gesture-tap-button');
iconColor = GetIconColor(pageItem, true, useColors);
let buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : 'PRESS';
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : 'PRESS';
if (Debug) console.log('CreateEntity Standard ~' + type + '~' + 'navigate.' + pageItem.id + '~' + iconId + '~' + iconColor + '~' + name + '~' + buttonText)
return '~' + type + '~' + 'navigate.' + pageItem.id + '~' + iconId + '~' + iconColor + '~' + name + '~' + buttonText;
@@ -3863,7 +3949,7 @@ function GetIconColor(pageItem: PageItem, value: (boolean | number), useColors:
);
}
if ((pageItem.useColor || useColors) && ((typeof (value) === 'boolean' && value) || value > (pageItem.minValueBrightness !== undefined ? pageItem.minValueBrightness : 0))) {
if ((pageItem.useColor || useColors) && (typeof (value) === 'boolean' && value) || ((typeof (value) === 'number') && (value > (pageItem.minValueBrightness !== undefined ? pageItem.minValueBrightness : 0)))) {
return rgb_dec565(pageItem.onColor !== undefined ? pageItem.onColor : config.defaultOnColor);
}
@@ -3971,6 +4057,9 @@ function GenerateThermoPage(page: PageThermo): Payload[] {
//Attribute hinzufügen, wenn im Alias definiert
let i_list = Array.prototype.slice.apply($('[state.id="' + id + '.*"]'));
let bt = ['~~~~', '~~~~', '~~~~', '~~~~', '~~~~', '~~~~', '~~~~', '~~~~', '~~~~'];
let tempIcon: string = '';
if ((i_list.length - 3) != 0) {
let i = 0;
@@ -4124,47 +4213,78 @@ function GenerateThermoPage(page: PageThermo): Payload[] {
if(stateKeyNumber == Mode) {
statusStr = stateName.replace('_', ' ');
}
switch(stateName) {
case 'AUTO':
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon('air-conditioner') + '~1024~1~' + 'AUTO' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[1] !== '') {
tempIcon = page.items[0].iconArray[1];
} else {
bt[iconIndex] = Icons.GetIcon('air-conditioner') + '~35921~0~' + 'AUTO' + '~';
tempIcon = 'air-conditioner';
}
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~1024~1~' + 'AUTO' + '~';
} else {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'AUTO' + '~';
}
break;
case 'COOL':
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon('snowflake') + '~11487~1~' + 'COOL' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[2] !== '') {
tempIcon = page.items[0].iconArray[2];
} else {
bt[iconIndex] = Icons.GetIcon('snowflake') + '~35921~0~' + 'COOL' + '~';
tempIcon = 'snowflake';
}
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~11487~1~' + 'COOL' + '~';
} else {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'COOL' + '~';
}
break;
case 'HEAT':
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon('fire') + '~64512~1~' + 'HEAT' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[3] !== '') {
tempIcon = page.items[0].iconArray[3];
} else {
bt[iconIndex] = Icons.GetIcon('fire') + '~35921~0~' + 'HEAT' + '~';
tempIcon = 'fire';
}
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~64512~1~' + 'HEAT' + '~';
} else {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'HEAT' + '~';
}
break;
case 'ECO':
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon('alpha-e-circle-outline') + '~2016~1~' + 'ECO' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[4] !== '') {
tempIcon = page.items[0].iconArray[4];
} else {
bt[iconIndex] = Icons.GetIcon('alpha-e-circle-outline') + '~35921~0~' + 'ECO' + '~';
tempIcon = 'alpha-e-circle-outline';
}
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~2016~1~' + 'ECO' + '~';
} else {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'ECO' + '~';
}
break;
case 'FAN_ONLY':
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon('fan') + '~11487~1~' + 'FAN_ONLY' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[5] !== '') {
tempIcon = page.items[0].iconArray[5];
} else {
bt[iconIndex] = Icons.GetIcon('fan') + '~35921~0~' + 'FAN_ONLY' + '~';
tempIcon = 'fan';
}
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~11487~1~' + 'FAN_ONLY' + '~';
} else {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'FAN_ONLY' + '~';
}
break;
case 'DRY':
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon('water-percent') + '~60897~1~' + 'DRY' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[6] !== '') {
tempIcon = page.items[0].iconArray[6];
} else {
bt[iconIndex] = Icons.GetIcon('water-percent') + '~35921~0~' + 'DRY' + '~';
tempIcon = 'water-percent';
}
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~60897~1~' + 'DRY' + '~';
} else {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'DRY' + '~';
}
break;
}
@@ -4172,32 +4292,47 @@ function GenerateThermoPage(page: PageThermo): Payload[] {
}
if (iconIndex <= 7 && existsState(id + '.ECO') && getState(id + '.ECO').val != null) {
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[4] !== '') {
tempIcon = page.items[0].iconArray[4];
} else {
tempIcon = 'alpha-e-circle-outline';
}
if (getState(id + '.ECO').val && getState(id + '.ECO').val == 1) {
bt[iconIndex] = Icons.GetIcon('alpha-e-circle-outline') + '~2016~1~' + 'ECO' + '~';
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~2016~1~' + 'ECO' + '~';
statusStr = 'ECO';
} else {
bt[iconIndex] = Icons.GetIcon('alpha-e-circle-outline') + '~35921~0~' + 'ECO' + '~';
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'ECO' + '~';
}
iconIndex++;
}
if (iconIndex <= 7 && existsState(id + '.SWING') && getState(id + '.SWING').val != null) {
if (getState(id + '.POWER').val && getState(id + '.SWING').val == 1) { //0=ON oder .SWING = true
bt[7] = Icons.GetIcon('swap-vertical-bold') + '~2016~1~' + 'SWING' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[7] !== '') {
tempIcon = page.items[0].iconArray[7];
} else {
bt[7] = Icons.GetIcon('swap-vertical-bold') + '~35921~0~' + 'SWING' + '~';
tempIcon = 'swap-vertical-bold';
}
if (getState(id + '.POWER').val && getState(id + '.SWING').val == 1) { //0=ON oder .SWING = true
bt[7] = Icons.GetIcon(tempIcon) + '~2016~1~' + 'SWING' + '~';
} else {
bt[7] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'SWING' + '~';
}
iconIndex++;
}
// Power Icon zuletzt pruefen, damit der Mode ggf. mit OFF ueberschrieben werden kann
if (existsState(id + '.POWER') && getState(id + '.POWER').val != null) {
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[0] !== '') {
tempIcon = page.items[0].iconArray[0];
} else {
tempIcon = 'power-standby';
}
if (States[Mode] == 'OFF' || !getState(id + '.POWER').val) {
bt[0] = Icons.GetIcon('power-standby') + '~35921~0~' + 'POWER' + '~';
bt[0] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'POWER' + '~';
statusStr = 'OFF';
}
else {
bt[0] = Icons.GetIcon('power-standby') + '~2016~1~' + 'POWER' + '~';
bt[0] = Icons.GetIcon(tempIcon) + '~2016~1~' + 'POWER' + '~';
}
}
}
@@ -4230,10 +4365,10 @@ function GenerateThermoPage(page: PageThermo): Payload[] {
+ minTemp + '~' // Thermostat Min-Temperatur
+ maxTemp + '~' // Thermostat Max-Temperatur
+ stepTemp + '~' // Schritte für Soll (5°C)
+ icon_res // Icons Status
+ icon_res // Icons Status
+ findLocale('thermostat', 'Currently') + '~' // Bezeichner vor Aktueller Raumtemperatur
+ findLocale('thermostat', 'State') + '~~' // Bezeichner vor State
+ temperatureUnit + '~' // iconTemperature dstTempTwoTempMode
+ findLocale('thermostat', 'State') + '~~' // Bezeichner vor State
+ temperatureUnit + '~' // iconTemperature dstTempTwoTempMode
+ destTemp2 + '~' // dstTempTwoTempMode --> Wenn Wert, dann 2 Temp
+ thermoPopup // PopUp
@@ -6154,6 +6289,11 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
iconColor = GetIconColor(pageItem, false, true);
}
let effect_supported = 'disable';
if (pageItem.modeList != undefined) {
effect_supported = 'enable';
}
out_msgs.push({
payload: 'entityUpdateDetail' + '~' // entityUpdateDetail
+ id + '~'
@@ -6165,7 +6305,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ 'disable' + '~' // colorMode
+ '' + '~' // Color-Bezeichnung
+ findLocale('lights', 'Temperature') + '~' // Temperature-Bezeichnung
+ findLocale('lights', 'Brightness') // Brightness-Bezeichnung
+ findLocale('lights', 'Brightness') + '~' //Brightness-Bezeichnung
+ effect_supported
});
}
@@ -6203,6 +6344,11 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
RegisterDetailEntityWatcher(id + '.ACTUAL', pageItem, type);
let effect_supported = 'disable';
if (pageItem.modeList != undefined) {
effect_supported = 'enable';
}
out_msgs.push({
payload: 'entityUpdateDetail' + '~' //entityUpdateDetail
+ id + '~'
@@ -6214,7 +6360,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ 'disable' + '~' //colorMod
+ '' + '~' //Color-Bezeichnung
+ findLocale('lights', 'Temperature') + '~' //Temperature-Bezeichnung
+ findLocale('lights', 'Brightness') //Brightness-Bezeichnung
+ findLocale('lights', 'Brightness') + '~' //Brightness-Bezeichnung
+ effect_supported
});
}
@@ -6270,6 +6417,11 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
//console.warn('function GenerateDetailPage role:hue -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
}
let effect_supported = 'disable';
if (pageItem.modeList != undefined) {
effect_supported = 'enable';
}
out_msgs.push({
payload: 'entityUpdateDetail' + '~' //entityUpdateDetail
+ id + '~'
@@ -6281,7 +6433,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ colorMode + '~' //colorMode (if hue-alias without hue-datapoint, then disable)
+ 'Color' + '~' //Color-Bezeichnung
+ findLocale('lights', 'Temperature') + '~' //Temperature-Bezeichnung
+ findLocale('lights', 'Brightness') //Brightness-Bezeichnung
+ findLocale('lights', 'Brightness') + '~' //Brightness-Bezeichnung
+ effect_supported
});
}
@@ -6336,6 +6489,11 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
//console.warn('function GenerateDetailPage role:rgb -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
}
let effect_supported = 'disable';
if (pageItem.modeList != undefined) {
effect_supported = 'enable';
}
out_msgs.push({
payload: 'entityUpdateDetail' + '~' //entityUpdateDetail
+ id + '~'
@@ -6347,7 +6505,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ colorMode + '~' //colorMode (if hue-alias without hue-datapoint, then disable)
+ 'Color' + '~' //Color-Bezeichnung
+ findLocale('lights', 'Temperature') + '~' //Temperature-Bezeichnung
+ findLocale('lights', 'Brightness') //Brightness-Bezeichnung
+ findLocale('lights', 'Brightness') + '~' //Brightness-Bezeichnung
+ effect_supported
});
}
@@ -6407,6 +6566,11 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
// console.warn('function GenerateDetailPage role:rgbSingle -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
}
let effect_supported = 'disable';
if (pageItem.modeList != undefined) {
effect_supported = 'enable';
}
out_msgs.push({
payload: 'entityUpdateDetail' + '~' //entityUpdateDetail
+ id + '~'
@@ -6418,7 +6582,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ colorMode + '~' //colorMode (if hue-alias without hue-datapoint, then disable)
+ 'Color' + '~' //Color-Bezeichnung
+ findLocale('lights', 'Temperature') + '~' //Temperature-Bezeichnung
+ findLocale('lights', 'Brightness') //Brightness-Bezeichnung
+ findLocale('lights', 'Brightness') + '~' //Brightness-Bezeichnung
+ effect_supported
});
}
@@ -6464,6 +6629,11 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
console.warn('function GenerateDetailPage role:ct -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
}
let effect_supported = 'disable';
if (pageItem.modeList != undefined) {
effect_supported = 'enable';
}
out_msgs.push({
payload: 'entityUpdateDetail' + '~' //entityUpdateDetail
+ id + '~'
@@ -6475,7 +6645,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ colorMode + '~' //colorMode (if hue-alias without hue-datapoint, then disable)
+ 'Color' + '~' //Color-Bezeichnung
+ findLocale('lights', 'Temperature') + '~' //Temperature-Bezeichnung
+ findLocale('lights', 'Brightness') //Brightness-Bezeichnung
+ findLocale('lights', 'Brightness') + '~' //Brightness-Bezeichnung
+ effect_supported
});
}
}
@@ -6635,7 +6806,7 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
action2 = 'cancle';
action3 = 'finish';
label1 = 'PAUSE';
label2 = 'CANCLE';
label2 = 'CANCEL';
label3 = 'FINISH';
}
@@ -6700,6 +6871,7 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
}
if (type == 'popupInSel') {
//console.log(o.common.role);
if (o.common.role == 'media') {
let actualState: any = '';
let optionalString: string = 'Kein Eintrag';
@@ -6861,9 +7033,12 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
} else if (o.common.role == 'buttonSensor') {
let actualValue: string = '';
if (existsObject(pageItem.id + '.VALUE')) {
actualValue = formatInSelText(pageItem.modeList[getState(pageItem.id + '.VALUE').val]);
RegisterDetailEntityWatcher(id + '.VALUE', pageItem, type);
if (pageItem.inSel_ChoiceState || pageItem.inSel_ChoiceState == undefined) {
if (existsObject(pageItem.id + '.VALUE')) {
actualValue = formatInSelText(pageItem.modeList[getState(pageItem.id + '.VALUE').val]);
RegisterDetailEntityWatcher(id + '.VALUE', pageItem, type);
}
}
let tempModeList = [];
@@ -6880,6 +7055,42 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ actualValue + '~'
+ valueList
});
} else if (o.common.role == 'light' ||
o.common.role == 'dimmer' ||
o.common.role == 'hue' ||
o.common.role == 'rgb' ||
o.common.role == 'rgbSingle' ||
o.common.role == 'ct') {
//console.log(pageItem.id);
if (pageItem.modeList != undefined) {
let actualValue: string = '';
if (pageItem.inSel_ChoiceState || pageItem.inSel_ChoiceState == undefined) {
if (existsObject(pageItem.id + '.VALUE')) {
actualValue = formatInSelText(pageItem.modeList[getState(pageItem.id + '.VALUE').val]);
RegisterDetailEntityWatcher(id + '.VALUE', pageItem, type);
}
}
let tempModeList = [];
for (let i = 0; i < pageItem.modeList.length; i++) {
tempModeList[i] = formatInSelText(pageItem.modeList[i]);
}
let valueList = pageItem.modeList != undefined ? tempModeList.join('?') : '';
//console.log(valueList);
out_msgs.push({
payload: 'entityUpdateDetail2' + '~' //entityUpdateDetail2
+ id + '~~' //{entity_id}
+ rgb_dec565(White) + '~' //{icon_color}~
+ 'insel' + '~'
+ actualValue + '~'
+ valueList
});
}
}
}
}
@@ -6987,7 +7198,13 @@ function HandleScreensaverUpdate(): void {
let val = getState(config.leftScreensaverEntity[i].ScreensaverEntity).val;
let iconColor = rgb_dec565(White);
let icon = Icons.GetIcon(config.leftScreensaverEntity[i].ScreensaverEntityIconOn);
let icon;
if (existsObject(config.leftScreensaverEntity[i].ScreensaverEntityIconOn)) {
let iconName = getState(config.leftScreensaverEntity[i].ScreensaverEntityIconOn).val;
icon = Icons.GetIcon(iconName);
} else {
icon = Icons.GetIcon(config.leftScreensaverEntity[i].ScreensaverEntityIconOn);
}
if (typeof(val) == 'number') {
val = (val * config.leftScreensaverEntity[i].ScreensaverEntityFactor).toFixed(config.leftScreensaverEntity[i].ScreensaverEntityDecimalPlaces) + config.leftScreensaverEntity[i].ScreensaverEntityUnitText;
@@ -7164,7 +7381,13 @@ function HandleScreensaverUpdate(): void {
let val = getState(config.bottomScreensaverEntity[i].ScreensaverEntity).val;
let iconColor = rgb_dec565(White);
let icon = Icons.GetIcon(config.bottomScreensaverEntity[i].ScreensaverEntityIconOn);
let icon;
if (existsObject(config.bottomScreensaverEntity[i].ScreensaverEntityIconOn)) {
let iconName = getState(config.bottomScreensaverEntity[i].ScreensaverEntityIconOn).val;
icon = Icons.GetIcon(iconName);
} else {
icon = Icons.GetIcon(config.bottomScreensaverEntity[i].ScreensaverEntityIconOn);
}
if (typeof(val) == 'number') {
val = (val * config.bottomScreensaverEntity[i].ScreensaverEntityFactor).toFixed(config.bottomScreensaverEntity[i].ScreensaverEntityDecimalPlaces) + config.bottomScreensaverEntity[i].ScreensaverEntityUnitText;
@@ -7215,7 +7438,7 @@ function HandleScreensaverUpdate(): void {
let val = getState(config.indicatorScreensaverEntity[i].ScreensaverEntity).val;
let iconColor = rgb_dec565(White);
let icon = null;
let icon;
if (existsObject(config.indicatorScreensaverEntity[i].ScreensaverEntityIconOn)) {
let iconName = getState(config.indicatorScreensaverEntity[i].ScreensaverEntityIconOn).val;
icon = Icons.GetIcon(iconName);
@@ -8112,6 +8335,11 @@ interface PageGrid extends Page {
items: PageItem[],
}
interface PageGrid2 extends Page {
type: 'cardGrid2',
items: PageItem[],
}
interface PageThermo extends Page {
type: 'cardThermo',
items: PageItem[],
@@ -8197,7 +8425,9 @@ type PageItem = {
popupType: (string | undefined),
popupOptions: (string[] | undefined),
useValue: (boolean | undefined),
monobutton: (boolean | undefined)
monobutton: (boolean | undefined),
inSel_ChoiceState: (boolean | undefined),
iconArray: (string[] | undefined)
}
type DimMode = {
@@ -8210,7 +8440,7 @@ type DimMode = {
type ConfigButtonFunction = {
mode: string | null,
page: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | PagePower | PageChart | PageUnlock | null),
page: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | PageGrid2 | PagePower | PageChart | PageUnlock | null),
entity: string | null,
setValue: string | number | null
}
@@ -8228,8 +8458,8 @@ type Config = {
defaultOnColor: RGB,
defaultOffColor: RGB,
defaultBackgroundColor: RGB,
pages: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | PagePower | PageChart | PageUnlock )[],
subPages: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | PagePower | PageChart | PageUnlock)[],
pages: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | PageGrid2 | PagePower | PageChart | PageUnlock )[],
subPages: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | PageGrid2 | PagePower | PageChart | PageUnlock)[],
button1: ConfigButtonFunction,
button2: ConfigButtonFunction
}

View File

@@ -1,6 +1,6 @@
/*-----------------------------------------------------------------------
TypeScript v4.0.5.14 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom
- abgestimmt auf TFT 50 / v4.0.5 / BerryDriver 8 / Tasmota 12.5.0
TypeScript v4.2.0.2 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @TT-Tom / @Sternmiere / @Britzelpuf / @ravenS0ne
- abgestimmt auf TFT 52 / v4.2.0 / BerryDriver 8 / Tasmota 13.1.0
@joBr99 Projekt: https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker
NsPanelTs.ts (dieses TypeScript in ioBroker) Stable: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/NsPanelTs.ts
icon_mapping.ts: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/icon_mapping.ts (TypeScript muss in global liegen)
@@ -16,6 +16,9 @@ In bestimmten Situationen kommt es vor, dass sich das Panel mit FlashNextion
unter Tasmota > 12.2.0 nicht flashen lässt. Für den Fall ein Tasmota Dowengrade
durchführen und FlashNextion wiederholen.
*******************************************************************************
Ab Tasmota > 13.0.0 ist für ein Upgrade ggfs. eine Umpartitionierung erforderlich
https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Tasmota-FAQ#3-tasmota-update-probleme
*******************************************************************************
ReleaseNotes:
Bugfixes und Erweiterungen:
@@ -137,7 +140,19 @@ ReleaseNotes:
- 28.04.2023 - v4.0.5.11 light 'hue' and light 'rgb' have '.TEMPERATURE' optional
- 02.05.2023 - v4.0.5.12 Add new Function Debug mode from script activatable via panel
- 02.05.2023 - v4.0.5.13 Fix Problems with weather-instances-number !="0" #876
- 02.05.2023 - v4.0.5.14 Fix: Remove empty log statements (PR #883)
- 02.05.2023 - v4.0.5.14 Fix: Remove empty log statements #883
- 30.07.2023 - v4.0.5.15 Improved screensaverAdvanced icon handling: option to load from iobroker object #944
- 12.08.2023 - v4.1.4 Upgrade TFT 51 / 4.1.4
- 12.08.2023 - v4.1.4.1 Fix Label CANCEL for popupTimer
- 12.08.2023 - v4.1.4.1 Fix TypeScript Error (JS-Adapter > 7.1.X) by Gargano
- 12.08.2023 - v4.1.4.1 CardGRid with maxItems = 8
- 12.08.2023 - v4.1.4.2 Add onStop function() to Schedules
- 13.08.2023 - v4.1.4.3 Add InSel to popUpLight
- 13.08.2023 - v4.1.4.4 Add Parameter inSel_ChoiceState to InSel to show/hide Focus
- 21.08.2023 - v4.2.0 Upgrade TFT 52 / 4.2.0
- 21.08.2023 - v4.2.0 Add new alias state for iconcolor and buttontext for icon for subpages
- 22.08.2023 - v4.2.0.1 Add iconArray to Alias "Klimaanlage" (airCondition)
- 23.08.2023 - v4.2.0.2 Add CardGrid2 with maxItems = 8
***********************************************************************************************************
* Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObect" gesetzt sein! *
@@ -155,6 +170,7 @@ Mögliche Seiten-Ansichten:
(die 4 kleineren Icons können als Wetter-Vorschau + 4Tage (Symbol + Höchsttemperatur) oder zur Anzeige definierter Infos konfiguriert werden)
cardEntities Page - 4 vertikale angeordnete Steuerelemente - auch als Subpage
cardGrid Page - 6 horizontal angeordnete Steuerelemente in 2 Reihen a 3 Steuerelemente - auch als Subpage
cardGrid2 Page - 8 horizontal angeordnete Steuerelemente in 2 Reihen a 4 Steuerelemente - auch als Subpage
cardThermo Page - Thermostat mit Solltemperatur, Isttemperatur, Mode - Weitere Eigenschaften können im Alias definiert werden
cardMedia Page - Mediaplayer - Ausnahme: Alias sollte mit Alias-Manager automatisch über Alexa-Verzeichnis Player angelegt werden
cardAlarm Page - Alarmseite mit Zustand und Tastenfeld
@@ -227,7 +243,7 @@ Erforderliche Adapter:
Upgrades in Konsole:
Tasmota BerryDriver : Backlog UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; Restart 1
TFT EU STABLE Version : FlashNextion http://nspanel.pky.eu/lovelace-ui/github/nspanel-v4.0.5.tft
TFT EU STABLE Version : FlashNextion http://nspanel.pky.eu/lovelace-ui/github/nspanel-v4.2.0.tft
---------------------------------------------------------------------------------------
*/
@@ -829,8 +845,8 @@ export const config = <Config> {
const request = require('request');
//Desired Firmware
const tft_version: string = 'v4.0.5';
const desired_display_firmware_version = 50;
const tft_version: string = 'v4.2.0';
const desired_display_firmware_version = 52;
const berry_driver_version = 8;
const tasmotaOtaUrl: string = 'http://ota.tasmota.com/tasmota32/release/';
@@ -841,9 +857,22 @@ let bgColorScrSaver: number = 0;
let globalTracklist: any;
let weatherAdapterInstanceNumber: number = 0;
let scheduleInitDimModeDay: any;
let scheduleInitDimModeNight: any;
onStop (function scriptStop () {
if (scheduleSendTime!=null) clearSchedule(scheduleSendTime);
if (scheduleSendDate!=null) clearSchedule(scheduleSendDate);
if (scheduleSwichScreensaver!=null) clearSchedule(scheduleSwichScreensaver);
if (scheduleStartup!=null) clearSchedule(scheduleStartup);
if (scheduleCheckUpdates!=null) clearSchedule(scheduleCheckUpdates);
if (scheduleInitDimModeDay!=null) clearSchedule(scheduleInitDimModeDay);
if (scheduleInitDimModeNight!=null) clearSchedule(scheduleInitDimModeNight);
}, 1000);
async function Init_Release() {
const FWVersion = [41,42,43,44,45,46,47,48,49,50,51,52]
const FWRelease = ['3.3.1','3.4.0','3.5.0','3.5.X','3.6.0','3.7.3','3.8.0','3.8.3','3.9.4','4.0.5','4.1.0','4.2.0']
const FWVersion = [41,42,43,44,45,46,47,48,49,50,51,52,53]
const FWRelease = ['3.3.1','3.4.0','3.5.0','3.5.X','3.6.0','3.7.3','3.8.0','3.8.3','3.9.4','4.0.5','4.1.4','4.2.0','4.3.0']
try {
if (existsObject(NSPanel_Path + 'Display_Firmware.desiredVersion') == false) {
await createStateAsync(NSPanel_Path + 'Display_Firmware.desiredVersion', desired_display_firmware_version, { type: 'number' });
@@ -1522,6 +1551,7 @@ InitWeatherForecast();
async function InitDimmode() {
try {
// Screensaver nachts auf dunkel ("brightnessNight: z.B. 2") oder aus ("brightnessNight:0")
if (!existsState(NSPanel_Path + 'NSPanel_Dimmode_brightnessDay')) {
await createStateAsync(NSPanel_Path + 'NSPanel_Dimmode_brightnessDay', <iobJS.StateCommon>{ type: 'number' });
@@ -1567,12 +1597,12 @@ async function InitDimmode() {
};
// timeDimMode Day
schedule({ hour: getState(NSPanel_Path + 'NSPanel_Dimmode_hourDay').val, minute: 0 }, () => {
scheduleInitDimModeDay = schedule({ hour: getState(NSPanel_Path + 'NSPanel_Dimmode_hourDay').val, minute: 0 }, () => {
ScreensaverDimmode(timeDimMode);
});
// timeDimMode Night
schedule({ hour: getState(NSPanel_Path + 'NSPanel_Dimmode_hourNight').val, minute: 0 }, () => {
scheduleInitDimModeNight = schedule({ hour: getState(NSPanel_Path + 'NSPanel_Dimmode_hourNight').val, minute: 0 }, () => {
ScreensaverDimmode(timeDimMode);
});
@@ -1705,7 +1735,7 @@ let pageId = 0;
let activePage = undefined;
//Uhrzeit an NSPanel senden
schedule('* * * * *', () => {
let scheduleSendTime = schedule('* * * * *', () => {
try {
SendTime();
HandleScreensaverUpdate();
@@ -1715,7 +1745,7 @@ schedule('* * * * *', () => {
});
//Wechsel zwischen Screensaver Entities und WeatherForecast
schedule('*/' + getState(NSPanel_Path + 'ScreensaverInfo.entityChangeTime').val + ' * * * * *', () => {
let scheduleSwichScreensaver = schedule('*/' + getState(NSPanel_Path + 'ScreensaverInfo.entityChangeTime').val + ' * * * * *', () => {
try {
//WeatherForecast true/false Umschaltung verzögert
if (getState(NSPanel_Path + "ScreensaverInfo.popupNotifyHeading").val == '' && getState(NSPanel_Path + "ScreensaverInfo.popupNotifyText").val == '' && getState(NSPanel_Path + "ScreensaverInfo.weatherForecast").val == true && getState(NSPanel_Path + "ScreensaverInfo.weatherForecastTimer").val == true) {
@@ -1774,17 +1804,17 @@ on({id: [].concat(config.weatherEntity + '.TEMP')
}
});
schedule('0 * * * *', () => {
let scheduleSendDate = schedule('0 * * * *', () => {
SendDate();
});
// 3:30 Uhr Startup durchführen und aktuelle TFT-Version empfangen
schedule({ hour: 3, minute: 30 }, async () => {
let scheduleStartup = schedule({ hour: 3, minute: 30 }, async () => {
await setStateAsync(config.panelSendTopic, 'pageType~pageStartup');
});
// Updates vergleichen aktuell alle 12 Stunden
schedule('{"time":{"start":"00:00","end":"23:59","mode":"hours","interval":12},"period":{"days":1}}', () => {
let scheduleCheckUpdates = schedule('{"time":{"start":"00:00","end":"23:59","mode":"hours","interval":12},"period":{"days":1}}', () => {
get_tasmota_status0();
get_panel_update_data();
check_updates();
@@ -2539,6 +2569,9 @@ function GeneratePage(page: Page): void {
case 'cardGrid':
SendToPanel(GenerateGridPage(<PageGrid>page));
break;
case 'cardGrid2':
SendToPanel(GenerateGridPage2(<PageGrid2>page));
break;
case 'cardMedia':
useMediaEvents = true;
SendToPanel(GenerateMediaPage(<PageMedia>page));
@@ -2669,6 +2702,16 @@ function GenerateGridPage(page: PageGrid): Payload[] {
}
}
function GenerateGridPage2(page: PageGrid2): Payload[] {
try {
let out_msgs: Array<Payload> = [{ payload: 'pageType~cardGrid2' }];
out_msgs.push({ payload: GeneratePageElements(page) });
return out_msgs;
} catch (err) {
console.warn('error at function GenerateGridPage2: ' + err.message);
}
}
function GeneratePageElements(page: Page): string {
try {
activePage = page;
@@ -2705,6 +2748,9 @@ function GeneratePageElements(page: Page): string {
case 'cardGrid':
maxItems = 6;
break;
case 'cardGrid2':
maxItems = 8;
break;
}
let pageData = 'entityUpd~' + page.heading + '~' + GetNavigationString(pageId);
@@ -2730,6 +2776,7 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
}
let name: string;
let buttonText: string = 'PRESS';
let type: string;
// ioBroker
@@ -2791,78 +2838,101 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
if (pageItem.navigate) {
if (pageItem.id == null && pageItem.targetPage != undefined){
let buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : 'PRESS';
if (pageItem.id == null && pageItem.targetPage != undefined) {
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : 'PRESS';
type = 'button';
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('gesture-tap-button');
iconColor = GetIconColor(pageItem, true, useColors);
if (Debug) console.log('CreateEntity statisch Icon Navi ~' + type + '~' + 'navigate.' + pageItem.targetPage + '~' + iconId + '~' + iconColor + '~' + pageItem.name + '~' + buttonText)
return '~' + type + '~' + 'navigate.' + pageItem.targetPage + '~' + iconId + '~' + iconColor + '~' + pageItem.name + '~' + buttonText;
} else if (pageItem.id != null && pageItem.targetPage != undefined){
let buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : 'PRESS';
} else if (pageItem.id != null && pageItem.targetPage != undefined) {
type = 'button';
switch (o.common.role) {
case 'socket':
case 'light':
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : o.common.role == 'socket' ? Icons.GetIcon('power-socket-de') : Icons.GetIcon('lightbulb');
iconId2 = pageItem.icon2 !== undefined ? Icons.GetIcon(pageItem.icon2) : o.common.role == 'socket' ? Icons.GetIcon('power-socket-de') : Icons.GetIcon('lightbulb');
optVal = '0';
iconId2 = pageItem.icon2 !== undefined ? Icons.GetIcon(pageItem.icon2) : iconId;
if (val === true || val === 'true') {
optVal = '1';
iconColor = GetIconColor(pageItem, true, useColors);
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : existsState(pageItem.id + '.BUTTONTEXT') ? getState(pageItem.id + '.BUTTONTEXT').val : 'PRESS';
if (existsState(pageItem.id + '.COLORDEC')) {
iconColor = getState(pageItem.id + '.COLORDEC').val;
} else {
iconColor = GetIconColor(pageItem, false, useColors);
if (pageItem.icon !== undefined) {
if (pageItem.icon2 !== undefined) {
iconId = iconId2;
}
}
}
break;
case 'blind':
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('window-open');
iconColor = GetIconColor(pageItem, existsState(pageItem.id + '.ACTUAL') ? getState(pageItem.id + '.ACTUAL').val : true, useColors);
break;
case 'door':
case 'window':
if (existsState(pageItem.id + '.ACTUAL')) {
if (getState(pageItem.id + '.ACTUAL').val) {
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : o.common.role == 'door' ? Icons.GetIcon('door-open') : Icons.GetIcon('window-open-variant');
if (val === true || val === 'true') {
iconColor = GetIconColor(pageItem, false, useColors);
} else {
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : o.common.role == 'door' ? Icons.GetIcon('door-closed') : Icons.GetIcon('window-closed-variant');
iconColor = GetIconColor(pageItem, true, useColors);
}
}
if (val === true || val === 'true') { iconId = iconId2 };
break;
case 'blind':
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('window-open');
iconColor = existsState(pageItem.id + '.COLORDEC') ? getState(pageItem.id + '.COLORDEC').val : GetIconColor(pageItem, existsState(pageItem.id + '.ACTUAL') ? getState(pageItem.id + '.ACTUAL').val : true, useColors);
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : existsState(pageItem.id + '.BUTTONTEXT') ? getState(pageItem.id + '.BUTTONTEXT').val : 'PRESS';
break;
case 'door':
case 'window':
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : o.common.role == 'door' ? Icons.GetIcon('door-open') : Icons.GetIcon('window-open-variant');
iconId2 = pageItem.icon2 !== undefined ? Icons.GetIcon(pageItem.icon2) : o.common.role == 'door' ? Icons.GetIcon('door-closed') : Icons.GetIcon('window-closed-variant');
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : existsState(pageItem.id + '.BUTTONTEXT') ? getState(pageItem.id + '.BUTTONTEXT').val : 'PRESS';
if (existsState(pageItem.id + '.COLORDEC')) {
iconColor = getState(pageItem.id + '.COLORDEC').val;
} else {
if (val === true || val === 'true') {
iconColor = GetIconColor(pageItem, false, useColors);
} else {
iconColor = GetIconColor(pageItem, true, useColors);
}
}
if (val === true || val === 'true') { iconId = iconId2 };
break;
case 'info':
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('gesture-tap-button');
iconId2 = pageItem.icon2 !== undefined ? Icons.GetIcon(pageItem.icon2) : Icons.GetIcon('gesture-tap-button');
iconColor = GetIconColor(pageItem, true, useColors);
if (val === true || val === 'true') {
iconColor = GetIconColor(pageItem, true, useColors);
iconId2 = pageItem.icon2 !== undefined ? Icons.GetIcon(pageItem.icon2) : iconId;
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : existsState(pageItem.id + '.BUTTONTEXT') ? getState(pageItem.id + '.BUTTONTEXT').val : 'PRESS';
if (existsState(pageItem.id + '.COLORDEC')) {
iconColor = getState(pageItem.id + '.COLORDEC').val;
} else {
iconColor = GetIconColor(pageItem, false, useColors);
if (pageItem.icon !== undefined) {
if (pageItem.icon2 !== undefined) {
iconId = iconId2;
}
if (val === true || val === 'true') {
iconColor = GetIconColor(pageItem, false, useColors);
} else {
iconColor = GetIconColor(pageItem, true, useColors);
}
};
}
if (val === true || val === 'true') { iconId = iconId2 };
break;
case 'warning':
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('gesture-tap-button');
iconColor = pageItem.onColor !== undefined ? GetIconColor(pageItem, true, useColors) : getState(pageItem.id + '.LEVEL').val;
name = pageItem.name !== undefined ? pageItem.name : getState(pageItem.id + '.INFO').val;
break;
default:
return '~delete~~~~~';
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : existsState(pageItem.id + '.BUTTONTEXT') ? getState(pageItem.id + '.BUTTONTEXT').val : 'PRESS';
iconColor = pageItem.onColor !== undefined ? GetIconColor(pageItem, true, useColors) : existsState(pageItem.id + '.COLORDEC') ? getState(pageItem.id + '.COLORDEC').val : 65535;
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('gesture-tap-button');
break;
// return '~delete~~~~~';
}
if (Debug) console.log('CreateEntity Dynamische Icon Navi ~' + type + '~' + 'navigate.' + pageItem.targetPage + '~' + iconId + '~' + iconColor + '~' + name + '~' + buttonText)
return '~' + type + '~' + 'navigate.' + pageItem.targetPage + '~' + iconId + '~' + iconColor + '~' + name + '~' + buttonText;
} else {
type = 'button';
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('gesture-tap-button');
iconColor = GetIconColor(pageItem, true, useColors);
let buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : 'PRESS';
buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : 'PRESS';
if (Debug) console.log('CreateEntity Standard ~' + type + '~' + 'navigate.' + pageItem.id + '~' + iconId + '~' + iconColor + '~' + name + '~' + buttonText)
return '~' + type + '~' + 'navigate.' + pageItem.id + '~' + iconId + '~' + iconColor + '~' + name + '~' + buttonText;
@@ -3364,7 +3434,7 @@ function GetIconColor(pageItem: PageItem, value: (boolean | number), useColors:
);
}
if ((pageItem.useColor || useColors) && ((typeof (value) === 'boolean' && value) || value > (pageItem.minValueBrightness !== undefined ? pageItem.minValueBrightness : 0))) {
if ((pageItem.useColor || useColors) && (typeof (value) === 'boolean' && value) || ((typeof (value) === 'number') && (value > (pageItem.minValueBrightness !== undefined ? pageItem.minValueBrightness : 0)))) {
return rgb_dec565(pageItem.onColor !== undefined ? pageItem.onColor : config.defaultOnColor);
}
@@ -3472,6 +3542,9 @@ function GenerateThermoPage(page: PageThermo): Payload[] {
//Attribute hinzufügen, wenn im Alias definiert
let i_list = Array.prototype.slice.apply($('[state.id="' + id + '.*"]'));
let bt = ['~~~~', '~~~~', '~~~~', '~~~~', '~~~~', '~~~~', '~~~~', '~~~~', '~~~~'];
let tempIcon: string = '';
if ((i_list.length - 3) != 0) {
let i = 0;
@@ -3625,47 +3698,78 @@ function GenerateThermoPage(page: PageThermo): Payload[] {
if(stateKeyNumber == Mode) {
statusStr = stateName.replace('_', ' ');
}
switch(stateName) {
case 'AUTO':
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon('air-conditioner') + '~1024~1~' + 'AUTO' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[1] !== '') {
tempIcon = page.items[0].iconArray[1];
} else {
bt[iconIndex] = Icons.GetIcon('air-conditioner') + '~35921~0~' + 'AUTO' + '~';
tempIcon = 'air-conditioner';
}
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~1024~1~' + 'AUTO' + '~';
} else {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'AUTO' + '~';
}
break;
case 'COOL':
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon('snowflake') + '~11487~1~' + 'COOL' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[2] !== '') {
tempIcon = page.items[0].iconArray[2];
} else {
bt[iconIndex] = Icons.GetIcon('snowflake') + '~35921~0~' + 'COOL' + '~';
tempIcon = 'snowflake';
}
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~11487~1~' + 'COOL' + '~';
} else {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'COOL' + '~';
}
break;
case 'HEAT':
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon('fire') + '~64512~1~' + 'HEAT' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[3] !== '') {
tempIcon = page.items[0].iconArray[3];
} else {
bt[iconIndex] = Icons.GetIcon('fire') + '~35921~0~' + 'HEAT' + '~';
tempIcon = 'fire';
}
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~64512~1~' + 'HEAT' + '~';
} else {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'HEAT' + '~';
}
break;
case 'ECO':
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon('alpha-e-circle-outline') + '~2016~1~' + 'ECO' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[4] !== '') {
tempIcon = page.items[0].iconArray[4];
} else {
bt[iconIndex] = Icons.GetIcon('alpha-e-circle-outline') + '~35921~0~' + 'ECO' + '~';
tempIcon = 'alpha-e-circle-outline';
}
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~2016~1~' + 'ECO' + '~';
} else {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'ECO' + '~';
}
break;
case 'FAN_ONLY':
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon('fan') + '~11487~1~' + 'FAN_ONLY' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[5] !== '') {
tempIcon = page.items[0].iconArray[5];
} else {
bt[iconIndex] = Icons.GetIcon('fan') + '~35921~0~' + 'FAN_ONLY' + '~';
tempIcon = 'fan';
}
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~11487~1~' + 'FAN_ONLY' + '~';
} else {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'FAN_ONLY' + '~';
}
break;
case 'DRY':
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon('water-percent') + '~60897~1~' + 'DRY' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[6] !== '') {
tempIcon = page.items[0].iconArray[6];
} else {
bt[iconIndex] = Icons.GetIcon('water-percent') + '~35921~0~' + 'DRY' + '~';
tempIcon = 'water-percent';
}
if(stateKeyNumber == Mode) {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~60897~1~' + 'DRY' + '~';
} else {
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'DRY' + '~';
}
break;
}
@@ -3673,32 +3777,47 @@ function GenerateThermoPage(page: PageThermo): Payload[] {
}
if (iconIndex <= 7 && existsState(id + '.ECO') && getState(id + '.ECO').val != null) {
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[4] !== '') {
tempIcon = page.items[0].iconArray[4];
} else {
tempIcon = 'alpha-e-circle-outline';
}
if (getState(id + '.ECO').val && getState(id + '.ECO').val == 1) {
bt[iconIndex] = Icons.GetIcon('alpha-e-circle-outline') + '~2016~1~' + 'ECO' + '~';
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~2016~1~' + 'ECO' + '~';
statusStr = 'ECO';
} else {
bt[iconIndex] = Icons.GetIcon('alpha-e-circle-outline') + '~35921~0~' + 'ECO' + '~';
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'ECO' + '~';
}
iconIndex++;
}
if (iconIndex <= 7 && existsState(id + '.SWING') && getState(id + '.SWING').val != null) {
if (getState(id + '.POWER').val && getState(id + '.SWING').val == 1) { //0=ON oder .SWING = true
bt[7] = Icons.GetIcon('swap-vertical-bold') + '~2016~1~' + 'SWING' + '~';
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[7] !== '') {
tempIcon = page.items[0].iconArray[7];
} else {
bt[7] = Icons.GetIcon('swap-vertical-bold') + '~35921~0~' + 'SWING' + '~';
tempIcon = 'swap-vertical-bold';
}
if (getState(id + '.POWER').val && getState(id + '.SWING').val == 1) { //0=ON oder .SWING = true
bt[7] = Icons.GetIcon(tempIcon) + '~2016~1~' + 'SWING' + '~';
} else {
bt[7] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'SWING' + '~';
}
iconIndex++;
}
// Power Icon zuletzt pruefen, damit der Mode ggf. mit OFF ueberschrieben werden kann
if (existsState(id + '.POWER') && getState(id + '.POWER').val != null) {
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[0] !== '') {
tempIcon = page.items[0].iconArray[0];
} else {
tempIcon = 'power-standby';
}
if (States[Mode] == 'OFF' || !getState(id + '.POWER').val) {
bt[0] = Icons.GetIcon('power-standby') + '~35921~0~' + 'POWER' + '~';
bt[0] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'POWER' + '~';
statusStr = 'OFF';
}
else {
bt[0] = Icons.GetIcon('power-standby') + '~2016~1~' + 'POWER' + '~';
bt[0] = Icons.GetIcon(tempIcon) + '~2016~1~' + 'POWER' + '~';
}
}
}
@@ -3731,10 +3850,10 @@ function GenerateThermoPage(page: PageThermo): Payload[] {
+ minTemp + '~' // Thermostat Min-Temperatur
+ maxTemp + '~' // Thermostat Max-Temperatur
+ stepTemp + '~' // Schritte für Soll (5°C)
+ icon_res // Icons Status
+ icon_res // Icons Status
+ findLocale('thermostat', 'Currently') + '~' // Bezeichner vor Aktueller Raumtemperatur
+ findLocale('thermostat', 'State') + '~~' // Bezeichner vor State
+ temperatureUnit + '~' // iconTemperature dstTempTwoTempMode
+ findLocale('thermostat', 'State') + '~~' // Bezeichner vor State
+ temperatureUnit + '~' // iconTemperature dstTempTwoTempMode
+ destTemp2 + '~' // dstTempTwoTempMode --> Wenn Wert, dann 2 Temp
+ thermoPopup // PopUp
@@ -5655,6 +5774,11 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
iconColor = GetIconColor(pageItem, false, true);
}
let effect_supported = 'disable';
if (pageItem.modeList != undefined) {
effect_supported = 'enable';
}
out_msgs.push({
payload: 'entityUpdateDetail' + '~' // entityUpdateDetail
+ id + '~'
@@ -5666,7 +5790,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ 'disable' + '~' // colorMode
+ '' + '~' // Color-Bezeichnung
+ findLocale('lights', 'Temperature') + '~' // Temperature-Bezeichnung
+ findLocale('lights', 'Brightness') // Brightness-Bezeichnung
+ findLocale('lights', 'Brightness') + '~' //Brightness-Bezeichnung
+ effect_supported
});
}
@@ -5704,6 +5829,11 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
RegisterDetailEntityWatcher(id + '.ACTUAL', pageItem, type);
let effect_supported = 'disable';
if (pageItem.modeList != undefined) {
effect_supported = 'enable';
}
out_msgs.push({
payload: 'entityUpdateDetail' + '~' //entityUpdateDetail
+ id + '~'
@@ -5715,7 +5845,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ 'disable' + '~' //colorMod
+ '' + '~' //Color-Bezeichnung
+ findLocale('lights', 'Temperature') + '~' //Temperature-Bezeichnung
+ findLocale('lights', 'Brightness') //Brightness-Bezeichnung
+ findLocale('lights', 'Brightness') + '~' //Brightness-Bezeichnung
+ effect_supported
});
}
@@ -5771,6 +5902,11 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
//console.warn('function GenerateDetailPage role:hue -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
}
let effect_supported = 'disable';
if (pageItem.modeList != undefined) {
effect_supported = 'enable';
}
out_msgs.push({
payload: 'entityUpdateDetail' + '~' //entityUpdateDetail
+ id + '~'
@@ -5782,7 +5918,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ colorMode + '~' //colorMode (if hue-alias without hue-datapoint, then disable)
+ 'Color' + '~' //Color-Bezeichnung
+ findLocale('lights', 'Temperature') + '~' //Temperature-Bezeichnung
+ findLocale('lights', 'Brightness') //Brightness-Bezeichnung
+ findLocale('lights', 'Brightness') + '~' //Brightness-Bezeichnung
+ effect_supported
});
}
@@ -5837,6 +5974,11 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
//console.warn('function GenerateDetailPage role:rgb -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
}
let effect_supported = 'disable';
if (pageItem.modeList != undefined) {
effect_supported = 'enable';
}
out_msgs.push({
payload: 'entityUpdateDetail' + '~' //entityUpdateDetail
+ id + '~'
@@ -5848,7 +5990,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ colorMode + '~' //colorMode (if hue-alias without hue-datapoint, then disable)
+ 'Color' + '~' //Color-Bezeichnung
+ findLocale('lights', 'Temperature') + '~' //Temperature-Bezeichnung
+ findLocale('lights', 'Brightness') //Brightness-Bezeichnung
+ findLocale('lights', 'Brightness') + '~' //Brightness-Bezeichnung
+ effect_supported
});
}
@@ -5908,6 +6051,11 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
// console.warn('function GenerateDetailPage role:rgbSingle -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
}
let effect_supported = 'disable';
if (pageItem.modeList != undefined) {
effect_supported = 'enable';
}
out_msgs.push({
payload: 'entityUpdateDetail' + '~' //entityUpdateDetail
+ id + '~'
@@ -5919,7 +6067,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ colorMode + '~' //colorMode (if hue-alias without hue-datapoint, then disable)
+ 'Color' + '~' //Color-Bezeichnung
+ findLocale('lights', 'Temperature') + '~' //Temperature-Bezeichnung
+ findLocale('lights', 'Brightness') //Brightness-Bezeichnung
+ findLocale('lights', 'Brightness') + '~' //Brightness-Bezeichnung
+ effect_supported
});
}
@@ -5965,6 +6114,11 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
console.warn('function GenerateDetailPage role:ct -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
}
let effect_supported = 'disable';
if (pageItem.modeList != undefined) {
effect_supported = 'enable';
}
out_msgs.push({
payload: 'entityUpdateDetail' + '~' //entityUpdateDetail
+ id + '~'
@@ -5976,7 +6130,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ colorMode + '~' //colorMode (if hue-alias without hue-datapoint, then disable)
+ 'Color' + '~' //Color-Bezeichnung
+ findLocale('lights', 'Temperature') + '~' //Temperature-Bezeichnung
+ findLocale('lights', 'Brightness') //Brightness-Bezeichnung
+ findLocale('lights', 'Brightness') + '~' //Brightness-Bezeichnung
+ effect_supported
});
}
}
@@ -6136,7 +6291,7 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
action2 = 'cancle';
action3 = 'finish';
label1 = 'PAUSE';
label2 = 'CANCLE';
label2 = 'CANCEL';
label3 = 'FINISH';
}
@@ -6201,6 +6356,7 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
}
if (type == 'popupInSel') {
//console.log(o.common.role);
if (o.common.role == 'media') {
let actualState: any = '';
let optionalString: string = 'Kein Eintrag';
@@ -6362,9 +6518,12 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
} else if (o.common.role == 'buttonSensor') {
let actualValue: string = '';
if (existsObject(pageItem.id + '.VALUE')) {
actualValue = formatInSelText(pageItem.modeList[getState(pageItem.id + '.VALUE').val]);
RegisterDetailEntityWatcher(id + '.VALUE', pageItem, type);
if (pageItem.inSel_ChoiceState || pageItem.inSel_ChoiceState == undefined) {
if (existsObject(pageItem.id + '.VALUE')) {
actualValue = formatInSelText(pageItem.modeList[getState(pageItem.id + '.VALUE').val]);
RegisterDetailEntityWatcher(id + '.VALUE', pageItem, type);
}
}
let tempModeList = [];
@@ -6381,6 +6540,42 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
+ actualValue + '~'
+ valueList
});
} else if (o.common.role == 'light' ||
o.common.role == 'dimmer' ||
o.common.role == 'hue' ||
o.common.role == 'rgb' ||
o.common.role == 'rgbSingle' ||
o.common.role == 'ct') {
//console.log(pageItem.id);
if (pageItem.modeList != undefined) {
let actualValue: string = '';
if (pageItem.inSel_ChoiceState || pageItem.inSel_ChoiceState == undefined) {
if (existsObject(pageItem.id + '.VALUE')) {
actualValue = formatInSelText(pageItem.modeList[getState(pageItem.id + '.VALUE').val]);
RegisterDetailEntityWatcher(id + '.VALUE', pageItem, type);
}
}
let tempModeList = [];
for (let i = 0; i < pageItem.modeList.length; i++) {
tempModeList[i] = formatInSelText(pageItem.modeList[i]);
}
let valueList = pageItem.modeList != undefined ? tempModeList.join('?') : '';
//console.log(valueList);
out_msgs.push({
payload: 'entityUpdateDetail2' + '~' //entityUpdateDetail2
+ id + '~~' //{entity_id}
+ rgb_dec565(White) + '~' //{icon_color}~
+ 'insel' + '~'
+ actualValue + '~'
+ valueList
});
}
}
}
}
@@ -6488,7 +6683,13 @@ function HandleScreensaverUpdate(): void {
let val = getState(config.leftScreensaverEntity[i].ScreensaverEntity).val;
let iconColor = rgb_dec565(White);
let icon = Icons.GetIcon(config.leftScreensaverEntity[i].ScreensaverEntityIconOn);
let icon;
if (existsObject(config.leftScreensaverEntity[i].ScreensaverEntityIconOn)) {
let iconName = getState(config.leftScreensaverEntity[i].ScreensaverEntityIconOn).val;
icon = Icons.GetIcon(iconName);
} else {
icon = Icons.GetIcon(config.leftScreensaverEntity[i].ScreensaverEntityIconOn);
}
if (typeof(val) == 'number') {
val = (val * config.leftScreensaverEntity[i].ScreensaverEntityFactor).toFixed(config.leftScreensaverEntity[i].ScreensaverEntityDecimalPlaces) + config.leftScreensaverEntity[i].ScreensaverEntityUnitText;
@@ -6665,7 +6866,13 @@ function HandleScreensaverUpdate(): void {
let val = getState(config.bottomScreensaverEntity[i].ScreensaverEntity).val;
let iconColor = rgb_dec565(White);
let icon = Icons.GetIcon(config.bottomScreensaverEntity[i].ScreensaverEntityIconOn);
let icon;
if (existsObject(config.bottomScreensaverEntity[i].ScreensaverEntityIconOn)) {
let iconName = getState(config.bottomScreensaverEntity[i].ScreensaverEntityIconOn).val;
icon = Icons.GetIcon(iconName);
} else {
icon = Icons.GetIcon(config.bottomScreensaverEntity[i].ScreensaverEntityIconOn);
}
if (typeof(val) == 'number') {
val = (val * config.bottomScreensaverEntity[i].ScreensaverEntityFactor).toFixed(config.bottomScreensaverEntity[i].ScreensaverEntityDecimalPlaces) + config.bottomScreensaverEntity[i].ScreensaverEntityUnitText;
@@ -6716,7 +6923,7 @@ function HandleScreensaverUpdate(): void {
let val = getState(config.indicatorScreensaverEntity[i].ScreensaverEntity).val;
let iconColor = rgb_dec565(White);
let icon = null;
let icon;
if (existsObject(config.indicatorScreensaverEntity[i].ScreensaverEntityIconOn)) {
let iconName = getState(config.indicatorScreensaverEntity[i].ScreensaverEntityIconOn).val;
icon = Icons.GetIcon(iconName);
@@ -7613,6 +7820,11 @@ interface PageGrid extends Page {
items: PageItem[],
}
interface PageGrid2 extends Page {
type: 'cardGrid2',
items: PageItem[],
}
interface PageThermo extends Page {
type: 'cardThermo',
items: PageItem[],
@@ -7698,7 +7910,9 @@ type PageItem = {
popupType: (string | undefined),
popupOptions: (string[] | undefined),
useValue: (boolean | undefined),
monobutton: (boolean | undefined)
monobutton: (boolean | undefined),
inSel_ChoiceState: (boolean | undefined),
iconArray: (string[] | undefined)
}
type DimMode = {
@@ -7711,7 +7925,7 @@ type DimMode = {
type ConfigButtonFunction = {
mode: string | null,
page: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | PagePower | PageChart | PageUnlock | null),
page: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | PageGrid2 | PagePower | PageChart | PageUnlock | null),
entity: string | null,
setValue: string | number | null
}
@@ -7729,8 +7943,8 @@ type Config = {
defaultOnColor: RGB,
defaultOffColor: RGB,
defaultBackgroundColor: RGB,
pages: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | PagePower | PageChart | PageUnlock )[],
subPages: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | PagePower | PageChart | PageUnlock)[],
pages: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | PageGrid2 | PagePower | PageChart | PageUnlock )[],
subPages: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | PageGrid2 | PagePower | PageChart | PageUnlock)[],
button1: ConfigButtonFunction,
button2: ConfigButtonFunction
}