Compare commits

...

19 Commits

Author SHA1 Message Date
Johannes
ade8c0d10a Update nspanel-lovelace-ui.py 2023-01-07 11:41:23 +01:00
Johannes
1be017f029 fix for #676 2023-01-07 11:40:12 +01:00
Armilar
0a3d5834fd v3.8.1 - New Release (Breaking Changes)
- Add New HMI-Navi (Breaking Changes)
- Add Tasmota "Web Admin Password" (Breaking Changes)
- Add Navigation bSubPrev and bSubNext and Subpages for bHome
- Bugfix for cardThermostat - Payload (Minor)
- Add Volumio-Player to cardMedia by @egal
- Upgrade TFT 47
- Add Volumio-Tracklist to cardMedia by @egal
- HMI Hotfix
2023-01-06 15:38:31 +01:00
Armilar
47e5f414c8 v3.8.1 - New Release (Breaking Changes)
- Add New HMI-Navi (Breaking Changes)
- Add Tasmota "Web Admin Password" (Breaking Changes)
- Add Navigation bSubPrev and bSubNext and Subpages for bHome
- Bugfix for cardThermostat - Payload (Minor)
- Add Volumio-Player to cardMedia by @egal
- Upgrade TFT 47
- Add Volumio-Tracklist to cardMedia by @egal
- HMI Hotfix
2023-01-06 15:36:22 +01:00
joBr99
9fcb845fd7 bump version to 3.8.2 (add nextion2text) 2023-01-06 14:11:26 +00:00
Johannes
1400ef039b bump version to 3.8.2 2023-01-06 14:44:44 +01:00
Johannes
ef83c45267 Merge branch 'main' of https://github.com/joBr99/nspanel-lovelace-ui 2023-01-06 14:43:53 +01:00
Johannes
5fb4e57cd1 hide 6th entity 2023-01-06 14:43:48 +01:00
Johannes
cbc256bbf9 fixes #670 2023-01-06 14:38:48 +01:00
Armilar
a5e60ac313 v3.8.1 - New Release (Breaking Changes)
- Add New HMI-Navi (Breaking Changes)
- Add Tasmota "Web Admin Password" (Breaking Changes)
- Add Navigation bSubPrev and bSubNext and Subpages for bHome
- Bugfix for cardThermostat - Payload (Minor)
- Add Volumio-Player to cardMedia by @egal
- Upgrade TFT 47
- Add Volumio-Tracklist to cardMedia by @egal
- HMI Hotfix
2023-01-06 12:15:53 +01:00
Armilar
d634ca1bac v3.8.1 - New Release (Breaking Changes)
- Add New HMI-Navi (Breaking Changes)
- Add Tasmota "Web Admin Password" (Breaking Changes)
- Add Navigation bSubPrev and bSubNext and Subpages for bHome
- Bugfix for cardThermostat - Payload (Minor)
- Add Volumio-Player to cardMedia by @egal
- Upgrade TFT 47
- Add Volumio-Tracklist to cardMedia by @egal
- HMI Hotfix
2023-01-06 12:12:17 +01:00
Armilar
0a6236b3e0 v3.8.0 - New Release (Breaking Changes)
- Add New HMI-Navi (Breaking Changes)
- Add Tasmota "Web Admin Password" (Breaking Changes)
- Add Navigation bSubPrev and bSubNext and Subpages for bHome
- Bugfix for cardThermostat - Payload (Minor)
- Add Volumio-Player to cardMedia by @egal
- Upgrade TFT 47
- Add Volumio-Tracklist to cardMedia by @egal
2023-01-06 11:56:00 +01:00
Armilar
183e4d03cb v3.8.0 - New Release (Breaking Changes)
- Add New HMI-Navi (Breaking Changes)
- Add Tasmota "Web Admin Password" (Breaking Changes)
- Add Navigation bSubPrev and bSubNext and Subpages for bHome
- Bugfix for cardThermostat - Payload (Minor)
- Add Volumio-Player to cardMedia by @egal
- Upgrade TFT 47
- Add Volumio-Tracklist to cardMedia by @egal
2023-01-06 11:53:45 +01:00
Armilar
8eb80af744 v3.8.0 - New Release (Breaking Changes)
- Add New HMI-Navi (Breaking Changes)
- Add Tasmota "Web Admin Password" (Breaking Changes)
- Add Navigation bSubPrev and bSubNext and Subpages for bHome
- Bugfix for cardThermostat - Payload (Minor)
- Add Volumio-Player to cardMedia by @egal
- Upgrade TFT 47
- Add Volumio-Tracklist to cardMedia by @egal
2023-01-06 11:52:01 +01:00
Armilar
393ef7d322 v3.8.0 - New Release (Breaking Changes)
- Add New HMI-Navi (Breaking Changes)
- Add Tasmota "Web Admin Password" (Breaking Changes)
- Add Navigation bSubPrev and bSubNext and Subpages for bHome
- Bugfix for cardThermostat - Payload (Minor)
- Add Volumio-Player to cardMedia by @egal
- Upgrade TFT 47
- Add Volumio-Tracklist to cardMedia by @egal
2023-01-06 11:46:52 +01:00
Armilar
42e715c6b5 v3.8.0 - New Release (Breaking Changes)
- Add New HMI-Navi (Breaking Changes)
- Add Tasmota "Web Admin Password" (Breaking Changes)
- Add Navigation bSubPrev and bSubNext and Subpages for bHome
- Bugfix for cardThermostat - Payload (Minor)
- Add Volumio-Player to cardMedia by @egal
- Upgrade TFT 47
- Add Volumio-Tracklist to cardMedia by @egal
2023-01-06 11:42:38 +01:00
Johannes
f7cba480cf Fix Prev/Next UUID Assignment in #665 Implementation fixes #669 2023-01-06 01:22:05 +01:00
Armilar
b9e7031500 v3.8.0 - New Release (Breaking Changes)
- Add New HMI-Navi (Breaking Changes)
- Add Tasmota "Web Admin Password" (Breaking Changes)
- Add Navigation bSubPrev and bSubNext and Subpages for bHome
- Bugfix for cardThermostat - Payload (Minor)
- Add Volumio-Player to cardMedia
- Upgrade TFT 47
2023-01-05 23:23:24 +01:00
Armilar
c78ccfc24a v3.8.0 - New Release (Breaking Changes)
- Add New HMI-Navi (Breaking Changes)
- Add Tasmota "Web Admin Password" (Breaking Changes)
- Add Navigation bSubPrev and bSubNext and Subpages for bHome
- Bugfix for cardThermostat - Payload (Minor)
- Add Volumio-Player to cardMedia
- Upgrade TFT 47
2023-01-05 23:20:06 +01:00
18 changed files with 787 additions and 2026 deletions

View File

