mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-20 14:37:01 +01:00
Compare commits
57 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0111a9bb21 | ||
|
|
9ac5c8d748 | ||
|
|
a725305cd4 | ||
|
|
0746221fe7 | ||
|
|
dbfd5e7da4 | ||
|
|
6d80a53e9c | ||
|
|
fb93f96a94 | ||
|
|
5dd7dd2c77 | ||
|
|
f11c870f47 | ||
|
|
e4727822a9 | ||
|
|
a75e7abc32 | ||
|
|
d3e308ccaf | ||
|
|
f5d785298f | ||
|
|
89cd951e70 | ||
|
|
9278258684 | ||
|
|
327be4bca2 | ||
|
|
27f492ba6a | ||
|
|
c66e595e65 | ||
|
|
29613e11cc | ||
|
|
2bf396f7af | ||
|
|
9dd34abac4 | ||
|
|
aae3aa9e62 | ||
|
|
ff3208d5fa | ||
|
|
da3ae4b78d | ||
|
|
256b3e5fe6 | ||
|
|
0629f70d30 | ||
|
|
3ed71d725d | ||
|
|
35e4252a6c | ||
|
|
9ba4395e6c | ||
|
|
909101d726 | ||
|
|
f99fa640fe | ||
|
|
d2434ca626 | ||
|
|
65f4dd3970 | ||
|
|
fac86624ae | ||
|
|
277b2ccfd6 | ||
|
|
cbfd803a65 | ||
|
|
ae691d298f | ||
|
|
ee187ae9cd | ||
|
|
35e1b4cd66 | ||
|
|
f6912ad3ca | ||
|
|
71a5830db4 | ||
|
|
8ada5ad9b9 | ||
|
|
9a59b453d2 | ||
|
|
e52091b274 | ||
|
|
95de956e77 | ||
|
|
358a5f8b72 | ||
|
|
4292a34c11 | ||
|
|
60c40d56e5 | ||
|
|
97fed8c52c | ||
|
|
bf06931a2e | ||
|
|
cec43eeb16 | ||
|
|
20c02007fa | ||
|
|
2be33d723a | ||
|
|
ea121ff9a9 | ||
|
|
601de7b47f | ||
|
|
0c33184e5c | ||
|
|
979d37281c |
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
custom: ['https://paypal.me/joBr99']
|
||||||
@@ -146,61 +146,61 @@ The following message can be used to update the content on the cardEntities Page
|
|||||||
|
|
||||||
### cardEntities Page
|
### cardEntities Page
|
||||||
|
|
||||||
`event,*eventName*,*PageNumber*,*PageHeading*,*entityName*,*buttonId*,*actionName*,*optionalValue*`
|
`event,*eventName*,*entityName*,*actionName*,*optionalValue*`
|
||||||
|
|
||||||
`event,pageOpen,0`
|
`event,pageOpen,0`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,up`
|
`event,buttonPress2,internalNameEntity,up`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,down`
|
`event,buttonPress2,internalNameEntity,down`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,stop`
|
`event,buttonPress2,internalNameEntity,stop`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,OnOff,1`
|
`event,buttonPress2,internalNameEntity,OnOff,1`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,button`
|
`event,buttonPress2,internalNameEntity,button`
|
||||||
|
|
||||||
### popupLight Page
|
### popupLight Page
|
||||||
|
|
||||||
`event,pageOpenDetail,popupLight,internalNameEntity`
|
`event,pageOpenDetail,popupLight,internalNameEntity`
|
||||||
|
|
||||||
`event,buttonPress,D,nameEntity,internalNameEntity,1,OnOff,1`
|
`event,buttonPress2,internalNameEntity,OnOff,1`
|
||||||
|
|
||||||
`event,buttonPress,D,nameEntity,internalNameEntity,1,brightnessSlider,50`
|
`event,buttonPress2,internalNameEntity,brightnessSlider,50`
|
||||||
|
|
||||||
`event,buttonPress,D,nameEntity,internalNameEntity,1,colorTempSlider,50`
|
`event,buttonPress2,internalNameEntity,colorTempSlider,50`
|
||||||
|
|
||||||
`event,buttonPress,D,nameEntity,internalNameEntity,1,colorWheel,x|y`
|
`event,buttonPress2,internalNameEntity,colorWheel,x|y`
|
||||||
|
|
||||||
### popupShutter Page
|
### popupShutter Page
|
||||||
|
|
||||||
`event,pageOpenDetail,popupShutter,internalNameEntity`
|
`event,pageOpenDetail,popupShutter,internalNameEntity`
|
||||||
|
|
||||||
`event,buttonPress,D,nameEntity,internalNameEntity,1,positionSlider,50`
|
`event,buttonPress2,internalNameEntity,positionSlider,50`
|
||||||
|
|
||||||
### popupNotify Page
|
### popupNotify Page
|
||||||
|
|
||||||
`event,buttonPress,D,D,*internalName*,1,notifyAction,yes`
|
`event,buttonPress2,*internalName*,notifyAction,yes`
|
||||||
|
|
||||||
`event,buttonPress,D,D,*internalName*,1,notifyAction,no`
|
`event,buttonPress2,*internalName*,notifyAction,no`
|
||||||
|
|
||||||
### cardThermo Page
|
### cardThermo Page
|
||||||
|
|
||||||
`event,pageOpen,0`
|
`event,pageOpen,0`
|
||||||
|
|
||||||
`event,tempUpd,*pageNumber*,*entityName*,*temperature*`
|
`event,buttonPress2,*entityName*,tempUpd,*temperature*`
|
||||||
|
|
||||||
`event,buttonPress,*pageNumber*,*tHeading*,*entityName,1,hvac_action,*hvac_action*
|
`event,buttonPress2,*entityName*,hvac_action,*hvac_action*`
|
||||||
|
|
||||||
### cardMedia Page
|
### cardMedia Page
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,media-back`
|
`event,buttonPress2,internalNameEntity,media-back`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,media-pause`
|
`event,buttonPress2,internalNameEntity,media-pause`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,media-next`
|
`event,buttonPress2,internalNameEntity,media-next`
|
||||||
|
|
||||||
`event,buttonPress,1,tHeading,internalNameEntity,1,volumeSlider,75`
|
`event,buttonPress2,internalNameEntity,volumeSlider,75`
|
||||||
|
|
||||||
### cardAlarm Page
|
### cardAlarm Page
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,10 @@ icons = [
|
|||||||
"solar-power",
|
"solar-power",
|
||||||
"battery-charging-medium",
|
"battery-charging-medium",
|
||||||
"battery-medium",
|
"battery-medium",
|
||||||
"shield-home"
|
"shield-home",
|
||||||
|
"door-open",
|
||||||
|
"door-closed",
|
||||||
|
"window-closed"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -53,7 +56,7 @@ icon_name_list = []
|
|||||||
for icon_name in icons:
|
for icon_name in icons:
|
||||||
#print(icon_name)
|
#print(icon_name)
|
||||||
icon = next((item for item in icon_metadata if item["name"] == icon_name), None)
|
icon = next((item for item in icon_metadata if item["name"] == icon_name), None)
|
||||||
if icon == None:
|
if icon is None:
|
||||||
print(f"WARNING ICON NOT FOUND: {icon_name}")
|
print(f"WARNING ICON NOT FOUND: {icon_name}")
|
||||||
else:
|
else:
|
||||||
hex = icon['hex']
|
hex = icon['hex']
|
||||||
@@ -63,7 +66,7 @@ for icon_name in icons:
|
|||||||
icon_name_list.append(icon_name)
|
icon_name_list.append(icon_name)
|
||||||
|
|
||||||
# write mapping lib for python
|
# write mapping lib for python
|
||||||
with open(os.path.join(__location__, "../../../apps/nspanel-lovelace-ui", "icon_mapper.py"), 'w') as f:
|
with open(os.path.join(__location__, "../../../apps/nspanel-lovelace-ui", "icon_mapping.py"), 'w') as f:
|
||||||
f.write("icons = {\n")
|
f.write("icons = {\n")
|
||||||
for idx, val in enumerate(icon_name_list):
|
for idx, val in enumerate(icon_name_list):
|
||||||
f.write(f" '{val}': {idx},\n")
|
f.write(f" '{val}': {idx},\n")
|
||||||
|
|||||||
@@ -40,3 +40,6 @@ ID | MD Icon Name | Icon
|
|||||||
33 | battery-charging-medium | 
|
33 | battery-charging-medium | 
|
||||||
34 | battery-medium | 
|
34 | battery-medium | 
|
||||||
35 | shield-home | 
|
35 | shield-home | 
|
||||||
|
36 | door-open | 
|
||||||
|
37 | door-closed | 
|
||||||
|
38 | window-closed | 
|
||||||
|
|||||||
@@ -541,8 +541,8 @@ Button bDown1
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 379
|
x coordinate : 377
|
||||||
y coordinate : 76
|
y coordinate : 75
|
||||||
Width : 50
|
Width : 50
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -567,14 +567,7 @@ Button bDown1
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn1.txt+",down"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn1.txt+","
|
|
||||||
tSend.txt+="1,down"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -596,7 +589,7 @@ Button bUp1
|
|||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 275
|
x coordinate : 275
|
||||||
y coordinate : 76
|
y coordinate : 75
|
||||||
Width : 50
|
Width : 50
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -621,14 +614,7 @@ Button bUp1
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn1.txt+",up"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn1.txt+","
|
|
||||||
tSend.txt+="1,up"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -649,8 +635,8 @@ Button bStop1
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 327
|
x coordinate : 325
|
||||||
y coordinate : 76
|
y coordinate : 75
|
||||||
Width : 50
|
Width : 50
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -675,14 +661,7 @@ Button bStop1
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn1.txt+",stop"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn1.txt+","
|
|
||||||
tSend.txt+="1,stop"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -703,8 +682,8 @@ Button bStop2
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 327
|
x coordinate : 326
|
||||||
y coordinate : 133
|
y coordinate : 132
|
||||||
Width : 50
|
Width : 50
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -729,14 +708,7 @@ Button bStop2
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn2.txt+",stop"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn2.txt+","
|
|
||||||
tSend.txt+="2,stop"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -757,8 +729,8 @@ Button bDown2
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 379
|
x coordinate : 377
|
||||||
y coordinate : 133
|
y coordinate : 131
|
||||||
Width : 50
|
Width : 50
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -783,14 +755,7 @@ Button bDown2
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn2.txt+",down"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn2.txt+","
|
|
||||||
tSend.txt+="2,down"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -812,7 +777,7 @@ Button bUp2
|
|||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 275
|
x coordinate : 275
|
||||||
y coordinate : 133
|
y coordinate : 132
|
||||||
Width : 50
|
Width : 50
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -837,14 +802,7 @@ Button bUp2
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn2.txt+",up"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn2.txt+","
|
|
||||||
tSend.txt+="2,up"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -865,8 +823,8 @@ Button bStop3
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 327
|
x coordinate : 326
|
||||||
y coordinate : 186
|
y coordinate : 185
|
||||||
Width : 50
|
Width : 50
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -891,14 +849,7 @@ Button bStop3
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn3.txt+",stop"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn3.txt+","
|
|
||||||
tSend.txt+="3,stop"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -919,8 +870,8 @@ Button bDown3
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 379
|
x coordinate : 378
|
||||||
y coordinate : 186
|
y coordinate : 185
|
||||||
Width : 50
|
Width : 50
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -945,14 +896,7 @@ Button bDown3
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn3.txt+",down"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn3.txt+","
|
|
||||||
tSend.txt+="3,down"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -999,14 +943,7 @@ Button bUp3
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn3.txt+",up"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn3.txt+","
|
|
||||||
tSend.txt+="3,up"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -1027,8 +964,8 @@ Button bStop4
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 327
|
x coordinate : 326
|
||||||
y coordinate : 242
|
y coordinate : 241
|
||||||
Width : 50
|
Width : 50
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -1053,14 +990,7 @@ Button bStop4
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn4.txt+",stop"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn4.txt+","
|
|
||||||
tSend.txt+="4,stop"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -1081,8 +1011,8 @@ Button bDown4
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 378
|
x coordinate : 377
|
||||||
y coordinate : 242
|
y coordinate : 241
|
||||||
Width : 50
|
Width : 50
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -1107,14 +1037,7 @@ Button bDown4
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn4.txt+",down"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn4.txt+","
|
|
||||||
tSend.txt+="4,down"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -1161,14 +1084,7 @@ Button bUp4
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn4.txt+",up"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn4.txt+","
|
|
||||||
tSend.txt+="4,up"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -1321,14 +1237,7 @@ Button bText1
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn1.txt+","
|
|
||||||
tSend.txt+="1,button"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -1349,8 +1258,8 @@ Button bText2
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 277
|
x coordinate : 276
|
||||||
y coordinate : 141
|
y coordinate : 140
|
||||||
Width : 145
|
Width : 145
|
||||||
Height : 30
|
Height : 30
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -1375,14 +1284,7 @@ Button bText2
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn2.txt+","
|
|
||||||
tSend.txt+="1,button"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -1429,14 +1331,7 @@ Button bText3
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn3.txt+","
|
|
||||||
tSend.txt+="1,button"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -1483,14 +1378,7 @@ Button bText4
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn4.txt+","
|
|
||||||
tSend.txt+="1,button"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -1511,8 +1399,8 @@ Dual-state Button btOnOff1
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 374
|
x coordinate : 373
|
||||||
y coordinate : 76
|
y coordinate : 75
|
||||||
Width : 50
|
Width : 50
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -1533,14 +1421,7 @@ Dual-state Button btOnOff1
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn1.txt+",OnOff,"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn1.txt+","
|
|
||||||
tSend.txt+="1,OnOff,"
|
|
||||||
covx btOnOff1.val,tTmp.txt,0,0
|
covx btOnOff1.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
@@ -1563,8 +1444,8 @@ Dual-state Button btOnOff2
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 374
|
x coordinate : 373
|
||||||
y coordinate : 133
|
y coordinate : 132
|
||||||
Width : 50
|
Width : 50
|
||||||
Height : 50
|
Height : 50
|
||||||
Effect : load
|
Effect : load
|
||||||
@@ -1585,14 +1466,7 @@ Dual-state Button btOnOff2
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn2.txt+",OnOff,"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn2.txt+","
|
|
||||||
tSend.txt+="2,OnOff,"
|
|
||||||
covx btOnOff2.val,tTmp.txt,0,0
|
covx btOnOff2.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
@@ -1637,14 +1511,7 @@ Dual-state Button btOnOff3
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn3.txt+",OnOff,"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn3.txt+","
|
|
||||||
tSend.txt+="3,OnOff,"
|
|
||||||
covx btOnOff3.val,tTmp.txt,0,0
|
covx btOnOff3.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
@@ -1689,14 +1556,7 @@ Dual-state Button btOnOff4
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn4.txt+",OnOff,"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn4.txt+","
|
|
||||||
tSend.txt+="4,OnOff,"
|
|
||||||
covx btOnOff4.val,tTmp.txt,0,0
|
covx btOnOff4.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
|
|||||||
@@ -172,9 +172,9 @@ Text tEntity1
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 33
|
x coordinate : 6
|
||||||
y coordinate : 155
|
y coordinate : 155
|
||||||
Width : 120
|
Width : 140
|
||||||
Height : 30
|
Height : 30
|
||||||
Effect : load
|
Effect : load
|
||||||
Effect Priority : 0
|
Effect Priority : 0
|
||||||
@@ -322,9 +322,9 @@ Text tEntity2
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 167
|
x coordinate : 157
|
||||||
y coordinate : 155
|
y coordinate : 155
|
||||||
Width : 120
|
Width : 140
|
||||||
Height : 30
|
Height : 30
|
||||||
Effect : load
|
Effect : load
|
||||||
Effect Priority : 0
|
Effect Priority : 0
|
||||||
@@ -352,9 +352,9 @@ Text tEntity3
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 296
|
x coordinate : 307
|
||||||
y coordinate : 155
|
y coordinate : 155
|
||||||
Width : 120
|
Width : 140
|
||||||
Height : 30
|
Height : 30
|
||||||
Effect : load
|
Effect : load
|
||||||
Effect Priority : 0
|
Effect Priority : 0
|
||||||
@@ -382,9 +382,9 @@ Text tEntity4
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 33
|
x coordinate : 6
|
||||||
y coordinate : 274
|
y coordinate : 274
|
||||||
Width : 120
|
Width : 140
|
||||||
Height : 30
|
Height : 30
|
||||||
Effect : load
|
Effect : load
|
||||||
Effect Priority : 0
|
Effect Priority : 0
|
||||||
@@ -412,9 +412,9 @@ Text tEntity5
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 167
|
x coordinate : 157
|
||||||
y coordinate : 274
|
y coordinate : 274
|
||||||
Width : 120
|
Width : 140
|
||||||
Height : 30
|
Height : 30
|
||||||
Effect : load
|
Effect : load
|
||||||
Effect Priority : 0
|
Effect Priority : 0
|
||||||
@@ -442,9 +442,9 @@ Text tEntity6
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 296
|
x coordinate : 307
|
||||||
y coordinate : 274
|
y coordinate : 274
|
||||||
Width : 120
|
Width : 140
|
||||||
Height : 30
|
Height : 30
|
||||||
Effect : load
|
Effect : load
|
||||||
Effect Priority : 0
|
Effect Priority : 0
|
||||||
@@ -595,7 +595,7 @@ Button bEntity1
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 53
|
x coordinate : 36
|
||||||
y coordinate : 75
|
y coordinate : 75
|
||||||
Width : 80
|
Width : 80
|
||||||
Height : 80
|
Height : 80
|
||||||
@@ -632,14 +632,7 @@ Button bEntity1
|
|||||||
|
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
tmLP.en=0
|
tmLP.en=0
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn1.txt+","
|
|
||||||
tSend.txt+="1,button"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -697,14 +690,7 @@ Button bEntity2
|
|||||||
|
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
tmLP.en=0
|
tmLP.en=0
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn2.txt+","
|
|
||||||
tSend.txt+="1,button"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -725,7 +711,7 @@ Button bEntity3
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 316
|
x coordinate : 337
|
||||||
y coordinate : 75
|
y coordinate : 75
|
||||||
Width : 80
|
Width : 80
|
||||||
Height : 80
|
Height : 80
|
||||||
@@ -762,14 +748,7 @@ Button bEntity3
|
|||||||
|
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
tmLP.en=0
|
tmLP.en=0
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn3.txt+","
|
|
||||||
tSend.txt+="1,button"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -790,7 +769,7 @@ Button bEntity4
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 53
|
x coordinate : 36
|
||||||
y coordinate : 194
|
y coordinate : 194
|
||||||
Width : 80
|
Width : 80
|
||||||
Height : 80
|
Height : 80
|
||||||
@@ -827,14 +806,7 @@ Button bEntity4
|
|||||||
|
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
tmLP.en=0
|
tmLP.en=0
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn4.txt+","
|
|
||||||
tSend.txt+="1,button"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -892,14 +864,7 @@ Button bEntity5
|
|||||||
|
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
tmLP.en=0
|
tmLP.en=0
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn5.txt+","
|
|
||||||
tSend.txt+="1,button"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -920,7 +885,7 @@ Button bEntity6
|
|||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Opacity : 127
|
Opacity : 127
|
||||||
x coordinate : 316
|
x coordinate : 337
|
||||||
y coordinate : 194
|
y coordinate : 194
|
||||||
Width : 80
|
Width : 80
|
||||||
Height : 80
|
Height : 80
|
||||||
@@ -957,14 +922,7 @@ Button bEntity6
|
|||||||
|
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
tmLP.en=0
|
tmLP.en=0
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn6.txt+",button"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn6.txt+","
|
|
||||||
tSend.txt+="1,button"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
|
|||||||
@@ -314,14 +314,11 @@ Text t2
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
// event,buttonPress2,entn,media-next
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
tSend.txt+=entn.txt+","
|
||||||
tSend.txt+="1,media-next"
|
tSend.txt+="media-next"
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -366,14 +363,11 @@ Text tPlayPause
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
// event,buttonPress2,entn,media-pause
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
tSend.txt+=entn.txt+","
|
||||||
tSend.txt+="1,media-pause"
|
tSend.txt+="media-pause"
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -418,14 +412,11 @@ Text t0
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
// event,buttonPress2,entn,media-back
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
tSend.txt+=entn.txt+","
|
||||||
tSend.txt+="1,media-back"
|
tSend.txt+="media-back"
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -512,14 +503,9 @@ Slider hVolume
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,positionSlider,50
|
// event,buttonPress2,internalNameEntity,volumeSlider,50
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"+entn.txt+",volumeSlider,"
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,volumeSlider,"
|
|
||||||
covx hVolume.val,tTmp.txt,0,0
|
covx hVolume.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
|
|||||||
@@ -613,13 +613,11 @@ Button bDown
|
|||||||
{
|
{
|
||||||
xTempDest.val=xTempDest.val-xTempStep.val
|
xTempDest.val=xTempDest.val-xTempStep.val
|
||||||
}
|
}
|
||||||
// temp chane event
|
// event,buttonPress2,entn,tempUpd,X
|
||||||
// event,tempUpd,pageNumber,entityName,temperature
|
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,tempUpd,"+tTmp.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+="tempUpd,"
|
||||||
//convert temperature
|
//convert temperature
|
||||||
covx xTempDest.val,tTmp.txt,0,0
|
covx xTempDest.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
@@ -669,11 +667,11 @@ Button bUp
|
|||||||
{
|
{
|
||||||
xTempDest.val=xTempDest.val+xTempStep.val
|
xTempDest.val=xTempDest.val+xTempStep.val
|
||||||
}
|
}
|
||||||
// temp chane event
|
// event,buttonPress2,entn,tempUpd,X
|
||||||
// event,tempUpd,pageNumber,entityName,temperature
|
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,tempUpd,"+tTmp.txt+","
|
tSend.txt="event,buttonPress2,"
|
||||||
tSend.txt+=entn.txt+","
|
tSend.txt+=entn.txt+","
|
||||||
|
tSend.txt+="tempUpd,"
|
||||||
//convert temperature
|
//convert temperature
|
||||||
covx xTempDest.val,tTmp.txt,0,0
|
covx xTempDest.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
@@ -778,12 +776,8 @@ Dual-state Button bt0
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
covx nPage,tTmp.txt,0,0
|
tSend.txt+=",hvac_action,"+va0.txt
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,hvac_action,"+va0.txt
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -831,12 +825,8 @@ Dual-state Button bt1
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
covx nPage,tTmp.txt,0,0
|
tSend.txt+=",hvac_action,"+va1.txt
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,hvac_action,"+va1.txt
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -884,12 +874,8 @@ Dual-state Button bt2
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
covx nPage,tTmp.txt,0,0
|
tSend.txt+=",hvac_action,"+va2.txt
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,hvac_action,"+va2.txt
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -937,12 +923,8 @@ Dual-state Button bt3
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
covx nPage,tTmp.txt,0,0
|
tSend.txt+=",hvac_action,"+va3.txt
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,hvac_action,"+va3.txt
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -990,12 +972,8 @@ Dual-state Button bt4
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
covx nPage,tTmp.txt,0,0
|
tSend.txt+=",hvac_action,"+va4.txt
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,hvac_action,"+va4.txt
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -1043,12 +1021,8 @@ Dual-state Button bt5
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
covx nPage,tTmp.txt,0,0
|
tSend.txt+=",hvac_action,"+va5.txt
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,hvac_action,"+va5.txt
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -1096,12 +1070,8 @@ Dual-state Button bt6
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
covx nPage,tTmp.txt,0,0
|
tSend.txt+=",hvac_action,"+va6.txt
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,hvac_action,"+va6.txt
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -1149,12 +1119,8 @@ Dual-state Button bt7
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
covx nPage,tTmp.txt,0,0
|
tSend.txt+=",hvac_action,"+va7.txt
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,hvac_action,"+va7.txt
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -1202,12 +1168,8 @@ Dual-state Button bt8
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
//craft command
|
//craft command
|
||||||
// convert pageNumber and write to tTmp
|
tSend.txt="event,buttonPress2,"+entn.txt
|
||||||
covx nPage,tTmp.txt,0,0
|
tSend.txt+=",hvac_action,"+va8.txt
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tHeading.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,hvac_action,"+va8.txt
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
|
|||||||
@@ -10,50 +10,50 @@ pageSerialTest
|
|||||||
13 Component(s)
|
13 Component(s)
|
||||||
48 Line(s) of event code
|
48 Line(s) of event code
|
||||||
43 Unique line(s) of event code
|
43 Unique line(s) of event code
|
||||||
cardMedia
|
|
||||||
22 Component(s)
|
|
||||||
210 Line(s) of event code
|
|
||||||
116 Unique line(s) of event code
|
|
||||||
popupNotify
|
popupNotify
|
||||||
17 Component(s)
|
17 Component(s)
|
||||||
179 Line(s) of event code
|
180 Line(s) of event code
|
||||||
118 Unique line(s) of event code
|
119 Unique line(s) of event code
|
||||||
pageSwipeTest
|
|
||||||
18 Component(s)
|
|
||||||
62 Line(s) of event code
|
|
||||||
44 Unique line(s) of event code
|
|
||||||
popupLight
|
|
||||||
27 Component(s)
|
|
||||||
338 Line(s) of event code
|
|
||||||
170 Unique line(s) of event code
|
|
||||||
pageTest
|
|
||||||
14 Component(s)
|
|
||||||
14 Line(s) of event code
|
|
||||||
14 Unique line(s) of event code
|
|
||||||
pageStartup
|
pageStartup
|
||||||
19 Component(s)
|
19 Component(s)
|
||||||
146 Line(s) of event code
|
146 Line(s) of event code
|
||||||
111 Unique line(s) of event code
|
111 Unique line(s) of event code
|
||||||
|
cardMedia
|
||||||
|
22 Component(s)
|
||||||
|
200 Line(s) of event code
|
||||||
|
115 Unique line(s) of event code
|
||||||
|
pageSwipeTest
|
||||||
|
18 Component(s)
|
||||||
|
62 Line(s) of event code
|
||||||
|
44 Unique line(s) of event code
|
||||||
popupShutter
|
popupShutter
|
||||||
19 Component(s)
|
19 Component(s)
|
||||||
194 Line(s) of event code
|
180 Line(s) of event code
|
||||||
106 Unique line(s) of event code
|
103 Unique line(s) of event code
|
||||||
|
pageTest
|
||||||
|
14 Component(s)
|
||||||
|
14 Line(s) of event code
|
||||||
|
14 Unique line(s) of event code
|
||||||
|
popupLight
|
||||||
|
26 Component(s)
|
||||||
|
304 Line(s) of event code
|
||||||
|
167 Unique line(s) of event code
|
||||||
screensaver
|
screensaver
|
||||||
25 Component(s)
|
25 Component(s)
|
||||||
173 Line(s) of event code
|
173 Line(s) of event code
|
||||||
124 Unique line(s) of event code
|
124 Unique line(s) of event code
|
||||||
cardThermo
|
cardThermo
|
||||||
42 Component(s)
|
42 Component(s)
|
||||||
438 Line(s) of event code
|
412 Line(s) of event code
|
||||||
|
221 Unique line(s) of event code
|
||||||
|
cardGrid
|
||||||
|
39 Component(s)
|
||||||
|
382 Line(s) of event code
|
||||||
221 Unique line(s) of event code
|
221 Unique line(s) of event code
|
||||||
cardEntities
|
cardEntities
|
||||||
54 Component(s)
|
54 Component(s)
|
||||||
808 Line(s) of event code
|
728 Line(s) of event code
|
||||||
320 Unique line(s) of event code
|
317 Unique line(s) of event code
|
||||||
cardGrid
|
|
||||||
39 Component(s)
|
|
||||||
406 Line(s) of event code
|
|
||||||
224 Unique line(s) of event code
|
|
||||||
cardAlarm
|
cardAlarm
|
||||||
35 Component(s)
|
35 Component(s)
|
||||||
259 Line(s) of event code
|
259 Line(s) of event code
|
||||||
@@ -61,6 +61,6 @@ cardAlarm
|
|||||||
|
|
||||||
Total
|
Total
|
||||||
14 Page(s)
|
14 Page(s)
|
||||||
350 Component(s)
|
349 Component(s)
|
||||||
3292 Line(s) of event code
|
3105 Line(s) of event code
|
||||||
842 Unique line(s) of event code
|
827 Unique line(s) of event code
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ Text tIcons
|
|||||||
Horizontal Alignment : left
|
Horizontal Alignment : left
|
||||||
Vertical Alignment : top
|
Vertical Alignment : top
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : îî´îï§îîî î
î£îîî°îîîîî½îîîîîî¾îîîîî¤î·îºîîï¤ï¡î
|
Text : îî´îï§îîî î
î£îîî°îîîîî½îîîîîî¾îîîîî¤î·îºîîï¤ï¡îî î î
|
||||||
Max. Text Size : 120
|
Max. Text Size : 120
|
||||||
Word wrap : enabled
|
Word wrap : enabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ Text tVersion
|
|||||||
Horizontal Alignment : center
|
Horizontal Alignment : center
|
||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text : 15
|
Text : 16
|
||||||
Max. Text Size : 10
|
Max. Text Size : 10
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
|
|||||||
@@ -78,15 +78,9 @@ Variable (int32) mode
|
|||||||
Scope: local
|
Scope: local
|
||||||
Value: 1
|
Value: 1
|
||||||
|
|
||||||
Variable (int32) mode_bright
|
|
||||||
Attributes
|
|
||||||
ID : 24
|
|
||||||
Scope: local
|
|
||||||
Value: 0
|
|
||||||
|
|
||||||
Variable (int32) mode_temp
|
Variable (int32) mode_temp
|
||||||
Attributes
|
Attributes
|
||||||
ID : 25
|
ID : 24
|
||||||
Scope: local
|
Scope: local
|
||||||
Value: 0
|
Value: 0
|
||||||
|
|
||||||
@@ -392,7 +386,7 @@ Text tId
|
|||||||
|
|
||||||
Text t0
|
Text t0
|
||||||
Attributes
|
Attributes
|
||||||
ID : 26
|
ID : 25
|
||||||
Scope : local
|
Scope : local
|
||||||
Dragging : 0
|
Dragging : 0
|
||||||
Disable release event after dragging: 0
|
Disable release event after dragging: 0
|
||||||
@@ -456,12 +450,8 @@ Picture pColorWheel
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,brightnessSlider,50
|
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,"
|
tSend.txt="event,buttonPress2,"+entn.txt+",colorWheel,"
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,colorWheel,"
|
|
||||||
sys0=tch0
|
sys0=tch0
|
||||||
sys0=sys0-pColorWheel.x
|
sys0=sys0-pColorWheel.x
|
||||||
covx sys0,tTmp.txt,0,0
|
covx sys0,tTmp.txt,0,0
|
||||||
@@ -509,34 +499,9 @@ Slider hBrightness
|
|||||||
Lower range limit : 0
|
Lower range limit : 0
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,brightnessSlider,50
|
|
||||||
//craft command
|
|
||||||
tSend.txt="event,buttonPress,D,"
|
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,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,1
|
|
||||||
crcputs tSend.txt,0
|
|
||||||
//send cmd
|
|
||||||
printh 55 bb
|
|
||||||
prints sys0,2
|
|
||||||
prints tSend.txt,0
|
|
||||||
prints crcval,2
|
|
||||||
|
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,brightnessSlider,50
|
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,"
|
tSend.txt="event,buttonPress2,"+entn.txt+",brightnessSlider,"
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,brightnessSlider,"
|
|
||||||
covx hBrightness.val,tTmp.txt,0,0
|
covx hBrightness.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
@@ -577,34 +542,9 @@ Slider hTempSlider
|
|||||||
Lower range limit : 0
|
Lower range limit : 0
|
||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,colorTempSlider,50
|
|
||||||
//craft command
|
|
||||||
tSend.txt="event,buttonPress,D,"
|
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,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,1
|
|
||||||
crcputs tSend.txt,0
|
|
||||||
//send cmd
|
|
||||||
printh 55 bb
|
|
||||||
prints sys0,2
|
|
||||||
prints tSend.txt,0
|
|
||||||
prints crcval,2
|
|
||||||
|
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,colorTempSlider,50
|
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,"
|
tSend.txt="event,buttonPress2,"+entn.txt+",colorTempSlider,"
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,colorTempSlider,"
|
|
||||||
covx hTempSlider.val,tTmp.txt,0,0
|
covx hTempSlider.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
@@ -710,11 +650,6 @@ Button bColor
|
|||||||
mode.val=0
|
mode.val=0
|
||||||
//enable color wheel
|
//enable color wheel
|
||||||
vis pColorWheel,1
|
vis pColorWheel,1
|
||||||
//vis t0,1
|
|
||||||
//disable brightness
|
|
||||||
//vis t1,0
|
|
||||||
//vis t2,0
|
|
||||||
//vis hBrightness,0
|
|
||||||
//disable color temp
|
//disable color temp
|
||||||
vis t4,0
|
vis t4,0
|
||||||
vis t3,0
|
vis t3,0
|
||||||
@@ -724,14 +659,6 @@ Button bColor
|
|||||||
mode.val=1
|
mode.val=1
|
||||||
//disable color wheel
|
//disable color wheel
|
||||||
vis pColorWheel,0
|
vis pColorWheel,0
|
||||||
//vis t0,0
|
|
||||||
//if(mode_bright.val==1)
|
|
||||||
//{
|
|
||||||
// //enable brightness
|
|
||||||
// vis t1,1
|
|
||||||
// vis t2,1
|
|
||||||
// vis hBrightness,1
|
|
||||||
//}
|
|
||||||
if(mode_temp.val==1)
|
if(mode_temp.val==1)
|
||||||
{
|
{
|
||||||
//enable color temp
|
//enable color temp
|
||||||
@@ -771,12 +698,8 @@ Dual-state Button btOnOff1
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,OnOff,1
|
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,"
|
tSend.txt="event,buttonPress2,"+entn.txt+","+"OnOff,"
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,OnOff,"
|
|
||||||
covx btOnOff1.val,tTmp.txt,0,0
|
covx btOnOff1.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
@@ -808,6 +731,7 @@ Timer tmSleep
|
|||||||
screensaver.originPage.val=dp
|
screensaver.originPage.val=dp
|
||||||
sleepValue=0
|
sleepValue=0
|
||||||
click b0,1
|
click b0,1
|
||||||
|
click b0,0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -885,46 +809,69 @@ Timer tmSerial
|
|||||||
vis t1,0
|
vis t1,0
|
||||||
vis t2,0
|
vis t2,0
|
||||||
vis hBrightness,0
|
vis hBrightness,0
|
||||||
mode_bright.val=0
|
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
vis t1,1
|
vis t1,1
|
||||||
vis t2,1
|
vis t2,1
|
||||||
vis hBrightness,1
|
vis hBrightness,1
|
||||||
mode_bright.val=1
|
|
||||||
covx tTmp.txt,sys0,0,0
|
covx tTmp.txt,sys0,0,0
|
||||||
hBrightness.val=sys0
|
hBrightness.val=sys0
|
||||||
}
|
}
|
||||||
if(mode.val==1)
|
|
||||||
{
|
|
||||||
// get ColorTemp value
|
// get ColorTemp value
|
||||||
spstr strCommand.txt,tTmp.txt,",",5
|
spstr strCommand.txt,tTmp.txt,",",5
|
||||||
if(tTmp.txt=="unknown")
|
if(tTmp.txt=="disable")
|
||||||
{
|
{
|
||||||
click bColor,1
|
|
||||||
mode_temp.val=1
|
|
||||||
}else if(tTmp.txt=="disable")
|
|
||||||
{
|
|
||||||
vis t4,0
|
|
||||||
vis t3,0
|
|
||||||
vis hTempSlider,0
|
vis hTempSlider,0
|
||||||
|
vis t3,0
|
||||||
|
vis t4,0
|
||||||
mode_temp.val=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
|
}else
|
||||||
{
|
{
|
||||||
vis t4,1
|
mode_temp.val=0
|
||||||
vis t3,1
|
|
||||||
vis hTempSlider,1
|
vis hTempSlider,1
|
||||||
mode_temp.val=1
|
vis t3,1
|
||||||
covx tTmp.txt,sys0,0,0
|
vis t4,1
|
||||||
hTempSlider.val=sys0
|
// mode == 0 is rgb controls currently shown
|
||||||
}
|
if(mode.val==0)
|
||||||
}
|
{
|
||||||
// get ColorWheel value
|
// switch mode
|
||||||
spstr strCommand.txt,tTmp.txt,",",6
|
click bColor,1
|
||||||
if(tTmp.txt!="disable")
|
click bColor,0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// get Color value
|
||||||
|
spstr strCommand.txt,tTmp.txt,",",6
|
||||||
|
// disable -> isn't supported
|
||||||
|
if(tTmp.txt=="disable")
|
||||||
|
{
|
||||||
|
vis t0,0
|
||||||
|
vis bColor,0
|
||||||
|
vis pColorWheel,0
|
||||||
|
}else
|
||||||
{
|
{
|
||||||
vis bColor,1
|
|
||||||
vis t0,1
|
vis t0,1
|
||||||
|
vis bColor,1
|
||||||
|
if(mode.val==0)
|
||||||
|
{
|
||||||
|
vis pColorWheel,1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="time")
|
if(tInstruction.txt=="time")
|
||||||
@@ -949,10 +896,6 @@ Timer tmSerial
|
|||||||
spstr strCommand.txt,tTmp.txt,",",1
|
spstr strCommand.txt,tTmp.txt,",",1
|
||||||
covx tTmp.txt,sleepTimeout,0,0
|
covx tTmp.txt,sleepTimeout,0,0
|
||||||
}
|
}
|
||||||
// end of user code
|
|
||||||
udelete payloadLength-1
|
|
||||||
bufferPos=0
|
|
||||||
}
|
|
||||||
if(tInstruction.txt=="pageType")
|
if(tInstruction.txt=="pageType")
|
||||||
{
|
{
|
||||||
//command format pageType,specialPageName
|
//command format pageType,specialPageName
|
||||||
@@ -990,21 +933,16 @@ Timer tmSerial
|
|||||||
page cardAlarm
|
page cardAlarm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// end of user code
|
||||||
|
udelete payloadLength-1
|
||||||
|
bufferPos=0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// next character
|
// next character
|
||||||
bufferPos++
|
bufferPos++
|
||||||
}
|
}
|
||||||
if(bufferPos==usize)
|
|
||||||
{
|
|
||||||
// copy whole buffer to t1.txt, for debugging
|
|
||||||
//ucopy t2.txt,0,usize,0
|
|
||||||
// ucopy n2.val,0,usize,0
|
|
||||||
// clear whole buffer
|
|
||||||
//code_c
|
|
||||||
//bufferPos=0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TouchCap tc0
|
TouchCap tc0
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ Button b2
|
|||||||
Touch Press Event
|
Touch Press Event
|
||||||
sleepTimeout=vaOldSleepT.val
|
sleepTimeout=vaOldSleepT.val
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,D,"+entn.txt+",1,notifyAction,yes"
|
tSend.txt="event,buttonPress2,"+entn.txt+",notifyAction,yes"
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -381,7 +381,7 @@ Button b1
|
|||||||
Touch Press Event
|
Touch Press Event
|
||||||
sleepTimeout=vaOldSleepT.val
|
sleepTimeout=vaOldSleepT.val
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,D,"+entn.txt+",1,notifyAction,no"
|
tSend.txt="event,buttonPress2,"+entn.txt+",notifyAction,no"
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -411,6 +411,7 @@ Timer tmSleep
|
|||||||
screensaver.originPage.val=dp
|
screensaver.originPage.val=dp
|
||||||
sleepValue=0
|
sleepValue=0
|
||||||
click b0,1
|
click b0,1
|
||||||
|
click b0,0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -313,12 +313,9 @@ Slider hPosition
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Release Event
|
Touch Release Event
|
||||||
// event,buttonPress,D,nameEntity,internalNameEntity,1,positionSlider,50
|
// event,buttonPress2,internalNameEntity,positionSlider,50
|
||||||
//craft command
|
//craft command
|
||||||
tSend.txt="event,buttonPress,D,"
|
tSend.txt="event,buttonPress2,"+entn.txt+",positionSlider,"
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,positionSlider,"
|
|
||||||
covx hPosition.val,tTmp.txt,0,0
|
covx hPosition.val,tTmp.txt,0,0
|
||||||
tSend.txt+=tTmp.txt
|
tSend.txt+=tTmp.txt
|
||||||
//send calc crc
|
//send calc crc
|
||||||
@@ -419,14 +416,7 @@ Button bDown1
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn.txt+",down"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,down"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -473,14 +463,7 @@ Button bStop1
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn.txt+",stop"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,stop"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -527,14 +510,7 @@ Button bUp1
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
// event,1,tHeading,tEntityName,1,up
|
tSend.txt="event,buttonPress2,"+entn.txt+",up"
|
||||||
//craft command
|
|
||||||
// convert pageNumber and write to tTmp
|
|
||||||
covx nPage,tTmp.txt,0,0
|
|
||||||
tSend.txt="event,buttonPress,"+tTmp.txt+","
|
|
||||||
tSend.txt+=tEntity.txt+","
|
|
||||||
tSend.txt+=entn.txt+","
|
|
||||||
tSend.txt+="1,up"
|
|
||||||
//send calc crc
|
//send calc crc
|
||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
@@ -564,6 +540,7 @@ Timer tmSleep
|
|||||||
screensaver.originPage.val=dp
|
screensaver.originPage.val=dp
|
||||||
sleepValue=0
|
sleepValue=0
|
||||||
click b0,1
|
click b0,1
|
||||||
|
click b0,0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
20
README.md
20
README.md
@@ -9,7 +9,7 @@ NsPanel Lovelace UI is a Firmware for the nextion screen inside of NSPanel in th
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Entities Page with support for cover, switch, input_boolean, sensor, button, scenes, input_button and light
|
- Entities Page with support for cover, switch, input_boolean, binary_sensor, sensor, button, scenes, input_button and light
|
||||||
- Grid Page with support for cover, switch, input_boolean, button, scenes, and light
|
- Grid Page with support for cover, switch, input_boolean, button, scenes, and light
|
||||||
- Detail Pages for Lights (Brightness, Temperature and Color of the Light) and for Covers (Position)
|
- Detail Pages for Lights (Brightness, Temperature and Color of the Light) and for Covers (Position)
|
||||||
- Thermostat Page
|
- Thermostat Page
|
||||||
@@ -309,6 +309,24 @@ key | optional | type | default | description
|
|||||||
`class` | False | string | | The name of the Class.
|
`class` | False | string | | The name of the Class.
|
||||||
`config` | False | complex | | Config/Mapping between Homeassistant and your NsPanel
|
`config` | False | complex | | Config/Mapping between Homeassistant and your NsPanel
|
||||||
|
|
||||||
|
### Override Icons
|
||||||
|
|
||||||
|
To override Icons of entities you can configure an icon name in your configuration, please see the following example.
|
||||||
|
Only the icons listed in the [Icon Table](HMI#icons-ids) are useable.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- type: cardGrid
|
||||||
|
heading: Lights
|
||||||
|
items:
|
||||||
|
- light.wled
|
||||||
|
- light.schreibtischlampe
|
||||||
|
- switch.deckenbeleuchtung_hinten:
|
||||||
|
icon: lightbulb
|
||||||
|
- delete
|
||||||
|
- delete
|
||||||
|
- type: cardMedia
|
||||||
|
```
|
||||||
|
|
||||||
## How to update
|
## How to update
|
||||||
|
|
||||||
Updating involves mainly already descriped steps from installation, so this is a short summary.
|
Updating involves mainly already descriped steps from installation, so this is a short summary.
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ icons = {
|
|||||||
'battery-charging-medium': 33,
|
'battery-charging-medium': 33,
|
||||||
'battery-medium': 34,
|
'battery-medium': 34,
|
||||||
'shield-home': 35,
|
'shield-home': 35,
|
||||||
|
'door-open': 36,
|
||||||
|
'door-closed': 37,
|
||||||
|
'window-closed': 38,
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_icon_id(ma_name):
|
def get_icon_id(ma_name):
|
||||||
64
apps/nspanel-lovelace-ui/icons.py
Normal file
64
apps/nspanel-lovelace-ui/icons.py
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
from icon_mapping import get_icon_id
|
||||||
|
|
||||||
|
weather_mapping = {
|
||||||
|
'clear-night': 'weather-night',
|
||||||
|
'cloudy': 'weather-cloudy',
|
||||||
|
'exceptional': 'alert-circle-outline',
|
||||||
|
'fog': 'weather-fog',
|
||||||
|
'hail': 'weather-hail',
|
||||||
|
'lightning': 'weather-lightning',
|
||||||
|
'lightning-rainy': 'weather-lightning-rainy',
|
||||||
|
'partlycloudy': 'weather-partly-cloudy',
|
||||||
|
'pouring': 'weather-pouring',
|
||||||
|
'rainy': 'weather-rainy',
|
||||||
|
'snowy': 'weather-snowy',
|
||||||
|
'snowy-rainy': 'weather-snowy-rainy',
|
||||||
|
'sunny': 'weather-sunny',
|
||||||
|
'windy': 'weather-windy',
|
||||||
|
'windy-variant': 'weather-windy-variant'
|
||||||
|
}
|
||||||
|
|
||||||
|
sensor_mapping_on = {
|
||||||
|
"door": "door-open",
|
||||||
|
}
|
||||||
|
|
||||||
|
sensor_mapping_off = {
|
||||||
|
"door": "door-closed",
|
||||||
|
}
|
||||||
|
|
||||||
|
sensor_mapping = {
|
||||||
|
"temperature": "thermometer",
|
||||||
|
"power": "flash"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def map_to_mdi_name(ha_type, state=None, device_class=None):
|
||||||
|
if ha_type == "weather":
|
||||||
|
return weather_mapping[state] if state in weather_mapping else "alert-circle-outline"
|
||||||
|
if ha_type == "button":
|
||||||
|
return "gesture-tap-button"
|
||||||
|
if ha_type == "scene":
|
||||||
|
return "palette"
|
||||||
|
if ha_type == "switch":
|
||||||
|
return "flash"
|
||||||
|
if ha_type == "light":
|
||||||
|
return "lightbulb"
|
||||||
|
if ha_type == "input_boolean":
|
||||||
|
return "check-circle-outline" if state == "on" else "close-circle-outline"
|
||||||
|
if ha_type == "cover":
|
||||||
|
return "window-open" if state == "open" else "window-closed"
|
||||||
|
|
||||||
|
elif ha_type == "sensor":
|
||||||
|
if state == "on":
|
||||||
|
return sensor_mapping_on[device_class] if device_class in sensor_mapping_on else "alert-circle-outline"
|
||||||
|
elif state == "off":
|
||||||
|
return sensor_mapping_off[device_class] if device_class in sensor_mapping_off else "alert-circle-outline"
|
||||||
|
else:
|
||||||
|
return sensor_mapping[device_class] if device_class in sensor_mapping else "alert-circle-outline"
|
||||||
|
|
||||||
|
return "alert-circle-outline"
|
||||||
|
|
||||||
|
def get_icon_id_ha(ha_name, state=None, device_class=None, overwrite=None):
|
||||||
|
if overwrite is not None:
|
||||||
|
return get_icon_id(overwrite)
|
||||||
|
return get_icon_id(map_to_mdi_name(ha_name, state, device_class))
|
||||||
@@ -2,8 +2,8 @@ import json
|
|||||||
import datetime
|
import datetime
|
||||||
import hassapi as hass
|
import hassapi as hass
|
||||||
from helper import scale, pos_to_color, rgb_dec565, rgb_brightness
|
from helper import scale, pos_to_color, rgb_dec565, rgb_brightness
|
||||||
from icon_mapper import get_icon_id
|
from icon_mapping import get_icon_id
|
||||||
|
from icons import get_icon_id_ha
|
||||||
# check Babel
|
# check Babel
|
||||||
import importlib
|
import importlib
|
||||||
babel_spec = importlib.util.find_spec("babel")
|
babel_spec = importlib.util.find_spec("babel")
|
||||||
@@ -14,12 +14,12 @@ class NsPanelLovelaceUIManager(hass.Hass):
|
|||||||
def initialize(self):
|
def initialize(self):
|
||||||
|
|
||||||
data = self.args["config"]
|
data = self.args["config"]
|
||||||
NsPanelLovelaceUI(self, data)
|
LovelaceUIPanel(self, data)
|
||||||
|
|
||||||
class Updater:
|
class Updater:
|
||||||
def __init__(self, nsplui, mode):
|
def __init__(self, nsplui, mode):
|
||||||
self.desired_display_firmware_version = 15
|
self.desired_display_firmware_version = 16
|
||||||
self.desired_display_firmware_url = "http://nspanel.pky.eu/lovelace-ui/github/nspanel-1f7a3d5.tft"
|
self.desired_display_firmware_url = "http://nspanel.pky.eu/lovelace-ui/github/nspanel-v1.7.0.tft"
|
||||||
self.desired_tasmota_driver_version = 3
|
self.desired_tasmota_driver_version = 3
|
||||||
self.desired_tasmota_driver_url = "https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be"
|
self.desired_tasmota_driver_url = "https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be"
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ class Updater:
|
|||||||
def update_panel_driver(self):
|
def update_panel_driver(self):
|
||||||
self.nsplui.mqtt.mqtt_publish(self.nsplui.config["panelSendTopic"].replace("CustomSend", "FlashNextion"), self.desired_display_firmware_url)
|
self.nsplui.mqtt.mqtt_publish(self.nsplui.config["panelSendTopic"].replace("CustomSend", "FlashNextion"), self.desired_display_firmware_url)
|
||||||
|
|
||||||
class NsPanelLovelaceUI:
|
class LovelaceUIPanel:
|
||||||
def __init__(self, api, config):
|
def __init__(self, api, config):
|
||||||
self.api = api
|
self.api = api
|
||||||
self.config = config
|
self.config = config
|
||||||
@@ -93,13 +93,10 @@ class NsPanelLovelaceUI:
|
|||||||
self.mqtt.mqtt_subscribe(topic=self.config["panelRecvTopic"])
|
self.mqtt.mqtt_subscribe(topic=self.config["panelRecvTopic"])
|
||||||
self.mqtt.listen_event(self.handle_mqtt_incoming_message, "MQTT_MESSAGE", topic=self.config["panelRecvTopic"], namespace='mqtt')
|
self.mqtt.listen_event(self.handle_mqtt_incoming_message, "MQTT_MESSAGE", topic=self.config["panelRecvTopic"], namespace='mqtt')
|
||||||
|
|
||||||
if "updateMode" in self.config:
|
# Read updateMode and use "auto-notify" as default
|
||||||
update_mode = self.config["updateMode"]
|
update_mode = self.config["updateMode"] if "updateMode" in self.config else "auto-notify"
|
||||||
else:
|
|
||||||
update_mode = "auto-notify"
|
|
||||||
self.updater = Updater(self, update_mode)
|
self.updater = Updater(self, update_mode)
|
||||||
|
|
||||||
|
|
||||||
# Request Tasmota Driver Version
|
# Request Tasmota Driver Version
|
||||||
self.mqtt.mqtt_publish(self.config["panelSendTopic"].replace("CustomSend", "GetDriverVersion"), "x")
|
self.mqtt.mqtt_publish(self.config["panelSendTopic"].replace("CustomSend", "GetDriverVersion"), "x")
|
||||||
|
|
||||||
@@ -134,12 +131,80 @@ class NsPanelLovelaceUI:
|
|||||||
self.current_screensaver_brightness = sorted_timesets[index-1]["value"]
|
self.current_screensaver_brightness = sorted_timesets[index-1]["value"]
|
||||||
self.api.log("Setting dim value to %s", sorted_timesets[index-1]) #level="DEBUG"
|
self.api.log("Setting dim value to %s", sorted_timesets[index-1]) #level="DEBUG"
|
||||||
found_current_dim_value = True
|
found_current_dim_value = True
|
||||||
|
# still no dim value
|
||||||
|
if not found_current_dim_value:
|
||||||
|
self.current_screensaver_brightness = sorted_timesets[-1]["value"]
|
||||||
# send screensaver brightness in case config has changed
|
# send screensaver brightness in case config has changed
|
||||||
self.update_screensaver_brightness(kwargs={"value": self.current_screensaver_brightness})
|
self.update_screensaver_brightness(kwargs={"value": self.current_screensaver_brightness})
|
||||||
|
|
||||||
# register callbacks
|
# register callbacks
|
||||||
self.register_callbacks()
|
self.register_callbacks()
|
||||||
|
|
||||||
|
def filter_dict_from_item_list(self, items):
|
||||||
|
# remove all dicts from list
|
||||||
|
cleaned_list = []
|
||||||
|
for item in items:
|
||||||
|
# in case item is a dict, grab the item name
|
||||||
|
if type(item) is dict:
|
||||||
|
cleaned_list.append(next(iter(item)))
|
||||||
|
else:
|
||||||
|
cleaned_list.append(item)
|
||||||
|
return cleaned_list
|
||||||
|
|
||||||
|
def get_all_configured_items(self):
|
||||||
|
items = []
|
||||||
|
for page in self.config["pages"]:
|
||||||
|
if "item" in page:
|
||||||
|
items.append(page["item"])
|
||||||
|
if "items" in page:
|
||||||
|
items.extend(page["items"])
|
||||||
|
return self.filter_dict_from_item_list(items)
|
||||||
|
|
||||||
|
def check_items(self):
|
||||||
|
items = self.get_all_configured_items()
|
||||||
|
for item in items:
|
||||||
|
if self.api.entity_exists(item) or item == "delete":
|
||||||
|
self.api.log("Found configured item in Home Assistant %s", item, level="DEBUG")
|
||||||
|
else:
|
||||||
|
self.api.error("The following item does not exist in Home Assistant, configuration error: %s", item)
|
||||||
|
|
||||||
|
def register_callbacks(self):
|
||||||
|
items = self.get_all_configured_items()
|
||||||
|
for item in items:
|
||||||
|
self.api.log("Enable state callback for %s", item, level="DEBUG")
|
||||||
|
self.api.handle = self.api.listen_state(self.state_change_callback, entity_id=item, attribute="all")
|
||||||
|
|
||||||
|
def state_change_callback(self, entity, attribute, old, new, kwargs):
|
||||||
|
current_page_config = self.config["pages"][self.current_page_nr]
|
||||||
|
page_type = current_page_config["type"]
|
||||||
|
self.api.log(f"Got state_callback from {entity}", level="DEBUG")
|
||||||
|
|
||||||
|
if page_type in ["cardEntities", "cardGrid"]:
|
||||||
|
items = current_page_config["items"]
|
||||||
|
items_filtered = self.filter_dict_from_item_list(items)
|
||||||
|
if entity in items_filtered:
|
||||||
|
self.api.log(f"State change on current page for {entity}", level="DEBUG")
|
||||||
|
# send update of the page
|
||||||
|
self.generate_entities_page(items)
|
||||||
|
# send detail pages in case they are open
|
||||||
|
if(entity.startswith("cover")):
|
||||||
|
self.generate_shutter_detail_page(entity)
|
||||||
|
if(entity.startswith("light")):
|
||||||
|
self.generate_light_detail_page(entity)
|
||||||
|
return
|
||||||
|
|
||||||
|
if page_type in ["cardThermo", "cardMedia"]:
|
||||||
|
if entity == current_page_config["item"]:
|
||||||
|
self.api.log(f"State change on current page for {entity}", level="DEBUG")
|
||||||
|
# send update of the whole page
|
||||||
|
if page_type == "cardThermo":
|
||||||
|
self.generate_thermo_page(entity)
|
||||||
|
return
|
||||||
|
if page_type == "cardMedia":
|
||||||
|
self.generate_media_page(entity)
|
||||||
|
return
|
||||||
|
return
|
||||||
|
|
||||||
def send_mqtt_msg(self,msg):
|
def send_mqtt_msg(self,msg):
|
||||||
self.api.log("Send Message to Tasmota: %s", msg) #, level="DEBUG"
|
self.api.log("Send Message to Tasmota: %s", msg) #, level="DEBUG"
|
||||||
self.mqtt.mqtt_publish(self.config["panelSendTopic"], msg)
|
self.mqtt.mqtt_publish(self.config["panelSendTopic"], msg)
|
||||||
@@ -164,27 +229,20 @@ class NsPanelLovelaceUI:
|
|||||||
|
|
||||||
# run action based on received command
|
# run action based on received command
|
||||||
if msg[0] == "event":
|
if msg[0] == "event":
|
||||||
|
|
||||||
if msg[1] == "startup":
|
if msg[1] == "startup":
|
||||||
self.api.log("Handling startup event", level="DEBUG")
|
self.api.log("Handling startup event", level="DEBUG")
|
||||||
|
|
||||||
# grab version from screen and pass to updater class
|
# grab version from screen and pass to updater class
|
||||||
self.updater.set_current_display_firmware_version(int(msg[2]))
|
self.updater.set_current_display_firmware_version(int(msg[2]))
|
||||||
|
|
||||||
# send date and time
|
# send date and time
|
||||||
self.update_time("")
|
self.update_time("")
|
||||||
self.update_date("")
|
self.update_date("")
|
||||||
|
|
||||||
# set screensaver timeout
|
# set screensaver timeout
|
||||||
timeout = self.config["timeoutScreensaver"]
|
timeout = self.config["timeoutScreensaver"]
|
||||||
self.send_mqtt_msg(f"timeout,{timeout}")
|
self.send_mqtt_msg(f"timeout,{timeout}")
|
||||||
|
|
||||||
# send screensaver brightness
|
# send screensaver brightness
|
||||||
self.update_screensaver_brightness(kwargs={"value": self.current_screensaver_brightness})
|
self.update_screensaver_brightness(kwargs={"value": self.current_screensaver_brightness})
|
||||||
|
|
||||||
# check for updates
|
# check for updates
|
||||||
msg_send = self.updater.check_updates()
|
msg_send = self.updater.check_updates()
|
||||||
|
|
||||||
# send messages for current page
|
# send messages for current page
|
||||||
if not msg_send:
|
if not msg_send:
|
||||||
self.generate_page(self.current_page_nr)
|
self.generate_page(self.current_page_nr)
|
||||||
@@ -205,6 +263,7 @@ class NsPanelLovelaceUI:
|
|||||||
else:
|
else:
|
||||||
value = None
|
value = None
|
||||||
self.handle_button_press(entity_id, btype, value)
|
self.handle_button_press(entity_id, btype, value)
|
||||||
|
|
||||||
if msg[1] == "buttonPress2":
|
if msg[1] == "buttonPress2":
|
||||||
entity_id = msg[2]
|
entity_id = msg[2]
|
||||||
btype = msg[3]
|
btype = msg[3]
|
||||||
@@ -216,12 +275,10 @@ class NsPanelLovelaceUI:
|
|||||||
|
|
||||||
if msg[1] == "pageOpenDetail":
|
if msg[1] == "pageOpenDetail":
|
||||||
self.api.log("Received pageOpenDetail command", level="DEBUG")
|
self.api.log("Received pageOpenDetail command", level="DEBUG")
|
||||||
self.generate_detail_page(msg[2], msg[3])
|
if msg[2] == "popupShutter":
|
||||||
|
self.generate_shutter_detail_page(msg[3])
|
||||||
if msg[1] == "tempUpd":
|
if msg[2] == "popupLight":
|
||||||
self.api.log("Received tempUpd command", level="DEBUG")
|
self.generate_light_detail_page(msg[3])
|
||||||
temp = int(msg[4])/10
|
|
||||||
self.api.get_entity(msg[3]).call_service("set_temperature", temperature=temp)
|
|
||||||
|
|
||||||
if msg[1] == "screensaverOpen":
|
if msg[1] == "screensaverOpen":
|
||||||
self.update_screensaver_weather("")
|
self.update_screensaver_weather("")
|
||||||
@@ -255,48 +312,33 @@ class NsPanelLovelaceUI:
|
|||||||
we = self.api.get_entity(self.config["weatherEntity"])
|
we = self.api.get_entity(self.config["weatherEntity"])
|
||||||
unit = "°C"
|
unit = "°C"
|
||||||
|
|
||||||
# this maps possible states from ha to material design icon names
|
icon_cur = get_icon_id_ha("weather", state=we.state)
|
||||||
weathericons = {
|
text_cur = f"{we.attributes.temperature}{unit}"
|
||||||
'clear-night': 'weather-night',
|
icon_cur_detail = get_icon_id("water-percent")
|
||||||
'cloudy': 'weather-cloudy',
|
text_cur_detail = f"{we.attributes.humidity} %"
|
||||||
'exceptional': 'alert-circle-outline',
|
|
||||||
'fog': 'weather-fog',
|
|
||||||
'hail': 'weather-hail',
|
|
||||||
'lightning': 'weather-lightning',
|
|
||||||
'lightning-rainy': 'weather-lightning-rainy',
|
|
||||||
'partlycloudy': 'weather-partly-cloudy',
|
|
||||||
'pouring': 'weather-pouring',
|
|
||||||
'rainy': 'weather-rainy',
|
|
||||||
'snowy': 'weather-snowy',
|
|
||||||
'snowy-rainy': 'weather-snowy-rainy',
|
|
||||||
'sunny': 'weather-sunny',
|
|
||||||
'windy': 'weather-windy',
|
|
||||||
'windy-variant': 'weather-windy-variant'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
up1 = we.attributes.forecast[0]['datetime']
|
||||||
|
up1 = datetime.datetime.fromisoformat(up1)
|
||||||
|
icon1 = get_icon_id_ha("weather", state=we.attributes.forecast[0]['condition'])
|
||||||
|
down1 = we.attributes.forecast[0]['temperature']
|
||||||
|
|
||||||
i1 = get_icon_id(weathericons[we.attributes.forecast[0]['condition']])
|
up2 = we.attributes.forecast[1]['datetime']
|
||||||
u1 = we.attributes.forecast[0]['temperature']
|
up2 = datetime.datetime.fromisoformat(up2)
|
||||||
i2 = get_icon_id(weathericons[we.attributes.forecast[1]['condition']])
|
icon2 = get_icon_id_ha("weather", state=we.attributes.forecast[1]['condition'])
|
||||||
u2 = we.attributes.forecast[1]['temperature']
|
down2 = we.attributes.forecast[1]['temperature']
|
||||||
|
|
||||||
o1 = we.attributes.forecast[0]['datetime']
|
|
||||||
o1 = datetime.datetime.fromisoformat(o1)
|
|
||||||
o2 = we.attributes.forecast[1]['datetime']
|
|
||||||
o2 = datetime.datetime.fromisoformat(o2)
|
|
||||||
global babel_spec
|
global babel_spec
|
||||||
if babel_spec is not None:
|
if babel_spec is not None:
|
||||||
o1 = babel.dates.format_date(o1, "E", locale=self.config["locale"])
|
up1 = babel.dates.format_date(up1, "E", locale=self.config["locale"])
|
||||||
o2 = babel.dates.format_date(o2, "E", locale=self.config["locale"])
|
up2 = babel.dates.format_date(up2, "E", locale=self.config["locale"])
|
||||||
else:
|
else:
|
||||||
o1 = o1.strftime("%a")
|
up1 = up1.strftime("%a")
|
||||||
o2 = o2.strftime("%a")
|
up2 = up2.strftime("%a")
|
||||||
|
|
||||||
self.send_mqtt_msg(f"weatherUpdate,?{get_icon_id(weathericons[we.state])}?{we.attributes.temperature}{unit}?{26}?{we.attributes.humidity} %?{o1}?{i1}?{u1}?{o2}?{i2}?{u2}")
|
self.send_mqtt_msg(f"weatherUpdate,?{icon_cur}?{text_cur}?{icon_cur_detail}?{text_cur_detail}?{up1}?{icon1}?{down1}?{up2}?{icon2}?{down2}")
|
||||||
|
|
||||||
|
|
||||||
def handle_button_press(self, entity_id, btype, optVal=None):
|
def handle_button_press(self, entity_id, btype, optVal=None):
|
||||||
|
|
||||||
if entity_id == "updateBerryNoYes" and optVal == "yes":
|
if entity_id == "updateBerryNoYes" and optVal == "yes":
|
||||||
# go back to main page before starting the update
|
# go back to main page before starting the update
|
||||||
self.generate_page(self.current_page_nr)
|
self.generate_page(self.current_page_nr)
|
||||||
@@ -324,7 +366,7 @@ class NsPanelLovelaceUI:
|
|||||||
if btype == "button":
|
if btype == "button":
|
||||||
if entity_id.startswith('scene'):
|
if entity_id.startswith('scene'):
|
||||||
self.api.get_entity(entity_id).call_service("turn_on")
|
self.api.get_entity(entity_id).call_service("turn_on")
|
||||||
if entity_id.startswith('light') or entity_id.startswith('switch'):
|
elif entity_id.startswith('light') or entity_id.startswith('switch') or entity_id.startswith('input_boolean'):
|
||||||
self.api.get_entity(entity_id).call_service("toggle")
|
self.api.get_entity(entity_id).call_service("toggle")
|
||||||
else:
|
else:
|
||||||
self.api.get_entity(entity_id).call_service("press")
|
self.api.get_entity(entity_id).call_service("press")
|
||||||
@@ -368,102 +410,32 @@ class NsPanelLovelaceUI:
|
|||||||
pos = pos/100
|
pos = pos/100
|
||||||
self.api.get_entity(entity_id).call_service("volume_set", volume_level=pos)
|
self.api.get_entity(entity_id).call_service("volume_set", volume_level=pos)
|
||||||
|
|
||||||
def check_items(self):
|
if btype == "tempUpd":
|
||||||
items = []
|
temp = int(optVal)/10
|
||||||
for page in self.config["pages"]:
|
self.api.get_entity(msg[3]).call_service("set_temperature", temperature=temp)
|
||||||
if "item" in page:
|
|
||||||
items.append(page["item"])
|
|
||||||
if "items" in page:
|
|
||||||
items.extend(page["items"])
|
|
||||||
|
|
||||||
for item in items:
|
|
||||||
if self.api.entity_exists(item) or item == "delete":
|
|
||||||
self.api.log("Found configured item in Home Assistant %s", item, level="DEBUG")
|
|
||||||
else:
|
|
||||||
self.api.error("The following item does not exist in Home Assistant, configuration error: %s", item)
|
|
||||||
|
|
||||||
def register_callbacks(self):
|
|
||||||
items = []
|
|
||||||
for page in self.config["pages"]:
|
|
||||||
if "item" in page:
|
|
||||||
items.append(page["item"])
|
|
||||||
if "items" in page:
|
|
||||||
items.extend(page["items"])
|
|
||||||
|
|
||||||
for item in items:
|
|
||||||
if not self.api.entity_exists(item):
|
|
||||||
continue
|
|
||||||
self.api.log("Enable state callback for %s", item, level="DEBUG")
|
|
||||||
self.api.handle = self.api.listen_state(self.state_change_callback, entity_id=item, attribute="all")
|
|
||||||
|
|
||||||
def state_change_callback(self, entity, attribute, old, new, kwargs):
|
|
||||||
current_page_config = self.config["pages"][self.current_page_nr]
|
|
||||||
|
|
||||||
page_type = current_page_config["type"]
|
|
||||||
|
|
||||||
self.api.log(f"Got state_callback from {entity}", level="DEBUG")
|
|
||||||
|
|
||||||
if page_type in ["cardEntities", "cardGrid"]:
|
|
||||||
items = current_page_config["items"]
|
|
||||||
if entity in items:
|
|
||||||
self.api.log(f"State change on current page for {entity}", level="DEBUG")
|
|
||||||
# send update of the page
|
|
||||||
command = self.generate_entities_page(items)
|
|
||||||
self.send_mqtt_msg(command)
|
|
||||||
if(entity.startswith("cover")):
|
|
||||||
self.generate_detail_page("popupShutter", entity)
|
|
||||||
if(entity.startswith("light")):
|
|
||||||
self.generate_detail_page("popupLight", entity)
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
if page_type == "cardThermo" or page_type == "cardMedia":
|
|
||||||
if entity == current_page_config["item"]:
|
|
||||||
self.api.log(f"State change on current page for {entity}", level="DEBUG")
|
|
||||||
# send update of the whole page
|
|
||||||
if page_type == "cardThermo":
|
|
||||||
self.send_mqtt_msg(self.generate_thermo_page(entity))
|
|
||||||
return
|
|
||||||
if page_type == "cardMedia":
|
|
||||||
self.send_mqtt_msg(self.generate_media_page(entity))
|
|
||||||
return
|
|
||||||
return
|
|
||||||
|
|
||||||
def generate_page(self, page_number):
|
def generate_page(self, page_number):
|
||||||
# get type of current page
|
# get type of page
|
||||||
page_type = self.config["pages"][self.current_page_nr]["type"]
|
page_type = self.config["pages"][self.current_page_nr]["type"]
|
||||||
self.api.log("Generating page commands for page %i with type %s", self.current_page_nr, page_type, level="DEBUG")
|
self.api.log("Generating page commands for page %i with type %s", self.current_page_nr, page_type, level="DEBUG")
|
||||||
if page_type == "cardEntities":
|
|
||||||
# Send page type
|
# Send page type
|
||||||
self.send_mqtt_msg(f"pageType,{page_type}")
|
self.send_mqtt_msg(f"pageType,{page_type}")
|
||||||
# Set Heading of Page
|
|
||||||
self.send_mqtt_msg(f"entityUpdHeading,{self.config['pages'][self.current_page_nr]['heading']}")
|
|
||||||
|
|
||||||
command = self.generate_entities_page(self.config["pages"][self.current_page_nr]["items"])
|
if page_type in ["cardEntities", "cardGrid"]:
|
||||||
self.send_mqtt_msg(command)
|
self.generate_entities_page(self.config["pages"][self.current_page_nr]["items"])
|
||||||
|
|
||||||
if page_type == "cardGrid":
|
|
||||||
# Send page type
|
|
||||||
self.send_mqtt_msg(f"pageType,{page_type}")
|
|
||||||
# Set Heading of Page
|
|
||||||
self.send_mqtt_msg(f"entityUpdHeading,{self.config['pages'][self.current_page_nr]['heading']}")
|
|
||||||
|
|
||||||
command = self.generate_entities_page(self.config["pages"][self.current_page_nr]["items"])
|
|
||||||
self.send_mqtt_msg(command)
|
|
||||||
|
|
||||||
if page_type == "cardThermo":
|
if page_type == "cardThermo":
|
||||||
# Send page type
|
self.generate_thermo_page(self.config["pages"][self.current_page_nr]["item"])
|
||||||
self.send_mqtt_msg(f"pageType,{page_type}")
|
|
||||||
command = self.generate_thermo_page(self.config["pages"][self.current_page_nr]["item"])
|
|
||||||
self.send_mqtt_msg(command)
|
|
||||||
|
|
||||||
if page_type == "cardMedia":
|
if page_type == "cardMedia":
|
||||||
# Send page type
|
self.generate_media_page(self.config["pages"][self.current_page_nr]["item"])
|
||||||
self.send_mqtt_msg("pageType,{0}".format(page_type))
|
|
||||||
command = self.generate_media_page(self.config["pages"][self.current_page_nr]["item"])
|
|
||||||
self.send_mqtt_msg(command)
|
|
||||||
|
|
||||||
def generate_entities_item(self, item):
|
def generate_entities_item(self, item):
|
||||||
|
icon = None
|
||||||
|
if type(item) is dict:
|
||||||
|
icon = next(iter(item.items()))[1]['icon']
|
||||||
|
item = next(iter(item.items()))[0]
|
||||||
|
|
||||||
# type of the item is the string before the "." in the item name
|
# type of the item is the string before the "." in the item name
|
||||||
item_type = item.split(".")[0]
|
item_type = item.split(".")[0]
|
||||||
@@ -480,65 +452,52 @@ class NsPanelLovelaceUI:
|
|||||||
name = entity.attributes.friendly_name
|
name = entity.attributes.friendly_name
|
||||||
|
|
||||||
if item_type == "cover":
|
if item_type == "cover":
|
||||||
return f",shutter,{item},{get_icon_id('window-open')},17299,{name},"
|
icon_id = get_icon_id_ha("cover", state=entity.state, overwrite=icon)
|
||||||
|
return f",shutter,{item},{icon_id},17299,{name},"
|
||||||
|
|
||||||
if item_type == "light":
|
if item_type == "light":
|
||||||
switch_val = 1 if entity.state == "on" else 0
|
switch_val = 1 if entity.state == "on" else 0
|
||||||
icon_color = self.getEntityColor(entity)
|
icon_color = self.getEntityColor(entity)
|
||||||
return f",{item_type},{item},{get_icon_id('lightbulb')},{icon_color},{name},{switch_val}"
|
icon_id = get_icon_id_ha("light", overwrite=icon)
|
||||||
|
return f",{item_type},{item},{icon_id},{icon_color},{name},{switch_val}"
|
||||||
|
|
||||||
if item_type == "switch" or item_type == "input_boolean":
|
if item_type == "switch" or item_type == "input_boolean":
|
||||||
|
icon_id = get_icon_id_ha(item_type, state=entity.state, overwrite=icon)
|
||||||
switch_val = 1 if entity.state == "on" else 0
|
switch_val = 1 if entity.state == "on" else 0
|
||||||
icon_id = get_icon_id("flash")
|
|
||||||
icon_color = self.getEntityColor(entity)
|
icon_color = self.getEntityColor(entity)
|
||||||
if item_type == "input_boolean":
|
|
||||||
if switch_val == 1:
|
|
||||||
icon_id = get_icon_id("check-circle-outline")
|
|
||||||
else:
|
|
||||||
icon_id = get_icon_id("close-circle-outline")
|
|
||||||
return f",switch,{item},{icon_id},{icon_color},{name},{switch_val}"
|
return f",switch,{item},{icon_id},{icon_color},{name},{switch_val}"
|
||||||
|
|
||||||
if item_type == "sensor":
|
if item_type in ["sensor", "binary_sensor"]:
|
||||||
# maps ha device classes to material design icons
|
device_class = self.get_safe_ha_attribute(entity.attributes, "device_class", "")
|
||||||
icon_mapping = {
|
icon_id = get_icon_id_ha("sensor", state=entity.state, device_class=device_class, overwrite=icon)
|
||||||
"temperature": "thermometer",
|
unit_of_measurement = self.get_safe_ha_attribute(entity.attributes, "unit_of_measurement", "")
|
||||||
"power": "flash"
|
|
||||||
}
|
|
||||||
if "device_class" in entity.attributes:
|
|
||||||
if entity.attributes.device_class in icon_mapping:
|
|
||||||
icon_id = icon_mapping[entity.attributes.device_class]
|
|
||||||
else:
|
|
||||||
self.api.log("No Icon found for device_class: %s. Please open a issue on github to report the missing mapping.", entity.attributes.device_class)
|
|
||||||
icon_id = get_icon_id('alert-circle-outline')
|
|
||||||
else:
|
|
||||||
icon_id = get_icon_id('alert-circle-outline')
|
|
||||||
unit_of_measurement = ""
|
|
||||||
if "unit_of_measurement" in entity.attributes:
|
|
||||||
unit_of_measurement = entity.attributes.unit_of_measurement
|
|
||||||
value = entity.state + " " + unit_of_measurement
|
value = entity.state + " " + unit_of_measurement
|
||||||
return f",text,{item},{icon_id},17299,{name},{value}"
|
return f",text,{item},{icon_id},17299,{name},{value}"
|
||||||
|
|
||||||
if item_type == "button" or item_type == "input_button":
|
if item_type in ["button", "input_button"]:
|
||||||
return f",button,{item},{get_icon_id('gesture-tap-button')},17299,{name},PRESS"
|
icon_id = get_icon_id_ha("button", overwrite=icon)
|
||||||
|
return f",button,{item},{icon_id},17299,{name},PRESS"
|
||||||
|
|
||||||
if item_type == "scene":
|
if item_type == "scene":
|
||||||
return f",button,{item},{get_icon_id('palette')},17299,{name},ACTIVATE"
|
icon_id = get_icon_id_ha("scene", overwrite=icon)
|
||||||
|
return f",button,{item},{icon_id},17299,{name},ACTIVATE"
|
||||||
|
|
||||||
def generate_entities_page(self, items):
|
def generate_entities_page(self, items):
|
||||||
|
# Set Heading of Page
|
||||||
|
self.send_mqtt_msg(f"entityUpdHeading,{self.config['pages'][self.current_page_nr]['heading']}")
|
||||||
# Get items and construct cmd string
|
# Get items and construct cmd string
|
||||||
command = "entityUpd"
|
command = "entityUpd"
|
||||||
for item in items:
|
for item in items:
|
||||||
command += self.generate_entities_item(item)
|
command += self.generate_entities_item(item)
|
||||||
return command
|
self.send_mqtt_msg(command)
|
||||||
|
|
||||||
def get_safe_ha_attribute(self, eattr, attr, default):
|
def get_safe_ha_attribute(self, eattr, attr, default):
|
||||||
return eattr[attr] if attr in eattr else default
|
return eattr[attr] if attr in eattr else default
|
||||||
|
|
||||||
def generate_thermo_page(self, item):
|
def generate_thermo_page(self, item):
|
||||||
|
|
||||||
if not self.api.entity_exists(item):
|
if not self.api.entity_exists(item):
|
||||||
return f"entityUpd,{item},Not found,220,220,Not found,150,300,5"
|
command = f"entityUpd,{item},Not found,220,220,Not found,150,300,5"
|
||||||
|
else:
|
||||||
entity = self.api.get_entity(item)
|
entity = self.api.get_entity(item)
|
||||||
heading = entity.attributes.friendly_name
|
heading = entity.attributes.friendly_name
|
||||||
current_temp = int(self.get_safe_ha_attribute(entity.attributes, "current_temperature", 0)*10)
|
current_temp = int(self.get_safe_ha_attribute(entity.attributes, "current_temperature", 0)*10)
|
||||||
@@ -562,7 +521,6 @@ class NsPanelLovelaceUI:
|
|||||||
if mode == "off":
|
if mode == "off":
|
||||||
icon_id = get_icon_id("power")
|
icon_id = get_icon_id("power")
|
||||||
color_on = 35921
|
color_on = 35921
|
||||||
|
|
||||||
if mode == "cool":
|
if mode == "cool":
|
||||||
icon_id = get_icon_id("snowflake")
|
icon_id = get_icon_id("snowflake")
|
||||||
color_on = 11487
|
color_on = 11487
|
||||||
@@ -572,11 +530,9 @@ class NsPanelLovelaceUI:
|
|||||||
if mode == "fan_only":
|
if mode == "fan_only":
|
||||||
icon_id = get_icon_id("fan")
|
icon_id = get_icon_id("fan")
|
||||||
color_on = 35921
|
color_on = 35921
|
||||||
|
|
||||||
state = 0
|
state = 0
|
||||||
if(mode == entity.state):
|
if(mode == entity.state):
|
||||||
state = 1
|
state = 1
|
||||||
|
|
||||||
icon_res += f",{icon_id},{color_on},{state},{mode}"
|
icon_res += f",{icon_id},{color_on},{state},{mode}"
|
||||||
|
|
||||||
len_hvac_modes = len(hvac_modes)
|
len_hvac_modes = len(hvac_modes)
|
||||||
@@ -592,36 +548,27 @@ class NsPanelLovelaceUI:
|
|||||||
icon_res = ","*4*padding_len + icon_res + ","*4*padding_len
|
icon_res = ","*4*padding_len + icon_res + ","*4*padding_len
|
||||||
# use first 5 icons
|
# use first 5 icons
|
||||||
icon_res = icon_res + ","*4*4
|
icon_res = icon_res + ","*4*4
|
||||||
|
command = f"entityUpd,{item},{heading},{current_temp},{dest_temp},{status},{min_temp},{max_temp},{step_temp}{icon_res}"
|
||||||
return f"entityUpd,{item},{heading},{current_temp},{dest_temp},{status},{min_temp},{max_temp},{step_temp}{icon_res}"
|
self.send_mqtt_msg(command)
|
||||||
|
|
||||||
def generate_media_page(self, item):
|
def generate_media_page(self, item):
|
||||||
|
|
||||||
if not self.api.entity_exists(item):
|
if not self.api.entity_exists(item):
|
||||||
return f"entityUpd,|{item}|Not found|{get_icon_id('alert-circle-outline')}|Please check your|apps.yaml in AppDaemon|50|11"
|
command = f"entityUpd,|{item}|Not found|{get_icon_id('alert-circle-outline')}|Please check your|apps.yaml in AppDaemon|50|11"
|
||||||
|
else:
|
||||||
entity = self.api.get_entity(item)
|
entity = self.api.get_entity(item)
|
||||||
heading = entity.attributes.friendly_name
|
heading = entity.attributes.friendly_name
|
||||||
icon = 0
|
icon = 0
|
||||||
title = ""
|
title = self.get_safe_ha_attribute(entity.attributes, "media_title", "")
|
||||||
author = ""
|
author = self.get_safe_ha_attribute(entity.attributes, "media_artist", "")
|
||||||
volume = 0
|
volume = int(self.get_safe_ha_attribute(entity.attributes, "volume_level", 0)*100)
|
||||||
|
iconplaypause = get_icon_id("pause") if entity.state == "playing" else get_icon_id("play")
|
||||||
if "media_content_type" in entity.attributes:
|
if "media_content_type" in entity.attributes:
|
||||||
if entity.attributes.media_content_type == "music":
|
if entity.attributes.media_content_type == "music":
|
||||||
icon = get_icon_id("music")
|
icon = get_icon_id("music")
|
||||||
if "media_title" in entity.attributes:
|
command = f"entityUpd,|{item}|{heading}|{icon}|{title}|{author}|{volume}|{iconplaypause}"
|
||||||
title = entity.attributes.media_title
|
|
||||||
if "media_artist" in entity.attributes:
|
|
||||||
author = entity.attributes.media_artist
|
|
||||||
if "volume_level" in entity.attributes:
|
|
||||||
volume = int(entity.attributes.volume_level*100)
|
|
||||||
|
|
||||||
if entity.state == "playing":
|
self.send_mqtt_msg(command)
|
||||||
iconplaypause = get_icon_id("pause")
|
|
||||||
else:
|
|
||||||
iconplaypause = get_icon_id("play")
|
|
||||||
|
|
||||||
return f"entityUpd,|{item}|{heading}|{icon}|{title}|{author}|{volume}|{iconplaypause}"
|
|
||||||
|
|
||||||
def getEntityColor(self, entity):
|
def getEntityColor(self, entity):
|
||||||
attr = entity.attributes
|
attr = entity.attributes
|
||||||
@@ -639,14 +586,10 @@ class NsPanelLovelaceUI:
|
|||||||
icon_color = rgb_dec565(color)
|
icon_color = rgb_dec565(color)
|
||||||
return icon_color
|
return icon_color
|
||||||
|
|
||||||
|
def generate_light_detail_page(self, entity):
|
||||||
def generate_detail_page(self, page_type, entity):
|
|
||||||
if page_type == "popupLight":
|
|
||||||
entity = self.api.get_entity(entity)
|
entity = self.api.get_entity(entity)
|
||||||
switch_val = 1 if entity.state == "on" else 0
|
switch_val = 1 if entity.state == "on" else 0
|
||||||
|
|
||||||
icon_color = self.getEntityColor(entity)
|
icon_color = self.getEntityColor(entity)
|
||||||
|
|
||||||
brightness = "disable"
|
brightness = "disable"
|
||||||
color_temp = "disable"
|
color_temp = "disable"
|
||||||
color = "disable"
|
color = "disable"
|
||||||
@@ -672,8 +615,8 @@ class NsPanelLovelaceUI:
|
|||||||
color = "disable"
|
color = "disable"
|
||||||
self.send_mqtt_msg(f"entityUpdateDetail,{get_icon_id('lightbulb')},{icon_color},{switch_val},{brightness},{color_temp},{color}")
|
self.send_mqtt_msg(f"entityUpdateDetail,{get_icon_id('lightbulb')},{icon_color},{switch_val},{brightness},{color_temp},{color}")
|
||||||
|
|
||||||
if page_type == "popupShutter":
|
def generate_shutter_detail_page(self, entity):
|
||||||
pos = self.api.get_entity(entity).attributes.current_position
|
pos = int(self.get_safe_ha_attribute(entity.attributes, "current_position", 50))
|
||||||
# reverse position for slider
|
# reverse position for slider
|
||||||
pos = 100-pos
|
pos = 100-pos
|
||||||
self.send_mqtt_msg(f"entityUpdateDetail,{pos}")
|
self.send_mqtt_msg(f"entityUpdateDetail,{pos}")
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 269 KiB |
@@ -1,101 +1,45 @@
|
|||||||
type RGB = {
|
|
||||||
red: number,
|
|
||||||
green: number,
|
|
||||||
blue: number
|
|
||||||
};
|
|
||||||
|
|
||||||
|
const Months = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"];
|
||||||
|
const Days = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"];
|
||||||
const Red: RGB = { red: 255, green: 0, blue: 0 };
|
const Red: RGB = { red: 255, green: 0, blue: 0 };
|
||||||
const White: RGB = { red: 255, green: 255, blue: 255 };
|
const White: RGB = { red: 255, green: 255, blue: 255 };
|
||||||
const Blue: RGB = { red: 68, green: 115, blue: 158 };
|
const Off: RGB = { red: 68, green: 115, blue: 158 };
|
||||||
|
const On: RGB = { red: 253, green: 216, blue: 53 };
|
||||||
|
const BatteryFull: RGB = { red: 96, green: 176, blue: 62 }
|
||||||
|
const BatteryEmpty: RGB = { red: 179, green: 45, blue: 25 }
|
||||||
|
|
||||||
type Payload = {
|
var Wohnen: PageEntities =
|
||||||
payload: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type Page = {
|
|
||||||
type: string,
|
|
||||||
heading: string
|
|
||||||
};
|
|
||||||
|
|
||||||
interface PageEntities extends Page {
|
|
||||||
type: "cardEntities",
|
|
||||||
items: PageItem[]
|
|
||||||
};
|
|
||||||
interface PageGrid extends Page {
|
|
||||||
type: "cardGrid",
|
|
||||||
items: PageItem[]
|
|
||||||
};
|
|
||||||
|
|
||||||
interface PageThermo extends Page {
|
|
||||||
type: "cardThermo",
|
|
||||||
item: PageItem
|
|
||||||
};
|
|
||||||
type Config = {
|
|
||||||
panelRecvTopic: string,
|
|
||||||
panelSendTopic: string,
|
|
||||||
timeoutScreensaver: number,
|
|
||||||
dimmode: number,
|
|
||||||
//brightnessScreensaver:
|
|
||||||
locale: string,
|
|
||||||
timeFormat: string,
|
|
||||||
dateFormat: string,
|
|
||||||
weatherEntity: string | null,
|
|
||||||
temperatureUnit: string,
|
|
||||||
leftEntity: string,
|
|
||||||
leftEntityIcon: number,
|
|
||||||
leftEntityText: string,
|
|
||||||
leftEntityUnitText: string | null,
|
|
||||||
rightEntity: string,
|
|
||||||
rightEntityIcon: number,
|
|
||||||
rightEntityText: string,
|
|
||||||
rightEntityUnitText: string | null,
|
|
||||||
defaultColor: RGB,
|
|
||||||
gridPageOnColor: RGB,
|
|
||||||
gridPageOffColor: RGB,
|
|
||||||
pages: (PageThermo | PageEntities | PageGrid)[],
|
|
||||||
button1Page: (PageThermo | PageEntities | PageGrid | null),
|
|
||||||
button2Page: (PageThermo | PageEntities | PageGrid | null),
|
|
||||||
};
|
|
||||||
|
|
||||||
type PageItem = {
|
|
||||||
id: string,
|
|
||||||
icon: (string | undefined),
|
|
||||||
onColor: (RGB | undefined),
|
|
||||||
offColor: (RGB | undefined),
|
|
||||||
useColor: (boolean | undefined)
|
|
||||||
}
|
|
||||||
var subscriptions: any = {};
|
|
||||||
|
|
||||||
var pageId = 0;
|
|
||||||
|
|
||||||
var page1: PageEntities =
|
|
||||||
{
|
{
|
||||||
"type": "cardEntities",
|
"type": "cardEntities",
|
||||||
"heading": "Haus",
|
"heading": "Haus",
|
||||||
|
"useColor": true,
|
||||||
"items": [
|
"items": [
|
||||||
<PageItem>{ id: "alias.0.Rolladen_Eltern" },
|
<PageItem>{ id: "alias.0.Stern"},
|
||||||
<PageItem>{ id: "alias.0.Erker" },
|
<PageItem>{ id: "alias.0.Erker"},
|
||||||
<PageItem>{ id: "alias.0.Küche", useColor: true },
|
<PageItem>{ id: "alias.0.Küche", interpolateColor: true },
|
||||||
<PageItem>{ id: "alias.0.Wand", useColor: true }
|
<PageItem>{ id: "alias.0.Wand" }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
var page2: PageEntities =
|
var Strom: PageEntities =
|
||||||
{
|
{
|
||||||
"type": "cardEntities",
|
"type": "cardEntities",
|
||||||
"heading": "Strom",
|
"heading": "Strom",
|
||||||
|
"useColor": true,
|
||||||
"items": [
|
"items": [
|
||||||
<PageItem>{ id: "alias.0.Netz" },
|
<PageItem>{ id: "alias.0.Netz", icon: 4, interpolateColor: true, offColor: BatteryFull, onColor: Red , minValue: -1000, maxValue: 1000 },
|
||||||
<PageItem>{ id: "alias.0.Hausverbrauch" },
|
<PageItem>{ id: "alias.0.Hausverbrauch", icon: 4, interpolateColor: true, offColor: BatteryFull, onColor: Red , maxValue: 1000 },
|
||||||
<PageItem>{ id: "alias.0.Pv" },
|
<PageItem>{ id: "alias.0.Pv", icon: 4, interpolateColor: true, offColor: Off, onColor: BatteryFull , maxValue: 1000 },
|
||||||
<PageItem>{ id: "alias.0.Batterie" }
|
<PageItem>{ id: "alias.0.Batterie", icon: 34, interpolateColor: true, offColor: BatteryEmpty, onColor: BatteryFull }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var button1Page: PageGrid =
|
var button1Page: PageGrid =
|
||||||
{
|
{
|
||||||
"type": "cardGrid",
|
"type": "cardGrid",
|
||||||
"heading": "Radio",
|
"heading": "Radio",
|
||||||
|
"useColor": true,
|
||||||
"items": [
|
"items": [
|
||||||
<PageItem>{ id: "alias.0.Radio.NJoy" },
|
<PageItem>{ id: "alias.0.Radio.NJoy" },
|
||||||
<PageItem>{ id: "alias.0.Radio.Delta_Radio" },
|
<PageItem>{ id: "alias.0.Radio.Delta_Radio" },
|
||||||
@@ -108,13 +52,14 @@ var button2Page: PageEntities =
|
|||||||
{
|
{
|
||||||
"type": "cardEntities",
|
"type": "cardEntities",
|
||||||
"heading": "Knopf2",
|
"heading": "Knopf2",
|
||||||
|
"useColor": true,
|
||||||
"items": [
|
"items": [
|
||||||
<PageItem>{ id: "alias.0.Schlafen" },
|
<PageItem>{ id: "alias.0.Schlafen" },
|
||||||
<PageItem>{ id: "alias.0.Stern" }
|
<PageItem>{ id: "alias.0.Stern" }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
var config: Config = {
|
export const config: Config = {
|
||||||
panelRecvTopic: "mqtt.0.tele.WzDisplay.RESULT",
|
panelRecvTopic: "mqtt.0.tele.WzDisplay.RESULT",
|
||||||
panelSendTopic: "mqtt.0.cmnd.WzDisplay.CustomSend",
|
panelSendTopic: "mqtt.0.cmnd.WzDisplay.CustomSend",
|
||||||
leftEntity: "alias.0.Batterie.ACTUAL",
|
leftEntity: "alias.0.Batterie.ACTUAL",
|
||||||
@@ -131,21 +76,28 @@ var config: Config = {
|
|||||||
timeFormat: "%H:%M",
|
timeFormat: "%H:%M",
|
||||||
dateFormat: "%A, %d. %B %Y",
|
dateFormat: "%A, %d. %B %Y",
|
||||||
weatherEntity: "alias.0.Wetter",
|
weatherEntity: "alias.0.Wetter",
|
||||||
gridPageOffColor: Blue,
|
defaultOffColor: Off,
|
||||||
gridPageOnColor: White,
|
defaultOnColor: On,
|
||||||
defaultColor: Blue,
|
defaultColor: Off,
|
||||||
temperatureUnit: "°C",
|
temperatureUnit: "°C",
|
||||||
pages: [page1, page2,
|
pages: [Wohnen, Strom,
|
||||||
{
|
{
|
||||||
"type": "cardThermo",
|
"type": "cardThermo",
|
||||||
"heading": "Thermostat",
|
"heading": "Thermostat",
|
||||||
"item": <PageItem>{ id: "alias.0.WzNsPanel" }
|
"useColor": true,
|
||||||
|
"items": [<PageItem>{ id: "alias.0.WzNsPanel" }]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
button1Page: button1Page,
|
button1Page: button1Page,
|
||||||
button2Page: button2Page
|
button2Page: button2Page
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var subscriptions: any = {};
|
||||||
|
|
||||||
|
var pageId = 0;
|
||||||
|
|
||||||
schedule("* * * * *", function () {
|
schedule("* * * * *", function () {
|
||||||
SendTime();
|
SendTime();
|
||||||
});
|
});
|
||||||
@@ -154,8 +106,6 @@ schedule("0 * * * *", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Only monitor the extra nodes if one or both are present
|
// Only monitor the extra nodes if one or both are present
|
||||||
var updateArray: string[] = [];
|
var updateArray: string[] = [];
|
||||||
if (config.rightEntity !== null && existsState(config.rightEntity)) {
|
if (config.rightEntity !== null && existsState(config.rightEntity)) {
|
||||||
@@ -177,7 +127,9 @@ on({ id: config.panelRecvTopic }, function (obj) {
|
|||||||
var split = json.CustomRecv.split(",");
|
var split = json.CustomRecv.split(",");
|
||||||
if (split[1] == "pageOpenDetail") {
|
if (split[1] == "pageOpenDetail") {
|
||||||
UnsubscribeWatcher();
|
UnsubscribeWatcher();
|
||||||
SendToPanel(GenerateDetailPage(split[2], split[3]));
|
let pageItem = config.pages[pageId].items.find(e => e.id === split[3]);
|
||||||
|
if (pageItem !== undefined)
|
||||||
|
SendToPanel(GenerateDetailPage(split[2], pageItem));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
HandleMessage(split[0], split[1], parseInt(split[2]), split);
|
HandleMessage(split[0], split[1], parseInt(split[2]), split);
|
||||||
@@ -186,7 +138,6 @@ on({ id: config.panelRecvTopic }, function (obj) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function SendToPanel(val: Payload | Payload[]): void {
|
function SendToPanel(val: Payload | Payload[]): void {
|
||||||
|
|
||||||
if (Array.isArray(val)) {
|
if (Array.isArray(val)) {
|
||||||
val.forEach(function (id, i) {
|
val.forEach(function (id, i) {
|
||||||
setState(config.panelSendTopic, id.payload);
|
setState(config.panelSendTopic, id.payload);
|
||||||
@@ -225,7 +176,6 @@ function HandleMessage(typ: string, method: string, page: number, words: Array<s
|
|||||||
}
|
}
|
||||||
|
|
||||||
function GeneratePage(page: Page): void {
|
function GeneratePage(page: Page): void {
|
||||||
|
|
||||||
switch (page.type) {
|
switch (page.type) {
|
||||||
case "cardEntities":
|
case "cardEntities":
|
||||||
SendToPanel(GenerateEntitiesPage(<PageEntities>page));
|
SendToPanel(GenerateEntitiesPage(<PageEntities>page));
|
||||||
@@ -250,18 +200,7 @@ function HandleHardwareButton(method: string): void {
|
|||||||
else {
|
else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
log("button1");
|
|
||||||
GeneratePage(page);
|
GeneratePage(page);
|
||||||
|
|
||||||
//SendToPanel({ payload: "wake" });
|
|
||||||
// switch (page.type) {
|
|
||||||
// case "cardEntities":
|
|
||||||
// SendToPanel(GenerateEntitiesPage(page));
|
|
||||||
// break;
|
|
||||||
// case "cardThermo":
|
|
||||||
// SendToPanel(GenerateThermoPage(0, page));
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function HandleStartupProcess(): void {
|
function HandleStartupProcess(): void {
|
||||||
@@ -272,16 +211,13 @@ function HandleStartupProcess(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SendDate(): void {
|
function SendDate(): void {
|
||||||
var months = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"];
|
|
||||||
var days = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"];
|
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
var day = days[d.getDay()];
|
var day = Days[d.getDay()];
|
||||||
var date = d.getDate();
|
var date = d.getDate();
|
||||||
var month = months[d.getMonth()];
|
var month = Months[d.getMonth()];
|
||||||
var year = d.getFullYear();
|
var year = d.getFullYear();
|
||||||
var _sendDate = "date,?" + day + " " + date + " " + month + " " + year;
|
var _sendDate = "date,?" + day + " " + date + " " + month + " " + year;
|
||||||
SendToPanel(<Payload>{ payload: _sendDate });
|
SendToPanel(<Payload>{ payload: _sendDate });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function SendTime(): void {
|
function SendTime(): void {
|
||||||
@@ -301,14 +237,14 @@ function SendTime(): void {
|
|||||||
function GenerateEntitiesPage(page: PageEntities): Payload[] {
|
function GenerateEntitiesPage(page: PageEntities): Payload[] {
|
||||||
var out_msgs: Array<Payload> = [];
|
var out_msgs: Array<Payload> = [];
|
||||||
out_msgs = [{ payload: "pageType,cardEntities" }, { payload: "entityUpdHeading," + page.heading }]
|
out_msgs = [{ payload: "pageType,cardEntities" }, { payload: "entityUpdHeading," + page.heading }]
|
||||||
out_msgs.push({ payload: GeneratePageElements(page.items, 4) });
|
out_msgs.push({ payload: GeneratePageElements(page.items, 4,page.useColor) });
|
||||||
return out_msgs
|
return out_msgs
|
||||||
}
|
}
|
||||||
|
|
||||||
function GenerateGridPage(page: PageGrid): Payload[] {
|
function GenerateGridPage(page: PageGrid): Payload[] {
|
||||||
var out_msgs: Array<Payload> = [];
|
var out_msgs: Array<Payload> = [];
|
||||||
out_msgs = [{ payload: "pageType,cardGrid" }, { payload: "entityUpdHeading," + page.heading }]
|
out_msgs = [{ payload: "pageType,cardGrid" }, { payload: "entityUpdHeading," + page.heading }]
|
||||||
out_msgs.push({ payload: GeneratePageElements(page.items, 6, true) });
|
out_msgs.push({ payload: GeneratePageElements(page.items, 6, page.useColor) });
|
||||||
return out_msgs
|
return out_msgs
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,23 +282,24 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
|
|||||||
val = getState(pageItem.id + ".SET").val;
|
val = getState(pageItem.id + ".SET").val;
|
||||||
RegisterEntityWatcher(pageItem.id + ".SET", pageItem.id, placeId);
|
RegisterEntityWatcher(pageItem.id + ".SET", pageItem.id, placeId);
|
||||||
}
|
}
|
||||||
var iconColor = rgb_dec565(useColors ? config.gridPageOffColor : config.defaultColor);
|
var iconColor = rgb_dec565(config.defaultColor);
|
||||||
|
|
||||||
switch (o.common.role) {
|
switch (o.common.role) {
|
||||||
case "light":
|
case "light":
|
||||||
type = "light"
|
type = "light"
|
||||||
iconId = 1
|
iconId = pageItem.icon !== undefined ? pageItem.icon : 1;
|
||||||
var optVal = "0"
|
var optVal = "0"
|
||||||
|
|
||||||
if (val === true || val === "true") {
|
if (val === true || val === "true") {
|
||||||
optVal = "1"
|
optVal = "1"
|
||||||
iconColor = rgb_dec565(useColors ? config.gridPageOnColor : config.defaultColor);
|
iconColor = GetIconColor(pageItem, true, useColors);
|
||||||
}
|
}
|
||||||
|
|
||||||
return "," + type + "," + pageItem.id + "," + iconId + "," + iconColor + "," + name + "," + optVal
|
return "," + type + "," + pageItem.id + "," + iconId + "," + iconColor + "," + name + "," + optVal;
|
||||||
|
|
||||||
case "dimmer":
|
case "dimmer":
|
||||||
type = "light"
|
type = "light"
|
||||||
iconId = 1
|
iconId = pageItem.icon !== undefined ? pageItem.icon : 1;
|
||||||
var optVal = "0"
|
var optVal = "0"
|
||||||
if (existsState(pageItem.id + ".ON_ACTUAL")) {
|
if (existsState(pageItem.id + ".ON_ACTUAL")) {
|
||||||
val = getState(pageItem.id + ".ON_ACTUAL").val;
|
val = getState(pageItem.id + ".ON_ACTUAL").val;
|
||||||
@@ -374,63 +311,79 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
|
|||||||
}
|
}
|
||||||
if (val === true || val === "true") {
|
if (val === true || val === "true") {
|
||||||
optVal = "1"
|
optVal = "1"
|
||||||
if ((pageItem.useColor || useColors) && existsState(pageItem.id + ".ACTUAL")) {
|
iconColor = GetIconColor(pageItem, existsState(pageItem.id + ".ACTUAL") ? getState(pageItem.id + ".ACTUAL").val : true, useColors);
|
||||||
|
|
||||||
let iconColorRgb =
|
|
||||||
Interpolate(
|
|
||||||
pageItem.onColor !== undefined ? pageItem.onColor : config.gridPageOffColor,
|
|
||||||
pageItem.offColor !== undefined ? pageItem.offColor : config.gridPageOnColor,
|
|
||||||
(getState(pageItem.id + ".ACTUAL").val / 100)
|
|
||||||
);
|
|
||||||
iconColor = rgb_dec565(iconColorRgb);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return "," + type + "," + pageItem.id + "," + iconId + "," + iconColor + "," + name + "," + optVal
|
return "," + type + "," + pageItem.id + "," + iconId + "," + iconColor + "," + name + "," + optVal;
|
||||||
|
|
||||||
case "blind":
|
case "blind":
|
||||||
type = "shutter"
|
type = "shutter"
|
||||||
iconId = 0
|
iconId = pageItem.icon !== undefined ? pageItem.icon : 0;
|
||||||
|
iconColor = GetIconColor(pageItem, existsState(pageItem.id + ".ACTUAL") ? getState(pageItem.id + ".ACTUAL").val : true, useColors);
|
||||||
return "," + type + "," + pageItem.id + "," + iconId + "," + iconColor + "," + name + ","
|
return "," + type + "," + pageItem.id + "," + iconId + "," + iconColor + "," + name + ","
|
||||||
|
|
||||||
case "info":
|
case "info":
|
||||||
case "value.temperature":
|
case "value.temperature":
|
||||||
type = "text"
|
type = "text";
|
||||||
|
iconId = pageItem.icon !== undefined ? pageItem.icon : 11;
|
||||||
|
let unit = "";
|
||||||
var optVal = "0"
|
var optVal = "0"
|
||||||
if (existsState(pageItem.id + ".ON_ACTUAL")) {
|
if (existsState(pageItem.id + ".ON_ACTUAL")) {
|
||||||
optVal = getState(pageItem.id + ".ON_ACTUAL").val + " " + GetUnitOfMeasurement(pageItem.id + ".ON_ACTUAL");
|
optVal = getState(pageItem.id + ".ON_ACTUAL").val;
|
||||||
|
unit = GetUnitOfMeasurement(pageItem.id + ".ON_ACTUAL");
|
||||||
RegisterEntityWatcher(pageItem.id + ".ON_ACTUAL", pageItem.id, placeId);
|
RegisterEntityWatcher(pageItem.id + ".ON_ACTUAL", pageItem.id, placeId);
|
||||||
}
|
}
|
||||||
else if (existsState(pageItem.id + ".ACTUAL")) {
|
else if (existsState(pageItem.id + ".ACTUAL")) {
|
||||||
optVal = getState(pageItem.id + ".ACTUAL").val;
|
optVal = getState(pageItem.id + ".ACTUAL").val;
|
||||||
|
unit = GetUnitOfMeasurement(pageItem.id + ".ACTUAL");
|
||||||
RegisterEntityWatcher(pageItem.id + ".ACTUAL", pageItem.id, placeId);
|
RegisterEntityWatcher(pageItem.id + ".ACTUAL", pageItem.id, placeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (o.common.role == "value.temperature") {
|
if (o.common.role == "value.temperature") {
|
||||||
iconId = 2;
|
iconId = pageItem.icon !== undefined ? pageItem.icon : 2;
|
||||||
optVal += config.temperatureUnit;
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
optVal += GetUnitOfMeasurement(pageItem.id + ".ACTUAL");
|
iconColor = GetIconColor(pageItem, parseInt(optVal), useColors);
|
||||||
}
|
|
||||||
return "," + type + "," + pageItem.id + "," + iconId + "," + iconColor + "," + name + "," + optVal;
|
return "," + type + "," + pageItem.id + "," + iconId + "," + iconColor + "," + name + "," + optVal + " " + unit;
|
||||||
|
|
||||||
case "button":
|
case "button":
|
||||||
type = "button";
|
type = "button";
|
||||||
iconId = 3;
|
iconId = pageItem.icon !== undefined ? pageItem.icon : 3;
|
||||||
var optVal = "PRESS";
|
let buttonText = pageItem.buttonText !== undefined ? pageItem.buttonText : "PRESS";
|
||||||
return "," + type + "," + pageItem.id + "," + iconId + "," + + iconColor + "," + name + "," + optVal;
|
iconColor = GetIconColor(pageItem, true, useColors);
|
||||||
|
return "," + type + "," + pageItem.id + "," + iconId + "," + + iconColor + "," + name + "," + buttonText;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return ",delete,,,,"
|
return ",delete,,,,";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ",delete,,,,,"
|
return ",delete,,,,,"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function GetIconColor(pageItem: PageItem, value: (boolean | number), useColors: boolean): number {
|
||||||
|
// dimmer
|
||||||
|
if ((pageItem.useColor || useColors) && pageItem.interpolateColor && typeof (value) === "number") {
|
||||||
|
let maxValue = pageItem.maxValue !== undefined ? pageItem.maxValue : 100;
|
||||||
|
let minValue = pageItem.minValue !== undefined ? pageItem.minValue : 0;
|
||||||
|
value = value > maxValue ? maxValue : value;
|
||||||
|
value = value < minValue ? minValue : value;
|
||||||
|
return rgb_dec565(
|
||||||
|
Interpolate(
|
||||||
|
pageItem.offColor !== undefined ? pageItem.offColor : config.defaultOffColor,
|
||||||
|
pageItem.onColor !== undefined ? pageItem.onColor : config.defaultOnColor,
|
||||||
|
scale(value, minValue, maxValue, 0, 1)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((pageItem.useColor || useColors) && ((typeof (value) === "boolean" && value) || value > (pageItem.minValue !== undefined ? pageItem.minValue : 0))) {
|
||||||
|
return rgb_dec565(pageItem.onColor !== undefined ? pageItem.onColor : config.defaultOnColor)
|
||||||
|
}
|
||||||
|
|
||||||
|
return rgb_dec565(pageItem.offColor !== undefined ? pageItem.offColor : config.defaultOffColor);
|
||||||
|
}
|
||||||
|
|
||||||
function RegisterEntityWatcher(id: string, entityId: string, placeId: number): void {
|
function RegisterEntityWatcher(id: string, entityId: string, placeId: number): void {
|
||||||
if (subscriptions.hasOwnProperty(id)) {
|
if (subscriptions.hasOwnProperty(id)) {
|
||||||
return;
|
return;
|
||||||
@@ -441,12 +394,12 @@ function RegisterEntityWatcher(id: string, entityId: string, placeId: number): v
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function RegisterDetailEntityWatcher(id: string, entityId: string, type: string): void {
|
function RegisterDetailEntityWatcher(id: string, pageItem: PageItem, type: string): void {
|
||||||
if (subscriptions.hasOwnProperty(id)) {
|
if (subscriptions.hasOwnProperty(id)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
subscriptions[id] = (on({ id: id, change: 'any' }, function () {
|
subscriptions[id] = (on({ id: id, change: 'any' }, function () {
|
||||||
SendToPanel(GenerateDetailPage(type, entityId));
|
SendToPanel(GenerateDetailPage(type, pageItem));
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -466,7 +419,7 @@ function GetUnitOfMeasurement(id: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function GenerateThermoPage(page: PageThermo): Payload[] {
|
function GenerateThermoPage(page: PageThermo): Payload[] {
|
||||||
var id = page.item.id
|
var id = page.items[0].id
|
||||||
var out_msgs: Array<Payload> = [];
|
var out_msgs: Array<Payload> = [];
|
||||||
out_msgs.push({ payload: "pageType,cardThermo" });
|
out_msgs.push({ payload: "pageType,cardThermo" });
|
||||||
|
|
||||||
@@ -571,56 +524,63 @@ function HandleButtonEvent(words): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function GenerateDetailPage(type: string, entityId: string): Payload[] {
|
function GenerateDetailPage(type: string, pageItem: PageItem): Payload[] {
|
||||||
|
|
||||||
var out_msgs: Array<Payload> = [];
|
var out_msgs: Array<Payload> = [];
|
||||||
let id = entityId
|
let id = pageItem.id
|
||||||
if (existsObject(id)) {
|
if (existsObject(id)) {
|
||||||
var o = getObject(id)
|
var o = getObject(id)
|
||||||
var val = null;
|
var val: (boolean | number) = 0;
|
||||||
let icon = 1;
|
let icon = 1;
|
||||||
|
var iconColor = rgb_dec565(config.defaultColor);
|
||||||
if (type == "popupLight") {
|
if (type == "popupLight") {
|
||||||
let switchVal = "0"
|
let switchVal = "0"
|
||||||
if (o.common.role == "light") {
|
if (o.common.role == "light") {
|
||||||
if (existsState(id + ".GET")) {
|
if (existsState(id + ".GET")) {
|
||||||
val = getState(id + ".GET").val;
|
val = getState(id + ".GET").val;
|
||||||
RegisterDetailEntityWatcher(id + ".GET", id, type);
|
RegisterDetailEntityWatcher(id + ".GET", pageItem, type);
|
||||||
}
|
}
|
||||||
else if (existsState(id + ".SET")) {
|
else if (existsState(id + ".SET")) {
|
||||||
val = getState(id + ".SET").val;
|
val = getState(id + ".SET").val;
|
||||||
RegisterDetailEntityWatcher(id + ".SET", id, type);
|
RegisterDetailEntityWatcher(id + ".SET", pageItem, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val)
|
if (val) {
|
||||||
switchVal = "1"
|
switchVal = "1";
|
||||||
|
iconColor = GetIconColor(pageItem, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
out_msgs.push({ payload: "entityUpdateDetail," + icon + "," + "17299," + switchVal + ",disable,disable,disable" })
|
out_msgs.push({ payload: "entityUpdateDetail," + icon + "," + + iconColor + "," + switchVal + ",disable,disable,disable" })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (o.common.role == "dimmer") {
|
if (o.common.role == "dimmer") {
|
||||||
if (existsState(id + ".ON_ACTUAL")) {
|
if (existsState(id + ".ON_ACTUAL")) {
|
||||||
val = getState(id + ".ON_ACTUAL").val;
|
val = getState(id + ".ON_ACTUAL").val;
|
||||||
RegisterDetailEntityWatcher(id + ".ON_ACTUAL", id, type);
|
RegisterDetailEntityWatcher(id + ".ON_ACTUAL", pageItem, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (existsState(id + ".ON_SET")) {
|
else if (existsState(id + ".ON_SET")) {
|
||||||
val = getState(id + ".ON_SET").val;
|
val = getState(id + ".ON_SET").val;
|
||||||
RegisterDetailEntityWatcher(id + ".ON_SET", id, type);
|
RegisterDetailEntityWatcher(id + ".ON_SET", pageItem, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val === true || val === "true")
|
if (val === true) {
|
||||||
|
var iconColor = GetIconColor(pageItem, val, false);
|
||||||
switchVal = "1"
|
switchVal = "1"
|
||||||
|
}
|
||||||
let brightness = 0;
|
let brightness = 0;
|
||||||
if (existsState(id + ".ACTUAL")) {
|
if (existsState(id + ".ACTUAL")) {
|
||||||
brightness = Math.trunc(scale(getState(id + ".ACTUAL").val, 0, 100, 0, 100))
|
brightness = Math.trunc(scale(getState(id + ".ACTUAL").val, 0, 100, 0, 100))
|
||||||
RegisterDetailEntityWatcher(id + ".ACTUAL", id, type);
|
iconColor = GetIconColor(pageItem, brightness, false);
|
||||||
|
RegisterDetailEntityWatcher(id + ".ACTUAL", pageItem, type);
|
||||||
}
|
}
|
||||||
let colortemp = "disable"
|
let colorTemp = "disable"
|
||||||
|
let colorMode = "disable"
|
||||||
//let attr_support_color = attr.supported_color_modes
|
//let attr_support_color = attr.supported_color_modes
|
||||||
//if (attr_support_color.includes("color_temp"))
|
//if (attr_support_color.includes("color_temp"))
|
||||||
// colortemp = Math.trunc(scale(attr.color_temp, attr.min_mireds, attr.max_mireds, 0, 100))
|
// colortemp = Math.trunc(scale(attr.color_temp, attr.min_mireds, attr.max_mireds, 0, 100))
|
||||||
|
|
||||||
out_msgs.push({ payload: "entityUpdateDetail," + icon + "," + "17299," + switchVal + "," + brightness + "," + colortemp })
|
out_msgs.push({ payload: "entityUpdateDetail," + icon + "," + iconColor + "," + switchVal + "," + brightness + "," + colorTemp + "," + colorMode })
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -763,7 +723,7 @@ function GetAccuWeatherIcon(icon: number): number {
|
|||||||
|
|
||||||
function GetBlendedColor(percentage: number): RGB {
|
function GetBlendedColor(percentage: number): RGB {
|
||||||
if (percentage < 50)
|
if (percentage < 50)
|
||||||
return Interpolate(config.gridPageOffColor, config.gridPageOnColor, percentage / 50.0);
|
return Interpolate(config.defaultOffColor, config.defaultOnColor, percentage / 50.0);
|
||||||
return Interpolate(Red, White, (percentage - 50) / 50.0);
|
return Interpolate(Red, White, (percentage - 50) / 50.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -779,5 +739,76 @@ function InterpolateNum(d1: number, d2: number, fraction: number): number {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function rgb_dec565(rgb: RGB): number {
|
function rgb_dec565(rgb: RGB): number {
|
||||||
return ((Math.floor(rgb.red / 255 * 31) << 11) | (Math.floor(rgb.green / 255 * 63) << 5) | (Math.floor(rgb.blue / 255 * 31)))
|
return ((Math.floor(rgb.red / 255 * 31) << 11) | (Math.floor(rgb.green / 255 * 63) << 5) | (Math.floor(rgb.blue / 255 * 31)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type RGB = {
|
||||||
|
red: number,
|
||||||
|
green: number,
|
||||||
|
blue: number
|
||||||
|
};
|
||||||
|
|
||||||
|
type Payload = {
|
||||||
|
payload: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
type Page = {
|
||||||
|
type: string,
|
||||||
|
heading: string,
|
||||||
|
items: PageItem[],
|
||||||
|
useColor: boolean
|
||||||
|
};
|
||||||
|
|
||||||
|
interface PageEntities extends Page {
|
||||||
|
type: "cardEntities",
|
||||||
|
items: PageItem[],
|
||||||
|
|
||||||
|
};
|
||||||
|
interface PageGrid extends Page {
|
||||||
|
type: "cardGrid",
|
||||||
|
items: PageItem[],
|
||||||
|
};
|
||||||
|
|
||||||
|
interface PageThermo extends Page {
|
||||||
|
type: "cardThermo",
|
||||||
|
items: PageItem[],
|
||||||
|
};
|
||||||
|
|
||||||
|
type PageItem = {
|
||||||
|
id: string,
|
||||||
|
icon: (number | undefined),
|
||||||
|
onColor: (RGB | undefined),
|
||||||
|
offColor: (RGB | undefined),
|
||||||
|
useColor: (boolean | undefined),
|
||||||
|
interpolateColor: (boolean | undefined),
|
||||||
|
minValue: (number | undefined),
|
||||||
|
maxValue: (number | undefined),
|
||||||
|
buttonText: (string | undefined)
|
||||||
|
}
|
||||||
|
|
||||||
|
type Config = {
|
||||||
|
panelRecvTopic: string,
|
||||||
|
panelSendTopic: string,
|
||||||
|
timeoutScreensaver: number,
|
||||||
|
dimmode: number,
|
||||||
|
//brightnessScreensaver:
|
||||||
|
locale: string,
|
||||||
|
timeFormat: string,
|
||||||
|
dateFormat: string,
|
||||||
|
weatherEntity: string | null,
|
||||||
|
temperatureUnit: string,
|
||||||
|
leftEntity: string,
|
||||||
|
leftEntityIcon: number,
|
||||||
|
leftEntityText: string,
|
||||||
|
leftEntityUnitText: string | null,
|
||||||
|
rightEntity: string,
|
||||||
|
rightEntityIcon: number,
|
||||||
|
rightEntityText: string,
|
||||||
|
rightEntityUnitText: string | null,
|
||||||
|
defaultColor: RGB,
|
||||||
|
defaultOnColor: RGB,
|
||||||
|
defaultOffColor: RGB,
|
||||||
|
pages: (PageThermo | PageEntities | PageGrid)[],
|
||||||
|
button1Page: (PageThermo | PageEntities | PageGrid | null),
|
||||||
|
button2Page: (PageThermo | PageEntities | PageGrid | null),
|
||||||
|
};
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
- Thermostat Card
|
- Thermostat Card
|
||||||
- Entity Card (Temperature, Switches and sensors, the script tries to figure the unit of measurement automatically)
|
- Entity Card (Temperature, Switches and sensors, the script tries to figure the unit of measurement automatically)
|
||||||
|
- Grid Card
|
||||||
- Detail Card (only switch and normal dimmer)
|
- Detail Card (only switch and normal dimmer)
|
||||||
- Live update (when value was changed in the backend and the page is currently open)
|
- Live update (when value was changed in the backend and the page is currently open)
|
||||||
- Screensaver Page with Time, Date and Weather Information.
|
- Screensaver Page with Time, Date and Weather Information.
|
||||||
@@ -44,8 +45,8 @@ See the icons currently usable in the following table:
|
|||||||
|
|
||||||
You can change the string and devices in the config object.
|
You can change the string and devices in the config object.
|
||||||
|
|
||||||
## Buttons
|
## Hardware buttons
|
||||||
If you like you can add special pages for the buttons, but there is a problem currently which will open the last page again. But if you press the button again, the correct page will open.
|
If you like you can add special pages for the buttons.
|
||||||
|
|
||||||
First you need to add this rule to Tasmota:
|
First you need to add this rule to Tasmota:
|
||||||
|
|
||||||
@@ -54,6 +55,12 @@ Rule2 on Button1#state do Publish tele/%topic%/RESULT {"CustomRecv":"event,butto
|
|||||||
Rule2
|
Rule2
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Colors
|
||||||
|
You can define colors this way and use them later in the PageItem element
|
||||||
|
```
|
||||||
|
const BatteryFull: RGB = { red: 96, green: 176, blue: 62 }
|
||||||
|
const BatteryEmpty: RGB = { red: 179, green: 45, blue: 25 }
|
||||||
|
```
|
||||||
## The config element in the script which needs to be configured
|
## The config element in the script which needs to be configured
|
||||||
```
|
```
|
||||||
var config: Config = {
|
var config: Config = {
|
||||||
@@ -73,14 +80,15 @@ var config: Config = {
|
|||||||
timeFormat: "%H:%M", // not used right now
|
timeFormat: "%H:%M", // not used right now
|
||||||
dateFormat: "%A, %d. %B %Y", // not used right now
|
dateFormat: "%A, %d. %B %Y", // not used right now
|
||||||
weatherEntity: "alias.0.Wetter",
|
weatherEntity: "alias.0.Wetter",
|
||||||
defaultColor: RGB, // Default color of all elements
|
defaultColor: Off, // Default color of all elements
|
||||||
gridPageOnColor: RGB, // Default on color on grid page
|
defaultOnColor: RGB, // Default on state color for items
|
||||||
gridPageOffColor: RGB, // Default off color on grid page
|
defaultOffColor: RGB, // Default off state color for page
|
||||||
temperatureUnit: "°C", // Unit to append on temperature sensors
|
temperatureUnit: "°C", // Unit to append on temperature sensors
|
||||||
pages: [
|
pages: [
|
||||||
{
|
{
|
||||||
"type": "cardEntities", // card type (cardEntities, cardThermo)
|
"type": "cardEntities", // card type (cardEntities, cardThermo)
|
||||||
"heading": "Testseite", // heading
|
"heading": "Testseite", // heading
|
||||||
|
"useColor": false, // should colors be enabled on this page, can be overridden in PageItem
|
||||||
"items": [ // items array (up to 4 on cardEntities, 1 for cardThermo)
|
"items": [ // items array (up to 4 on cardEntities, 1 for cardThermo)
|
||||||
<PageItem>{ id: "alias.0.Rolladen_Eltern" }, // device which must be configured in the device panel. Use only the folder for the device, not the set, get states ...
|
<PageItem>{ id: "alias.0.Rolladen_Eltern" }, // device which must be configured in the device panel. Use only the folder for the device, not the set, get states ...
|
||||||
<PageItem>{ id: "alias.0.Erker" },
|
<PageItem>{ id: "alias.0.Erker" },
|
||||||
@@ -92,17 +100,19 @@ var config: Config = {
|
|||||||
{
|
{
|
||||||
"type": "cardEntities",
|
"type": "cardEntities",
|
||||||
"heading": "Strom",
|
"heading": "Strom",
|
||||||
|
"useColor": true, // should colors be enabled on this page, can be overridden in PageItem
|
||||||
"items": [
|
"items": [
|
||||||
<PageItem>{ id: "alias.0.Netz" },
|
<PageItem>{ id: "alias.0.Netz" },
|
||||||
<PageItem>{ id: "alias.0.Hausverbrauch" },
|
<PageItem>{ id: "alias.0.Hausverbrauch", icon: 4, interpolateColor: true, offColor: BatteryFull, onColor: Red , maxValue: 1000 },
|
||||||
<PageItem>{ id: "alias.0.Pv" },
|
<PageItem>{ id: "alias.0.Pv" },
|
||||||
<PageItem>{ id: "alias.0.Batterie" }
|
<PageItem>{ id: "alias.0.Batterie", icon: 34, interpolateColor: true, offColor: BatteryEmpty, onColor: BatteryFull }
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "cardThermo",
|
"type": "cardThermo",
|
||||||
"heading": "Thermostat",
|
"heading": "Thermostat",
|
||||||
|
"useColor": false, // should colors be enabled on this page, can be overridden in PageItem
|
||||||
"item": "alias.0.WzNsPanel" // Needs to be a thermostat in the device panel
|
"item": "alias.0.WzNsPanel" // Needs to be a thermostat in the device panel
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -119,6 +129,10 @@ type PageItem = {
|
|||||||
onColor: (RGB | undefined), // the color the item will get when active
|
onColor: (RGB | undefined), // the color the item will get when active
|
||||||
offColor: (RGB | undefined), // the color the item will get when inactive
|
offColor: (RGB | undefined), // the color the item will get when inactive
|
||||||
useColor: (boolean | undefined) // override colors, only Grid pages has colors enabled per default
|
useColor: (boolean | undefined) // override colors, only Grid pages has colors enabled per default
|
||||||
|
interpolateColor: (boolean | undefined),// fade between color on and off, useColor on Page or PageItem must be enabled
|
||||||
|
minValue: (number | undefined), // the minimum value for the fade calculation, if smaller the minimum value will be used
|
||||||
|
maxValue: (number | undefined), // the maximum value for the fade calculation, if larger the maximum value will be used
|
||||||
|
buttonText: (string | undefined) // the Button Text, default is "Press"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -130,6 +144,7 @@ var button1Page: PageGrid =
|
|||||||
{
|
{
|
||||||
"type": "cardGrid",
|
"type": "cardGrid",
|
||||||
"heading": "Radio",
|
"heading": "Radio",
|
||||||
|
"useColor": true, // should colors be enabled on this page, can be overridden in PageItem
|
||||||
"items": [
|
"items": [
|
||||||
<PageItem>{ id: "alias.0.Radio.NJoy" },
|
<PageItem>{ id: "alias.0.Radio.NJoy" },
|
||||||
<PageItem>{ id: "alias.0.Radio.Delta_Radio" },
|
<PageItem>{ id: "alias.0.Radio.Delta_Radio" },
|
||||||
@@ -138,7 +153,7 @@ var button1Page: PageGrid =
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
Pages array can look like this:
|
Pages array can look like this, so you can add the pages as object or define them in the array itself. This is up to you.
|
||||||
|
|
||||||
```
|
```
|
||||||
pages: [
|
pages: [
|
||||||
@@ -146,6 +161,7 @@ pages: [
|
|||||||
{
|
{
|
||||||
"type": "cardEntities",
|
"type": "cardEntities",
|
||||||
"heading": "Strom",
|
"heading": "Strom",
|
||||||
|
"useColor": true, // should colors be enabled on this page, can be overridden in PageItem
|
||||||
"items": [
|
"items": [
|
||||||
<PageItem>{ id: "alias.0.Netz" },
|
<PageItem>{ id: "alias.0.Netz" },
|
||||||
<PageItem>{ id: "alias.0.Hausverbrauch" },
|
<PageItem>{ id: "alias.0.Hausverbrauch" },
|
||||||
|
|||||||
Reference in New Issue
Block a user