Page screensaver
    Attributes
        ID                                  : 0
        Scope                               : local
        Dragging                            : 0
        Disable release event after 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                         : 0
    
    Events
        Preinitialize Event
            recmod=1
            bauds=115200
            vis tInstruction,0
            vis tTmp,0
            vis p0,0
            vis tNotifyHead,0
            vis tNotifyText,0
            //load gloabl time string from pageIcons
            //tTime.txt=vaTime.txt
            spstr pageIcons.vaTime.txt,tTime.txt,"?",0
            spstr pageIcons.vaTime.txt,tAMPM.txt,"?",1
            if(tAMPM.txt=="")
            {
                vis tAMPM,0
            }
            tDate.txt=pageIcons.vaDate.txt
            dim=dimValue
            vis tSend,0
            //page open event
            // clear weather elements, to keep example content in HMI
        
Variable (string) strCommand
    Attributes
        ID            : 4
        Scope         : local
        Text          : 
        Max. Text Size: 200
    
Variable (string) tId
    Attributes
        ID            : 17
        Scope         : local
        Text          : 
        Max. Text Size: 25
    
Variable (int32) vaTap
    Attributes
        ID   : 25
        Scope: local
        Value: 0
    
Variable (string) tInstruction
    Attributes
        ID            : 31
        Scope         : local
        Text          : 
        Max. Text Size: 50
    
Variable (string) tTmp
    Attributes
        ID            : 32
        Scope         : local
        Text          : 
        Max. Text Size: 50
    
Text tTime
    Attributes
        ID                                  : 5
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 0
        y coordinate                        : 0
        Width                               : 320
        Height                              : 150
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 5
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 21:32   
        Max. Text Size                      : 15
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tDate
    Attributes
        ID                                  : 6
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 0
        y coordinate                        : 180
        Width                               : 320
        Height                              : 36
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 1
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : Tuesday, 08. March 2022
        Max. Text Size                      : 35
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tSend
    Attributes
        ID                                  : 7
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 19
        y coordinate                        : 450
        Width                               : 27
        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                      : 50
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tMainIcon
    Attributes
        ID                                  : 8
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 125
        y coordinate                        : 241
        Width                               : 70
        Height                              : 65
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 4
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tMainText
    Attributes
        ID                                  : 9
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 111
        y coordinate                        : 305
        Width                               : 110
        Height                              : 42
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 3
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tForecast1
    Attributes
        ID                                  : 10
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 5
        y coordinate                        : 368
        Width                               : 71
        Height                              : 25
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 0
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tForecast1Val
    Attributes
        ID                                  : 11
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 2
        y coordinate                        : 434
        Width                               : 70
        Height                              : 24
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 0
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tF1Icon
    Attributes
        ID                                  : 12
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 23
        y coordinate                        : 397
        Width                               : 40
        Height                              : 34
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 1
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tForecast2
    Attributes
        ID                                  : 13
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 86
        y coordinate                        : 369
        Width                               : 71
        Height                              : 24
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 0
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tF2Icon
    Attributes
        ID                                  : 14
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 103
        y coordinate                        : 397
        Width                               : 40
        Height                              : 34
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 1
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tForecast2Val
    Attributes
        ID                                  : 15
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 83
        y coordinate                        : 434
        Width                               : 71
        Height                              : 24
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 0
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text t10
    Attributes
        ID                                  : 16
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 49
        y coordinate                        : 225
        Width                               : 225
        Height                              : 2
        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                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tAMPM
    Attributes
        ID                                  : 18
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 105
        y coordinate                        : 122
        Width                               : 103
        Height                              : 57
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 4
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : PM
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tForecast3Val
    Attributes
        ID                                  : 19
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 165
        y coordinate                        : 435
        Width                               : 70
        Height                              : 23
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 0
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tF3Icon
    Attributes
        ID                                  : 20
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 183
        y coordinate                        : 398
        Width                               : 40
        Height                              : 33
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 1
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tForecast3
    Attributes
        ID                                  : 21
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 167
        y coordinate                        : 370
        Width                               : 70
        Height                              : 23
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 0
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tForecast4
    Attributes
        ID                                  : 22
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 247
        y coordinate                        : 370
        Width                               : 70
        Height                              : 23
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 0
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tF4Icon
    Attributes
        ID                                  : 23
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 263
        y coordinate                        : 398
        Width                               : 40
        Height                              : 33
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 1
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 5
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tForecast4Val
    Attributes
        ID                                  : 24
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 246
        y coordinate                        : 435
        Width                               : 70
        Height                              : 23
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 0
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tMainTextAlt
    Attributes
        ID                                  : 27
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 203
        y coordinate                        : 249
        Width                               : 105
        Height                              : 41
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 3
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : left
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tMainIconAlt
    Attributes
        ID                                  : 28
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 100
        y coordinate                        : 260
        Width                               : 100
        Height                              : 65
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 4
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tMRIcon
    Attributes
        ID                                  : 29
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 201
        y coordinate                        : 304
        Width                               : 40
        Height                              : 34
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 1
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tMR
    Attributes
        ID                                  : 30
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 243
        y coordinate                        : 309
        Width                               : 61
        Height                              : 20
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 0
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : left
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 10
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tNotifyHead
    Attributes
        ID                                  : 33
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 0
        y coordinate                        : 240
        Width                               : 320
        Height                              : 58
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 3
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 35
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Text tNotifyText
    Attributes
        ID                                  : 34
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 0
        y coordinate                        : 298
        Width                               : 320
        Height                              : 58
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Fill                                : solid color
        Style                               : flat
        Associated Keyboard                 : none
        Font ID                             : 3
        Back. Color                         : 0
        Font Color                          : 65535
        Horizontal Alignment                : center
        Vertical Alignment                  : center
        Input Type                          : character
        Text                                : 
        Max. Text Size                      : 35
        Word wrap                           : disabled
        Horizontal Spacing                  : 0
        Vertical Spacing                    : 0
    