@@ -1,79 +0,0 @@
--- HMI/n2t-out
+++ HMI/US/landscape/n2t-out
│ --- HMI/n2t-out/Program.s.txt
├── +++ HMI/US/landscape/n2t-out/Program.s.txt
│ @@ -10,10 +10,8 @@
│ int sleepValue=0
│ // dim value
│ int dimValue=40
│ int dimValueNormal=100
│ //color vars
│ int defaultFontColor=65535
│ int defaultBcoColor=6371
│ - // fix touch offset
│ - lcd_dev fffb 0002 0000 0020
│ page pageStartup
│ --- HMI/n2t-out/pageStartup.txt
├── +++ HMI/US/landscape/n2t-out/pageStartup.txt
│ @@ -173,15 +173,15 @@
│ Max. Text Size : 10
│ Events
│ Touch Press Event
│ recmod=1
│ bauds=115200
│ // startup event
│ - tSend.txt="event,startup,"+tVersion.txt+",eu"
│ + tSend.txt="event,startup,"+tVersion.txt+",us-l"
│ //send calc crc
│ btlen tSend.txt,sys0
│ crcrest 1,0xffff // reset CRC
│ crcputh 55 bb
│ crcputs sys0,2
│ crcputs tSend.txt,0
│ //send cmd
│ --- HMI/n2t-out/screensaver.txt
├── +++ HMI/US/landscape/n2t-out/screensaver.txt
│ @@ -29,17 +29,14 @@
│ }
│ tDate.txt=pageIcons.vaDate.txt
│ dim=dimValue
│ vis tSend,0
│ //page open event
│ // clear weather elements, to keep example content in HMI
│ - Postinitialize Event
│ - click m0,1
│ -
│ Variable (string) strCommand
│ Attributes
│ Scope : local
│ Text :
│ Max. Text Size: 200
│ Variable (string) strTmp
│ @@ -103,24 +100,14 @@
│ Value: 0
│ Variable (int32) ycR
│ Attributes
│ Scope: local
│ Value: 0
│ -Text m0
│ - Attributes
│ - Scope : local
│ - Dragging : 0
│ - Disable release event after dragging: 0
│ - Send Component ID : disabled
│ - Associated Keyboard : none
│ - Text :
│ - Max. Text Size : 10
│ -
│ Text t10
│ Attributes
│ Scope : local
│ Dragging : 0
│ Disable release event after dragging: 0
│ Send Component ID : disabled
│ Associated Keyboard : none

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1,513 +1 @@
+++ /dev/fd/62 2023-01-05 18:06:15.475339237 +0000 +++ /dev/fd/62 2023-01-06 14:11:20.674466368 +0000
+I/n2t-out/Program.s.txt
++ HMI/US/portrait/n2t-out/Program.s.txt
+I/n2t-out/cardEntities.txt
++ HMI/US/portrait/n2t-out/cardEntities.txt
+5 +96,57 @@
+ }
+ }
+
+e (string) entn1
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 80
+ Max. Text Size: 65
+
+e (string) entn2
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 80
+ Max. Text Size: 65
+
+e (string) entn3
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 80
+ Max. Text Size: 65
+ Max. Text Size: 65
+ Max. Text Size: 65
+
+e (string) entn6
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 65
+
+e (string) nent1
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 80
+ Max. Text Size: 40
+
+e (string) nent2
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 40
+14 +176,26 @@
+e (string) type6
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 10
+
+14 +224,32 @@
+nNum6
+ributes
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled
+ Associated Keyboard : none
+ Value : 0
+
+14 +282,34 @@
+ntity6
+ributes
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled
+ Associated Keyboard : none
+ Text : tEntity5
+ Max. Text Size : 30
+
+14 +352,34 @@
+con6
+ributes
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled
+ Associated Keyboard : none
+ Text : 
+ Max. Text Size : 5
+
+14 +521,70 @@
+hSlider6
+ributes
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled
+ Position : 50
+ Upper range limit : 100
+ Lower range limit : 0
+
+nts
+ Touch Release Event
+ nNum5.val=hSlider5.val
+ tSend.txt="event,buttonPress2,"+entn6.txt+",number-set,"
+ covx nNum5.val,tTmp.txt,0,0
+ tSend.txt+=tTmp.txt
+ //send calc crc
+ btlen tSend.txt,sys0
+ crcrest 1,0xffff // reset CRC
+ crcputh 55 bb
+ crcputs sys0,2
+ crcputs tSend.txt,0
+ //send cmd
+ printh 55 bb
+ prints sys0,2
+ prints tSend.txt,0
+ prints crcval,2
+
+14 +677,64 @@
+bDown6
+ributes
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled
+ State : unpressed
+ Text : 
+ Max. Text Size : 10
+
+nts
+ Touch Press Event
+ tSend.txt="event,buttonPress2,"+entn6.txt+",down"
+ //send calc crc
+ btlen tSend.txt,sys0
+ crcrest 1,0xffff // reset CRC
+ crcputh 55 bb
+ crcputs sys0,2
+ crcputs tSend.txt,0
+ //send cmd
+ printh 55 bb
+ prints sys0,2
+ prints tSend.txt,0
+ prints crcval,2
+
+14 +877,64 @@
+bStop6
+ributes
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled
+ State : unpressed
+ Text : 
+ Max. Text Size : 10
+
+nts
+ Touch Press Event
+ tSend.txt="event,buttonPress2,"+entn6.txt+",stop"
+ //send calc crc
+ btlen tSend.txt,sys0
+ crcrest 1,0xffff // reset CRC
+ crcputh 55 bb
+ crcputs sys0,2
+ crcputs tSend.txt,0
+ //send cmd
+ printh 55 bb
+ prints sys0,2
+ prints tSend.txt,0
+ prints crcval,2
+
+14 +1027,64 @@
+bText6
+ributes
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled
+ State : unpressed
+ Text :
+ Max. Text Size : 45
+
+nts
+ Touch Press Event
+ tSend.txt="event,buttonPress2,"+entn6.txt+",button"
+ //send calc crc
+ btlen tSend.txt,sys0
+ crcrest 1,0xffff // reset CRC
+ crcputh 55 bb
+ crcputs sys0,2
+ crcputs tSend.txt,0
+ //send cmd
+ printh 55 bb
+ prints sys0,2
+ prints tSend.txt,0
+ prints crcval,2
+
+14 +1177,64 @@
+bUp6
+ributes
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled
+ State : unpressed
+ Text : 
+ Max. Text Size : 10
+
+nts
+ Touch Press Event
+ tSend.txt="event,buttonPress2,"+entn6.txt+",up"
+ //send calc crc
+ btlen tSend.txt,sys0
+ crcrest 1,0xffff // reset CRC
+ crcputh 55 bb
+ crcputs sys0,2
+ crcputs tSend.txt,0
+ //send cmd
+ printh 55 bb
+ prints sys0,2
+ prints tSend.txt,0
+ prints crcval,2
+
+14 +1335,68 @@
+ate Button btOnOff6
+ributes
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled
+ State : unpressed
+ Text :
+ Max. Text Size : 10
+
+nts
+ Touch Press Event
+ tSend.txt="event,buttonPress2,"+entn6.txt+",OnOff,"
+ covx btOnOff5.val,tTmp.txt,0,0
+ tSend.txt+=tTmp.txt
+ //send calc crc
+ btlen tSend.txt,sys0
+ crcrest 1,0xffff // reset CRC
+ crcputh 55 bb
+ crcputs sys0,2
+ crcputs tSend.txt,0
+ //send cmd
+ printh 55 bb
+ prints sys0,2
+ prints tSend.txt,0
+ prints crcval,2
+
+,14 +1529,84 @@
+ page popupInSel
+ if(type4.txt=="timer")
+ page popupTimer
+ if(type5.txt=="timer")
+ {
+ page popupTimer
+ }
+
+ m5
+ributes
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled
+
+nts
+ Touch Press Event
+ pageIcons.tTmp1.txt=tEntity6.txt
+ pageIcons.tTmp2.txt=entn6.txt
+ pageIcons.tTmp3.txt=tIcon6.txt
+ if(type6.txt=="shutter")
+ {
+ //popupShutter.tHeading.txt=tEntity5.txt
+ page popupShutter
+ }
+ if(type6.txt=="light")
+ {
+ //popupLight.tEntity.txt=tEntity5.txt
+ page popupLight
+ }
+ if(type6.txt=="fan")
+ {
+ page popupFan
+ }
+ if(type6.txt=="input_sel")
+ {
+ page popupInSel
+ }
+ if(type6.txt=="timer")
+ {
+ page popupTimer
+ }
+,14 +2334,312 @@
+ spstr strCommand.txt,type5.txt,"~",38
+ spstr strCommand.txt,entn5.txt,"~",39
+ spstr strCommand.txt,tIcon5.txt,"~",40
+ spstr strCommand.txt,tTmp.txt,"~",41
+ spstr strCommand.txt,tEntity5.txt,"~",42
+ spstr strCommand.txt,tId.txt,"~",43
+ spstr strCommand.txt,tTmp.txt,"~",43
+ if(type5.txt=="text"||type5.txt=="timer")
+ spstr strCommand.txt,bText5.txt,"~",43
+ spstr strCommand.txt,bText5.txt,"~",43
+ spstr strCommand.txt,bText5.txt,"~",43
+ // get Type
+ spstr strCommand.txt,type6.txt,"~",44
+ // get internal name
+ spstr strCommand.txt,entn6.txt,"~",45
+ if(type6.txt=="delete"||type6.txt=="")
+ {
+ vis bUp6,0
+ vis bStop6,0
+ vis bDown6,0
+ vis btOnOff6,0
+ vis tEntity6,0
+ vis tIcon6,0
+ vis bText6,0
+ vis hSlider6,0
+ vis nNum6,0
+ }else
+ {
+ // change icon
+ spstr strCommand.txt,tIcon6.txt,"~",46
+ vis tIcon6,1
+ // change icon color
+ spstr strCommand.txt,tTmp.txt,"~",47
+ covx tTmp.txt,sys0,0,0
+ tIcon6.pco=sys0
+ // set name
+ spstr strCommand.txt,tEntity6.txt,"~",48
+ vis tEntity6,1
+ }
+ if(type6.txt=="shutter")
+ {
+ vis bUp6,1
+ vis bStop6,1
+ vis bDown6,1
+ vis btOnOff6,0
+ vis bText6,0
+ vis hSlider6,0
+ vis nNum6,0
+ // get Button State (optional Value)
+ spstr strCommand.txt,tId.txt,"~",49
+ // up button
+ spstr tId.txt,tTmp.txt,"|",3
+ if(tTmp.txt=="disable")
+ {
+ bUp6.pco=27501
+ spstr tId.txt,bUp6.txt,"|",0
+ tsw bUp6,0
+ }else if(tTmp.txt=="enable")
+ {
+ bUp6.pco=65535
+ spstr tId.txt,bUp6.txt,"|",0
+ tsw bUp6,1
+ }
+ // stop button
+ spstr tId.txt,tTmp.txt,"|",4
+ if(tTmp.txt=="disable")
+ {
+ bStop6.pco=27501
+ spstr tId.txt,bStop6.txt,"|",1
+ tsw bStop6,0
+ }else if(tTmp.txt=="enable")
+ {
+ bStop6.pco=65535
+ spstr tId.txt,bStop6.txt,"|",1
+ tsw bStop6,1
+ }
+ // down button
+ spstr tId.txt,tTmp.txt,"|",5
+ if(tTmp.txt=="disable")
+ {
+ bDown6.pco=27501
+ spstr tId.txt,bDown6.txt,"|",2
+ tsw bDown6,0
+ }else if(tTmp.txt=="enable")
+ {
+ bDown6.pco=65535
+ spstr tId.txt,bDown6.txt,"|",2
+ tsw bDown6,1
+ }
+ }
+ if(type6.txt=="light"||type6.txt=="switch"||type6.txt=="fan")
+ {
+ vis bUp6,0
+ vis bStop6,0
+ vis bDown6,0
+ vis btOnOff6,1
+ vis bText6,0
+ vis hSlider6,0
+ vis nNum6,0
+ // get Button State (optional Value)
+ spstr strCommand.txt,tTmp.txt,"~",49
+ covx tTmp.txt,sys0,0,0
+ btOnOff6.val=sys0
+ }
+ if(type6.txt=="text"||type6.txt=="timer")
+ {
+ vis bUp6,0
+ vis bStop6,0
+ vis bDown6,0
+ vis btOnOff6,0
+ vis bText6,1
+ tsw bText6,0
+ vis hSlider6,0
+ vis nNum6,0
+ bText6.pco=65535
+ bText6.pco2=65535
+ // get Text (optional Value)
+ spstr strCommand.txt,bText6.txt,"~",49
+ }
+ if(type6.txt=="button"||type6.txt=="input_sel")
+ {
+ vis bUp6,0
+ vis bStop6,0
+ vis bDown6,0
+ vis btOnOff6,0
+ vis bText6,1
+ tsw bText6,1
+ vis hSlider6,0
+ vis nNum6,0
+ bText6.pco=1374
+ bText6.pco2=1374
+ // get Text (optional Value)
+ spstr strCommand.txt,bText6.txt,"~",49
+ }
+ if(type6.txt=="number")
+ {
+ vis bUp6,0
+ vis bStop6,0
+ vis bDown6,0
+ vis btOnOff6,0
+ vis bText6,0
+ tsw bText6,0
+ vis hSlider6,1
+ vis nNum6,1
+ // get config (optional Value) (use bText as variable)
+ spstr strCommand.txt,bText6.txt,"~",49
+ //first value is current value
+ spstr bText6.txt,tTmp.txt,"|",0
+ covx tTmp.txt,sys0,0,0
+ hSlider6.val=sys0
+ nNum6.val=sys0
+ //second value is min value
+ spstr bText6.txt,tTmp.txt,"|",1
+ covx tTmp.txt,sys0,0,0
+ hSlider6.minval=sys0
+ //third value is max value
+ spstr bText6.txt,tTmp.txt,"|",2
+ covx tTmp.txt,sys0,0,0
+ hSlider6.maxval=sys0
+ }
+I/n2t-out/pageStartup.txt
++ HMI/US/portrait/n2t-out/pageStartup.txt
+I/n2t-out/screensaver.txt
++ HMI/US/portrait/n2t-out/screensaver.txt
+9 +29,20 @@
+ }
+ tDate.txt=pageIcons.vaDate.txt
+ dim=dimValue
+ vis tSend,0
+ //page open event
+ // clear weather elements, to keep example content in HMI
+
+ Postinitialize Event
+ click m0,1
+
+e (string) strCommand
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 200
+
+e (string) strTmp
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 2
+
+e (string) tId
+ributes
+ Scope : local
+ Text :
+ Max. Text Size: 25
+
+e (string) tInstruction
+24 +94,14 @@
+ Value: 0
+
+e (int32) ycR
+ributes
+ Scope: local
+ Value: 0
+
+
+ributes
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled
+ Associated Keyboard : none
+ Text :
+ Max. Text Size : 10
+
+0
+ributes
+ Scope : local
+ Dragging : 0
+ Disable release event after dragging: 0
+ Send Component ID : disabled
+ Associated Keyboard : none

