mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-22 22:18:38 +01:00
Compare commits
2 Commits
v4.7.2
...
9e4030cc8b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e4030cc8b | ||
|
|
127671047f |
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -58,5 +58,5 @@ _If applicable, add screenshots/pictures to help explain your problem._
|
|||||||
_Add any other context about the problem here._
|
_Add any other context about the problem here._
|
||||||
_Please note here in case you are using ioBroker_
|
_Please note here in case you are using ioBroker_
|
||||||
|
|
||||||
### PANEL / FIRMWARE VERSION
|
### PANEL / FIRMWARE VERION
|
||||||
_Please add the Panel/Firmware Version you are using (EU, US-L or US-P)_
|
_Please add the Panel/Firmware Version you are using (EU, US-L or US-P)_
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/feature-request.md
vendored
2
.github/ISSUE_TEMPLATE/feature-request.md
vendored
@@ -24,5 +24,5 @@ _A clear and concise description of what the feature should do._
|
|||||||
### ADDITIONAL CONTEXT
|
### ADDITIONAL CONTEXT
|
||||||
_Add any other context about the problem here._
|
_Add any other context about the problem here._
|
||||||
|
|
||||||
### PANEL / FIRMWARE VERSION
|
### PANEL / FIRMWARE VERION
|
||||||
_Please add the Panel/Firmware Version you are using (EU, US-L or US-P)_
|
_Please add the Panel/Firmware Version you are using (EU, US-L or US-P)_
|
||||||
|
|||||||
4
.github/workflows/builder.yaml
vendored
4
.github/workflows/builder.yaml
vendored
@@ -92,7 +92,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
if: env.BUILD_ARGS != '--test'
|
if: env.BUILD_ARGS != '--test'
|
||||||
uses: docker/login-action@v3.3.0
|
uses: docker/login-action@v3.0.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
@@ -100,7 +100,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build ${{ matrix.addon }} add-on
|
- name: Build ${{ matrix.addon }} add-on
|
||||||
if: steps.check.outputs.build_arch == 'true'
|
if: steps.check.outputs.build_arch == 'true'
|
||||||
uses: home-assistant/builder@2024.08.2
|
uses: home-assistant/builder@2024.01.0
|
||||||
with:
|
with:
|
||||||
args: |
|
args: |
|
||||||
${{ env.BUILD_ARGS }} \
|
${{ env.BUILD_ARGS }} \
|
||||||
|
|||||||
2
.github/workflows/lint.yaml
vendored
2
.github/workflows/lint.yaml
vendored
@@ -36,6 +36,6 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: 🚀 Run Home Assistant Add-on Lint
|
- name: 🚀 Run Home Assistant Add-on Lint
|
||||||
uses: frenck/action-addon-linter@v2.18
|
uses: frenck/action-addon-linter@v2.15
|
||||||
with:
|
with:
|
||||||
path: "./${{ matrix.path }}"
|
path: "./${{ matrix.path }}"
|
||||||
|
|||||||
@@ -102,28 +102,6 @@
|
|||||||
│ crcputs sys0,2
|
│ crcputs sys0,2
|
||||||
│ crcputs tSend.txt,0
|
│ crcputs tSend.txt,0
|
||||||
│ //send cmd
|
│ //send cmd
|
||||||
│ --- HMI/n2t-out/popupLight.txt
|
|
||||||
├── +++ HMI/US/landscape/n2t-out/popupLight.txt
|
|
||||||
│ @@ -453,19 +453,14 @@
|
|
||||||
│ ucopy strCommand.txt,4,payloadLength-5,0
|
|
||||||
│ // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
|
|
||||||
│ spstr strCommand.txt,tInstruction.txt,"~",0
|
|
||||||
│ spstr strCommand.txt,tTmp.txt,"~",1
|
|
||||||
│ if(tInstruction.txt=="entityUpdateDetail"&&entn.txt==tTmp.txt)
|
|
||||||
│ {
|
|
||||||
│ // change icon
|
|
||||||
│ - spstr strCommand.txt,tTmp.txt,"~",2
|
|
||||||
│ - if(tTmp.txt!="")
|
|
||||||
│ - {
|
|
||||||
│ - tIcon1.txt=tTmp.txt
|
|
||||||
│ - }
|
|
||||||
│ //spstr strCommand.txt,tIcon1.txt,"~",2
|
|
||||||
│ vis tIcon1,1
|
|
||||||
│ // change icon color
|
|
||||||
│ spstr strCommand.txt,tTmp.txt,"~",3
|
|
||||||
│ covx tTmp.txt,sys0,0,0
|
|
||||||
│ tIcon1.pco=sys0
|
|
||||||
│ // get Button State
|
|
||||||
│ --- HMI/n2t-out/popupNotify.txt
|
│ --- HMI/n2t-out/popupNotify.txt
|
||||||
├── +++ HMI/US/landscape/n2t-out/popupNotify.txt
|
├── +++ HMI/US/landscape/n2t-out/popupNotify.txt
|
||||||
│ @@ -439,18 +439,14 @@
|
│ @@ -439,18 +439,14 @@
|
||||||
@@ -336,7 +314,7 @@
|
|||||||
│ Value: 0
|
│ Value: 0
|
||||||
│
|
│
|
||||||
│ Variable (int32) xc1
|
│ Variable (int32) xc1
|
||||||
│ @@ -370,165 +336,50 @@
|
│ @@ -370,145 +336,50 @@
|
||||||
│ Scope : local
|
│ Scope : local
|
||||||
│ Dragging : 0
|
│ Dragging : 0
|
||||||
│ Send Component ID : disabled
|
│ Send Component ID : disabled
|
||||||
@@ -347,10 +325,6 @@
|
|||||||
│ - Events
|
│ - Events
|
||||||
│ - Touch Press Event
|
│ - Touch Press Event
|
||||||
│ - tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
│ - tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
||||||
│ - if(entn1.txt=="")
|
|
||||||
│ - {
|
|
||||||
│ - tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -375,10 +349,6 @@
|
|||||||
│ - Events
|
│ - Events
|
||||||
│ - Touch Press Event
|
│ - Touch Press Event
|
||||||
│ - tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
│ - tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
||||||
│ - if(entn2.txt=="")
|
|
||||||
│ - {
|
|
||||||
│ - tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -403,10 +373,6 @@
|
|||||||
│ - Events
|
│ - Events
|
||||||
│ - Touch Press Event
|
│ - Touch Press Event
|
||||||
│ - tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
│ - tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
||||||
│ - if(entn3.txt=="")
|
|
||||||
│ - {
|
|
||||||
│ - tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -431,10 +397,6 @@
|
|||||||
│ - Events
|
│ - Events
|
||||||
│ - Touch Press Event
|
│ - Touch Press Event
|
||||||
│ - tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
│ - tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
||||||
│ - if(entn4.txt=="")
|
|
||||||
│ - {
|
|
||||||
│ - tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -459,10 +421,6 @@
|
|||||||
│ - Events
|
│ - Events
|
||||||
│ - Touch Press Event
|
│ - Touch Press Event
|
||||||
│ - tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
│ - tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
||||||
│ - if(entn5.txt=="")
|
|
||||||
│ - {
|
|
||||||
│ - tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -502,7 +460,7 @@
|
|||||||
│ Send Component ID : disabled
|
│ Send Component ID : disabled
|
||||||
│ Associated Keyboard: none
|
│ Associated Keyboard: none
|
||||||
│ Text : PM
|
│ Text : PM
|
||||||
│ @@ -710,15 +561,14 @@
|
│ @@ -690,15 +561,14 @@
|
||||||
│ if(tTmp.txt!="")
|
│ if(tTmp.txt!="")
|
||||||
│ {
|
│ {
|
||||||
│ covx tTmp.txt,defaultFontColor,0,0
|
│ covx tTmp.txt,defaultFontColor,0,0
|
||||||
@@ -518,7 +476,7 @@
|
|||||||
│ if(tAMPM.txt=="")
|
│ if(tAMPM.txt=="")
|
||||||
│ {
|
│ {
|
||||||
│ vis tAMPM,0
|
│ vis tAMPM,0
|
||||||
│ @@ -839,44 +689,34 @@
|
│ @@ -819,44 +689,34 @@
|
||||||
│ //e6Val
|
│ //e6Val
|
||||||
│ spstr strCommand.txt,e6Val.txt,"~",60
|
│ spstr strCommand.txt,e6Val.txt,"~",60
|
||||||
│ //f1Icon
|
│ //f1Icon
|
||||||
@@ -563,3 +521,22 @@
|
|||||||
│ spstr strCommand.txt,tNotifyText.txt,"~",2
|
│ spstr strCommand.txt,tNotifyText.txt,"~",2
|
||||||
│ if(tNotifyHead.txt!=""||tNotifyText.txt!="")
|
│ if(tNotifyHead.txt!=""||tNotifyText.txt!="")
|
||||||
│ {
|
│ {
|
||||||
|
│ @@ -952,14 +812,18 @@
|
||||||
|
│ {
|
||||||
|
│ page cardPower
|
||||||
|
│ }
|
||||||
|
│ if(tId.txt=="cardChart")
|
||||||
|
│ {
|
||||||
|
│ page cardChart
|
||||||
|
│ }
|
||||||
|
│ + if(tId.txt=="cardLChart")
|
||||||
|
│ + {
|
||||||
|
│ + page cardLChart
|
||||||
|
│ + }
|
||||||
|
│ }
|
||||||
|
│ if(tInstruction.txt=="timeout")
|
||||||
|
│ {
|
||||||
|
│ //set timeout to global var
|
||||||
|
│ spstr strCommand.txt,tTmp.txt,"~",1
|
||||||
|
│ covx tTmp.txt,sleepTimeout,0,0
|
||||||
|
│ }
|
||||||
|
|||||||
@@ -1985,26 +1985,6 @@
|
|||||||
│ Variable (string) entn
|
│ Variable (string) entn
|
||||||
│ Attributes
|
│ Attributes
|
||||||
│ Scope : local
|
│ Scope : local
|
||||||
│ @@ -453,19 +453,14 @@
|
|
||||||
│ ucopy strCommand.txt,4,payloadLength-5,0
|
|
||||||
│ // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
|
|
||||||
│ spstr strCommand.txt,tInstruction.txt,"~",0
|
|
||||||
│ spstr strCommand.txt,tTmp.txt,"~",1
|
|
||||||
│ if(tInstruction.txt=="entityUpdateDetail"&&entn.txt==tTmp.txt)
|
|
||||||
│ {
|
|
||||||
│ // change icon
|
|
||||||
│ - spstr strCommand.txt,tTmp.txt,"~",2
|
|
||||||
│ - if(tTmp.txt!="")
|
|
||||||
│ - {
|
|
||||||
│ - tIcon1.txt=tTmp.txt
|
|
||||||
│ - }
|
|
||||||
│ //spstr strCommand.txt,tIcon1.txt,"~",2
|
|
||||||
│ vis tIcon1,1
|
|
||||||
│ // change icon color
|
|
||||||
│ spstr strCommand.txt,tTmp.txt,"~",3
|
|
||||||
│ covx tTmp.txt,sys0,0,0
|
|
||||||
│ tIcon1.pco=sys0
|
|
||||||
│ // get Button State
|
|
||||||
│ --- HMI/n2t-out/popupNotify.txt
|
│ --- HMI/n2t-out/popupNotify.txt
|
||||||
├── +++ HMI/US/portrait/n2t-out/popupNotify.txt
|
├── +++ HMI/US/portrait/n2t-out/popupNotify.txt
|
||||||
│ @@ -348,15 +348,15 @@
|
│ @@ -348,15 +348,15 @@
|
||||||
@@ -2279,7 +2259,7 @@
|
|||||||
│ Value: 0
|
│ Value: 0
|
||||||
│
|
│
|
||||||
│ Variable (int32) xc1
|
│ Variable (int32) xc1
|
||||||
│ @@ -370,165 +324,50 @@
|
│ @@ -370,145 +324,50 @@
|
||||||
│ Scope : local
|
│ Scope : local
|
||||||
│ Dragging : 0
|
│ Dragging : 0
|
||||||
│ Send Component ID : disabled
|
│ Send Component ID : disabled
|
||||||
@@ -2290,10 +2270,6 @@
|
|||||||
│ - Events
|
│ - Events
|
||||||
│ - Touch Press Event
|
│ - Touch Press Event
|
||||||
│ - tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
│ - tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
||||||
│ - if(entn1.txt=="")
|
|
||||||
│ - {
|
|
||||||
│ - tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -2318,10 +2294,6 @@
|
|||||||
│ - Events
|
│ - Events
|
||||||
│ - Touch Press Event
|
│ - Touch Press Event
|
||||||
│ - tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
│ - tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
||||||
│ - if(entn2.txt=="")
|
|
||||||
│ - {
|
|
||||||
│ - tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -2346,10 +2318,6 @@
|
|||||||
│ - Events
|
│ - Events
|
||||||
│ - Touch Press Event
|
│ - Touch Press Event
|
||||||
│ - tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
│ - tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
||||||
│ - if(entn3.txt=="")
|
|
||||||
│ - {
|
|
||||||
│ - tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -2374,10 +2342,6 @@
|
|||||||
│ - Events
|
│ - Events
|
||||||
│ - Touch Press Event
|
│ - Touch Press Event
|
||||||
│ - tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
│ - tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
||||||
│ - if(entn4.txt=="")
|
|
||||||
│ - {
|
|
||||||
│ - tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -2402,10 +2366,6 @@
|
|||||||
│ - Events
|
│ - Events
|
||||||
│ - Touch Press Event
|
│ - Touch Press Event
|
||||||
│ - tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
│ - tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
||||||
│ - if(entn5.txt=="")
|
|
||||||
│ - {
|
|
||||||
│ - tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -2445,7 +2405,7 @@
|
|||||||
│ Send Component ID : disabled
|
│ Send Component ID : disabled
|
||||||
│ Associated Keyboard: none
|
│ Associated Keyboard: none
|
||||||
│ Text : PM
|
│ Text : PM
|
||||||
│ @@ -710,15 +549,14 @@
|
│ @@ -690,15 +549,14 @@
|
||||||
│ if(tTmp.txt!="")
|
│ if(tTmp.txt!="")
|
||||||
│ {
|
│ {
|
||||||
│ covx tTmp.txt,defaultFontColor,0,0
|
│ covx tTmp.txt,defaultFontColor,0,0
|
||||||
@@ -2461,7 +2421,7 @@
|
|||||||
│ if(tAMPM.txt=="")
|
│ if(tAMPM.txt=="")
|
||||||
│ {
|
│ {
|
||||||
│ vis tAMPM,0
|
│ vis tAMPM,0
|
||||||
│ @@ -839,44 +677,34 @@
|
│ @@ -819,44 +677,34 @@
|
||||||
│ //e6Val
|
│ //e6Val
|
||||||
│ spstr strCommand.txt,e6Val.txt,"~",60
|
│ spstr strCommand.txt,e6Val.txt,"~",60
|
||||||
│ //f1Icon
|
│ //f1Icon
|
||||||
@@ -2506,3 +2466,22 @@
|
|||||||
│ spstr strCommand.txt,tNotifyText.txt,"~",2
|
│ spstr strCommand.txt,tNotifyText.txt,"~",2
|
||||||
│ if(tNotifyHead.txt!=""||tNotifyText.txt!="")
|
│ if(tNotifyHead.txt!=""||tNotifyText.txt!="")
|
||||||
│ {
|
│ {
|
||||||
|
│ @@ -952,14 +800,18 @@
|
||||||
|
│ {
|
||||||
|
│ page cardPower
|
||||||
|
│ }
|
||||||
|
│ if(tId.txt=="cardChart")
|
||||||
|
│ {
|
||||||
|
│ page cardChart
|
||||||
|
│ }
|
||||||
|
│ + if(tId.txt=="cardLChart")
|
||||||
|
│ + {
|
||||||
|
│ + page cardLChart
|
||||||
|
│ + }
|
||||||
|
│ }
|
||||||
|
│ if(tInstruction.txt=="timeout")
|
||||||
|
│ {
|
||||||
|
│ //set timeout to global var
|
||||||
|
│ spstr strCommand.txt,tTmp.txt,"~",1
|
||||||
|
│ covx tTmp.txt,sleepTimeout,0,0
|
||||||
|
│ }
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
+++ /dev/fd/62 2024-11-22 20:00:11.734673876 +0000
|
+++ /dev/fd/62 2024-01-20 19:56:08.135834636 +0000
|
||||||
+I/n2t-out/Program.s.txt
|
+I/n2t-out/Program.s.txt
|
||||||
++ HMI/US/portrait/n2t-out/Program.s.txt
|
++ HMI/US/portrait/n2t-out/Program.s.txt
|
||||||
+1 +12,11 @@
|
+1 +12,11 @@
|
||||||
@@ -686,13 +686,6 @@
|
|||||||
+ covx tTmp.txt,sys0,0,0
|
+ covx tTmp.txt,sys0,0,0
|
||||||
+ hSlider6.maxval=sys0
|
+ hSlider6.maxval=sys0
|
||||||
+ }
|
+ }
|
||||||
+ }
|
|
||||||
+ if(tInstruction.txt=="pageType")
|
|
||||||
+ {
|
|
||||||
+ sleepValue=0
|
|
||||||
+ //command format pageType,specialPageName
|
|
||||||
+ //write name of speical page to tId
|
|
||||||
+ spstr strCommand.txt,tId.txt,"~",1
|
|
||||||
+I/n2t-out/cardGrid.txt
|
+I/n2t-out/cardGrid.txt
|
||||||
++ HMI/US/portrait/n2t-out/cardGrid.txt
|
++ HMI/US/portrait/n2t-out/cardGrid.txt
|
||||||
+ +7,14 @@
|
+ +7,14 @@
|
||||||
@@ -946,6 +939,13 @@
|
|||||||
+ spstr strCommand.txt,tEntity9.txt,"~",66
|
+ spstr strCommand.txt,tEntity9.txt,"~",66
|
||||||
+ vis tEntity9,1
|
+ vis tEntity9,1
|
||||||
+ }
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if(tInstruction.txt=="pageType")
|
||||||
|
+ {
|
||||||
|
+ sleepValue=0
|
||||||
|
+ //command format pageType,specialPageName
|
||||||
|
+ //write name of speical page to tId
|
||||||
|
+ spstr strCommand.txt,tId.txt,"~",1
|
||||||
+I/n2t-out/cardLChart.txt
|
+I/n2t-out/cardLChart.txt
|
||||||
++ HMI/US/portrait/n2t-out/cardLChart.txt
|
++ HMI/US/portrait/n2t-out/cardLChart.txt
|
||||||
+ +7,14 @@
|
+ +7,14 @@
|
||||||
@@ -1527,26 +1527,6 @@
|
|||||||
+e (string) entn
|
+e (string) entn
|
||||||
+ributes
|
+ributes
|
||||||
+ Scope : local
|
+ Scope : local
|
||||||
+19 +453,14 @@
|
|
||||||
+ ucopy strCommand.txt,4,payloadLength-5,0
|
|
||||||
+ // write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
|
|
||||||
+ spstr strCommand.txt,tInstruction.txt,"~",0
|
|
||||||
+ spstr strCommand.txt,tTmp.txt,"~",1
|
|
||||||
+ if(tInstruction.txt=="entityUpdateDetail"&&entn.txt==tTmp.txt)
|
|
||||||
+ {
|
|
||||||
+ // change icon
|
|
||||||
+ spstr strCommand.txt,tTmp.txt,"~",2
|
|
||||||
+ if(tTmp.txt!="")
|
|
||||||
+ {
|
|
||||||
+ tIcon1.txt=tTmp.txt
|
|
||||||
+ }
|
|
||||||
+ //spstr strCommand.txt,tIcon1.txt,"~",2
|
|
||||||
+ vis tIcon1,1
|
|
||||||
+ // change icon color
|
|
||||||
+ spstr strCommand.txt,tTmp.txt,"~",3
|
|
||||||
+ covx tTmp.txt,sys0,0,0
|
|
||||||
+ tIcon1.pco=sys0
|
|
||||||
+ // get Button State
|
|
||||||
+I/n2t-out/popupNotify.txt
|
+I/n2t-out/popupNotify.txt
|
||||||
++ HMI/US/portrait/n2t-out/popupNotify.txt
|
++ HMI/US/portrait/n2t-out/popupNotify.txt
|
||||||
+15 +348,15 @@
|
+15 +348,15 @@
|
||||||
@@ -1821,7 +1801,7 @@
|
|||||||
+ Value: 0
|
+ Value: 0
|
||||||
+
|
+
|
||||||
+e (int32) xc1
|
+e (int32) xc1
|
||||||
+165 +324,50 @@
|
+145 +324,50 @@
|
||||||
+ Scope : local
|
+ Scope : local
|
||||||
+ Dragging : 0
|
+ Dragging : 0
|
||||||
+ Send Component ID : disabled
|
+ Send Component ID : disabled
|
||||||
@@ -1832,10 +1812,6 @@
|
|||||||
+nts
|
+nts
|
||||||
+ Touch Press Event
|
+ Touch Press Event
|
||||||
+ tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
+ tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
||||||
+ if(entn1.txt=="")
|
|
||||||
+ {
|
|
||||||
+ tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -1860,10 +1836,6 @@
|
|||||||
+nts
|
+nts
|
||||||
+ Touch Press Event
|
+ Touch Press Event
|
||||||
+ tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
+ tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
||||||
+ if(entn2.txt=="")
|
|
||||||
+ {
|
|
||||||
+ tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -1888,10 +1860,6 @@
|
|||||||
+nts
|
+nts
|
||||||
+ Touch Press Event
|
+ Touch Press Event
|
||||||
+ tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
+ tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
||||||
+ if(entn3.txt=="")
|
|
||||||
+ {
|
|
||||||
+ tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -1916,10 +1884,6 @@
|
|||||||
+nts
|
+nts
|
||||||
+ Touch Press Event
|
+ Touch Press Event
|
||||||
+ tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
+ tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
||||||
+ if(entn4.txt=="")
|
|
||||||
+ {
|
|
||||||
+ tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -1944,10 +1908,6 @@
|
|||||||
+nts
|
+nts
|
||||||
+ Touch Press Event
|
+ Touch Press Event
|
||||||
+ tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
+ tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
||||||
+ if(entn5.txt=="")
|
|
||||||
+ {
|
|
||||||
+ tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -2048,3 +2008,22 @@
|
|||||||
+ spstr strCommand.txt,tNotifyText.txt,"~",2
|
+ spstr strCommand.txt,tNotifyText.txt,"~",2
|
||||||
+ if(tNotifyHead.txt!=""||tNotifyText.txt!="")
|
+ if(tNotifyHead.txt!=""||tNotifyText.txt!="")
|
||||||
+ {
|
+ {
|
||||||
|
+14 +800,18 @@
|
||||||
|
+ {
|
||||||
|
+ page cardPower
|
||||||
|
+ }
|
||||||
|
+ if(tId.txt=="cardChart")
|
||||||
|
+ {
|
||||||
|
+ page cardChart
|
||||||
|
+ }
|
||||||
|
+ if(tId.txt=="cardLChart")
|
||||||
|
+ {
|
||||||
|
+ page cardLChart
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if(tInstruction.txt=="timeout")
|
||||||
|
+ {
|
||||||
|
+ //set timeout to global var
|
||||||
|
+ spstr strCommand.txt,tTmp.txt,"~",1
|
||||||
|
+ covx tTmp.txt,sleepTimeout,0,0
|
||||||
|
+ }
|
||||||
|
|||||||
@@ -30,10 +30,6 @@ popupLightNew
|
|||||||
23 Component(s)
|
23 Component(s)
|
||||||
412 Line(s) of event code
|
412 Line(s) of event code
|
||||||
209 Unique line(s) of event code
|
209 Unique line(s) of event code
|
||||||
popupLight
|
|
||||||
28 Component(s)
|
|
||||||
417 Line(s) of event code
|
|
||||||
228 Unique line(s) of event code
|
|
||||||
cardGrid2
|
cardGrid2
|
||||||
52 Component(s)
|
52 Component(s)
|
||||||
703 Line(s) of event code
|
703 Line(s) of event code
|
||||||
@@ -58,6 +54,10 @@ cardLChart
|
|||||||
33 Component(s)
|
33 Component(s)
|
||||||
412 Line(s) of event code
|
412 Line(s) of event code
|
||||||
267 Unique line(s) of event code
|
267 Unique line(s) of event code
|
||||||
|
popupLight
|
||||||
|
28 Component(s)
|
||||||
|
412 Line(s) of event code
|
||||||
|
227 Unique line(s) of event code
|
||||||
cardPower
|
cardPower
|
||||||
54 Component(s)
|
54 Component(s)
|
||||||
541 Line(s) of event code
|
541 Line(s) of event code
|
||||||
@@ -66,6 +66,10 @@ cardThermo
|
|||||||
57 Component(s)
|
57 Component(s)
|
||||||
550 Line(s) of event code
|
550 Line(s) of event code
|
||||||
320 Unique line(s) of event code
|
320 Unique line(s) of event code
|
||||||
|
screensaver2
|
||||||
|
64 Component(s)
|
||||||
|
424 Line(s) of event code
|
||||||
|
264 Unique line(s) of event code
|
||||||
popupInSel
|
popupInSel
|
||||||
34 Component(s)
|
34 Component(s)
|
||||||
621 Line(s) of event code
|
621 Line(s) of event code
|
||||||
@@ -86,10 +90,6 @@ popupThermo
|
|||||||
44 Component(s)
|
44 Component(s)
|
||||||
523 Line(s) of event code
|
523 Line(s) of event code
|
||||||
276 Unique line(s) of event code
|
276 Unique line(s) of event code
|
||||||
screensaver2
|
|
||||||
64 Component(s)
|
|
||||||
448 Line(s) of event code
|
|
||||||
272 Unique line(s) of event code
|
|
||||||
cardEntities
|
cardEntities
|
||||||
67 Component(s)
|
67 Component(s)
|
||||||
1205 Line(s) of event code
|
1205 Line(s) of event code
|
||||||
@@ -98,5 +98,5 @@ cardEntities
|
|||||||
Total
|
Total
|
||||||
23 Page(s)
|
23 Page(s)
|
||||||
881 Component(s)
|
881 Component(s)
|
||||||
10798 Line(s) of event code
|
10769 Line(s) of event code
|
||||||
2472 Unique line(s) of event code
|
2466 Unique line(s) of event code
|
||||||
|
|||||||
@@ -806,11 +806,6 @@ Timer tmSerial
|
|||||||
if(tInstruction.txt=="entityUpdateDetail"&&entn.txt==tTmp.txt)
|
if(tInstruction.txt=="entityUpdateDetail"&&entn.txt==tTmp.txt)
|
||||||
{
|
{
|
||||||
// change icon
|
// change icon
|
||||||
spstr strCommand.txt,tTmp.txt,"~",2
|
|
||||||
if(tTmp.txt!="")
|
|
||||||
{
|
|
||||||
tIcon1.txt=tTmp.txt
|
|
||||||
}
|
|
||||||
//spstr strCommand.txt,tIcon1.txt,"~",2
|
//spstr strCommand.txt,tIcon1.txt,"~",2
|
||||||
vis tIcon1,1
|
vis tIcon1,1
|
||||||
// change icon color
|
// change icon color
|
||||||
|
|||||||
@@ -903,10 +903,6 @@ Text f1Icon
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
||||||
if(entn1.txt=="")
|
|
||||||
{
|
|
||||||
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -951,10 +947,6 @@ Text f2Icon
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
||||||
if(entn2.txt=="")
|
|
||||||
{
|
|
||||||
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -999,10 +991,6 @@ Text f3Icon
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
||||||
if(entn3.txt=="")
|
|
||||||
{
|
|
||||||
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -1047,10 +1035,6 @@ Text f4Icon
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
||||||
if(entn4.txt=="")
|
|
||||||
{
|
|
||||||
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -1095,10 +1079,6 @@ Text f5Icon
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
||||||
if(entn5.txt=="")
|
|
||||||
{
|
|
||||||
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -1814,10 +1794,6 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
if(tId.txt=="cardLChart")
|
|
||||||
{
|
|
||||||
page cardLChart
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="timeout")
|
if(tInstruction.txt=="timeout")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -457,11 +457,6 @@ Timer tmSerial
|
|||||||
if(tInstruction.txt=="entityUpdateDetail"&&entn.txt==tTmp.txt)
|
if(tInstruction.txt=="entityUpdateDetail"&&entn.txt==tTmp.txt)
|
||||||
{
|
{
|
||||||
// change icon
|
// change icon
|
||||||
spstr strCommand.txt,tTmp.txt,"~",2
|
|
||||||
if(tTmp.txt!="")
|
|
||||||
{
|
|
||||||
tIcon1.txt=tTmp.txt
|
|
||||||
}
|
|
||||||
//spstr strCommand.txt,tIcon1.txt,"~",2
|
//spstr strCommand.txt,tIcon1.txt,"~",2
|
||||||
vis tIcon1,1
|
vis tIcon1,1
|
||||||
// change icon color
|
// change icon color
|
||||||
|
|||||||
@@ -377,10 +377,6 @@ Text f1Icon
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
tSend.txt="event,buttonPress2,"+entn1.txt+",button"
|
||||||
if(entn1.txt=="")
|
|
||||||
{
|
|
||||||
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -405,10 +401,6 @@ Text f2Icon
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
tSend.txt="event,buttonPress2,"+entn2.txt+",button"
|
||||||
if(entn2.txt=="")
|
|
||||||
{
|
|
||||||
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -433,10 +425,6 @@ Text f3Icon
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
tSend.txt="event,buttonPress2,"+entn3.txt+",button"
|
||||||
if(entn3.txt=="")
|
|
||||||
{
|
|
||||||
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -461,10 +449,6 @@ Text f4Icon
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
tSend.txt="event,buttonPress2,"+entn4.txt+",button"
|
||||||
if(entn4.txt=="")
|
|
||||||
{
|
|
||||||
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -489,10 +473,6 @@ Text f5Icon
|
|||||||
Events
|
Events
|
||||||
Touch Press Event
|
Touch Press Event
|
||||||
tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
tSend.txt="event,buttonPress2,"+entn5.txt+",button"
|
||||||
if(entn5.txt=="")
|
|
||||||
{
|
|
||||||
tSend.txt="event,buttonPress2,screensaver,bExit,"+tTmp.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
|
||||||
@@ -976,10 +956,6 @@ Timer tmSerial
|
|||||||
{
|
{
|
||||||
page cardChart
|
page cardChart
|
||||||
}
|
}
|
||||||
if(tId.txt=="cardLChart")
|
|
||||||
{
|
|
||||||
page cardLChart
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(tInstruction.txt=="timeout")
|
if(tInstruction.txt=="timeout")
|
||||||
{
|
{
|
||||||
|
|||||||
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
@@ -5,7 +5,7 @@ If you like this project consider buying me a pizza 🍕 <a href="https://paypal
|
|||||||
[](https://github.com/hacs/integration)
|
[](https://github.com/hacs/integration)
|
||||||

|

|
||||||
[](https://github.com/joBr99/nspanel-lovelace-ui/releases)
|
[](https://github.com/joBr99/nspanel-lovelace-ui/releases)
|
||||||

|

|
||||||
[](https://github.com/joBr99/nspanel-lovelace-ui/commits/main)
|
[](https://github.com/joBr99/nspanel-lovelace-ui/commits/main)
|
||||||
|
|
||||||
|
|
||||||
@@ -65,5 +65,3 @@ SmartHomeNG: https://github.com/sisamiwe/shng-nspanel-plugin
|
|||||||
OpenHAB: https://github.com/donoo/o2n2l
|
OpenHAB: https://github.com/donoo/o2n2l
|
||||||
|
|
||||||
NodeRed: https://github.com/laluz742/node-red-contrib-nspanel-lui
|
NodeRed: https://github.com/laluz742/node-red-contrib-nspanel-lui
|
||||||
|
|
||||||
ESPHome without any Backend: https://github.com/olicooper/esphome-nspanel-lovelace-native
|
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
ha_api = None
|
ha_api = None
|
||||||
mqtt_api = None
|
mqtt_api = None
|
||||||
ad_api = None
|
|
||||||
@@ -132,7 +132,6 @@ class LuiBackendConfig(object):
|
|||||||
'sleepTrackingZones': ["not_home", "off"],
|
'sleepTrackingZones': ["not_home", "off"],
|
||||||
'sleepOverride': None,
|
'sleepOverride': None,
|
||||||
'locale': "en_US",
|
'locale': "en_US",
|
||||||
'quiet': True,
|
|
||||||
'timeFormat': "%H:%M",
|
'timeFormat': "%H:%M",
|
||||||
'dateFormatBabel': "full",
|
'dateFormatBabel': "full",
|
||||||
'dateAdditionalTemplate': "",
|
'dateAdditionalTemplate': "",
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import datetime
|
|||||||
import apis
|
import apis
|
||||||
from helper import scale, pos_to_color, rgb_dec565
|
from helper import scale, pos_to_color, rgb_dec565
|
||||||
from pages import LuiPagesGen
|
from pages import LuiPagesGen
|
||||||
from luibackend.config import Card
|
|
||||||
|
|
||||||
class LuiController(object):
|
class LuiController(object):
|
||||||
|
|
||||||
@@ -334,11 +333,6 @@ class LuiController(object):
|
|||||||
apis.ha_api.get_entity(entity_id).call_service("return_to_base")
|
apis.ha_api.get_entity(entity_id).call_service("return_to_base")
|
||||||
elif entity_id.startswith('service'):
|
elif entity_id.startswith('service'):
|
||||||
apis.ha_api.call_service(entity_id.replace('service.', '', 1).replace('.','/', 1), **entity_config.data)
|
apis.ha_api.call_service(entity_id.replace('service.', '', 1).replace('.','/', 1), **entity_config.data)
|
||||||
elif entity_id.startswith('valve'):
|
|
||||||
if apis.ha_api.get_entity(entity_id).state == "open":
|
|
||||||
apis.ha_api.get_entity(entity_id).call_service("close_valve")
|
|
||||||
else:
|
|
||||||
apis.ha_api.get_entity(entity_id).call_service("open_valve")
|
|
||||||
|
|
||||||
# for media page
|
# for media page
|
||||||
if button_type == "media-next":
|
if button_type == "media-next":
|
||||||
@@ -353,8 +347,8 @@ class LuiController(object):
|
|||||||
else:
|
else:
|
||||||
apis.ha_api.get_entity(entity_id).call_service("turn_off")
|
apis.ha_api.get_entity(entity_id).call_service("turn_off")
|
||||||
if button_type == "media-shuffle":
|
if button_type == "media-shuffle":
|
||||||
shuffle = not apis.ha_api.get_entity(entity_id).attributes['shuffle']
|
suffle = not apis.ha_api.get_entity(entity_id).attributes.shuffle
|
||||||
apis.ha_api.get_entity(entity_id).call_service("shuffle_set", shuffle=shuffle)
|
apis.ha_api.get_entity(entity_id).call_service("shuffle_set", shuffle=suffle)
|
||||||
if button_type == "volumeSlider":
|
if button_type == "volumeSlider":
|
||||||
pos = int(value)
|
pos = int(value)
|
||||||
# HA wants this value between 0 and 1 as float
|
# HA wants this value between 0 and 1 as float
|
||||||
@@ -371,7 +365,7 @@ class LuiController(object):
|
|||||||
if button_type == "colorTempSlider":
|
if button_type == "colorTempSlider":
|
||||||
entity = apis.ha_api.get_entity(entity_id)
|
entity = apis.ha_api.get_entity(entity_id)
|
||||||
#scale 0-100 from slider to color range of lamp
|
#scale 0-100 from slider to color range of lamp
|
||||||
color_val = scale(int(value), (0, 100), (entity.attributes['min_mireds'], entity.attributes['max_mireds']))
|
color_val = scale(int(value), (0, 100), (entity.attributes.min_mireds, entity.attributes.max_mireds))
|
||||||
apis.ha_api.get_entity(entity_id).call_service("turn_on", color_temp=color_val)
|
apis.ha_api.get_entity(entity_id).call_service("turn_on", color_temp=color_val)
|
||||||
if button_type == "colorWheel":
|
if button_type == "colorWheel":
|
||||||
apis.ha_api.log(value)
|
apis.ha_api.log(value)
|
||||||
@@ -398,9 +392,9 @@ class LuiController(object):
|
|||||||
if button_type == "opnSensorNotify":
|
if button_type == "opnSensorNotify":
|
||||||
msg = ""
|
msg = ""
|
||||||
entity = apis.ha_api.get_entity(entity_id)
|
entity = apis.ha_api.get_entity(entity_id)
|
||||||
if open_sensors := entity.attributes.get("open_sensors") is not None:
|
if "open_sensors" in entity.attributes and entity.attributes.open_sensors is not None:
|
||||||
for e in open_sensors:
|
for e in entity.attributes.open_sensors:
|
||||||
msg += f"- {apis.ha_api.get_entity(e).attributes['friendly_name']}\r\n"
|
msg += f"- {apis.ha_api.get_entity(e).attributes.friendly_name}\r\n"
|
||||||
self._pages_gen.send_message_page("opnSensorNotifyRes", "", msg, "", "")
|
self._pages_gen.send_message_page("opnSensorNotifyRes", "", msg, "", "")
|
||||||
|
|
||||||
# for cardUnlock
|
# for cardUnlock
|
||||||
@@ -417,22 +411,22 @@ class LuiController(object):
|
|||||||
|
|
||||||
if button_type == "mode-preset_modes":
|
if button_type == "mode-preset_modes":
|
||||||
entity = apis.ha_api.get_entity(entity_id)
|
entity = apis.ha_api.get_entity(entity_id)
|
||||||
preset_mode = entity.attributes['preset_modes'][int(value)]
|
preset_mode = entity.attributes.preset_modes[int(value)]
|
||||||
entity.call_service("set_preset_mode", preset_mode=preset_mode)
|
entity.call_service("set_preset_mode", preset_mode=preset_mode)
|
||||||
|
|
||||||
if button_type == "mode-swing_modes":
|
if button_type == "mode-swing_modes":
|
||||||
entity = apis.ha_api.get_entity(entity_id)
|
entity = apis.ha_api.get_entity(entity_id)
|
||||||
swing_mode = entity.attributes['swing_modes'][int(value)]
|
swing_mode = entity.attributes.swing_modes[int(value)]
|
||||||
entity.call_service("set_swing_mode", swing_mode=swing_mode)
|
entity.call_service("set_swing_mode", swing_mode=swing_mode)
|
||||||
|
|
||||||
if button_type == "mode-fan_modes":
|
if button_type == "mode-fan_modes":
|
||||||
entity = apis.ha_api.get_entity(entity_id)
|
entity = apis.ha_api.get_entity(entity_id)
|
||||||
fan_mode = entity.attributes['fan_modes'][int(value)]
|
fan_mode = entity.attributes.fan_modes[int(value)]
|
||||||
entity.call_service("set_fan_mode", fan_mode=fan_mode)
|
entity.call_service("set_fan_mode", fan_mode=fan_mode)
|
||||||
|
|
||||||
if button_type in ["mode-input_select", "mode-select"]:
|
if button_type in ["mode-input_select", "mode-select"]:
|
||||||
entity = apis.ha_api.get_entity(entity_id)
|
entity = apis.ha_api.get_entity(entity_id)
|
||||||
option = entity.attributes['options'][int(value)]
|
option = entity.attributes.options[int(value)]
|
||||||
entity.call_service("select_option", option=option)
|
entity.call_service("select_option", option=option)
|
||||||
|
|
||||||
if button_type == "mode-light":
|
if button_type == "mode-light":
|
||||||
@@ -444,12 +438,12 @@ class LuiController(object):
|
|||||||
if options_list is not None:
|
if options_list is not None:
|
||||||
option = options_list[int(value)]
|
option = options_list[int(value)]
|
||||||
else:
|
else:
|
||||||
option = entity.attributes['effect_list'][int(value)]
|
option = entity.attributes.effect_list[int(value)]
|
||||||
entity.call_service("turn_on", effect=option)
|
entity.call_service("turn_on", effect=option)
|
||||||
|
|
||||||
if button_type == "mode-media_player":
|
if button_type == "mode-media_player":
|
||||||
entity = apis.ha_api.get_entity(entity_id)
|
entity = apis.ha_api.get_entity(entity_id)
|
||||||
option = entity.attributes['source_list'][int(value)]
|
option = entity.attributes.source_list[int(value)]
|
||||||
entity.call_service("select_source", source=option)
|
entity.call_service("select_source", source=option)
|
||||||
|
|
||||||
# timer detail page
|
# timer detail page
|
||||||
@@ -464,9 +458,3 @@ class LuiController(object):
|
|||||||
apis.ha_api.get_entity(entity_id).call_service("pause")
|
apis.ha_api.get_entity(entity_id).call_service("pause")
|
||||||
if button_type == "timer-finish":
|
if button_type == "timer-finish":
|
||||||
apis.ha_api.get_entity(entity_id).call_service("finish")
|
apis.ha_api.get_entity(entity_id).call_service("finish")
|
||||||
|
|
||||||
@property
|
|
||||||
def current_card(self) -> Card:
|
|
||||||
"""Used to get the current card"""
|
|
||||||
|
|
||||||
return self._current_card
|
|
||||||
|
|||||||
@@ -159,8 +159,8 @@ alarm_control_panel_mapping = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
climate_mapping = {
|
climate_mapping = {
|
||||||
'auto': 'fan-auto',
|
'auto': 'calendar-sync',
|
||||||
'heat_cool': 'sun-snowflake-variant',
|
'heat_cool': 'calendar-sync',
|
||||||
'heat': 'fire',
|
'heat': 'fire',
|
||||||
'off': 'power',
|
'off': 'power',
|
||||||
'cool': 'snowflake',
|
'cool': 'snowflake',
|
||||||
@@ -213,9 +213,6 @@ def get_icon_ha(entity_id, overwrite=None, stateOverwrite=None):
|
|||||||
entity = apis.ha_api.get_entity(entity_id)
|
entity = apis.ha_api.get_entity(entity_id)
|
||||||
state = entity.state if stateOverwrite is None else stateOverwrite
|
state = entity.state if stateOverwrite is None else stateOverwrite
|
||||||
|
|
||||||
if entity_id in ["sensor.weather_forecast_daily", "sensor.weather_forecast_hourly"]:
|
|
||||||
ha_type = "weather"
|
|
||||||
|
|
||||||
if overwrite is not None:
|
if overwrite is not None:
|
||||||
if type(overwrite) is str:
|
if type(overwrite) is str:
|
||||||
return get_icon_char(overwrite)
|
return get_icon_char(overwrite)
|
||||||
@@ -266,8 +263,8 @@ def get_icon_ha(entity_id, overwrite=None, stateOverwrite=None):
|
|||||||
# based on media_content_type
|
# based on media_content_type
|
||||||
elif ha_type == "media_player":
|
elif ha_type == "media_player":
|
||||||
result_icon = "speaker-off"
|
result_icon = "speaker-off"
|
||||||
if media_content_type := entity.attributes.get("media_content_type"):
|
if "media_content_type" in entity.attributes:
|
||||||
if media_content_type in media_content_type_mapping:
|
if entity.attributes.media_content_type in media_content_type_mapping:
|
||||||
result_icon = media_content_type_mapping[media_content_type]
|
result_icon = media_content_type_mapping[entity.attributes.media_content_type]
|
||||||
|
|
||||||
return get_icon_char(result_icon)
|
return get_icon_char(result_icon)
|
||||||
|
|||||||
@@ -77,13 +77,12 @@ class LuiMqttListener(object):
|
|||||||
self._controller.detail_open(msg[2], msg[3])
|
self._controller.detail_open(msg[2], msg[3])
|
||||||
|
|
||||||
class LuiMqttSender(object):
|
class LuiMqttSender(object):
|
||||||
def __init__(self, api, use_api, topic_send, api_panel_name, quiet):
|
def __init__(self, api, use_api, topic_send, api_panel_name):
|
||||||
self._ha_api = api
|
self._ha_api = api
|
||||||
self._use_api = use_api
|
self._use_api = use_api
|
||||||
self._topic_send = topic_send
|
self._topic_send = topic_send
|
||||||
self._api_panel_name = api_panel_name
|
self._api_panel_name = api_panel_name
|
||||||
self._prev_msg = ""
|
self._prev_msg = ""
|
||||||
self._quiet = quiet
|
|
||||||
|
|
||||||
def send_mqtt_msg(self, msg, topic=None, force=False):
|
def send_mqtt_msg(self, msg, topic=None, force=False):
|
||||||
if not force and self._prev_msg == msg:
|
if not force and self._prev_msg == msg:
|
||||||
@@ -91,9 +90,7 @@ class LuiMqttSender(object):
|
|||||||
return
|
return
|
||||||
self._prev_msg = msg
|
self._prev_msg = msg
|
||||||
|
|
||||||
if self._quiet is False:
|
|
||||||
apis.ha_api.log(f"Sending Message: {msg}")
|
apis.ha_api.log(f"Sending Message: {msg}")
|
||||||
|
|
||||||
if self._use_api:
|
if self._use_api:
|
||||||
apis.ha_api.call_service(service="esphome/" + self._api_panel_name + "_nspanelui_api_call", command=2, data=msg)
|
apis.ha_api.call_service(service="esphome/" + self._api_panel_name + "_nspanelui_api_call", command=2, data=msg)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -97,12 +97,13 @@ class LuiPagesGen(object):
|
|||||||
if state == "sunny":
|
if state == "sunny":
|
||||||
icon_color = 65504 #bright-yellow
|
icon_color = 65504 #bright-yellow
|
||||||
|
|
||||||
if color := attr.get("rgb_color"):
|
if "rgb_color" in attr and attr.rgb_color:
|
||||||
if brightness := attr.get("brightness"):
|
color = attr.rgb_color
|
||||||
color = rgb_brightness(color, brightness)
|
if "brightness" in attr and attr.brightness:
|
||||||
|
color = rgb_brightness(color, attr.brightness)
|
||||||
icon_color = rgb_dec565(color)
|
icon_color = rgb_dec565(color)
|
||||||
elif brightness := attr.get("brightness"):
|
elif "brightness" in attr and attr.brightness:
|
||||||
color = rgb_brightness([253, 216, 53], brightness)
|
color = rgb_brightness([253, 216, 53], attr.brightness)
|
||||||
icon_color = rgb_dec565(color)
|
icon_color = rgb_dec565(color)
|
||||||
return icon_color
|
return icon_color
|
||||||
|
|
||||||
@@ -191,9 +192,6 @@ class LuiPagesGen(object):
|
|||||||
else:
|
else:
|
||||||
entityType = "delete"
|
entityType = "delete"
|
||||||
|
|
||||||
if entityId in ["sensor.weather_forecast_daily", "sensor.weather_forecast_hourly"]:
|
|
||||||
entityType = "weather"
|
|
||||||
|
|
||||||
apis.ha_api.log(f"Generating item for {entityId} with type {entityType}", level="DEBUG")
|
apis.ha_api.log(f"Generating item for {entityId} with type {entityType}", level="DEBUG")
|
||||||
|
|
||||||
status_entity = apis.ha_api.get_entity(item.status) if item.status and apis.ha_api.entity_exists(item.status) else None
|
status_entity = apis.ha_api.get_entity(item.status) if item.status and apis.ha_api.entity_exists(item.status) else None
|
||||||
@@ -223,7 +221,7 @@ class LuiPagesGen(object):
|
|||||||
if status_entity:
|
if status_entity:
|
||||||
icon_res = get_icon_ha(item.status, overwrite=icon)
|
icon_res = get_icon_ha(item.status, overwrite=icon)
|
||||||
icon_color = self.get_entity_color(status_entity, ha_type=item.status.split(".")[0], overwrite=colorOverride)
|
icon_color = self.get_entity_color(status_entity, ha_type=item.status.split(".")[0], overwrite=colorOverride)
|
||||||
if item.status.startswith("sensor") and cardType in ["cardGrid", "cardGrid1", "cardGrid2"] and item.iconOverride is None:
|
if item.status.startswith("sensor") and (cardType == "cardGrid" or cardType == "cardGrid2") and item.iconOverride is None:
|
||||||
icon_res = status_entity.state[:4]
|
icon_res = status_entity.state[:4]
|
||||||
if icon_res[-1] == ".":
|
if icon_res[-1] == ".":
|
||||||
icon_res = icon_res[:-1]
|
icon_res = icon_res[:-1]
|
||||||
@@ -247,7 +245,7 @@ class LuiPagesGen(object):
|
|||||||
if status_entity:
|
if status_entity:
|
||||||
icon_id = get_icon_ha(item.status, overwrite=icon)
|
icon_id = get_icon_ha(item.status, overwrite=icon)
|
||||||
icon_color = self.get_entity_color(status_entity, ha_type=item.status.split(".")[0], overwrite=colorOverride)
|
icon_color = self.get_entity_color(status_entity, ha_type=item.status.split(".")[0], overwrite=colorOverride)
|
||||||
if item.status.startswith("sensor") and cardType in ["cardGrid", "cardGrid1", "cardGrid2"] and item.iconOverride is None:
|
if item.status.startswith("sensor") and (cardType == "cardGrid" or cardType == "cardGrid2") and item.iconOverride is None:
|
||||||
icon_id = status_entity.state[:4]
|
icon_id = status_entity.state[:4]
|
||||||
if icon_id[-1] == ".":
|
if icon_id[-1] == ".":
|
||||||
icon_id = icon_id[:-1]
|
icon_id = icon_id[:-1]
|
||||||
@@ -275,7 +273,7 @@ class LuiPagesGen(object):
|
|||||||
icon_up_status = "disable"
|
icon_up_status = "disable"
|
||||||
icon_stop_status = "disable"
|
icon_stop_status = "disable"
|
||||||
icon_down_status = "disable"
|
icon_down_status = "disable"
|
||||||
bits = entity.attributes.get('supported_features')
|
bits = entity.attributes.supported_features
|
||||||
pos = entity.attributes.get("current_position")
|
pos = entity.attributes.get("current_position")
|
||||||
if pos is None:
|
if pos is None:
|
||||||
pos_status = entity.state
|
pos_status = entity.state
|
||||||
@@ -320,7 +318,7 @@ class LuiPagesGen(object):
|
|||||||
value = value + unit_of_measurement
|
value = value + unit_of_measurement
|
||||||
if entityType == "binary_sensor":
|
if entityType == "binary_sensor":
|
||||||
value = get_translation(self._locale, f"backend.component.binary_sensor.state.{device_class}.{entity.state}")
|
value = get_translation(self._locale, f"backend.component.binary_sensor.state.{device_class}.{entity.state}")
|
||||||
if cardType in ["cardGrid", "cardGrid1", "cardGrid2"] and entityType == "sensor" and icon is None:
|
if (cardType == "cardGrid" or cardType == "cardGrid2") and entityType == "sensor" and icon is None:
|
||||||
icon_id = entity.state[:4]
|
icon_id = entity.state[:4]
|
||||||
if icon_id[-1] == ".":
|
if icon_id[-1] == ".":
|
||||||
icon_id = icon_id[:-1]
|
icon_id = icon_id[:-1]
|
||||||
@@ -382,14 +380,8 @@ class LuiPagesGen(object):
|
|||||||
elif entityType == "weather":
|
elif entityType == "weather":
|
||||||
entityTypePanel = "text"
|
entityTypePanel = "text"
|
||||||
unit = get_attr_safe(entity, "temperature_unit", "")
|
unit = get_attr_safe(entity, "temperature_unit", "")
|
||||||
if type(item.stype) == int:
|
if type(item.stype) == int and len(entity.attributes.forecast) >= item.stype:
|
||||||
results = apis.ha_api.call_service(
|
fdate = dp.parse(entity.attributes.forecast[item.stype]['datetime'])
|
||||||
"weather/get_forecasts", target={"entity_id": entityId}, service_data={"type": "daily"}
|
|
||||||
)
|
|
||||||
forecast = results.get("result", {}).get("response", {}).get(entityId, {}).get('forecast') or entity.attributes.get('forecast', [])
|
|
||||||
if len(forecast) >= item.stype:
|
|
||||||
day_forecast = forecast[item.stype]
|
|
||||||
fdate = dp.parse(day_forecast['datetime'])
|
|
||||||
global babel_spec
|
global babel_spec
|
||||||
if babel_spec is not None:
|
if babel_spec is not None:
|
||||||
dateformat = "E" if item.nameOverride is None else item.nameOverride
|
dateformat = "E" if item.nameOverride is None else item.nameOverride
|
||||||
@@ -397,20 +389,11 @@ class LuiPagesGen(object):
|
|||||||
else:
|
else:
|
||||||
dateformat = "%a" if item.nameOverride is None else item.nameOverride
|
dateformat = "%a" if item.nameOverride is None else item.nameOverride
|
||||||
name = fdate.astimezone().strftime(dateformat)
|
name = fdate.astimezone().strftime(dateformat)
|
||||||
icon_id = get_icon_ha(entityId, stateOverwrite=day_forecast['condition'])
|
icon_id = get_icon_ha(entityId, stateOverwrite=entity.attributes.forecast[item.stype]['condition'])
|
||||||
value = f'{day_forecast.get("temperature", "")}{unit}'
|
value = f'{entity.attributes.forecast[item.stype].get("temperature", "")}{unit}'
|
||||||
color = self.get_entity_color(entity, ha_type=entityType, stateOverwrite=day_forecast['condition'], overwrite=colorOverride)
|
color = self.get_entity_color(entity, ha_type=entityType, stateOverwrite=entity.attributes.forecast[item.stype]['condition'], overwrite=colorOverride)
|
||||||
else:
|
else:
|
||||||
value = f'{get_attr_safe(entity, "temperature", "")}{unit}'
|
value = f'{get_attr_safe(entity, "temperature", "")}{unit}'
|
||||||
else:
|
|
||||||
value = f'{get_attr_safe(entity, "temperature", "")}{unit}'
|
|
||||||
elif entityType == "valve":
|
|
||||||
entityTypePanel = "valve"
|
|
||||||
value = get_translation(self._locale, f"backend.component.binary_sensor.state.door.{entity.state}")
|
|
||||||
if entity.state == "open":
|
|
||||||
icon_id = get_icon_id("valve-open")
|
|
||||||
else:
|
|
||||||
icon_id = get_icon_id("valve-closed")
|
|
||||||
else:
|
else:
|
||||||
name = "unsupported"
|
name = "unsupported"
|
||||||
# Overwrite for value
|
# Overwrite for value
|
||||||
@@ -469,7 +452,7 @@ class LuiPagesGen(object):
|
|||||||
command = f"entityUpd~Not found~{navigation}~{item}~check~220~apps.yaml~150~300~5~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Please~your~~"
|
command = f"entityUpd~Not found~{navigation}~{item}~check~220~apps.yaml~150~300~5~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Please~your~~"
|
||||||
else:
|
else:
|
||||||
entity = apis.ha_api.get_entity(item)
|
entity = apis.ha_api.get_entity(item)
|
||||||
heading = title if title != "unknown" else entity.attributes['friendly_name']
|
heading = title if title != "unknown" else entity.attributes.friendly_name
|
||||||
current_temp = get_attr_safe(entity, "current_temperature", "")
|
current_temp = get_attr_safe(entity, "current_temperature", "")
|
||||||
dest_temp = get_attr_safe(entity, "temperature", None)
|
dest_temp = get_attr_safe(entity, "temperature", None)
|
||||||
dest_temp2 = ""
|
dest_temp2 = ""
|
||||||
@@ -551,7 +534,7 @@ class LuiPagesGen(object):
|
|||||||
command = f"entityUpd~Not found~{navigation}"
|
command = f"entityUpd~Not found~{navigation}"
|
||||||
else:
|
else:
|
||||||
entity = apis.ha_api.get_entity(item)
|
entity = apis.ha_api.get_entity(item)
|
||||||
heading = title if title != "unknown" else entity.attributes['friendly_name']
|
heading = title if title != "unknown" else entity.attributes.friendly_name
|
||||||
|
|
||||||
# get data from homeassistant
|
# get data from homeassistant
|
||||||
data_raw = apis.ha_api.get_history(entity_id = item, days = 7)
|
data_raw = apis.ha_api.get_history(entity_id = item, days = 7)
|
||||||
@@ -598,12 +581,12 @@ class LuiPagesGen(object):
|
|||||||
else:
|
else:
|
||||||
media_icon = self.generate_entities_item(entity, "cardGrid")
|
media_icon = self.generate_entities_item(entity, "cardGrid")
|
||||||
ha_entity = apis.ha_api.get_entity(entityId)
|
ha_entity = apis.ha_api.get_entity(entityId)
|
||||||
heading = title if title != "unknown" else ha_entity.attributes['friendly_name']
|
heading = title if title != "unknown" else ha_entity.attributes.friendly_name
|
||||||
title = get_attr_safe(ha_entity, "media_title", "")
|
title = get_attr_safe(ha_entity, "media_title", "")
|
||||||
author = get_attr_safe(ha_entity, "media_artist", "")
|
author = get_attr_safe(ha_entity, "media_artist", "")
|
||||||
volume = int(get_attr_safe(ha_entity, "volume_level", 0)*100)
|
volume = int(get_attr_safe(ha_entity, "volume_level", 0)*100)
|
||||||
iconplaypause = get_icon_id("pause") if ha_entity.state == "playing" else get_icon_id("play")
|
iconplaypause = get_icon_id("pause") if ha_entity.state == "playing" else get_icon_id("play")
|
||||||
bits = ha_entity.attributes['supported_features']
|
bits = ha_entity.attributes.supported_features
|
||||||
onoffbutton = "disable"
|
onoffbutton = "disable"
|
||||||
if bits & 0b10000000:
|
if bits & 0b10000000:
|
||||||
if ha_entity.state == "off":
|
if ha_entity.state == "off":
|
||||||
@@ -653,7 +636,7 @@ class LuiPagesGen(object):
|
|||||||
if not entity.attributes.get("code_arm_required", False):
|
if not entity.attributes.get("code_arm_required", False):
|
||||||
numpad = "disable"
|
numpad = "disable"
|
||||||
if overwrite_supported_modes is None:
|
if overwrite_supported_modes is None:
|
||||||
bits = entity.attributes['supported_features']
|
bits = entity.attributes.supported_features
|
||||||
if bits & 0b000001:
|
if bits & 0b000001:
|
||||||
supported_modes.append("arm_home")
|
supported_modes.append("arm_home")
|
||||||
if bits & 0b000010:
|
if bits & 0b000010:
|
||||||
@@ -692,7 +675,7 @@ class LuiPagesGen(object):
|
|||||||
|
|
||||||
#add button to show sensor state
|
#add button to show sensor state
|
||||||
add_btn = ""
|
add_btn = ""
|
||||||
if entity.attributes.get("open_sensors") is not None:
|
if "open_sensors" in entity.attributes and entity.attributes.open_sensors is not None:
|
||||||
add_btn=f"{get_icon_id('progress-alert')}~{rgb_dec565([243,179,0])}~"
|
add_btn=f"{get_icon_id('progress-alert')}~{rgb_dec565([243,179,0])}~"
|
||||||
if alarmBtn is not None and type(alarmBtn) is dict:
|
if alarmBtn is not None and type(alarmBtn) is dict:
|
||||||
entity = alarmBtn.get("entity")
|
entity = alarmBtn.get("entity")
|
||||||
@@ -796,8 +779,6 @@ class LuiPagesGen(object):
|
|||||||
if send_page_type:
|
if send_page_type:
|
||||||
if card.cardType == "cardGrid" and len(card.entities) > 6:
|
if card.cardType == "cardGrid" and len(card.entities) > 6:
|
||||||
card.cardType = "cardGrid2"
|
card.cardType = "cardGrid2"
|
||||||
if card.cardType == "cardGrid1":
|
|
||||||
card.cardType = "cardGrid"
|
|
||||||
self.page_type(card.cardType)
|
self.page_type(card.cardType)
|
||||||
|
|
||||||
# send sleep timeout if there is one configured for the current card
|
# send sleep timeout if there is one configured for the current card
|
||||||
@@ -807,7 +788,7 @@ class LuiPagesGen(object):
|
|||||||
self._send_mqtt_msg(f'timeout~{self._config.get("sleepTimeout")}')
|
self._send_mqtt_msg(f'timeout~{self._config.get("sleepTimeout")}')
|
||||||
|
|
||||||
temp_unit = card.raw_config.get("temperatureUnit", "celsius")
|
temp_unit = card.raw_config.get("temperatureUnit", "celsius")
|
||||||
if card.cardType in ["cardEntities", "cardGrid", "cardGrid1","cardGrid2"]:
|
if card.cardType in ["cardEntities", "cardGrid", "cardGrid2"]:
|
||||||
self.generate_entities_page(navigation, card.title, card.entities, card.cardType, temp_unit)
|
self.generate_entities_page(navigation, card.title, card.entities, card.cardType, temp_unit)
|
||||||
return
|
return
|
||||||
if card.cardType == "cardThermo":
|
if card.cardType == "cardThermo":
|
||||||
@@ -859,26 +840,25 @@ class LuiPagesGen(object):
|
|||||||
color_temp = "disable"
|
color_temp = "disable"
|
||||||
color = "disable"
|
color = "disable"
|
||||||
effect_supported = "disable"
|
effect_supported = "disable"
|
||||||
supported_color_modes = entity.attributes['supported_color_modes']
|
|
||||||
|
|
||||||
if "onoff" not in supported_color_modes:
|
if "onoff" not in entity.attributes.supported_color_modes:
|
||||||
brightness = 0
|
brightness = 0
|
||||||
if entity.state == "on":
|
if entity.state == "on":
|
||||||
if brightness := entity.attributes.get("brightness"):
|
if "brightness" in entity.attributes and entity.attributes.brightness:
|
||||||
# scale 0-255 brightness from ha to 0-100
|
# scale 0-255 brightness from ha to 0-100
|
||||||
brightness = int(scale(brightness, (0,255), (0,100)))
|
brightness = int(scale(entity.attributes.brightness,(0,255),(0,100)))
|
||||||
else:
|
else:
|
||||||
brightness = "disable"
|
brightness = "disable"
|
||||||
if "color_temp" in supported_color_modes:
|
if "color_temp" in entity.attributes.supported_color_modes and entity.attributes.supported_color_modes:
|
||||||
if color_temp := entity.attributes.get("color_temp"):
|
if "color_temp" in entity.attributes and entity.attributes.color_temp:
|
||||||
# scale ha color temp range to 0-100
|
# scale ha color temp range to 0-100
|
||||||
color_temp = int(scale(color_temp, (entity.attributes['min_mireds'], entity.attributes['max_mireds']),(0, 100)))
|
color_temp = int(scale(entity.attributes.color_temp,(entity.attributes.min_mireds, entity.attributes.max_mireds),(0,100)))
|
||||||
else:
|
else:
|
||||||
color_temp = "unknown"
|
color_temp = "unknown"
|
||||||
else:
|
else:
|
||||||
color_temp = "disable"
|
color_temp = "disable"
|
||||||
list_color_modes = ["xy", "rgb", "rgbw", "hs"]
|
list_color_modes = ["xy", "rgb", "rgbw", "hs"]
|
||||||
if any(item in list_color_modes for item in supported_color_modes):
|
if any(item in list_color_modes for item in entity.attributes.supported_color_modes):
|
||||||
color = "enable"
|
color = "enable"
|
||||||
else:
|
else:
|
||||||
color = "disable"
|
color = "disable"
|
||||||
@@ -918,7 +898,7 @@ class LuiPagesGen(object):
|
|||||||
iconTiltRightStatus = "disable"
|
iconTiltRightStatus = "disable"
|
||||||
tilt_pos = "disable"
|
tilt_pos = "disable"
|
||||||
|
|
||||||
bits = entity.attributes['supported_features']
|
bits = entity.attributes.supported_features
|
||||||
|
|
||||||
# position supported
|
# position supported
|
||||||
if bits & 0b00001111:
|
if bits & 0b00001111:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import adbase as ad
|
import hassapi as hass
|
||||||
|
|
||||||
from luibackend.config import LuiBackendConfig
|
from luibackend.config import LuiBackendConfig
|
||||||
from luibackend.controller import LuiController
|
from luibackend.controller import LuiController
|
||||||
@@ -6,19 +6,15 @@ from luibackend.mqtt import LuiMqttListener, LuiMqttSender
|
|||||||
from luibackend.updater import Updater
|
from luibackend.updater import Updater
|
||||||
|
|
||||||
import apis
|
import apis
|
||||||
import json
|
|
||||||
from typing import Literal
|
|
||||||
|
|
||||||
class NsPanelLovelaceUIManager(ad.ADBase):
|
class NsPanelLovelaceUIManager(hass.Hass):
|
||||||
|
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
self.adapi = self.get_ad_api()
|
self.log('Starting')
|
||||||
self.adapi.log('Starting')
|
apis.ha_api = self
|
||||||
apis.ad_api = self.adapi
|
|
||||||
apis.ha_api = self.get_plugin_api("HASS")
|
|
||||||
apis.mqtt_api = self.get_plugin_api("MQTT")
|
apis.mqtt_api = self.get_plugin_api("MQTT")
|
||||||
|
|
||||||
cfg = self._cfg = LuiBackendConfig(apis.ha_api, self.args["config"])
|
cfg = self._cfg = LuiBackendConfig(self, self.args["config"])
|
||||||
|
|
||||||
use_api = cfg.get("use_api") == True
|
use_api = cfg.get("use_api") == True
|
||||||
|
|
||||||
@@ -26,11 +22,10 @@ class NsPanelLovelaceUIManager(ad.ADBase):
|
|||||||
topic_recv = cfg.get("panelRecvTopic")
|
topic_recv = cfg.get("panelRecvTopic")
|
||||||
api_panel_name = cfg.get("panelName")
|
api_panel_name = cfg.get("panelName")
|
||||||
api_device_id = cfg.get("panelDeviceId")
|
api_device_id = cfg.get("panelDeviceId")
|
||||||
quiet = cfg.get("quiet")
|
|
||||||
|
|
||||||
mqttsender = self._mqttsender = LuiMqttSender(apis.ha_api, use_api, topic_send, api_panel_name, quiet)
|
mqttsend = LuiMqttSender(self, use_api, topic_send, api_panel_name)
|
||||||
|
|
||||||
self._controller = LuiController(cfg, mqttsender.send_mqtt_msg)
|
controller = LuiController(cfg, mqttsend.send_mqtt_msg)
|
||||||
|
|
||||||
desired_tasmota_driver_version = 8
|
desired_tasmota_driver_version = 8
|
||||||
desired_display_firmware_version = 53
|
desired_display_firmware_version = 53
|
||||||
@@ -46,35 +41,11 @@ class NsPanelLovelaceUIManager(ad.ADBase):
|
|||||||
desired_tasmota_driver_url = cfg._config.get("berryURL", "https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be")
|
desired_tasmota_driver_url = cfg._config.get("berryURL", "https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be")
|
||||||
|
|
||||||
mode = cfg.get("updateMode")
|
mode = cfg.get("updateMode")
|
||||||
updater = Updater(self.adapi.log, mqttsender, topic_send, mode, desired_display_firmware_version, model, desired_display_firmware_url, desired_tasmota_driver_version, desired_tasmota_driver_url)
|
updater = Updater(self.log, mqttsend, topic_send, mode, desired_display_firmware_version, model, desired_display_firmware_url, desired_tasmota_driver_version, desired_tasmota_driver_url)
|
||||||
|
|
||||||
# Request Tasmota Driver Version
|
# Request Tasmota Driver Version
|
||||||
updater.request_berry_driver_version()
|
updater.request_berry_driver_version()
|
||||||
|
|
||||||
LuiMqttListener(use_api, topic_recv, api_panel_name, api_device_id, self._controller, updater)
|
LuiMqttListener(use_api, topic_recv, api_panel_name, api_device_id, controller, updater)
|
||||||
|
|
||||||
self.adapi.log(f'Started ({version})')
|
self.log(f'Started ({version})')
|
||||||
|
|
||||||
#
|
|
||||||
# helpers
|
|
||||||
#
|
|
||||||
|
|
||||||
def show_card(self, card_key: str) -> None:
|
|
||||||
"""Used to show card on panel"""
|
|
||||||
|
|
||||||
msg = json.dumps({"CustomRecv":f"event,buttonPress2,navigate.{card_key},button"})
|
|
||||||
topic = self._cfg.get("panelRecvTopic")
|
|
||||||
self._mqttsender.send_mqtt_msg(msg, topic)
|
|
||||||
|
|
||||||
def navigate(self, direction: Literal['up', 'prev', 'next']) -> None:
|
|
||||||
"""Used to navigate different directions on the panel"""
|
|
||||||
|
|
||||||
msg = json.dumps({"CustomRecv":f"event,buttonPress2,nav{direction.title()},button"})
|
|
||||||
topic = self._cfg.get("panelRecvTopic")
|
|
||||||
self._mqttsender.send_mqtt_msg(msg, topic)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def current_card(self) -> str:
|
|
||||||
"""Used to get the panel's current card"""
|
|
||||||
|
|
||||||
return self._controller.current_card.key
|
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ Using a 6th entity will automatically activate the alternative layout.
|
|||||||
type: 0
|
type: 0
|
||||||
- entity: weather.demo_weather_north
|
- entity: weather.demo_weather_north
|
||||||
type: 1
|
type: 1
|
||||||
|
- entity: weather.demo_weather_north
|
||||||
|
type: 2
|
||||||
- entity: sensor.energy_usage
|
- entity: sensor.energy_usage
|
||||||
- entity: delete
|
- entity: delete
|
||||||
- entity: sensor.indoor_temp
|
- entity: sensor.indoor_temp
|
||||||
|
|||||||
@@ -93,38 +93,3 @@ Now, to install NSPanel Lovelace UI Backend with HACS, follow these steps:
|
|||||||
6. A confirmation panel will appear, click on `Download`, and wait for HACS to
|
6. A confirmation panel will appear, click on `Download`, and wait for HACS to
|
||||||
proceed with the download
|
proceed with the download
|
||||||
7. The Backend Application is now installed, and HACS will inform you when updates are available
|
7. The Backend Application is now installed, and HACS will inform you when updates are available
|
||||||
|
|
||||||
# Workaround for HomeAssistant 2024.04
|
|
||||||
AppDaemon is using the old REST API that until AppDaemon moved on the the websocket API this woraround is needed to get weather forecast data from homeassistant. (https://github.com/AppDaemon/appdaemon/issues/1837)
|
|
||||||
|
|
||||||
To get the forecast data in appdaemon, there is a script needed in homeassistant's configuration.yaml:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
template:
|
|
||||||
- trigger:
|
|
||||||
- platform: time_pattern
|
|
||||||
hours: /1
|
|
||||||
- platform: homeassistant
|
|
||||||
event: start
|
|
||||||
action:
|
|
||||||
- service: weather.get_forecasts
|
|
||||||
data:
|
|
||||||
type: daily
|
|
||||||
target:
|
|
||||||
entity_id: weather.home # change to your weather entity
|
|
||||||
response_variable: daily
|
|
||||||
sensor:
|
|
||||||
- name: Weather Forecast Daily
|
|
||||||
unique_id: weather_forecast_daily
|
|
||||||
state: "{{ states('weather.home') }}" # # change to your weather entity in this line
|
|
||||||
attributes:
|
|
||||||
temperature: "{{ state_attr('weather.home', 'temperature') }}" # change to your weather entity
|
|
||||||
temperature_unit: "{{ state_attr('weather.home', 'temperature_unit') }}" # change to your weather entity
|
|
||||||
forecast: "{{ daily['weather.home'].forecast }}" # change to your weather entity
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
Adjust the entities in your apps.yaml that are accessing the forecast to the newly created trigger template:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
const sourceDP = 'alias.0.Wohnzimmer.Heizung.ACTUAL';
|
var sourceDP = 'alias.0.Wohnzimmer.Heizung.ACTUAL';
|
||||||
const targetDP = '0_userdata.0.Test.chartTest';
|
var targetDP = '0_userdata.0.Test.chartTest';
|
||||||
const rangeHours = 24;
|
var rangeHours = 24;
|
||||||
const maxXAchsisTicks = 6;
|
var maxXAchsisTicks = 6;
|
||||||
const historyInstance = 'history.0';
|
var historyInstance = 'history.0';
|
||||||
const factor = 1; // Bei zu großen Werten und negativen Anzeigen im Panel um das 10fache erhöhen
|
|
||||||
|
|
||||||
on({id: sourceDP, change: "any"}, async function (obj) {
|
on({id: sourceDP, change: "any"}, async function (obj) {
|
||||||
sendTo(historyInstance, 'getHistory', {
|
sendTo(historyInstance, 'getHistory', {
|
||||||
@@ -26,7 +25,7 @@ on({id: sourceDP, change: "any"}, async function (obj) {
|
|||||||
//Check history items for requested hours
|
//Check history items for requested hours
|
||||||
for (var j = 0, targetValue = 0; j < result.result.length; j++) {
|
for (var j = 0, targetValue = 0; j < result.result.length; j++) {
|
||||||
var valueDate = new Date(result.result[j].ts);
|
var valueDate = new Date(result.result[j].ts);
|
||||||
var value = Math.round(result.result[j].val / factor * 10);
|
var value = (Math.round(result.result[j].val * 10) / 10);
|
||||||
|
|
||||||
if (valueDate > targetDate){
|
if (valueDate > targetDate){
|
||||||
if ((targetDate.getHours() % stepXAchsis) == 0){
|
if ((targetDate.getHours() % stepXAchsis) == 0){
|
||||||
|
|||||||
@@ -1,38 +1,23 @@
|
|||||||
/**
|
const Debug = false;
|
||||||
* Dieses Script fragt eine influxDb ab, um Daten für die cardLcart (Liniendiagramm) zuberechnen und im richtigen Format bereitzustellen.
|
|
||||||
* Es erstellt automatisch einen Datenpunkt.
|
|
||||||
* Die Abfrage muss ggf. angepasst werden. Aktuell ermittelt sie Werte der letzten 24h, zu Stundenwerten zusammengefasst.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const Debug = false; // true für erweiterte Ausgaben im Log
|
const NSPanel_Path = '0_userdata.0.NSPanel.1.';
|
||||||
|
|
||||||
const NSPanel_Path = '0_userdata.0.NSPanel.';
|
|
||||||
const Path = NSPanel_Path + 'Influx2NSPanel.cardLChart.';
|
const Path = NSPanel_Path + 'Influx2NSPanel.cardLChart.';
|
||||||
const InfluxInstance = 'influxdb.0';
|
const InfluxInstance = 'influxdb.1';
|
||||||
const influxDbBucket = 'storage_short';
|
const influxDbBucket = 'iobroker';
|
||||||
const numberOfHoursAgo = 24;
|
const numberOfHoursAgo = 24;
|
||||||
const xAxisTicksEveryM = 60;
|
const xAxisTicksEveryM = 60;
|
||||||
const xAxisLabelEveryM = 240;
|
const xAxisLabelEveryM = 240;
|
||||||
//
|
|
||||||
|
|
||||||
const sensors : Record<string, Record <string, string>> = {};
|
// this records holds all sensors and their corresponding states which act as the data source for the charts
|
||||||
/**
|
// add all sensors which are to be displayed in this script, there is no need to use multiple scripts
|
||||||
* Hier werden die Sensoren festgelegt nach flogendem Schema
|
const sensors : Record<string, string> = {};
|
||||||
*
|
/* ↓ Id of the sensor ↓ Id of the data source for the charts */
|
||||||
* sensors[‘Datenpunkt(kompletter Pfad) des Messwertes'] = {'taget': 'Name des Datenpunkt für die Chartwerte', 'measurement': 'genutzter Alias in der Influxdb für den Messwert'};
|
sensors['deconz.0.Sensors.65.temperature'] = Path + 'buero_temperature.ACTUAL';
|
||||||
*
|
sensors['deconz.0.Sensors.65.humidity'] = Path + 'buero_luftfeuchte.ACTUAL';
|
||||||
* Wenn der Wert in der Datenbank keinen Alias hat bleibt der Wert 'measurement': weg.
|
|
||||||
* Jeder Messwert bekommt einen eigenen sensors[...] = {'target':....}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
sensors['netatmo-crawler.0.stationData.1.temperature'] = {'target':'AussenTemp', 'measurement':'wetter.temperatur'};
|
|
||||||
|
|
||||||
// ##### ab hier keine Änderungen mehr nötig #####
|
|
||||||
|
|
||||||
// create data source for NsPanel on script startup
|
// create data source for NsPanel on script startup
|
||||||
Object.keys(sensors).forEach(async id => {
|
Object.keys(sensors).forEach(async x => {
|
||||||
await generateDateAsync(id);
|
await generateDateAsync(x, sensors[x]);
|
||||||
});
|
});
|
||||||
|
|
||||||
// then listen to the sensors and update the data source states accordingly
|
// then listen to the sensors and update the data source states accordingly
|
||||||
@@ -40,21 +25,15 @@ on({ id: Object.keys(sensors), change: 'any' }, async function (obj) {
|
|||||||
if (!obj.id) {
|
if (!obj.id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await generateDateAsync(obj.id);
|
|
||||||
|
await generateDateAsync(obj.id, sensors[obj.id]);
|
||||||
});
|
});
|
||||||
|
|
||||||
//__________________________
|
async function generateDateAsync(sensorId: string, dataPointId: string) {
|
||||||
// Beschreibe diese Funktion: Daten generieren
|
|
||||||
async function generateDateAsync(sensorId: string) {
|
|
||||||
let idMeasurement = sensors[sensorId].measurement;
|
|
||||||
if (idMeasurement =='' ||idMeasurement == undefined) {idMeasurement = sensorId};
|
|
||||||
const dataPointId:string = Path + sensors[sensorId].target +'.ACTUAL';
|
|
||||||
if (Debug) log(`(f) generateDateAsync: ${sensorId} ${dataPointId} > ${idMeasurement}`);
|
|
||||||
|
|
||||||
const query =[
|
const query =[
|
||||||
'from(bucket: "' + influxDbBucket + '")',
|
'from(bucket: "' + influxDbBucket + '")',
|
||||||
'|> range(start: -' + numberOfHoursAgo + 'h)',
|
'|> range(start: -' + numberOfHoursAgo + 'h)',
|
||||||
'|> filter(fn: (r) => r["_measurement"] == "' + idMeasurement + '")',
|
'|> filter(fn: (r) => r["_measurement"] == "' + sensorId + '")',
|
||||||
'|> filter(fn: (r) => r["_field"] == "value")',
|
'|> filter(fn: (r) => r["_field"] == "value")',
|
||||||
'|> drop(columns: ["from", "ack", "q"])',
|
'|> drop(columns: ["from", "ack", "q"])',
|
||||||
'|> aggregateWindow(every: 1h, fn: last, createEmpty: false)',
|
'|> aggregateWindow(every: 1h, fn: last, createEmpty: false)',
|
||||||
@@ -68,12 +47,13 @@ async function generateDateAsync(sensorId: string) {
|
|||||||
console.error(result.error);
|
console.error(result.error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Debug) console.log(JSON.stringify(result));
|
|
||||||
|
if (Debug) console.log(result);
|
||||||
const numResults = result.result.length;
|
const numResults = result.result.length;
|
||||||
let coordinates : string = '';
|
let coordinates : string = '';
|
||||||
for (let r = 0; r < numResults; r++)
|
for (let r = 0; r < numResults; r++)
|
||||||
{
|
{
|
||||||
const list : string[] = [];
|
const list : string[] = []
|
||||||
const numValues = result.result[r].length;
|
const numValues = result.result[r].length;
|
||||||
|
|
||||||
for (let i = 0; i < numValues; i++)
|
for (let i = 0; i < numValues; i++)
|
||||||
@@ -84,6 +64,7 @@ async function generateDateAsync(sensorId: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
coordinates = list.join("~");
|
coordinates = list.join("~");
|
||||||
|
|
||||||
if (Debug) console.log(coordinates);
|
if (Debug) console.log(coordinates);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,8 +95,6 @@ async function generateDateAsync(sensorId: string) {
|
|||||||
await setOrCreate(dataPointId, ticksAndLabelsList.join("+") + '~' + coordinates, true);
|
await setOrCreate(dataPointId, ticksAndLabelsList.join("+") + '~' + coordinates, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//__________________________
|
|
||||||
// Beschreibe diese Funktion: Datenpunkte anlegen bzw. schreiben
|
|
||||||
async function setOrCreate(id : string, value : any, ack : boolean) {
|
async function setOrCreate(id : string, value : any, ack : boolean) {
|
||||||
if (!(await existsStateAsync(id))) {
|
if (!(await existsStateAsync(id))) {
|
||||||
await createStateAsync(id, value, {
|
await createStateAsync(id, value, {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -2565,10 +2565,6 @@
|
|||||||
"en-US":"Crossfade",
|
"en-US":"Crossfade",
|
||||||
"de-DE":"Überblenden"
|
"de-DE":"Überblenden"
|
||||||
},
|
},
|
||||||
"tools":{
|
|
||||||
"en-US":"Tools",
|
|
||||||
"de-DE":"Tools"
|
|
||||||
},
|
|
||||||
"speaker":{
|
"speaker":{
|
||||||
"en-US":"Speakerlist",
|
"en-US":"Speakerlist",
|
||||||
"de-DE":"Wiedergabegeräte",
|
"de-DE":"Wiedergabegeräte",
|
||||||
|
|||||||
@@ -2701,13 +2701,5 @@
|
|||||||
"scriptname":{
|
"scriptname":{
|
||||||
"en-US":"Script name",
|
"en-US":"Script name",
|
||||||
"de-DE":"Skriptname"
|
"de-DE":"Skriptname"
|
||||||
},
|
|
||||||
"hiddencards_offon":{
|
|
||||||
"en-US":"hidden Cards (on/off)",
|
|
||||||
"de-DE":"ausgeblendete Seiten (an/aus)"
|
|
||||||
},
|
|
||||||
"easyview_layout":{
|
|
||||||
"en-US":"Easyview Layout",
|
|
||||||
"de-DE":"Einfaches Layout"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
|
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
|
||||||
name: NSPanel Lovelace UI Addon
|
name: NSPanel Lovelace UI Addon
|
||||||
version: "4.7.80"
|
version: "4.7.74"
|
||||||
slug: nspanel-lovelace-ui
|
slug: nspanel-lovelace-ui
|
||||||
description: NSPanel Lovelace UI Addon
|
description: NSPanel Lovelace UI Addon
|
||||||
services:
|
services:
|
||||||
|
|||||||
@@ -209,11 +209,11 @@ class HAEntity(panel_cards.Entity):
|
|||||||
forecast = libs.home_assistant.execute_script(
|
forecast = libs.home_assistant.execute_script(
|
||||||
entity_name=self.entity_id,
|
entity_name=self.entity_id,
|
||||||
domain='weather',
|
domain='weather',
|
||||||
service="get_forecasts",
|
service="get_forecast",
|
||||||
service_data={
|
service_data={
|
||||||
'type': forecast_type
|
'type': forecast_type
|
||||||
}
|
}
|
||||||
).get(self.entity_id,{}).get("forecast", [])
|
).get("forecast", [])
|
||||||
if len(forecast) > pos:
|
if len(forecast) > pos:
|
||||||
forcast_pos = forecast[pos]
|
forcast_pos = forecast[pos]
|
||||||
forcast_condition = forcast_pos.get("condition", "")
|
forcast_condition = forcast_pos.get("condition", "")
|
||||||
|
|||||||
@@ -20,32 +20,27 @@ def calculate_dim_values(sleepTracking, sleepTrackingZones, sleepBrightness, scr
|
|||||||
dimmode = sleepBrightness
|
dimmode = sleepBrightness
|
||||||
elif isinstance(sleepBrightness, list):
|
elif isinstance(sleepBrightness, list):
|
||||||
logging.error("list style config for sleepBrightness no longer supported")
|
logging.error("list style config for sleepBrightness no longer supported")
|
||||||
#elif sleepBrightness.startswith("ha:"):
|
elif sleepBrightness.startswith("ha:"):
|
||||||
# time.sleep(1)
|
time.sleep(1)
|
||||||
# dimmode = int(float(libs.home_assistant.get_template(sleepBrightness)[3:]))
|
dimmode = int(float(libs.home_assistant.get_template(sleepBrightness)[3:]))
|
||||||
# involved_entities.extend(libs.home_assistant.get_template_listener_entities(sleepBrightness))
|
involved_entities.extend(libs.home_assistant.get_template_listener_entities(sleepBrightness))
|
||||||
elif libs.home_assistant.is_existent(sleepBrightness):
|
elif libs.home_assistant.is_existent(sleepBrightness):
|
||||||
involved_entities.append(sleepBrightness)
|
involved_entities.append(sleepBrightness)
|
||||||
try:
|
|
||||||
dimmode = int(float(libs.home_assistant.get_entity_data(sleepBrightness).get('state', 10)))
|
dimmode = int(float(libs.home_assistant.get_entity_data(sleepBrightness).get('state', 10)))
|
||||||
except ValueError:
|
|
||||||
print("sleepBrightness entity invalid")
|
|
||||||
|
|
||||||
if screenBrightness:
|
if screenBrightness:
|
||||||
if isinstance(screenBrightness, int):
|
if isinstance(screenBrightness, int):
|
||||||
dimValueNormal = screenBrightness
|
dimValueNormal = screenBrightness
|
||||||
elif isinstance(screenBrightness, list):
|
elif isinstance(screenBrightness, list):
|
||||||
logging.error("list style config for screenBrightness no longer supported")
|
logging.error("list style config for screenBrightness no longer supported")
|
||||||
#elif screenBrightness.startswith("ha:"):
|
elif screenBrightness.startswith("ha:"):
|
||||||
# time.sleep(1)
|
time.sleep(1)
|
||||||
# dimValueNormal = int(float(libs.home_assistant.get_template(screenBrightness)[3:]))
|
dimValueNormal = int(float(libs.home_assistant.get_template(screenBrightness)[3:]))
|
||||||
# involved_entities.extend(libs.home_assistant.get_template_listener_entities(screenBrightness))
|
involved_entities.extend(libs.home_assistant.get_template_listener_entities(screenBrightness))
|
||||||
elif libs.home_assistant.is_existent(screenBrightness):
|
elif libs.home_assistant.is_existent(screenBrightness):
|
||||||
involved_entities.append(screenBrightness)
|
involved_entities.append(screenBrightness)
|
||||||
try:
|
|
||||||
dimValueNormal = int(float(libs.home_assistant.get_entity_data(screenBrightness).get('state', 100)))
|
dimValueNormal = int(float(libs.home_assistant.get_entity_data(screenBrightness).get('state', 100)))
|
||||||
except ValueError:
|
|
||||||
print("screenBrightness entity invalid")
|
|
||||||
# force sleep brightness to zero in case sleepTracking is active
|
# force sleep brightness to zero in case sleepTracking is active
|
||||||
if sleepTracking:
|
if sleepTracking:
|
||||||
if libs.home_assistant.is_existent(sleepTracking):
|
if libs.home_assistant.is_existent(sleepTracking):
|
||||||
|
|||||||
@@ -228,8 +228,6 @@ class LovelaceUIPanel:
|
|||||||
self.render_current_page(requested=True)
|
self.render_current_page(requested=True)
|
||||||
if msg[1] == "buttonPress2":
|
if msg[1] == "buttonPress2":
|
||||||
entity_id = msg[2]
|
entity_id = msg[2]
|
||||||
if entity_id == "":
|
|
||||||
return
|
|
||||||
btype = msg[3]
|
btype = msg[3]
|
||||||
value = msg[4] if len(msg) > 4 else None
|
value = msg[4] if len(msg) > 4 else None
|
||||||
if btype == "bExit":
|
if btype == "bExit":
|
||||||
@@ -280,8 +278,6 @@ class LovelaceUIPanel:
|
|||||||
self.privious_cards.append(self.current_card)
|
self.privious_cards.append(self.current_card)
|
||||||
self.current_card = self.searchCard(card_iid)
|
self.current_card = self.searchCard(card_iid)
|
||||||
self.render_current_page(switchPages=True)
|
self.render_current_page(switchPages=True)
|
||||||
case 'mode-light':
|
|
||||||
ha_control.handle_buttons(entity_id, btype, value, entity_config=entity_config)
|
|
||||||
case _:
|
case _:
|
||||||
ha_control.handle_buttons(entity_id, btype, value)
|
ha_control.handle_buttons(entity_id, btype, value)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
paho-mqtt==1.6.1
|
paho-mqtt
|
||||||
pyyaml
|
pyyaml
|
||||||
websockets
|
websockets
|
||||||
websocket-client
|
websocket-client
|
||||||
|
|||||||
Reference in New Issue
Block a user