Picture p0
    Attributes
        ID                                  : 1
        Scope                               : local
        Dragging                            : 0
        Disable release event after dragging: 0
        Send Component ID                   : disabled
        Opacity                             : 127
        x coordinate                        : 0
        y coordinate                        : 1
        Width                               : 319
        Height                              : 479
        Effect                              : load
        Effect Priority                     : 0
        Effect Time                         : 300
        Picture ID                          : 0
    
Timer tmSerial
    Attributes
        ID         : 3
        Scope      : local
        Period (ms): 50
        Enabled    : yes
    
    Events
        Timer Event
            // data available
            if(usize>1)
            {
                bufferPos=0
                while(bufferPos<usize)
                {
                    // check for 0x55 0xBB - Command Init Secuence
                    if(u[bufferPos]==187&&u[bufferPos-1]==85)
                    {
                        //remove garbage at the start of the buffer if there's any to free buffer for command
                        if(u[bufferPos]!=1)
                        {
                            udelete bufferPos-1
                        }
                        //instruction is now aligned with buffer, because we deleted garbage before instrcution
                        //get length after init sequence (check if there are more than to bytes in buffer)
                        if(3<usize)
                        {
                            // check if serial buffer has reached the announced length
                            ucopy payloadLength,2,2,0
                            // we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
                            payloadLength+=3
                            // payload length does also not contain crc, so we are adding another 2 bytes for crc
                            payloadLength+=2
                            if(payloadLength<usize)
                            {
                                // calculate crc
                                crcrest 1,0xFFFF
                                // u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
                                //crcputu 3,u[2]
                                // u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
                                crcputu 0,payloadLength-1
                                // get recived crc to be able to compare it
                                ucopy recvCrc,payloadLength-1,2,0
                                // compare crc with recived value
                                if(crcval==recvCrc)
                                {
                                    // crc is okay
                                    // here is the location where acual code should be
                                    // write command to variable strCommand
                                    ucopy strCommand.txt,4,payloadLength-5,0
                                    // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
                                    spstr strCommand.txt,tInstruction.txt,"~",0
                                    if(tInstruction.txt=="wake")
                                    {
                                        //dim=100
                                        click tc0,1
                                    }
                                    if(tInstruction.txt=="dimmode")
                                    {
                                        // get value
                                        spstr strCommand.txt,tTmp.txt,"~",1
                                        covx tTmp.txt,dimValue,0,0
                                        dim=dimValue
                                    }
                                    if(tInstruction.txt=="time")
                                    {
                                        //get set time to global variable
                                        spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
                                        spstr pageIcons.vaTime.txt,tTime.txt,"?",0
                                        spstr pageIcons.vaTime.txt,tAMPM.txt,"?",1
                                        if(tAMPM.txt=="")
                                        {
                                            vis tAMPM,0
                                        }
                                    }
                                    if(tInstruction.txt=="date")
                                    {
                                        //get set date to global variable
                                        spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
                                        tDate.txt=pageIcons.vaDate.txt
                                    }
                                    if(tInstruction.txt=="timeout")
                                    {
                                        //set timeout to global var
                                        spstr strCommand.txt,tTmp.txt,"~",1
                                        covx tTmp.txt,sleepTimeout,0,0
                                    }
                                    if(tInstruction.txt=="weatherUpdate")
                                    {
                                        vis tMainIcon,1
                                        vis tMainIconAlt,0
                                        vis tMainText,1
                                        vis tMainTextAlt,0
                                        vis tMRIcon,0
                                        vis tMR,0
                                        //tMainIcon
                                        spstr strCommand.txt,tMainIcon.txt,"~",1
                                        tMainIconAlt.txt=tMainIcon.txt
                                        //tMainText
                                        spstr strCommand.txt,tMainText.txt,"~",2
                                        tMainTextAlt.txt=tMainText.txt
                                        //tForecast1
                                        spstr strCommand.txt,tForecast1.txt,"~",3
                                        //tF1Icon
                                        spstr strCommand.txt,tF1Icon.txt,"~",4
                                        //tForecast1Val
                                        spstr strCommand.txt,tForecast1Val.txt,"~",5
                                        //tForecast2
                                        spstr strCommand.txt,tForecast2.txt,"~",6
                                        //tF2Icon
                                        spstr strCommand.txt,tF2Icon.txt,"~",7
                                        //tForecast2Val
                                        spstr strCommand.txt,tForecast2Val.txt,"~",8
                                        //tForecast3
                                        spstr strCommand.txt,tForecast3.txt,"~",9
                                        //tF3Icon
                                        spstr strCommand.txt,tF3Icon.txt,"~",10
                                        //tForecast3Val
                                        spstr strCommand.txt,tForecast3Val.txt,"~",11
                                        //tForecast4
                                        spstr strCommand.txt,tForecast4.txt,"~",12
                                        //tF4Icon
                                        spstr strCommand.txt,tF4Icon.txt,"~",13
                                        //tForecast4Val
                                        spstr strCommand.txt,tForecast4Val.txt,"~",14
                                        //alternative layout
                                        //tMRIcon
                                        spstr strCommand.txt,tMRIcon.txt,"~",15
                                        if(tMRIcon.txt!="")
                                        {
                                            //value for tMRIcon, activate alternative layout
                                            vis tMainIcon,0
                                            vis tMainText,0
                                            vis tMainTextAlt,1
                                            vis tMainIconAlt,1
                                            vis tMRIcon,1
                                            vis tMR,1
                                            vis tForecast1,0
                                            vis tF1Icon,0
                                            vis tForecast1Val,0
                                            //move forecast values to the right
                                            tForecast4.txt=tForecast3.txt
                                            tForecast3.txt=tForecast2.txt
                                            tForecast2.txt=tForecast1.txt
                                            tForecast4Val.txt=tForecast3Val.txt
                                            tForecast3Val.txt=tForecast2Val.txt
                                            tForecast2Val.txt=tForecast1Val.txt
                                            tF4Icon.txt=tF3Icon.txt
                                            tF3Icon.txt=tF2Icon.txt
                                            tF2Icon.txt=tF1Icon.txt
                                        }
                                        //tMR
                                        spstr strCommand.txt,tMR.txt,"~",16
                                    }
                                    if(tInstruction.txt=="color")
                                    {
                                        spstr strCommand.txt,tTmp.txt,"~",1
                                        covx tTmp.txt,tTime.bco,0,0
                                        screensaver.bco=tTime.bco
                                        tAMPM.bco=tTime.bco
                                        tDate.bco=tTime.bco
                                        tMainIcon.bco=tTime.bco
                                        tMainText.bco=tTime.bco
                                        tMainIconAlt.bco=tTime.bco
                                        tMainTextAlt.bco=tTime.bco
                                        tMRIcon.bco=tTime.bco
                                        tMR.bco=tTime.bco
                                        tMRIcon.bco=tTime.bco
                                        tForecast1.bco=tTime.bco
                                        tForecast1Val.bco=tTime.bco
                                        tF1Icon.bco=tTime.bco
                                        tForecast2.bco=tTime.bco
                                        tForecast2Val.bco=tTime.bco
                                        tF2Icon.bco=tTime.bco
                                        tForecast3.bco=tTime.bco
                                        tForecast3Val.bco=tTime.bco
                                        tF3Icon.bco=tTime.bco
                                        tForecast4.bco=tTime.bco
                                        tForecast4Val.bco=tTime.bco
                                        tF4Icon.bco=tTime.bco
                                        spstr strCommand.txt,tTmp.txt,"~",2
                                        covx tTmp.txt,tTime.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",3
                                        covx tTmp.txt,tAMPM.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",4
                                        covx tTmp.txt,tDate.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",5
                                        covx tTmp.txt,tMainIcon.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",6
                                        covx tTmp.txt,tMainText.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",7
                                        covx tTmp.txt,tForecast1.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",8
                                        covx tTmp.txt,tForecast2.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",9
                                        covx tTmp.txt,tForecast3.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",10
                                        covx tTmp.txt,tForecast4.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",11
                                        covx tTmp.txt,tF1Icon.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",12
                                        covx tTmp.txt,tF2Icon.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",13
                                        covx tTmp.txt,tF3Icon.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",14
                                        covx tTmp.txt,tF4Icon.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",15
                                        covx tTmp.txt,tForecast1Val.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",16
                                        covx tTmp.txt,tForecast2Val.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",17
                                        covx tTmp.txt,tForecast3Val.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",18
                                        covx tTmp.txt,tForecast4Val.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",19
                                        covx tTmp.txt,t10.bco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",20
                                        covx tTmp.txt,tMainIconAlt.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",21
                                        covx tTmp.txt,tMainTextAlt.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",22
                                        covx tTmp.txt,tMRIcon.pco,0,0
                                        spstr strCommand.txt,tTmp.txt,"~",23
                                        covx tTmp.txt,tMR.pco,0,0
                                    }
                                    if(tInstruction.txt=="notify")
                                    {
                                        spstr strCommand.txt,tNotifyHead.txt,"~",1
                                        spstr strCommand.txt,tNotifyText.txt,"~",2
                                        if(tNotifyHead.txt!=""||tNotifyText.txt!="")
                                        {
                                            vis tNotifyHead,1
                                            vis tNotifyText,1
                                        }else
                                        {
                                            vis tNotifyHead,0
                                            vis tNotifyText,0
                                        }
                                    }
                                    if(tInstruction.txt=="pageType")
                                    {
                                        dim=100
                                        //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
                                        //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 u[2]+3
                                        bufferPos=0
                                        if(tId.txt=="popupLight")
                                        {
                                            pageIcons.tTmp1.txt=tTmp.txt
                                            page popupLight
                                        }
                                        if(tId.txt=="pageStartup")
                                        {
                                            page pageStartup
                                        }
                                        if(tId.txt=="cardThermo")
                                        {
                                            page cardThermo
                                        }
                                        if(tId.txt=="cardMedia")
                                        {
                                            page cardMedia
                                        }
                                        if(tId.txt=="pageStartup")
                                        {
                                            page pageStartup
                                        }
                                        if(tId.txt=="popupNotify")
                                        {
                                            page popupNotify
                                        }
                                        if(tId.txt=="cardGrid")
                                        {
                                            page cardGrid
                                        }
                                        if(tId.txt=="cardEntities")
                                        {
                                            page cardEntities
                                        }
                                        if(tId.txt=="cardAlarm")
                                        {
                                            page cardAlarm
                                        }
                                        if(tId.txt=="cardQR")
                                        {
                                            page cardQR
                                        }
                                    }
                                    // end of user code
                                    udelete payloadLength-1
                                    bufferPos=0
                                }
                            }
                        }
                    }
                    // next character
                    bufferPos++
                }
            }
        
Timer tmSleep
    Attributes
        ID         : 26
        Scope      : local
        Period (ms): 1000
        Enabled    : yes
    
    Events
        Timer Event
            if(sleepTimeout!=0&&dimValue!=dim)
            {
                sleepValue+=1
                if(sleepTimeout<=sleepValue)
                {
                    sleepValue=0
                    dim=dimValue
                    vaTap.val=0
                }
            }
        
TouchCap tc0
    Attributes
        ID   : 2
        Scope: local
        Value: 0
    
    Events
        Touch Press Event
            if(tNotifyHead.txt!=""||tNotifyText.txt!="")
            {
                if(dim!=0)
                {
                    tNotifyHead.txt=""
                    tNotifyText.txt=""
                    vis tNotifyHead,0
                    vis tNotifyText,0
                }
            }
            dim=dimValueNormal
            vaTap.val+=1
            covx vaTap.val,tTmp.txt,0,0
            tSend.txt="event,buttonPress2,screensaver,bExit,"+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
        