View File

@@ -83,6 +83,16 @@ Page cardEntities
vis bText5,0 vis bText5,0
vis hSlider5,0 vis hSlider5,0
vis nNum5,0 vis nNum5,0
//ui e6
vis btOnOff6,0
vis bUp6,0
vis bStop6,0
vis bDown6,0
vis tIcon6,0
vis tEntity6,0
vis bText6,0
vis hSlider6,0
vis nNum6,0
cardEntities.bco=defaultBcoColor cardEntities.bco=defaultBcoColor
for(sys0=0;sys0<65;sys0++) for(sys0=0;sys0<65;sys0++)
{ {

View File

@@ -76,11 +76,11 @@ popupInSel
295 Unique line(s) of event code 295 Unique line(s) of event code
cardEntities cardEntities
91 Component(s) 91 Component(s)
1609 Line(s) of event code 1618 Line(s) of event code
690 Unique line(s) of event code 699 Unique line(s) of event code
Total Total
19 Page(s) 19 Page(s)
709 Component(s) 709 Component(s)
8633 Line(s) of event code 8642 Line(s) of event code
2247 Unique line(s) of event code 2255 Unique line(s) of event code

View File

@@ -75,6 +75,16 @@ Page cardEntities
vis bText5,0 vis bText5,0
vis hSlider5,0 vis hSlider5,0
vis nNum5,0 vis nNum5,0
//ui e6
vis btOnOff6,0
vis bUp6,0
vis bStop6,0
vis bDown6,0
vis tIcon6,0
vis tEntity6,0
vis bText6,0
vis hSlider6,0
vis nNum6,0
cardEntities.bco=defaultBcoColor cardEntities.bco=defaultBcoColor
for(sys0=0;sys0<65;sys0++) for(sys0=0;sys0<65;sys0++)
{ {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -165,14 +165,14 @@ class LuiBackendConfig(object):
# setup prev and next uuids # setup prev and next uuids
top_level_cards = list(filter(lambda card: not card.hidden, self._config_cards)) top_level_cards = list(filter(lambda card: not card.hidden, self._config_cards))
card_ids = [card.id for card in top_level_cards] card_uuids = [card.uuid for card in top_level_cards]
prev_ids = card_ids[-1:] + card_ids[:-1] prev_uuids = card_uuids[-1:] + card_uuids[:-1]
next_ids = card_ids[ 1:] + card_ids[: 1] next_uuids = card_uuids[ 1:] + card_uuids[: 1]
if len(card_ids) > 1: if len(card_uuids) > 1:
for prev_id, card, next_id in zip(prev_ids, top_level_cards, next_ids): for prev_uuids, card, next_uuids in zip(prev_uuids, top_level_cards, next_uuids):
(card.uuid_prev, card.uuid_next) = (prev_id, next_id) (card.uuid_prev, card.uuid_next) = (prev_uuids, next_uuids)
# parse screensaver # parse screensaver
self._config_screensaver = Card(self.get("screensaver")) self._config_screensaver = Card(self.get("screensaver"))

View File

@@ -489,7 +489,7 @@ class LuiPagesGen(object):
detailPage = "" detailPage = ""
if any(x in ["preset_modes", "swing_modes", "fan_modes"] for x in entity.attributes): if any(x in ["preset_modes", "swing_modes", "fan_modes"] for x in entity.attributes):
detailPage = "1" detailPage = "0"
command = f"entityUpd~{heading}~{navigation}~{item}~{current_temp} {temperature_unit}~{dest_temp}~{state_value}~{min_temp}~{max_temp}~{step_temp}{icon_res}~{currently_translation}~{state_translation}~{action_translation}~{temperature_unit_icon}~{dest_temp2}~{detailPage}" command = f"entityUpd~{heading}~{navigation}~{item}~{current_temp} {temperature_unit}~{dest_temp}~{state_value}~{min_temp}~{max_temp}~{step_temp}{icon_res}~{currently_translation}~{state_translation}~{action_translation}~{temperature_unit_icon}~{dest_temp2}~{detailPage}"
self._send_mqtt_msg(command) self._send_mqtt_msg(command)

View File

@@ -27,8 +27,8 @@ class NsPanelLovelaceUIManager(hass.Hass):
controller = LuiController(cfg, mqttsend.send_mqtt_msg) controller = LuiController(cfg, mqttsend.send_mqtt_msg)
desired_tasmota_driver_version = 8 desired_tasmota_driver_version = 8
desired_display_firmware_version = 47 desired_display_firmware_version = 48
version = "v3.8.0" version = "v3.8.3"
model = cfg.get("model") model = cfg.get("model")
if model == "us-l": if model == "us-l":

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
TypeScript v3.7.3.2 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar/@Sternmiere/@Britzelpuf TypeScript v3.8.1 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar/@Sternmiere/@Britzelpuf
- abgestimmt auf TFT 46 / v3.7.3 / BerryDriver 8 / Tasmota 12.3.1 - abgestimmt auf TFT 47 / v3.8.1 / BerryDriver 8 / Tasmota 12.3.1
@joBr99 Projekt: https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker @joBr99 Projekt: https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker
NsPanelTs.ts (dieses TypeScript in ioBroker) Stable: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/NsPanelTs.ts NsPanelTs.ts (dieses TypeScript in ioBroker) Stable: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/NsPanelTs.ts
icon_mapping.ts: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/icon_mapping.ts (TypeScript muss in global liegen) icon_mapping.ts: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/icon_mapping.ts (TypeScript muss in global liegen)
@@ -106,6 +106,14 @@ ReleaseNotes:
- 28.12.2022 - v3.7.3.0 Update Berry Version 8 - 28.12.2022 - v3.7.3.0 Update Berry Version 8
- 29.12.2022 - v3.7.3.1 Hotfix - us-p - DateString - Use long/short Weekday and long/short Month - 29.12.2022 - v3.7.3.1 Hotfix - us-p - DateString - Use long/short Weekday and long/short Month
- 29.12.2022 - v3.7.3.2 Add pageItem.id to Submenu; New Parameter targetPage by TT-TOM / @tt-tom17 - 29.12.2022 - v3.7.3.2 Add pageItem.id to Submenu; New Parameter targetPage by TT-TOM / @tt-tom17
- 30.12.2022 - v3.8.0 Add New HMI-Navi
- 01.01.2023 - v3.8.0 Add Tasmota "Web Admin Password"
- 02.01.2023 - v3.8.0 Add Navigation bSubPrev and bSubNext and Subpages for bHome
- 03.01.2023 - v3.8.0 Bugfix for cardThermostat - Payload (Minor)
- 04.01.2023 - v3.8.0 Add Volumio-Player to cardMedia
- 05.01.2023 - v3.8.0 Upgrade TFT 47
- 06.01.2023 - v3.8.0 Add Volumio Tracklist
- 06.01.2023 - v3.8.1 HMI-Hotfix
***************************************************************************************************************** *****************************************************************************************************************
* Falls Aliase durch das Skript erstellt werden sollen, muss in der JavaScript Instanz "setObect" gesetzt sein! * * Falls Aliase durch das Skript erstellt werden sollen, muss in der JavaScript Instanz "setObect" gesetzt sein! *
@@ -179,7 +187,7 @@ Erforderliche Adapter:
Upgrades in Konsole: Upgrades in Konsole:
Tasmota BerryDriver : Backlog UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; Restart 1 Tasmota BerryDriver : Backlog UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; Restart 1
TFT EU STABLE Version : FlashNextion http://nspanel.pky.eu/lovelace-ui/github/nspanel-v3.7.3.tft TFT EU STABLE Version : FlashNextion http://nspanel.pky.eu/lovelace-ui/github/nspanel-v3.8.1.tft
--------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------
*/ */
let Icons = new IconsSelector(); let Icons = new IconsSelector();
@@ -189,6 +197,9 @@ const autoCreateAlias = true; //Für diese Option muss der Hak
const weatherAdapterInstance: string = 'accuweather.0.'; //Möglich 'accuweather.0.' oder 'daswetter.0.' const weatherAdapterInstance: string = 'accuweather.0.'; //Möglich 'accuweather.0.' oder 'daswetter.0.'
const weatherScreensaverTempMinMax: string = 'MinMax'; // Mögliche Werte: 'Min', 'Max' oder 'MinMax' const weatherScreensaverTempMinMax: string = 'MinMax'; // Mögliche Werte: 'Min', 'Max' oder 'MinMax'
const tasmota_web_admin_user: string = 'admin'; // ändern, falls der User im Tasmota vor dem Kompilieren umbenannt wurde (Standard Tasmota: admin)
const tasmota_web_admin_password: string = ''; // setzten, falls "Web Admin Password" in Tasmote vergeben
const NSPanel_Path = '0_userdata.0.NSPanel.1.'; const NSPanel_Path = '0_userdata.0.NSPanel.1.';
const NSPanel_Alarm_Path = '0_userdata.0.NSPanel.'; //Neuer Pfad für gemeinsame Nutzung durch mehrere Panels (bei Nutzung der cardAlarm) const NSPanel_Alarm_Path = '0_userdata.0.NSPanel.'; //Neuer Pfad für gemeinsame Nutzung durch mehrere Panels (bei Nutzung der cardAlarm)
@@ -293,32 +304,38 @@ let vwIconColor = [];
let Service: PageEntities = let Service: PageEntities =
{ {
"type": "cardEntities", 'type': 'cardEntities',
"heading": "NSPanel Service", 'heading': 'NSPanel Service',
"useColor": true, 'useColor': true,
"subPage": false, 'subPage': false,
"parent": undefined, 'parent': undefined,
"items": [ 'prev': undefined,
<PageItem>{ id: AliasPath + 'autoUpdate', name: "Auto-Updates" ,icon: "update", offColor: MSRed, onColor: MSGreen}, 'next': undefined,
<PageItem>{ navigate: true, id: "NSPanel_Infos", icon: "information-outline", onColor: White, name: "NSPanel Infos"}, 'home': undefined,
<PageItem>{ navigate: true, id: "NSPanel_Firmware_Info", icon: "update", onColor: White, name: "Firmware Infos"}, 'items': [
<PageItem>{ navigate: true, id: "NSPanel_Einstellungen", icon: "wrench-outline", onColor: White, name: "Screensaver"} <PageItem>{ id: AliasPath + 'autoUpdate', name: 'Auto-Updates' ,icon: 'update', offColor: MSRed, onColor: MSGreen},
<PageItem>{ navigate: true, id: 'NSPanel_Infos', icon: 'information-outline', onColor: White, name: 'NSPanel Infos'},
<PageItem>{ navigate: true, id: 'NSPanel_Firmware_Info', icon: 'update', onColor: White, name: 'Firmware Infos'},
<PageItem>{ navigate: true, id: 'NSPanel_Einstellungen', icon: 'wrench-outline', onColor: White, name: 'Screensaver'}
] ]
}; };
//Subpage 1 von Subpages_2 //Subpage 1 von Subpages_2
let NSPanel_Infos: PageEntities = let NSPanel_Infos: PageEntities =
{ {
"type": "cardEntities", 'type': 'cardEntities',
"heading": "NSPanel Infos", 'heading': 'NSPanel Infos',
"useColor": true, 'useColor': true,
"subPage": true, 'subPage': true,
"parent": Service, 'parent': Service,
"items": [ 'prev': undefined,
'next': undefined,
'home': undefined,
'items': [
<PageItem>{ id: AliasPath + 'Tasmota.Hardware', name: 'Hardware', icon: 'memory', offColor: MSYellow, onColor: MSYellow, useColor: true}, <PageItem>{ id: AliasPath + 'Tasmota.Hardware', name: 'Hardware', icon: 'memory', offColor: MSYellow, onColor: MSYellow, useColor: true},
<PageItem>{ id: AliasPath + 'Sensor.ESP32.Temperature', name: "ESP Temperatur", icon: "thermometer", unit: "°C", offColor: MSYellow, onColor: MSYellow, useColor: true}, <PageItem>{ id: AliasPath + 'Sensor.ESP32.Temperature', name: 'ESP Temperatur', icon: 'thermometer', unit: '°C', offColor: MSYellow, onColor: MSYellow, useColor: true},
<PageItem>{ id: AliasPath + 'Tasmota.Uptime', name: "Uptime", icon: "timeline-clock-outline", offColor: MSYellow, onColor: MSYellow, useColor: true}, <PageItem>{ id: AliasPath + 'Tasmota.Uptime', name: 'Uptime', icon: 'timeline-clock-outline', offColor: MSYellow, onColor: MSYellow, useColor: true},
<PageItem>{ id: AliasPath + 'Tasmota.Wifi.RSSI', name: "Wifi-Signal", icon: "signal-distance-variant", unit: "dBm", offColor: MSYellow, onColor: MSYellow, useColor: true} <PageItem>{ id: AliasPath + 'Tasmota.Wifi.RSSI', name: 'Wifi-Signal', icon: 'signal-distance-variant', unit: 'dBm', offColor: MSYellow, onColor: MSYellow, useColor: true}
] ]
}; };
@@ -330,6 +347,9 @@ let Service: PageEntities =
'useColor': true, 'useColor': true,
'subPage': true, 'subPage': true,
'parent': Service, 'parent': Service,
'prev': undefined,
'next': undefined,
'home': undefined,
'items': [ 'items': [
<PageItem>{ id: AliasPath + 'Dimmode.brightnessDay', name: 'Brightness Tag', icon: 'brightness-5', offColor: MSYellow, onColor: MSYellow, useColor: true, minValue: 5, maxValue: 10}, <PageItem>{ id: AliasPath + 'Dimmode.brightnessDay', name: 'Brightness Tag', icon: 'brightness-5', offColor: MSYellow, onColor: MSYellow, useColor: true, minValue: 5, maxValue: 10},
<PageItem>{ id: AliasPath + 'Dimmode.brightnessNight', name: 'Brightness Nacht', icon: 'brightness-4', offColor: MSYellow, onColor: MSYellow, useColor: true, minValue: 0, maxValue: 4}, <PageItem>{ id: AliasPath + 'Dimmode.brightnessNight', name: 'Brightness Nacht', icon: 'brightness-4', offColor: MSYellow, onColor: MSYellow, useColor: true, minValue: 0, maxValue: 4},
@@ -346,6 +366,9 @@ let Service: PageEntities =
'useColor': true, 'useColor': true,
'subPage': true, 'subPage': true,
'parent': Service, 'parent': Service,
'prev': undefined,
'next': undefined,
'home': undefined,
'items': [ 'items': [
<PageItem>{ id: AliasPath + 'Tasmota.Version', name: 'Tasmota Firmware', offColor: MSYellow, onColor: MSYellow, useColor: true}, <PageItem>{ id: AliasPath + 'Tasmota.Version', name: 'Tasmota Firmware', offColor: MSYellow, onColor: MSYellow, useColor: true},
<PageItem>{ id: AliasPath + 'Display.TFTVersion', name: 'TFT-Firmware', offColor: MSYellow, onColor: MSYellow, useColor: true}, <PageItem>{ id: AliasPath + 'Display.TFTVersion', name: 'TFT-Firmware', offColor: MSYellow, onColor: MSYellow, useColor: true},
@@ -359,7 +382,6 @@ export const config: Config = {
panelSendTopic: 'mqtt.0.SmartHome.NSPanel_1.cmnd.CustomSend', // anpassen panelSendTopic: 'mqtt.0.SmartHome.NSPanel_1.cmnd.CustomSend', // anpassen
firstScreensaverEntity: { ScreensaverEntity: 'accuweather.0.Hourly.h0.PrecipitationProbability', ScreensaverEntityIcon: 'weather-pouring', ScreensaverEntityText: 'Regen', ScreensaverEntityUnitText: '%', ScreensaverEntityIconColor: {'val_min': 0, 'val_max': 100} }, firstScreensaverEntity: { ScreensaverEntity: 'accuweather.0.Hourly.h0.PrecipitationProbability', ScreensaverEntityIcon: 'weather-pouring', ScreensaverEntityText: 'Regen', ScreensaverEntityUnitText: '%', ScreensaverEntityIconColor: {'val_min': 0, 'val_max': 100} },
secondScreensaverEntity: { ScreensaverEntity: 'accuweather.0.Current.WindSpeed', ScreensaverEntityIcon: 'weather-windy', ScreensaverEntityText: "Wind", ScreensaverEntityUnitText: 'km/h', ScreensaverEntityIconColor: {'val_min': 0, 'val_max': 120} }, secondScreensaverEntity: { ScreensaverEntity: 'accuweather.0.Current.WindSpeed', ScreensaverEntityIcon: 'weather-windy', ScreensaverEntityText: "Wind", ScreensaverEntityUnitText: 'km/h', ScreensaverEntityIconColor: {'val_min': 0, 'val_max': 120} },
//secondScreensaverEntity: { ScreensaverEntity: 'accuweather.0.Current.WindSpeed', ScreensaverEntityIcon: 'weather-windy', ScreensaverEntityText: "Wind", ScreensaverEntityUnitText: 'km/h', ScreensaverEntityIconColor: {'val_min': 0, 'val_max': 120} },
thirdScreensaverEntity: { ScreensaverEntity: 'accuweather.0.Current.UVIndex', ScreensaverEntityIcon: 'solar-power', ScreensaverEntityText: 'UV', ScreensaverEntityUnitText: '', ScreensaverEntityIconColor: {'val_min': 0, 'val_max': 9} }, thirdScreensaverEntity: { ScreensaverEntity: 'accuweather.0.Current.UVIndex', ScreensaverEntityIcon: 'solar-power', ScreensaverEntityText: 'UV', ScreensaverEntityUnitText: '', ScreensaverEntityIconColor: {'val_min': 0, 'val_max': 9} },
fourthScreensaverEntity: { ScreensaverEntity: 'accuweather.0.Current.RelativeHumidity', ScreensaverEntityIcon: 'water-percent', ScreensaverEntityText: 'Luft', ScreensaverEntityUnitText: '%', ScreensaverEntityIconColor: {'val_min': 0, 'val_max': 100, 'val_best': 65} }, fourthScreensaverEntity: { ScreensaverEntity: 'accuweather.0.Current.RelativeHumidity', ScreensaverEntityIcon: 'water-percent', ScreensaverEntityText: 'Luft', ScreensaverEntityUnitText: '%', ScreensaverEntityIconColor: {'val_min': 0, 'val_max': 100, 'val_best': 65} },
alternativeScreensaverLayout: false, alternativeScreensaverLayout: false,
@@ -383,7 +405,8 @@ export const config: Config = {
NSPanel_Infos, //Auto-Alias Service Page NSPanel_Infos, //Auto-Alias Service Page
NSPanel_Einstellungen, //Auto-Alias Service Page NSPanel_Einstellungen, //Auto-Alias Service Page
NSPanel_Firmware_Info //Auto-Alias Service Page NSPanel_Firmware_Info, //Auto-Alias Service Page
], ],
button1Page: null, //Beispiel-Seite auf Button 1, wenn Rule2 definiert - Wenn nicht definiert --> button1Page: null, button1Page: null, //Beispiel-Seite auf Button 1, wenn Rule2 definiert - Wenn nicht definiert --> button1Page: null,
button2Page: null //Beispiel-Seite auf Button 2, wenn Rule2 definiert - Wenn nicht definiert --> button1Page: null, button2Page: null //Beispiel-Seite auf Button 2, wenn Rule2 definiert - Wenn nicht definiert --> button1Page: null,
@@ -914,6 +937,11 @@ setState(config.panelSendTopic, 'pageType~pageStartup');
get_tasmota_status0(); get_tasmota_status0();
get_panel_update_data(); get_panel_update_data();
check_updates(); check_updates();
/*
setTimeout(async function () {
setState(config.panelSendTopic, 'pageType~pageStartup');
}, 60000);
*/
//------------------Begin Update Functions //------------------Begin Update Functions
@@ -944,7 +972,7 @@ function get_locales() {
async function check_updates() { async function check_updates() {
try { try {
const desired_display_firmware_version = 46; const desired_display_firmware_version = 47;
const berry_driver_version = 8; const berry_driver_version = 8;
if (Debug) { if (Debug) {
@@ -1179,8 +1207,15 @@ function get_current_berry_driver_version() {
if (Debug) { if (Debug) {
console.log('Requesting current berry driver version'); console.log('Requesting current berry driver version');
} }
let urlString = `http://${get_current_tasmota_ip_address()}/cm?cmnd=GetDriverVersion`;
if (tasmota_web_admin_password != '') {
urlString = `http://${get_current_tasmota_ip_address()}/cm?user=${tasmota_web_admin_user}&password=${tasmota_web_admin_password}&cmnd=GetDriverVersion`;
}
request({ request({
url: `http://${get_current_tasmota_ip_address()}/cm?cmnd=GetDriverVersion`,
url: `${urlString}`,
headers: { headers: {
'User-Agent': 'ioBroker' 'User-Agent': 'ioBroker'
} }
@@ -1206,8 +1241,14 @@ function get_tasmota_status0() {
if (Debug) { if (Debug) {
console.log('Requesting tasmota status0'); console.log('Requesting tasmota status0');
} }
let urlString = `http://${get_current_tasmota_ip_address()}/cm?cmnd=Status0`;
if (tasmota_web_admin_password != '') {
urlString = `http://${get_current_tasmota_ip_address()}/cm?user=${tasmota_web_admin_user}&password=${tasmota_web_admin_password}&cmnd=Status0`;
}
request({ request({
url: `http://${get_current_tasmota_ip_address()}/cm?cmnd=Status0`, url: `${urlString}`,
headers: { headers: {
'User-Agent': 'ioBroker' 'User-Agent': 'ioBroker'
} }
@@ -1379,8 +1420,14 @@ on({ id: config.panelRecvTopic }, async (obj) => {
function update_berry_driver_version() { function update_berry_driver_version() {
try { try {
let urlString = `http://${get_current_tasmota_ip_address()}/cm?cmnd=Backlog UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; Restart 1`;
if (tasmota_web_admin_password != '') {
urlString = `http://${get_current_tasmota_ip_address()}/cm?user=${tasmota_web_admin_user}&password=${tasmota_web_admin_password}&cmnd=Backlog UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; Restart 1`;
}
request({ request({
url: `http://${get_current_tasmota_ip_address()}/cm?cmnd=Backlog UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; Restart 1`, url: `${urlString}`,
headers: { headers: {
'User-Agent': 'ioBroker' 'User-Agent': 'ioBroker'
} }
@@ -1393,11 +1440,17 @@ function update_berry_driver_version() {
} }
function update_tft_firmware() { function update_tft_firmware() {
const tft_version: string = 'v3.7.3'; const tft_version: string = 'v3.8.1';
const desired_display_firmware_url = `http://nspanel.pky.eu/lovelace-ui/github/nspanel-${tft_version}.tft`; const desired_display_firmware_url = `http://nspanel.pky.eu/lovelace-ui/github/nspanel-${tft_version}.tft`;
try { try {
let urlString = `http://${get_current_tasmota_ip_address()}/cm?cmnd=FlashNextion ${desired_display_firmware_url}`;
if (tasmota_web_admin_password != '') {
urlString = `http://${get_current_tasmota_ip_address()}/cm?user=${tasmota_web_admin_user}&password=${tasmota_web_admin_password}&cmnd=FlashNextion ${desired_display_firmware_url}`;
}
request({ request({
url: `http://${get_current_tasmota_ip_address()}/cm?cmnd=FlashNextion ${desired_display_firmware_url}`, url: `${urlString}`,
headers: { headers: {
'User-Agent': 'ioBroker' 'User-Agent': 'ioBroker'
} }
@@ -1412,8 +1465,14 @@ function update_tft_firmware() {
function update_tasmota_firmware() { function update_tasmota_firmware() {
try { try {
let urlString = `http://${get_current_tasmota_ip_address()}/cm?cmnd=Upgrade 1`;
if (tasmota_web_admin_password != '') {
urlString = `http://${get_current_tasmota_ip_address()}/cm?user=${tasmota_web_admin_user}&password=${tasmota_web_admin_password}&cmnd=Upgrade 1`;
}
request({ request({
url: `http://${get_current_tasmota_ip_address()}/cm?cmnd=Upgrade 1`, url: `${urlString}`,
headers: { headers: {
'User-Agent': 'ioBroker' 'User-Agent': 'ioBroker'
} }
@@ -2013,6 +2072,19 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
case 'motion': case 'motion':
type = 'text';
if (val === true) {
optVal = 'On';
iconColor = GetIconColor(pageItem, true, useColors);
iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : Icons.GetIcon('motion-sensor');
} else {
optVal = 'Off';
iconColor = GetIconColor(pageItem, false, useColors);
iconId = pageItem.icon2 !== undefined ? Icons.GetIcon(pageItem.icon2) : Icons.GetIcon('motion-sensor');
}
return '~' + type + '~' + pageItem.id + '~' + iconId + '~' + iconColor + '~' + name + '~' + optVal;
case 'info': case 'info':
case 'humidity': case 'humidity':
@@ -2528,9 +2600,9 @@ function GenerateThermoPage(page: PageThermo): Payload[] {
destTemp2 = getState(id + '.' + page.items[0].setThermoDestTemp2).val; destTemp2 = getState(id + '.' + page.items[0].setThermoDestTemp2).val;
} }
let thermoPopup = 0 let thermoPopup = 1
if (page.items[0].popupThermoMode1 != undefined) { if (page.items[0].popupThermoMode1 != undefined) {
thermoPopup = 1; thermoPopup = 0;
} }
@@ -2547,9 +2619,9 @@ function GenerateThermoPage(page: PageThermo): Payload[] {
+ minTemp + '~' // Thermostat Min-Temperatur + minTemp + '~' // Thermostat Min-Temperatur
+ maxTemp + '~' // Thermostat Max-Temperatur + maxTemp + '~' // Thermostat Max-Temperatur
+ stepTemp + '~' // Schritte für Soll (5°C) + stepTemp + '~' // Schritte für Soll (5°C)
+ icon_res + '~' // Icons Status + icon_res // Icons Status
+ findLocale('thermostat', 'Currently') + '~' // Bezeichner vor Aktueller Raumtemperatur + findLocale('thermostat', 'Currently') + '~' // Bezeichner vor Aktueller Raumtemperatur
+ findLocale('thermostat', 'State') + '~' // Bezeichner vor State + findLocale('thermostat', 'State') + '~~' // Bezeichner vor State
+ config.temperatureUnit + '~' // iconTemperature dstTempTwoTempMode + config.temperatureUnit + '~' // iconTemperature dstTempTwoTempMode
+ destTemp2 + '~' // dstTempTwoTempMode --> Wenn Wert, dann 2 Temp + destTemp2 + '~' // dstTempTwoTempMode --> Wenn Wert, dann 2 Temp
+ thermoPopup // PopUp + thermoPopup // PopUp
@@ -2688,6 +2760,33 @@ async function createAutoMediaAlias(id: string, mediaDevice: string, adapterPlay
} }
} }
} }
if (adapterPlayerInstance.startsWith('volumio')) {
if (existsObject(id) == false){
console.log('Volumio Alias ' + id + ' existiert nicht - wird jetzt angelegt')
let dpPath: string = adapterPlayerInstance;
try {
setObject(id, {_id: id, type: 'channel', common: {role: 'media', name:'media'}, native: {}});
await createAliasAsync(id + '.ACTUAL', dpPath + 'playbackInfo.volume', true, <iobJS.StateCommon>{ type: 'number', role: 'value.volume', name: 'ACTUAL' });
await createAliasAsync(id + '.ALBUM', dpPath + 'playbackInfo.album', true, <iobJS.StateCommon>{ type: 'string', role: 'media.album', name: 'ALBUM' });
await createAliasAsync(id + '.ARTIST', dpPath + 'playbackInfo.artist', true, <iobJS.StateCommon>{ type: 'string', role: 'media.artist', name: 'ARTIST' });
await createAliasAsync(id + '.TITLE', dpPath + 'playbackInfo.title', true, <iobJS.StateCommon>{ type: 'string', role: 'media.title', name: 'TITLE' });
await createAliasAsync(id + '.NEXT', dpPath + 'player.next', true, <iobJS.StateCommon>{ type: 'boolean', role: 'button.next', name: 'NEXT' });
await createAliasAsync(id + '.PREV', dpPath + 'player.prev', true, <iobJS.StateCommon>{ type: 'boolean', role: 'button.prev', name: 'PREV' });
await createAliasAsync(id + '.PLAY', dpPath + 'player.play', true, <iobJS.StateCommon>{ type: 'boolean', role: 'button.play', name: 'PLAY' });
await createAliasAsync(id + '.PAUSE', dpPath + 'player.toggle', true, <iobJS.StateCommon>{ type: 'boolean', role: 'button.pause', name: 'PAUSE' });
await createAliasAsync(id + '.STOP', dpPath + 'player.stop', true, <iobJS.StateCommon>{ type: 'boolean', role: 'button.stop', name: 'STOP' });
await createAliasAsync(id + '.STATE', dpPath + 'playbackInfo.status', true, <iobJS.StateCommon>{ type: 'boolean', role: 'media.state', name: 'STATE' });
await createAliasAsync(id + '.VOLUME', dpPath + 'playbackInfo.volume', true, <iobJS.StateCommon>{ type: 'number', role: 'level.volume', name: 'VOLUME' });
await createAliasAsync(id + '.REPEAT', dpPath + 'playbackInfo.repeat', true, <iobJS.StateCommon>{ type: 'number', role: 'media.mode.repeat', name: 'REPEAT' });
await createAliasAsync(id + '.SHUFFLE', dpPath + 'queue.shuffle', true, <iobJS.StateCommon>{ type: 'boolean', role: 'media.mode.shuffle', name: 'SHUFFLE' });
await createAliasAsync(id + '.status', dpPath + 'playbackInfo.status', true, <iobJS.StateCommon>{ type: 'string', role: 'media.state', name: 'status' });
} catch (err) {
console.warn('function createAutoMediaAlias: ' + err.message);
}
}
}
} }
} }
@@ -2792,6 +2891,13 @@ function GenerateMediaPage(page: PageMedia): Payload[] {
} }
} }
//Volumio
if (v2Adapter == 'volumio') {
if (name != undefined) { author = author + " [" + name + "]"; }
name = getState(vInstance + 'info.name').val; /* page.heading;
getState(id + '.TRACK').val; */
}
let volume = getState(id + '.VOLUME').val; let volume = getState(id + '.VOLUME').val;
let iconplaypause = Icons.GetIcon('pause'); //pause let iconplaypause = Icons.GetIcon('pause'); //pause
let shuffle_icon = Icons.GetIcon('shuffle-variant'); //shuffle let shuffle_icon = Icons.GetIcon('shuffle-variant'); //shuffle
@@ -2800,6 +2906,8 @@ function GenerateMediaPage(page: PageMedia): Payload[] {
if (shuffle == 'off' || shuffle == false || shuffle == 0) { if (shuffle == 'off' || shuffle == false || shuffle == 0) {
shuffle_icon = Icons.GetIcon('shuffle-disabled'); //shuffle shuffle_icon = Icons.GetIcon('shuffle-disabled'); //shuffle
} }
if (v2Adapter == 'volumio') { shuffle_icon = Icons.GetIcon('refresh'); } //Volumio: refresh playlist
//Für alle Player //Für alle Player
if (getState(id + '.STATE').val) { if (getState(id + '.STATE').val) {
@@ -2819,6 +2927,16 @@ function GenerateMediaPage(page: PageMedia): Payload[] {
} }
} }
//Ausnahme Volumio: status = string: play, pause, stop usw.
if (v2Adapter == 'volumio') {
if (getState(id + '.status').val == 'play') {
onoffbutton = 65535;
iconplaypause = Icons.GetIcon('pause'); //pause
} else {
iconplaypause = Icons.GetIcon('play'); //play
}
}
let currentSpeaker = 'kein Speaker gefunden'; let currentSpeaker = 'kein Speaker gefunden';
if (v2Adapter == 'alexa2') { if (v2Adapter == 'alexa2') {
@@ -2834,7 +2952,7 @@ function GenerateMediaPage(page: PageMedia): Payload[] {
} }
//------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------
// nachfolgend alle Alexa-Devices (ist Online / Player- und Commands-Verzeichnis vorhanden) auflisten und verketten // nachfolgend alle Alexa-Devices (ist Online / Player- und Commands-Verzeichnis vorhanden) auflisten und verketten
// Wenn Konstante alexaSpeakerList mind. einen Eintrag enthält, wird die Konstante verwendet - ansonsten Alle Devices aus dem Alexa Adapter // Wenn Konstante alexaSpeakerList mind. einen Eintrag enthält, wird die Konstante verwendet - ansonsten Alle Devices aus dem Alexa Adapter
let speakerList = ''; let speakerList = '';
if (page.items[0].speakerList.length > 0) { if (page.items[0].speakerList.length > 0) {
for (let i_index in page.items[0].speakerList) { for (let i_index in page.items[0].speakerList) {
@@ -2877,17 +2995,30 @@ function GenerateMediaPage(page: PageMedia): Payload[] {
let playListString: string = '~~~~~~' let playListString: string = '~~~~~~'
let playListIconCol = rgb_dec565(HMIOff); let playListIconCol = rgb_dec565(HMIOff);
if (page.items[0].playList != undefined) { if (page.items[0].playList != undefined) {
/* Volumio: get actual playlist if empty */
if (v2Adapter == 'volumio') {
if (page.items[0].playList.length == 0) {
request({ url: `${getState(vInstance+'info.host').val}/api/listplaylists`, headers: {'User-Agent': 'ioBroker'} },
async (error, response, result) => {
try {
page.items[0].playList = JSON.parse(result);
if (Debug) console.log(page.items[0].playList);
} catch (err) {
console.log('get_volumio-playlist: ' + err.message);
}
}
);
}
}
playListIconCol = rgb_dec565(HMIOn); playListIconCol = rgb_dec565(HMIOn);
playListString = 'input_sel' + '~' + playListString = 'input_sel' + '~' +
id + '?playlist' + '~' + id + '?playlist' + '~' +
Icons.GetIcon('playlist-play') + '~' + Icons.GetIcon('playlist-play') + '~' +
playListIconCol + '~' + playListIconCol + '~' +
'Playlist' + '~' + 'PlayL ' + page.heading + '~' +
'media1~' 'media1~'
} }
//Testvariable ********************
//InSel Playlist //InSel Playlist
let trackListString: string = '~~~~~~' let trackListString: string = '~~~~~~'
let trackListIconCol = rgb_dec565(HMIOff); let trackListIconCol = rgb_dec565(HMIOff);
@@ -2949,6 +3080,7 @@ function GenerateMediaPage(page: PageMedia): Payload[] {
repeatIconCol = rgb_dec565(HMIOn); repeatIconCol = rgb_dec565(HMIOn);
} }
} }
/* Volumio todo: 2 boolean 'Repeat' + 'RepeatSingle' */
if (v2Adapter == 'spotify-premium' || v2Adapter == 'alexa2' || v2Adapter == 'sonos') { if (v2Adapter == 'spotify-premium' || v2Adapter == 'alexa2' || v2Adapter == 'sonos') {
repeatButtonString = 'button' + '~' + repeatButtonString = 'button' + '~' +
@@ -3357,6 +3489,10 @@ function HandleButtonEvent(words): void {
return; return;
} }
if (words[2] == 'bNext' || words[2] == 'bPrev' || words[2] == 'bUp' || words[2] == 'bHome' || words[2] == 'bSubNext' || words[2] == 'bSubPrev' ) {
buttonAction = words[2];
}
if (Debug) { if (Debug) {
console.log(buttonAction); console.log(buttonAction);
} }
@@ -3395,6 +3531,10 @@ function HandleButtonEvent(words): void {
UnsubscribeWatcher(); UnsubscribeWatcher();
GeneratePage(config.pages[pageId]); GeneratePage(config.pages[pageId]);
break; break;
case 'bSubNext':
UnsubscribeWatcher();
GeneratePage(eval(activePage.next));
break;
case 'bPrev': case 'bPrev':
pageNum = (((pageId - 1) % config.pages.length) + config.pages.length) % config.pages.length; pageNum = (((pageId - 1) % config.pages.length) + config.pages.length) % config.pages.length;
pageId = pageNum; pageId = pageNum;
@@ -3413,6 +3553,10 @@ function HandleButtonEvent(words): void {
GeneratePage(config.pages[pageId]); GeneratePage(config.pages[pageId]);
} }
break; break;
case 'bSubPrev':
UnsubscribeWatcher();
GeneratePage(eval(activePage.prev));
break;
case 'bExit': case 'bExit':
if (config.screenSaverDoubleClick && words[2] == 'screensaver') { if (config.screenSaverDoubleClick && words[2] == 'screensaver') {
if (words[4] >= 2) { if (words[4] >= 2) {
@@ -3442,7 +3586,11 @@ function HandleButtonEvent(words): void {
console.log('bExit: ' + words[4] + ' - ' + pageId); console.log('bExit: ' + words[4] + ' - ' + pageId);
} }
UnsubscribeWatcher(); UnsubscribeWatcher();
GeneratePage(config.pages[0]); if (activePage.home != undefined) {
GeneratePage(eval(activePage.home));
} else {
GeneratePage(config.pages[0]);
}
break; break;
case 'notifyAction': case 'notifyAction':
if (words[4] == 'yes') { if (words[4] == 'yes') {
@@ -3684,6 +3832,7 @@ function HandleButtonEvent(words): void {
setIfExists(id + '.NEXT', true); setIfExists(id + '.NEXT', true);
break; break;
case 'media-shuffle': case 'media-shuffle':
if ((findPageItem(id).adapterPlayerInstance).startsWith("volumio")) { findPageItem(id).playList = []; break; } //Volumio: empty playlist $uha-20230103
if (getState(id + '.SHUFFLE').val == 'off') { if (getState(id + '.SHUFFLE').val == 'off') {
setIfExists(id + '.SHUFFLE', 'on'); setIfExists(id + '.SHUFFLE', 'on');
} else { } else {
@@ -3733,6 +3882,7 @@ function HandleButtonEvent(words): void {
switch (deviceAdapterPL) { switch (deviceAdapterPL) {
case 'spotify-premium': case 'spotify-premium':
let strDevicePI = pageItemPL.playList[words[4]] let strDevicePI = pageItemPL.playList[words[4]]
console.log(strDevicePI)
let playlistListString = (getState(adapterInstancePL + 'playlists.playlistListString').val).split(';'); let playlistListString = (getState(adapterInstancePL + 'playlists.playlistListString').val).split(';');
let playlistListIds = (getState(adapterInstancePL + 'playlists.playlistListIds').val).split(';'); let playlistListIds = (getState(adapterInstancePL + 'playlists.playlistListIds').val).split(';');
let playlistIndex = playlistListString.indexOf(strDevicePI); let playlistIndex = playlistListString.indexOf(strDevicePI);
@@ -3745,6 +3895,24 @@ function HandleButtonEvent(words): void {
let tempListItem = pageItemPL.playList[words[4]].split('.'); let tempListItem = pageItemPL.playList[words[4]].split('.');
setState(adapterInstancePL + 'Echo-Devices.' + pageItemPL.mediaDevice + '.Music-Provider.' + tempListItem[0], tempListItem[1]); setState(adapterInstancePL + 'Echo-Devices.' + pageItemPL.mediaDevice + '.Music-Provider.' + tempListItem[0], tempListItem[1]);
break; break;
case 'volumio':
let strDevicePL = pageItemPL.playList[words[4]];
request({ url:`${getState(adapterInstancePL+'info.host').val}/api/commands/?cmd=playplaylist&name=${strDevicePL}`, headers: {'User-Agent': 'ioBroker'} },
async (error, response, result)=>{}); /* nothing todo @ error */
setTimeout(async function () {
request({ url: `${getState(adapterInstancePL+'info.host').val}/api/getQueue`, headers: {'User-Agent': 'ioBroker'} },
async (error, response, result) => {
try {
const QUEUELIST = JSON.parse(result);
globalTracklist = QUEUELIST.queue;
if (Debug) { for (let i_index in QUEUELIST.queue) console.log(QUEUELIST.queue[i_index]); }
} catch (err) {
console.log('get_volumio-queue: ' + err.message);
}
}
);
}, 2000);
break;
} }
break; break;
case 'mode-tracklist': case 'mode-tracklist':
@@ -3761,6 +3929,10 @@ function HandleButtonEvent(words): void {
case 'alexa2': case 'alexa2':
console.log('Aktuell hat alexa2 keine Tracklist') console.log('Aktuell hat alexa2 keine Tracklist')
break; break;
case 'volumio':
request({ url:`${getState(adapterInstanceTL+'info.host').val}/api/commands/?cmd=play&N=${words[4]}`, headers: {'User-Agent': 'ioBroker'} },
async (error, response, result)=>{}); /* nothing todo @ error */
break;
} }
break; break;
case 'mode-repeat': case 'mode-repeat':
@@ -4005,27 +4177,26 @@ function GetNavigationString(pageId: number): string {
console.log(pageId); console.log(pageId);
} }
// left navigation arrow | right navigation arrow if (activePage.subPage && activePage.prev == undefined && activePage.next == undefined) {
// X|X return 'button~bUp~' + Icons.GetIcon('arrow-up-bold') + '~' + rgb_dec565(White) + '~~~button~bHome~' + Icons.GetIcon('home') + '~' + rgb_dec565(White) + '~~';
// 0 = no arrow } else if (activePage.subPage && activePage.prev == undefined && activePage.next != undefined) {
// 1|1 = right and left navigation arrow return 'button~bUp~' + Icons.GetIcon('arrow-up-bold') + '~' + rgb_dec565(White) + '~~~button~bSubNext~' + Icons.GetIcon('arrow-right-bold') + '~' + rgb_dec565(White) + '~~';
// 2|0 = (right) up navigation arrow } else if (activePage.subPage && activePage.prev != undefined && activePage.next != undefined) {
// 2|2 = (right) up navigation arrow | (left) home navigation icon return 'button~bSubPrev~' + Icons.GetIcon('arrow-left-bold') + '~' + rgb_dec565(White) + '~~~button~bSubNext~' + Icons.GetIcon('arrow-right-bold') + '~' + rgb_dec565(White) + '~~';
} else if (activePage.subPage && activePage.prev != undefined && activePage.next == undefined) {
if (activePage.subPage) return 'button~bSubPrev~' + Icons.GetIcon('arrow-left-bold') + '~' + rgb_dec565(White) + '~~~button~bHome~' + Icons.GetIcon('home') + '~' + rgb_dec565(White) + '~~';
return '2|2'; }
switch (pageId) { switch (pageId) {
case 0: case 0:
return '1|1';
case config.pages.length - 1: case config.pages.length - 1:
return '1|1'; return 'button~bPrev~' + Icons.GetIcon('arrow-left-bold') + '~' + rgb_dec565(White) + '~~~button~bNext~' + Icons.GetIcon('arrow-right-bold') + '~' + rgb_dec565(White) + '~~';
case -1: case -1:
return '2|0'; return 'button~bUp~' + Icons.GetIcon('arrow-up-bold') + '~' + rgb_dec565(White) + ' ~~~delete~~~~~';
case -2: case -2:
return '2|0'; return 'button~bUp~' + Icons.GetIcon('arrow-up-bold') + '~' + rgb_dec565(White) + '~~~delete~~~~~';
default: default:
return '1|1'; return 'button~bPrev~' + Icons.GetIcon('arrow-left-bold') + '~' + rgb_dec565(White) + '~~~button~bNext~' + Icons.GetIcon('arrow-right-bold') + '~' + rgb_dec565(White) + '~~';
} }
} catch (err) { } catch (err) {
@@ -4034,7 +4205,7 @@ function GetNavigationString(pageId: number): string {
} }
function GenerateDetailPage(type: string, optional: string, pageItem: PageItem): Payload[] { function GenerateDetailPage(type: string, optional: string, pageItem: PageItem): Payload[] {
//console.log(type + ' - ' + optional + ' - ' + pageItem.id) if (Debug) console.log(type + ' - ' + optional + ' - ' + pageItem.id);
try { try {
let out_msgs: Array<Payload> = []; let out_msgs: Array<Payload> = [];
let id = pageItem.id let id = pageItem.id
@@ -4660,10 +4831,24 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
tempPlayList[i] = formatInSelText(tPlayList[i]); tempPlayList[i] = formatInSelText(tPlayList[i]);
} }
optionalString = pageItem.playList != undefined ? tempPlayList.join('?') : '' optionalString = pageItem.playList != undefined ? tempPlayList.join('?') : ''
} } else if (vAdapter == 'volumio') { /* Volumio: limit 900 chars */
actualState = ''; //todo: no actual playlistname saving
let tempPlayList = []; let tempPll = 0;
for (let i = 0; i < pageItem.playList.length; i++) {
tempPll += pageItem.playList[i].length; if (tempPll > 900) break;
tempPlayList[i] = formatInSelText(pageItem.playList[i]);
}
optionalString = pageItem.playList != undefined ? tempPlayList.join('?') : ''
} /**/
mode = 'playlist'; mode = 'playlist';
} else if (optional == 'tracklist') { } else if (optional == 'tracklist') {
actualState = '' actualState = '';
/* Volumio: works for files */
if (vAdapter == 'volumio') {
actualState = getState(pageItem.id + '.TITLE').val;
} else {
actualState = getState(pageItem.adapterPlayerInstance + 'player.trackName').val;
}
actualState = getState(pageItem.adapterPlayerInstance + 'player.trackName').val; actualState = getState(pageItem.adapterPlayerInstance + 'player.trackName').val;
actualState = (actualState.replace('?','')).split(' -'); actualState = (actualState.replace('?','')).split(' -');
actualState = actualState[0].split(" ("); actualState = actualState[0].split(" (");
@@ -4673,6 +4858,11 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
//let trackArray = (function () { try {return JSON.parse(getState(pageItem.adapterPlayerInstance + 'player.playlist.trackListArray').val);} catch(e) {return {};}})(); //let trackArray = (function () { try {return JSON.parse(getState(pageItem.adapterPlayerInstance + 'player.playlist.trackListArray').val);} catch(e) {return {};}})();
for (let track_index=0; track_index < 45; track_index++) { for (let track_index=0; track_index < 45; track_index++) {
let temp_cut_array = getAttr(globalTracklist, track_index + '.title'); let temp_cut_array = getAttr(globalTracklist, track_index + '.title');
/* Volumio: @local/NAS no title -> name */
if (temp_cut_array == undefined) {
temp_cut_array = getAttr(globalTracklist, track_index + '.name');
}
if (Debug) console.log(temp_cut_array);
if (temp_cut_array != undefined) { if (temp_cut_array != undefined) {
temp_cut_array = (temp_cut_array.replace('?','')).split(' -'); temp_cut_array = (temp_cut_array.replace('?','')).split(' -');
temp_cut_array = temp_cut_array[0].split(" ("); temp_cut_array = temp_cut_array[0].split(" (");
@@ -5809,7 +5999,10 @@ type Page = {
items: PageItem[], items: PageItem[],
useColor: boolean, useColor: boolean,
subPage: boolean, subPage: boolean,
parent: Page parent: Page,
prev: string,
next: string,
home: string
}; };
interface PageEntities extends Page { interface PageEntities extends Page {
@@ -5879,6 +6072,7 @@ type PageItem = {
playList: (string[] | undefined), playList: (string[] | undefined),
equalizerList: (string[] | undefined), equalizerList: (string[] | undefined),
repeatList: (string[] | undefined), repeatList: (string[] | undefined),
globalTracklist: (string[] | undefined),
modeList: (string[] | undefined), modeList: (string[] | undefined),
hidePassword: (boolean | undefined), hidePassword: (boolean | undefined),
autoCreateALias: (boolean | undefined) autoCreateALias: (boolean | undefined)