Merge branch 'joBr99:main' into main

This commit is contained in:
Armilar
2022-06-12 14:26:31 +02:00
committed by GitHub
97 changed files with 1634 additions and 1252 deletions

16
.github/workflows/docs.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: docs-ci
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-video markdown-include
- run: mkdocs gh-deploy --force

View File

@@ -75,7 +75,7 @@ jobs:
continue-on-error: true
run: |
find -name "**.txt"
rm Nextion2Text.py*
rm Nextion2Text.py* ignore-id.py out.txt
- uses: stefanzweifel/git-auto-commit-action@v4
with:

View File

@@ -1,6 +1,6 @@
diff -bur HMI/n2t-out/Program.s.txt HMI/US/landscape/n2t-out/Program.s.txt
--- HMI/n2t-out/Program.s.txt 2022-06-08 20:00:07.004980492 +0000
+++ HMI/US/landscape/n2t-out/Program.s.txt 2022-06-08 20:00:08.089056883 +0000
--- HMI/n2t-out/Program.s.txt 2022-06-12 12:21:18.432756347 +0000
+++ HMI/US/landscape/n2t-out/Program.s.txt 2022-06-12 12:21:19.348768343 +0000
@@ -11,6 +11,4 @@
// dim value
int dimValue=40
@@ -9,8 +9,8 @@ diff -bur HMI/n2t-out/Program.s.txt HMI/US/landscape/n2t-out/Program.s.txt
- lcd_dev fffb 0002 0000 0020
page pageStartup
diff -bur HMI/n2t-out/pageStartup.txt HMI/US/landscape/n2t-out/pageStartup.txt
--- HMI/n2t-out/pageStartup.txt 2022-06-08 20:00:07.004980492 +0000
+++ HMI/US/landscape/n2t-out/pageStartup.txt 2022-06-08 20:00:08.089056883 +0000
--- HMI/n2t-out/pageStartup.txt 2022-06-12 12:21:18.432756347 +0000
+++ HMI/US/landscape/n2t-out/pageStartup.txt 2022-06-12 12:21:19.348768343 +0000
@@ -177,7 +177,7 @@
recmod=1
bauds=115200

View File

@@ -14,10 +14,6 @@ cardMedia
34 Component(s)
363 Line(s) of event code
195 Unique line(s) of event code
pageStartup
19 Component(s)
157 Line(s) of event code
117 Unique line(s) of event code
cardGrid
42 Component(s)
439 Line(s) of event code
@@ -26,6 +22,10 @@ cardQR
32 Component(s)
374 Line(s) of event code
218 Unique line(s) of event code
pageStartup
19 Component(s)
157 Line(s) of event code
117 Unique line(s) of event code
popupNotify
17 Component(s)
204 Line(s) of event code

View File

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

View File

@@ -152,7 +152,7 @@ Text tVersion
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 36
Text : 37
Max. Text Size : 10
Picture p0

Binary file not shown.

Binary file not shown.

View File

@@ -1,6 +1,6 @@
diff -bur HMI/n2t-out/Program.s.txt HMI/US/portrait/n2t-out/Program.s.txt
--- HMI/n2t-out/Program.s.txt 2022-06-08 20:00:07.004980492 +0000
+++ HMI/US/portrait/n2t-out/Program.s.txt 2022-06-08 20:00:07.521016838 +0000
--- HMI/n2t-out/Program.s.txt 2022-06-12 12:21:18.432756347 +0000
+++ HMI/US/portrait/n2t-out/Program.s.txt 2022-06-12 12:21:18.872762109 +0000
@@ -11,6 +11,6 @@
// dim value
int dimValue=40
@@ -11,8 +11,8 @@ diff -bur HMI/n2t-out/Program.s.txt HMI/US/portrait/n2t-out/Program.s.txt
+ //lcd_dev fffb 0002 0000 0020
page pageStartup
diff -bur HMI/n2t-out/cardEntities.txt HMI/US/portrait/n2t-out/cardEntities.txt
--- HMI/n2t-out/cardEntities.txt 2022-06-08 20:00:07.004980492 +0000
+++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-06-08 20:00:07.521016838 +0000
--- HMI/n2t-out/cardEntities.txt 2022-06-12 12:21:18.436756399 +0000
+++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-06-12 12:21:18.876762161 +0000
@@ -63,6 +63,16 @@
vis bText4,0
vis hSlider4,0
@@ -467,59 +467,9 @@ diff -bur HMI/n2t-out/cardEntities.txt HMI/US/portrait/n2t-out/cardEntities.txt
}
if(tInstruction.txt=="pageType")
{
diff -bur HMI/n2t-out/cardMedia.txt HMI/US/portrait/n2t-out/cardMedia.txt
--- HMI/n2t-out/cardMedia.txt 2022-06-08 20:00:07.004980492 +0000
+++ HMI/US/portrait/n2t-out/cardMedia.txt 2022-06-08 20:00:07.521016838 +0000
@@ -45,12 +45,6 @@
Scope: local
Value: 0
-Variable (string) vaMenu
- Attributes
- Scope : local
- Text :
- Max. Text Size: 50
-
Text tSend
Attributes
Scope : local
@@ -218,24 +212,6 @@
Text :
Max. Text Size : 10
- Events
- Touch Release Event
- if(vaMenu.txt!="")
- {
- tSend.txt="event,buttonPress2,"+vaMenu.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
- }
-
Text t1
Attributes
Scope : local
@@ -644,8 +620,6 @@
vis t5,1
covx tTmp.txt,t5.pco,0,0
}
- //tIconBtnEntityName
- spstr strCommand.txt,vaMenu.txt,"~",12
}
if(tInstruction.txt=="time")
{
diff -bur HMI/n2t-out/pageStartup.txt HMI/US/portrait/n2t-out/pageStartup.txt
--- HMI/n2t-out/pageStartup.txt 2022-06-08 20:00:07.004980492 +0000
+++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-06-08 20:00:07.525017120 +0000
--- HMI/n2t-out/pageStartup.txt 2022-06-12 12:21:18.432756347 +0000
+++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-06-12 12:21:18.872762109 +0000
@@ -142,7 +142,7 @@
Disable release event after dragging: 0
Send Component ID : disabled

View File

@@ -1,8 +1,8 @@
+++ HMI/US/portrait/diff-eu-version.txt 2022-06-08 20:00:07.557019374 +0000
+--- HMI/n2t-out/Program.s.txt 2022-06-08 20:00:07.004980492 +0000
++++ HMI/US/portrait/n2t-out/Program.s.txt 2022-06-08 20:00:07.521016838 +0000
+--- HMI/n2t-out/cardEntities.txt 2022-06-08 20:00:07.004980492 +0000
++++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-06-08 20:00:07.521016838 +0000
+++ HMI/US/portrait/diff-eu-version.txt 2022-06-12 12:21:18.904762528 +0000
+--- HMI/n2t-out/Program.s.txt 2022-06-12 12:21:18.432756347 +0000
++++ HMI/US/portrait/n2t-out/Program.s.txt 2022-06-12 12:21:18.872762109 +0000
+--- HMI/n2t-out/cardEntities.txt 2022-06-12 12:21:18.436756399 +0000
++++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-06-12 12:21:18.876762161 +0000
+@@ -63,6 +63,16 @@
+@@ -120,6 +130,18 @@
+@@ -156,6 +178,15 @@
@@ -12,52 +12,5 @@
+@@ -970,6 +1149,33 @@
+@@ -1075,6 +1281,28 @@
+@@ -1850,6 +2078,169 @@
+diff -bur HMI/n2t-out/cardMedia.txt HMI/US/portrait/n2t-out/cardMedia.txt
+--- HMI/n2t-out/cardMedia.txt 2022-06-08 20:00:07.004980492 +0000
++++ HMI/US/portrait/n2t-out/cardMedia.txt 2022-06-08 20:00:07.521016838 +0000
+@@ -45,12 +45,6 @@
+ Scope: local
+ Value: 0
+
+-Variable (string) vaMenu
+- Attributes
+- Scope : local
+- Text :
+- Max. Text Size: 50
+-
+ Text tSend
+ Scope : local
+@@ -218,24 +212,6 @@
+ Text :
+ Max. Text Size : 10
+- Events
+- Touch Release Event
+- if(vaMenu.txt!="")
+- {
+- tSend.txt="event,buttonPress2,"+vaMenu.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
+- }
+-
+ Text t1
+ Scope : local
+@@ -644,8 +620,6 @@
+ vis t5,1
+ covx tTmp.txt,t5.pco,0,0
+ }
+- //tIconBtnEntityName
+- spstr strCommand.txt,vaMenu.txt,"~",12
+ }
+ if(tInstruction.txt=="time")
+ {
+--- HMI/n2t-out/pageStartup.txt 2022-06-08 20:00:07.004980492 +0000
++++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-06-08 20:00:07.525017120 +0000
+--- HMI/n2t-out/pageStartup.txt 2022-06-12 12:21:18.432756347 +0000
++++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-06-12 12:21:18.872762109 +0000

View File

@@ -57,6 +57,13 @@ Variable (int32) vaSpeakerPos
Scope: local
Value: 0
Variable (string) vaMenu
Attributes
ID : 33
Scope : local
Text :
Max. Text Size: 50
Text tSend
Attributes
ID : 2
@@ -444,6 +451,24 @@ Text tIcon
Horizontal Spacing : 0
Vertical Spacing : 0
Events
Touch Release Event
if(vaMenu.txt!="")
{
tSend.txt="event,buttonPress2,"+vaMenu.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
}
Text t1
Attributes
ID : 21
@@ -1069,6 +1094,8 @@ Timer tmSerial
vis t5,1
covx tTmp.txt,t5.pco,0,0
}
//tIconBtnEntityName
spstr strCommand.txt,vaMenu.txt,"~",12
}
if(tInstruction.txt=="time")
{

View File

@@ -22,6 +22,10 @@ cardQR
32 Component(s)
374 Line(s) of event code
218 Unique line(s) of event code
pageStartup
19 Component(s)
157 Line(s) of event code
117 Unique line(s) of event code
popupNotify
17 Component(s)
204 Line(s) of event code
@@ -30,6 +34,10 @@ cardThermo
53 Component(s)
555 Line(s) of event code
292 Unique line(s) of event code
cardMedia
34 Component(s)
363 Line(s) of event code
195 Unique line(s) of event code
screensaver
38 Component(s)
319 Line(s) of event code
@@ -42,21 +50,13 @@ cardGrid
42 Component(s)
439 Line(s) of event code
259 Unique line(s) of event code
cardMedia
33 Component(s)
349 Line(s) of event code
183 Unique line(s) of event code
cardAlarm
40 Component(s)
392 Line(s) of event code
239 Unique line(s) of event code
pageStartup
19 Component(s)
157 Line(s) of event code
117 Unique line(s) of event code
Total
13 Page(s)
423 Component(s)
4858 Line(s) of event code
1292 Unique line(s) of event code
424 Component(s)
4872 Line(s) of event code
1304 Unique line(s) of event code

View File

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

View File

@@ -45,6 +45,12 @@ Variable (int32) vaSpeakerPos
Scope: local
Value: 0
Variable (string) vaMenu
Attributes
Scope : local
Text :
Max. Text Size: 50
Text tSend
Attributes
Scope : local
@@ -212,6 +218,24 @@ Text tIcon
Text :
Max. Text Size : 10
Events
Touch Release Event
if(vaMenu.txt!="")
{
tSend.txt="event,buttonPress2,"+vaMenu.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
}
Text t1
Attributes
Scope : local
@@ -620,6 +644,8 @@ Timer tmSerial
vis t5,1
covx tTmp.txt,t5.pco,0,0
}
//tIconBtnEntityName
spstr strCommand.txt,vaMenu.txt,"~",12
}
if(tInstruction.txt=="time")
{

View File

@@ -152,7 +152,7 @@ Text tVersion
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 36
Text : 37
Max. Text Size : 10
Picture p0

Binary file not shown.

Binary file not shown.

View File

@@ -22,14 +22,14 @@ popupLight
27 Component(s)
352 Line(s) of event code
191 Unique line(s) of event code
cardMedia
34 Component(s)
363 Line(s) of event code
195 Unique line(s) of event code
pageStartup
19 Component(s)
157 Line(s) of event code
117 Unique line(s) of event code
cardMedia
34 Component(s)
363 Line(s) of event code
195 Unique line(s) of event code
popupShutter
25 Component(s)
330 Line(s) of event code

View File

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

View File

@@ -152,7 +152,7 @@ Text tVersion
Disable release event after dragging: 0
Send Component ID : disabled
Associated Keyboard : none
Text : 36
Text : 37
Max. Text Size : 10
Picture p0

Binary file not shown.

Binary file not shown.

764
README.md
View File

@@ -42,766 +42,6 @@ Some (not all) screenshots from the US Portrait Version:
![screens-us-p](doc-pics/screens-us-p.png)
## TLDR
1. Install Tasmota to NSPanel
2. Install Berry Driver in Tasmota and setup MQTT
3. Flash Nextion Firmware
4. Install AppDaemon, setup MQTT and install Backend Application
## Documentation
For more detailed Instructions see the following Sections:
- [Requirements](#requirements)
- [Installation - Home Automation Part (Home Assistant)](#installation---home-automation-part-home-assistant)
- [Installation - Home Automation Part (IoBroker)](#installation---home-automation-part-iobroker)
- [Installation - NSPanel Part (Firmware)](#installation---nspanel-part)
- [Configuration](#configuration)
- [Configuring the MQTT integration in AppDaemon](#configuring-the-mqtt-integration-in-appdaemon)
- [Configure your NSPanel in AppDaemon](#configure-your-nspanel-in-appdaemon)
- [How to update](#how-to-update)
- [FAQ](#faq---frequently-asked-questions)
## Requirements
- NSPanel
- USB to Serial TTL Adapter
- Running Instance of the Home Automation Platform of your Choise
- Running [Home Assistant Instance](https://www.home-assistant.io/installation/)
- with installed [MQTT Broker](https://www.home-assistant.io/docs/mqtt/broker)
- Running [ioBroker Instance](https://www.iobroker.net/#en/documentation)
- with installed MQTT Broker
## Installation - Home Automation Part (Home Assistant)
This section describes the Installation Steps for HomeAssistant, follow each step.
<details><summary>1. Installing HomeAssistant Add-Ons</summary>
<p>
### Installing AppDaemon
The backend application for HomeAssistant is written in a python for [AppDaemon](https://github.com/AppDaemon/appdaemon).
This means it requires a working and running installation of AppDaemon.
The easiest way to install it is through Home Assistant's Supervisor Add-on Store, it will be automaticly connected to your Home Assistant Instance.
![hass-add-on-store](doc-pics/hass-add-on-store.png)
#### Add babel package to AppDaemon Container (Optional)
For localisation (date in your local language) you need to add the python package babel to your AppDaemon Installation.
![appdaemon-babel](doc-pics/appdaemon-babel.png)
### Installing Studio Code Server (optional, recommended)
You will need a way to edit the `apps.yaml` config file in the Appdaemon folder.
Install Studio Code Server from Home Assistant's Supervisor Add-on Store to easily edit configuration Files on your HomeAssistant Instance.
</p>
</details>
<details><summary>2. Installing HomeAssistant Community Store</summary>
<p>
### Installing HACS
HACS is the Home Assistant Community Store and allows for community integrations and
automations to be updated cleanly and easily from the Home Assistant web user interface.
It's simple to install the AppDaemon app without HACS, but keeping up to date requires
manual steps that HACS will handle for you: you will be notified of updates, and they
can be installed by a click on a button.
If you want to use HACS, you will have to follow [their documentation on how to install HACS](https://hacs.xyz/docs/setup/download).
</p>
</details>
<details><summary>3. Installing Lovelace AppDaemon Backend Application </summary>
<p>
### Installing AppDaemon Backend Application
To install Lovelace UI Backend App with HACS, you will need to make sure that you enabled
AppDaemon automations in HACS, as these are not enabled by default:
1. Click on `Configuration` on the left menu bar in Home Assistant Web UI
2. Select `Devices & Services`
3. Select `Integrations`
4. Find `HACS` and click on `Configure`
5. In the window that opens, make sure that `Enable AppDaemon apps discovery & tracking`
is checked, or check it and click `Submit`
6. If you just enabled this (or just installed HACS), you might have to wait a few minutes
as all repositories are being fetched; you might hit a GitHub rate limit, which might
then require you to wait a few hours for HACS to be fully configured. In this case,
you won't be able to proceed to the next steps until HACS is ready.
Now, to install NSPanel Lovelace UI Backend with HACS, follow these steps:
1. Click on `HACS` on the left menu bar in Home Assistant Web UI
2. Click on `Automations` in the right panel
3. Click on `Explore & download repositories` in the bottom right corner
4. Search for `NSPanel`, and click on `NSPanel Lovelace UI Backend` in the list that appears
5. In the bottom right corner of the panel that appears, click on
`Download this repository with HACS`
6. A confirmation panel will appear, click on `Download`, and wait for HACS to
proceed with the download
7. The Backend Application is now installed, and HACS will inform you when updates are available
</p>
</details>
## Installation - Home Automation Part (IoBroker)
If you are looking for an ioBroker Integration instead of HomeAssistant take a look into the [Readme](ioBroker/README.md) of the iobroker folder.
Thanks to [britzelpuf](https://github.com/britzelpuf) for this integration.
## Installation - NSPanel Part
This section describes how to free your nspanel from stock firmware and get it ready for Lovelace UI 🎉
You only need to do one **Tasmota** OR **ESPHome**
<details><summary>Installation Instructions for Tasmota (Recommended)</summary>
<p>
### Flash Tasmota to your NSPanel
You need to connect to your nspanel via serial and flash tasmtoa [tasmota32-nspanel.factory.bin](https://tasmota.github.io/install/firmware/development/tasmota32-nspanel.factory.bin) to your NSPanel. You can use the Tasmota Web Installer to do so. [Tasmota Web Installer](https://tasmota.github.io/install/)
Make sure to come back to this guide, before uploading the nspanel.be/autoexec.be files.
For more deatils see the [NSPanel Page of the Tasmota Template Repository](https://templates.blakadder.com/sonoff_NSPanel.html).
### Configure Tasmota Template for NSPanel
Configure the NSPanel template for Tasmota. (Go to Configuration and Configure Other and paste the template there, make sure to tick the activate checkbox)
![tasmota-template-config](doc-pics/tasmota-template-config.png)
You can use the following template or copy the one on the [Tasmota Template Repo Site](https://templates.blakadder.com/sonoff_NSPanel.html).
`{"NAME":"NSPanel","GPIO":[0,0,0,0,3872,0,0,0,0,0,32,0,0,0,0,225,0,480,224,1,0,0,0,33,0,0,0,0,0,0,0,0,0,0,4736,0],"FLAG":0,"BASE":1,"CMND":"ADCParam 2,11200,10000,3950 | Sleep 0 | BuzzerPWM 1"}`
After a reboot of tasmota your screen will light up with the stock display firmware.
### Setup your MQTT Server in Tasmota
Configure your MQTT Server in Tasmota.
See Tasmota [MQTT Documentation](https://tasmota.github.io/docs/MQTT/) for more details.
![tasmota-mqtt-config](doc-pics/tasmota-mqtt-config.png)
### Upload Berry Driver to Tasmota
1. Download the autoexec.be from the repository: [Berry Driver](tasmota/autoexec.be)
2. Go to `Consoles` > `Manage File System` in Tasmota and upload the previously downloaded file.
3. Restart your NSPanel
### Flash Firmware to Nextion Screen
Note for ioBroker Users: Check the Release Notes, if the ioBroker Backend is not up to date with the current release there will be a note and you have to flash the latest compatible version from there.
#### Use your own Webserver
Upload the nspanel.tft from the lastest release to a Webserver (for example www folder of Home Assistant) and execute the following command in Tasmota Console. (Development Version: [tft file from HMI folder](HMI/nspanel.tft))
**Webserver must be HTTP, HTTPS is not supported, due to limitations of berry lang on tasmota**
`FlashNextion http://ip-address-of-your-homeassistant:8123/local/nspanel.tft`
#### Use my webserver
Due the limitations of Berry, it's not possible to download the tft file directly from github, so I'm also renting a small server where you can download the file via HTTP.
Use the one following commands to flash the latest release from this repository, just execute the following Command in Tasmota:
EU Version: `FlashNextion http://nspanel.pky.eu/lui-release.tft`
US Version Portrait: `FlashNextion http://nspanel.pky.eu/lui-us-p-release.tft`
US Version Landscape: `FlashNextion http://nspanel.pky.eu/lui-us-l-release.tft`
</p>
</details>
<details><summary>Installation Instructions for ESPHome</summary>
<p>
Support for ESPHome is WIP, see this third-party [ESPHome component](https://github.com/sairon/esphome-nspanel-lovelace-ui) which allows using ESPHome instead of Tasmota.
</p>
</details>
## Configuration
Note this is the documentation of the current development version and might have changed since latest release, so see the documentation of the current release visit:
https://github.com/joBr99/nspanel-lovelace-ui/tree/v2.9.3
### Configuring the MQTT integration in AppDaemon
For the app to work you need a working MQTT Configuration in AppDaemon. Please add the configuration of your mqtt server, user and password to your existing `appdaemon.yaml`
NOTE: This are not the options of the AppDaemon Addon in HomeAssistant. You will find this file under: `config/appdaemon/appdeamon.yaml`
```yaml
---
secrets: /config/secrets.yaml
appdaemon:
latitude: 52.0
longitude: 4.0
elevation: 2
time_zone: Europe/Berlin
plugins:
HASS:
type: hass
MQTT:
type: mqtt
namespace: mqtt
client_id: "appdaemon"
client_host: 192.168.75.30
client_port: 1883
client_user: "mqttuser"
client_password: "mqttpassword"
client_topics: NONE
http:
url: http://127.0.0.1:5050
admin:
api:
hadashboard:
```
Please see [appdaemon.yaml](appdaemon/appdaemon.yaml) as an exmaple.
### Configure your NSPanel in AppDaemon
Confiure your NSPanel as you like, you need to edit the `apps.yaml` inside of your Appdaemon config folder.
You can have multiple nspanel sections. There are some more exmaples in the appdaemon folder of this repo.
```yaml
---
nspanel-1:
module: nspanel-lovelace-ui
class: NsPanelLovelaceUIManager
config:
panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT"
panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend"
updateMode: "auto-notify"
sleepTimeout: 20
#sleepBrightness: 10
sleepBrightness:
- time: "7:00:00"
value: 10
- time: "23:00:00"
value: 0
locale: "de_DE" # used for translations in translations.py and for localized date if babel python package is installed
screensaver:
entity: weather.k3ll3r
cards:
- type: cardEntities
entities:
- entity: switch.example_item
name: NameOverride
icon: mdi:lightbulb
- entity: light.example_item
- entity: cover.example_item
- entity: input_boolean.example_item
title: Example Entities 1
- type: cardEntities
entities:
- entity: switch.example_item
- entity: delete
- entity: cover.example_item
- entity: input_boolean.example_item
title: Example Entities 2
- type: cardEntities
entities:
- entity: binary_sensor.example_item
- entity: sensor.example_item
- entity: button.example_item
- entity: number.example_item
title: Example Entities 3
- type: cardEntities
entities:
- entity: scenes.example_item
- entity: script.example_item
- entity: button.example_item
- entity: input_button.example_item
title: Example Entities 4
- type: cardGrid
entities:
- entity: light.example_item
- entity: switch.example_item
- entity: delete
- entity: button.example_item
- entity: cover.example_item
- entity: delete # delete at the end is optional
title: Exmaple Gird
- type: cardThermo
entity: climate.example_item
- type: cardMedia
entity: media_player.example_item
- type: cardAlarm
entity: alarm_control_panel.alarmo
- type: cardQR
title: Guest Wifi
qrCode: "WIFI:S:test_ssid;T:WPA;P:test_pw;;"
entities:
- entity: iText.test_ssid
name: Name
icon: mdi:wifi
- entity: iText.test_pw
name: Password
icon: mdi:key
```
key | optional | type | default | description
-- | -- | -- | -- | --
`module` | False | string | | The module name of the app.
`class` | False | string | | The name of the Class.
`config` | False | complex | | Config/Mapping between Homeassistant and your NsPanel
### Possible configuration values for config key
key | optional | type | default | description
-- | -- | -- | -- | --
`panelRecvTopic` | False | string | `tele/tasmota_your_mqtt_topic/RESULT` | The mqtt topic used to receive messages.
`panelSendTopic` | False | string | `cmnd/tasmota_your_mqtt_topic/CustomSend` | The mqtt topic used to send messages.
`updateMode` | True | string | `auto-notify` | Update Mode; Possible values: "auto", "auto-notify", "manual"
`model` | True | string | `eu` | Model; Possible values: "eu", "us-l" and "us-p"
`sleepTimeout` | True | integer | `20` | Timeout for the screen to enter screensaver, to disable screensaver use 0
`sleepBrightness` | True | integer/complex | `20` | Brightness for the screen on the screensaver, see example below for complex/scheduled config.
`screenBrightness` | True | integer/complex | `100` | Brightness for the screen during usage, config format is the same as sleepBrightness.
`sleepTracking` | True | string | None | Forces screensaver brightness to 0 in case entity state is not_home or off, can be a group, person or device_tracker entity.
`sleepOverride` | True | complex | None | Allows overriding of the sleepBrightness if entity state is on, true or home. Overrides sleepBrightness but sleepTracking takes precedence.
`locale` | True | string | `en_US` | Used by babel to determinante Date format on screensaver, also used for localization.
`dateFormatBabel` | True | string | `full` | formatting options on https://babel.pocoo.org/en/latest/dates.html?highlight=name%20of%20day#date-fields
`timeFormat` | True | string | `%H:%M` | Time Format on screensaver. Substring after `?` is displayed in a seperate smaller textbox. Useful for 12h time format with AM/PM <pre>`"%I:%M ?%p"`</pre>
`dateAdditonalTemplate` | True | string | `""` | Addional Text dispayed after Date, can contain a Homeassistant Template Example `" - {{ states('sun.sun') }}"`
`timeAdditonalTemplate` | True | string | `""` | Addional Text dispayed below Time, can contain a Homeassistant Template
`dateFormat` | True | string | `%A, %d. %B %Y` | date format used if babel is not installed
`cards` | False | complex | | configuration for cards that are displayed on panel
`screensaver` | True | complex | | configuration for screensaver
`hiddenCards` | True | complex | | configuration for cards that can be accessed though navigate items
<details><summary>Possible languages for locale config key</summary>
<p>
- `af_xx` - Afrikaans
- `ar_xx` - Arabic
- `bg_xx` - Bulgarian
- `ca_xx` - Catalan
- `cs_xx` - Czech
- `da_xx` - Danish
- `de_xx` - German
- `el_xx` - Greek
- `en_xx` - English
- `es_xx` - Spanish
- `et_xx` - Estonian
- `fa_xx` - Persian
- `fi_xx` - Finnish
- `fr_xx` - French
- `he_xx` - Hebrew
- `hr_xx` - Croatian
- `hu_xx` - Hungarian
- `hy_xx` - Armenian
- `id_xx` - Indonesian
- `is_xx` - Icelandic
- `it_xx` - Italian
- `lb_xx` - Luxembourgish
- `lt_xx` - Lithuanian
- `lv_xx` - Latvian
- `nb_xx` - Norwegian
- `nl_xx` - Dutch
- `nn_xx` - Norwegian
- `pl_xx` - Polish
- `pt_xx` - Portuguese
- `ro_xx` - Romanian
- `ru_xx` - Russian
- `sk_xx` - Slovak
- `sl_xx` - Slovenian
- `sv_xx` - Swedish
- `th_xx` - Thai
- `tr_xx` - Turkish
- `uk_xx` - Ukrainian
- `vi_xx` - Vietnamese
</p>
</details>
#### Possible configuration values for a card in card config</summary>
key | optional | type | default | description
-- | -- | -- | -- | --
`type` | False | string | `None` | Used by navigate items
`entities` | False | complex | `None` | contains entities of the card, only valid on cardEntities and cardGrid and cardQR
`title` | True | string | `None` | Title of the Page
`entity` | False | string | `None` | contains the entity of the current card, valid for cardThermo, cardAlarm and cardMedia
`key` | True | string | `None` | Used by navigate items
`mediaControl` | True | string | `None` | Only valid on cardMedia, contains the action executed on pressing the top left media icon. (useful to navigate to a hidden card or start a script)
`alarmControl` | True | complex | `None` | Only valid on cardAlarm, contains the action executed on pressing the left bottom icon, by default this button is used to show a list of open sensors on a failed attempt to arm.
#### Possible configuration values for entities key
key | optional | type | default | description
-- | -- | -- | -- | --
`entity` | False | string | `None` | name of ha entity
`name` | True | string | `None` | Used to override names
`icon` | True | string | `None` | Used to override icons
`color` | True | array | `None` | Overwrite color of entity `color: [255, 0, 0]`
`state` | True | string | `None` | Only displayed if Entity state is equal to this value
`state_not` | True | string | `None` | Only displayed if Entity state is unequal to this value
`status` | True | string | `None` | Only valid for navigate items, adds a entity to track state for the icon
##### Override Icons or Names
To overwrite Icons or Names of entities you can configure an icon and/or name in your configuration, please see the following example.
Only the icons listed in the [Icon Cheatsheet](https://htmlpreview.github.io/?https://github.com/joBr99/nspanel-lovelace-ui/blob/main/HMI/icon-cheatsheet.html) are useable.
```yaml
entities:
- entity: light.test_item
name: NameOverride
icon: mdi:lightbulb
```
It is also possible to configure different icon overwrites per state:
```yaml
icon:
"on": mdi:lightbulb
"off": mdi:lightbulb
```
#### Possible configuration values for screensaver config
key | optional | type | default | description
-- | -- | -- | -- | --
`entity` | True | string | `weather.example` | weather entity from homeassistant
`weatherUnit` | True | string | `celsius` | unit for temperature, valid values are `celsius` or `fahrenheit`
`weatherOverrideForecast1` | True | complex | `None` | sensor entity from home assistant here to overwrite the first weather forecast item on the screensaver
`weatherOverrideForecast2` | True | complex | `None` | sensor entity from home assistant here to overwrite the second weather forecast item on the screensaver
`weatherOverrideForecast3` | True | complex | `None` | sensor entity from home assistant here to overwrite the third weather forecast item on the screensaver
`weatherOverrideForecast4` | True | complex | `None` | sensor entity from home assistant here to overwrite the forth weather forecast item on the screensaver
`statusIcon1` | True | complex | `None` | status icon left to the date string, config similar to weatherOverride
`statusIcon2` | True | complex | `None` | status icon right to the date string, config similar to weatherOverride
`doubleTapToUnlock` | True | boolean | `False` | requires to tap screensaver two times
`alternativeLayout` | True | boolean | `False` | alternative layout with humidity
`theme` | True | complex | | configuration for theme
`defaultCard` | True | string | `None` | default page after exiting screensaver; only works with top level cards defined in cards; needs to be a navigation item, see subpages (navigate.type_key) This config option will also be evaluated as a HomeAssistant Template.
`key` | True | string | `None` | Used by navigate items
Example for the weatherOverride config options:
```yaml
weatherOverrideForecast4:
entity: sensor.example_item
name: name
icon: mdi:lightbulb
```
#### Possible configuration values for screensaver theme config
key | option | type | default | description
-- | -- | -- | -- | --
`background` | True | list | Black | `[R, G, B]`
`time` | True | list | White | `[R, G, B]`
`timeAMPM` | True | list | White | `[R, G, B]`
`date` | True | list | White | `[R, G, B]`
`tMainIcon` | True | list | White | `[R, G, B]`
`tMainText` | True | list | White | `[R, G, B]`
`tForecast1` | True | list | White | `[R, G, B]`
`tForecast2` | True | list | White | `[R, G, B]`
`tForecast3` | True | list | White | `[R, G, B]`
`tForecast4` | True | list | White | `[R, G, B]`
`tF1Icon` | True | list | White | `[R, G, B]`
`tF2Icon` | True | list | White | `[R, G, B]`
`tF3Icon` | True | list | White | `[R, G, B]`
`tF4Icon` | True | list | White | `[R, G, B]`
`tForecast1Val` | True | list | White | `[R, G, B]`
`tForecast2Val` | True | list | White | `[R, G, B]`
`tForecast3Val` | True | list | White | `[R, G, B]`
`tForecast4Val` | True | list | White | `[R, G, B]`
`bar` | True | list | White | `[R, G, B]`
`tMainIconAlt` | True | list | White | `[R, G, B]`
`tMainTextAlt` | True | list | White | `[R, G, B]`
`tMRIcon` | True | list | White | `[R, G, B]`
`tMR` | True | list | White | `[R, G, B]`
`autoWeather` | True | boolean | false | Set to `true` to enable weather icons to change depending on state e.g. blue for rainy. Any custom colors in `tMainIcon` `tF1Icon` `tF2Icon` `tF3Icon` `tF4Icon` take precedence.
If `autoWeather: true` is set. You may also overwrite the default color mapping for any valid weather state provided by homeassistant e.g. `rainy: [50, 50, 255]` or `sunny: [255, 255, 0]`
Specify colours as red green and blue values from 0-255 e.g. `[255, 0, 0]` for red or `[0, 0, 255]` for blue. These are translated internally to RGB565 (note that this has lower color depth so the colours may not appear the same). Also note that the screen has a low contrast ratio, so colors look sigificantly different at full display brightness and lowest brightness.
Example for the theme config:
```yaml
screensaver:
theme:
autoWeather: true
```
For complex setups where you want to reuse the theme over multiple panels see the config exmaples in the appdaemon folder.
#### Schedule sleep brightness
It is possible to schedule a brightness change for the screen at specific times.
```yaml
sleepBrightness:
- time: "7:00:00"
value: 10
- time: "23:00:00"
value: 0
```
```yaml
sleepBrightness:
- time: "sunrise"
value: 10
- time: "sunset + 1:00:00"
value: 0
```
`sleepTracking` overrides this setting and sets the brightness to 0 if the state of the configured Home Assistant entity is `off` or `not_home`. You may also use a [Home Assistant group](https://www.home-assistant.io/integrations/group) to track multiple entities.
`sleepOverride` overrides sleepBrightness but does not take precedence over sleepTracking. This is useful if, for example, you want your NSPanel to be brighter than usual if your light is on or if you want to override a panel dimming if you are in the room.
The following example configuration does nothing during the day but at night, if the bedroom light is on the NSPanel brightness will be 20 instead of 0.
```yaml
sleepBrightness:
- time: "sunrise"
value: 20
- time: "sunset"
value: 0
sleepOverride:
entity: light.bedroomlight
brightness: 20
```
Also it is possible to configure a text or a character by using "text:" as a prefix instead of an icon. `icon: text:X`
#### Fahrenheit on cardThermo
```yaml
- type: cardThermo
entity: climate.example_item
temperatureUnit: fahrenheit
```
#### Subpages
You can configure entities with with the prefix `navigate`, that are navigating to cards, in case it's hidden card, the navigation items will change and the arrow is bringing you back to the privious page.
```yaml
- entity: navigate.cardGrid_testKey
```
will allow you to navigate to a cardGrid page with the configured key testKey
```yaml
hiddenCards:
- type: cardGrid
title: Exmaple Grid
entities:
- entity: light.test_item
key: testKey
```
#### Change behaviour of hardware buttons
##### Tasmota Rules
You can configure the buttons to mimic an UI element on the screen by configuring tasmota rules.
The following rule will change the behaviour of the two buttons to do page navigation.
```
Rule2 on Button1#state do Publish tele/%topic%/RESULT {"CustomRecv":"event,buttonPress2,hwbtn,bPrev"} endon on Button2#state do Publish tele/%topic%/RESULT {"CustomRecv":"event,buttonPress2,hwbtn,bNext"} endon
Rule2 1
```
##### Decouple buttons from controlling power outputs
If you do not want your NSPanel physical buttons to trigger the relays and prefer to have them as software configurable buttons, open the Tasmota console of your NSPanel and enter the following:
`SetOption73 1`
Your relays will now appear as switches in HomeAssistant and you can control your buttons by using automations:
![image](https://user-images.githubusercontent.com/57167030/169677954-5b811d12-dab8-4415-89aa-e4196732765e.png)
You may reverse this change by entering the following in the Tasmota console of your NSPanel:
`SetOption73 0`
Please note: Doing this will mean that if HomeAssistant is not working for any reason your buttons will not function correctly.
#### Sending Notifications to the Panel
There are two notification types, that can be triggered by sending a command over mqtt to the panel here are examples for homeassistant scripts:
<details>
<summary>Seperate Page</summary>
<br>
This is the notification used by the backend for updates, opening it requires to the following commands to the CustomSend Topic:
`pageType popupNotify`
`entityUpdateDetail~internalName~heading~headingColor~button1text~button1color~button2text~tB2Color~notificationText~textColor~sleepTimeout`
It is possible to exit from the page by sending `exitPopup`
Send Message to the Panel combined with a buzzer sound:
```yaml
nspanel_popup_notification:
alias: Popup Notification
sequence:
- service: mqtt.publish
data:
topic: cmnd/tasmota_NsPanelTerrasse/Backlog
payload: CustomSend pageType~popupNotify; CustomSend entityUpdateDetail~id~{{
title }}~65535~~~~~{{ message }}~65535~{{ timeout }}; Buzzer 2,2,2
mode: single
icon: mdi:message-badge
```
Send Message to the Panel:
```yaml
nspanel_popup_notification:
alias: Popup Notification
sequence:
- service: mqtt.publish
data:
topic: cmnd/tasmota_NsPanelTerrasse/Backlog
payload: CustomSend pageType~popupNotify; CustomSend entityUpdateDetail~id~{{
title }}~65535~~~~~{{ message }}~65535~{{ timeout }}
mode: single
icon: mdi:message-badge
```
</details>
<details>
<summary>Notification on screensaver</summary>
<br>
The screensaver can display Notifications by sending this command to the CustomSend topic: `notify~heading~text`
Send Message to the Screensaver combined with a buzzer sound:
```yaml
nspanel_screensaver_notification:
alias: Screensaver Notification
sequence:
- service: mqtt.publish
data:
topic: cmnd/tasmota_NsPanelTerrasse/Backlog
payload: CustomSend notify~{{ heading }}~{{ message }}; Buzzer 2,2,2
mode: single
icon: mdi:message-badge
```
Send Message to the Screensaver:
```yaml
nspanel_screensaver_notification:
alias: Screensaver Notification
sequence:
- service: mqtt.publish
data:
topic: cmnd/tasmota_NsPanelTerrasse/Backlog
payload: CustomSend notify~{{ heading }}~{{ message }}
mode: single
icon: mdi:message-badge
```
</details>
## How to update
Updating involves mainly already descriped steps from installation, so this is a short summary.
This project has three main parts, on a new release you usally need to update at least two of them, the AppDaemon Backend and the firmware of the display.
Sometimes there are also changes to the berry driver script on tasmota.
*Note the commands in the following section will update to the current development version of this repository, use the command from release page if you want to use a release version*
### Update AppDaemon Script
HACS will show you that there is an update avalible and ask you to update.
### Update Display Firmware
Use the following command to update or use your own webserver.
If you are using a recent release you also should be able to update directly with a notification on the screen.
EU Version: `FlashNextion http://nspanel.pky.eu/lui-release.tft`
US Version Portrait: `FlashNextion http://nspanel.pky.eu/lui-us-p-release.tft`
US Version Landscape: `FlashNextion http://nspanel.pky.eu/lui-us-l-release.tft`
### Update Tasmota Berry Driver
Since release 1.1 you can update the berry driver directly from the Tasmota Console with the following command.
`UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be`
## FAQ - Frequently Asked Questions
### Waiting for content - This is taking longer than usual on the screen
Please check your MQTT Topics in your apps.yaml and your mqtt configuration on tasmota.
### How to upgrade from a release to the current development version
1. Update App in HACS to main
Click redownload in the menu of the app in HACS.
Select main version.
**!!! Wait for it to load, dropdown needs to be selectable again, otherwise it will download the latest release !!!**
![hacs-main](doc-pics/hacs-main.png)
**!!! Wait for it to load, dropdown needs to be selectable again, otherwise it will download the latest release !!!**
Click download.
2. Restart AppDaemon
3. Flash current Development Firmware in Tasmota Console. DO NOT USE THIS URL (only if you are on main/dev)
`FlashNextion http://nspanel.pky.eu/lui.tft` DO NOT USE THIS URL (only if you are on main/dev)
Development happens in the EU version, so it is possible that the US Version isn't up to date with the current development version of the EU firmware, the lastet US versions are still downloadable with the following links:
`FlashNextion http://nspanel.pky.eu/lui-us-l.tft` DO NOT USE THIS URL (only if you are on main/dev)
`FlashNextion http://nspanel.pky.eu/lui-us-p.tft` DO NOT USE THIS URL (only if you are on main/dev)
Visit https://docs.nspanel.pky.eu/ for installation instructions and documentation of the configuration.

View File

@@ -86,27 +86,24 @@ class LuiBackendConfig(object):
'cards': [{
'type': 'cardEntities',
'entities': [{
'entity': 'switch.test_item',
'name': 'Test Item'
}, {
'entity': 'switch.test_item'
}],
'title': 'Example Entities Page'
}, {
'type': 'cardGrid',
'entities': [{
'entity': 'switch.test_item'
}, {
'entity': 'switch.test_item'
}, {
'entity': 'switch.test_item'
}
],
'title': 'Example Grid Page'
}, {
'type': 'climate',
'entity': 'climate.test_item',
'temperatureUnit': 'celsius'
'entity': 'iText.',
'name': 'MQTT Config successful',
'icon': 'mdi:check',
'color:': [0, 255, 0],
},{
'entity': 'iText.',
'name': 'Continue adding',
'icon': 'mdi:arrow-right-bold',
},{
'entity': 'iText.',
'name': 'cards to your',
'icon': 'mdi:card',
},{
'entity': 'iText.',
'name': 'apps.yaml',
'icon': 'mdi:cog',
}],
'title': 'Setup successful'
}],
'screensaver': {
'type': 'screensaver',

View File

@@ -298,6 +298,7 @@ class LuiPagesGen(object):
heading = title if title != "unknown" else entity.attributes.friendly_name
current_temp = get_attr_safe(entity, "current_temperature", "")
dest_temp = get_attr_safe(entity, "temperature", None)
dest_temp2 = ""
if dest_temp is None:
dest_temp = get_attr_safe(entity, "target_temp_high", 0)
dest_temp2 = int(get_attr_safe(entity, "target_temp_low", 0)*10)

View File

@@ -24,8 +24,8 @@ class NsPanelLovelaceUIManager(hass.Hass):
controller = LuiController(self, cfg, send_mqtt_msg)
desired_display_firmware_version = 36
version = "v2.9.0"
desired_display_firmware_version = 37
version = "v3.0.0"
model = cfg.get("model")
if model == "us-l":

BIN
doc-pics/card-alarm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
doc-pics/card-media.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

1
docs/CNAME Normal file
View File

@@ -0,0 +1 @@
docs.nspanel.pky.eu

80
docs/_assets/user.css Normal file
View File

@@ -0,0 +1,80 @@
/*.md-header__button.md-logo img {
width: unset;
}*/
.md-main__inner {
margin-top: unset;
}
.md-nav__title {
display: none;
}
/*.md-header,*/ .md-footer {
background-color: #333333;
}
.md-footer__inner.md-grid {
display: none;
}
.md-sidebar {
padding-top: 0px;
}
/*.md-sidebar.md-sidebar--primary {
position: unset;
}*/
.md-sidebar.md-sidebar--secondary {
padding-top: 10px;
}
.md-sidebar.md-sidebar--primary .md-sidebar__scrollwrap {
/*overflow-y: unset;*/
padding-right: 1px;
border-right: 1px solid #adadad;
}
.md-sidebar.md-sidebar--primary .md-sidebar__inner {
/*border-right: 1px solid #adadad;*/
padding-bottom: 30px;
}
.md-sidebar.md-sidebar--secondary .md-sidebar__inner {
border-left: 1px solid #adadad;
}
.md-nav__item .md-nav__list {
padding-left: 10px;
}
.md-content {
margin-top: 25px;
/*border-left: 1px solid #adadad;
border-right: 1px solid #adadad;*/
}
.md-top {
display: none;
}
.md-typeset hr {
border-bottom: 1px solid #adadad;
}
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5 {
font-weight: bold;
}
.md-typeset table:not([class]) td:not(:last-child),
.md-typeset table:not([class]) th:not(:last-child) {
border-right: .05rem solid var(--md-typeset-table-color);
}
ol li::marker {
font-weight: bold;
}

20
docs/card-alarm.md Normal file
View File

@@ -0,0 +1,20 @@
# Alarm Card
![card-alarm](img/card-alarm.png)
```yaml
cards:
- type: cardAlarm
title: Alarm Test 1
entity: alarm_control_panel.alarmo
```
List of supported config keys of this card:
key | optional | type | default | description
-- | -- | -- | -- | --
`type` | False | string | `None` | Used by navigate items
`title` | True | string | `None` | Title of the Page
`entity` | False | string | `None` | contains the entity of the current card
`key` | True | string | `None` | Used by navigate items
`alarmControl` | True | complex | `None` | overwrites the action executed on pressing the left bottom icon, by default this button is used to show a list of open sensors on a failed attempt to arm.

26
docs/card-climate.md Normal file
View File

@@ -0,0 +1,26 @@
# Climate/Thermo Card
![card-thermo](img/card-thermo.png)
```yaml
cards:
- type: cardThermo
title: HeatPump
entity: climate.heatpump
- type: cardThermo
title: HvaC
entity: climate.hvac
- type: cardThermo
title: ecobee
entity: climate.ecobee
```
List of supported config keys of this card:
key | optional | type | default | description
-- | -- | -- | -- | --
`type` | False | string | `None` | Type of the card
`entities` | False | complex | `None` | contains a list of entities of this card
`title` | True | string | `None` | Title of the Page
`temperatureUnit` | True | string | `celsius` | set this to fahrenheit to change the temperatureUnit on the page
`key` | True | string | `None` | Used by navigate items in combination with the type (cardEntities_key)

42
docs/card-entities.md Normal file
View File

@@ -0,0 +1,42 @@
# Entities Page
![card-entities](img/card-entities.png)
```yaml
cards:
- type: cardEntities
title: Test Entities Card
entities:
- entity: light.bed_light
- entity: switch.decorative_lights
- entity: cover.hall_window
- entity: sensor.outside_temperature
```
List of supported config keys of this card:
key | optional | type | default | description
-- | -- | -- | -- | --
`type` | False | string | `None` | Type of the card
`entities` | False | complex | `None` | contains a list of entities of this card
`title` | True | string | `None` | Title of the Page
`key` | True | string | `None` | Used by navigate items in combination with the type (cardEntities_key)
List of supported entitiy types for this page:
- cover
- switch
- input_boolean
- binary_sensor
- sensor
- button
- number
- scenes
- script
- input_button
- light
- input_text (read-only)
- lock
- fan
- automation
- iText

47
docs/card-grid.md Normal file
View File

@@ -0,0 +1,47 @@
# Grid Page
![card-grid](img/card-grid.png)
```yaml
cards:
- type: cardGrid
title: Test Grid Card
entities:
- entity: light.bed_light
- entity: switch.decorative_lights
- entity: sensor.outside_temperature
name: Outside Temp
- entity: sensor.carbon_monoxide
- entity: light.entrance_color_white_lights
name: Entrance
- entity: light.office_rgbw_lights
name: Office RGBW
icon: mdi:office-building
```
List of supported config keys of this card:
key | optional | type | default | description
-- | -- | -- | -- | --
`type` | False | string | `None` | Type of the card
`entities` | False | complex | `None` | contains a list of entities of this card
`title` | True | string | `None` | Title of the Page
`key` | True | string | `None` | Used by navigate items in combination with the type (cardEntities_key)
List of supported entitiy types for this page:
- cover
- switch
- input_boolean
- binary_sensor
- sensor
- button
- number
- scenes
- script
- input_button
- light
- input_text (read-only)
- lock
- automation
- iText

19
docs/card-media.md Normal file
View File

@@ -0,0 +1,19 @@
# Alarm Card
![card-media](img/card-media.png)
```yaml
cards:
- type: cardMedia
entity: media_player.spotify
```
List of supported config keys of this card:
key | optional | type | default | description
-- | -- | -- | -- | --
`type` | False | string | `None` | Used by navigate items
`title` | True | string | `None` | Title of the Page
`entity` | False | string | `None` | contains the entity of the current card
`key` | True | string | `None` | Used by navigate items
`alarmControl` | True | complex | `None` | overwrites the action executed on pressing the left bottom icon, by default this button is used to show a list of open sensors on a failed attempt to arm.

46
docs/card-qr.md Normal file
View File

@@ -0,0 +1,46 @@
# WiFi / QR Card
![card-qr](img/card-qr.png)
```yaml
cards:
- type: cardQR
title: Guest Wifi
qrCode: "WIFI:S:test_ssid;T:WPA;P:test_pw;;"
entities:
- entity: iText.test_ssid
name: Name
icon: mdi:wifi
- entity: iText.test_pw
name: Password
icon: mdi:key
```
List of supported config keys of this card:
key | optional | type | default | description
-- | -- | -- | -- | --
`type` | False | string | `None` | Used by navigate items
`entities` | False | complex | `None` | contains entities of the card, only valid on cardEntities and cardGrid and cardQR
`title` | True | string | `None` | Title of the Page
`key` | True | string | `None` | Used by navigate items
`qrCode` | False | string | `None` | Value of the qrCode
List of supported entitiy types for this page:
- switch
- input_boolean
- binary_sensor
- sensor
- button
- scenes
- script
- input_button
- light
- input_text (read-only)
- lock
- automation
The qrCode value is evaluated as a homeassistant Template, so it is possible to get values from HomeAssistant within the qrCode.
`"WIFI:S:{{states('input_text.test_ssid')}};T:WPA;P:{{states('input_text.test_pw')}};;"`

171
docs/config-overview.md Normal file
View File

@@ -0,0 +1,171 @@
# Configuration
To confiure your NSPanel to your needs, you need to edit the `apps.yaml` inside of your Appdaemon config folder and add card and entities you want to display on the screen.
If you've sucessfully set up mqtt, you should already have a configuration looking like this:
```yaml
---
nspanel-1:
module: nspanel-lovelace-ui
class: NsPanelLovelaceUIManager
config:
panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT"
panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend"
```
You can continue from this point adding configuration for the weather forcecast on the screensaver, configuring a schedule for the brightness of the screensaver and your first cards.
```yaml
---
nspanel-1:
module: nspanel-lovelace-ui
class: NsPanelLovelaceUIManager
config:
panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT"
panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend"
sleepTimeout: 20
sleepBrightness:
- time: "7:00:00"
value: 10
- time: "23:00:00"
value: 0
locale: "de_DE"
screensaver:
entity: weather.k3ll3r
cards:
- type: cardEntities
entities:
- entity: switch.example_item
- entity: light.example_item
title: Example 1
- type: cardGrid
entities:
- entity: switch.example_item
- entity: light.example_item
title: Example 2
```
This is the full list of configuration options supported for the config key:
key | optional | type | default | description
-- | -- | -- | -- | --
`panelRecvTopic` | False | string | `tele/tasmota_your_mqtt_topic/RESULT` | The mqtt topic used to receive messages.
`panelSendTopic` | False | string | `cmnd/tasmota_your_mqtt_topic/CustomSend` | The mqtt topic used to send messages.
`updateMode` | True | string | `auto-notify` | Update Mode; Possible values: "auto", "auto-notify", "manual"
`model` | True | string | `eu` | Model; Possible values: "eu", "us-l" and "us-p"
`sleepTimeout` | True | integer | `20` | Timeout for the screen to enter screensaver, to disable screensaver use 0
`sleepBrightness` | True | integer/complex | `20` | Brightness for the screen on the screensaver, see example below for complex/scheduled config.
`screenBrightness` | True | integer/complex | `100` | Brightness for the screen during usage, config format is the same as sleepBrightness.
`sleepTracking` | True | string | None | Forces screensaver brightness to 0 in case entity state is not_home or off, can be a group, person or device_tracker entity.
`sleepOverride` | True | complex | None | Allows overriding of the sleepBrightness if entity state is on, true or home. Overrides sleepBrightness but sleepTracking takes precedence.
`locale` | True | string | `en_US` | Used by babel to determinante Date format on screensaver, also used for localization.
`dateFormatBabel` | True | string | `full` | formatting options on https://babel.pocoo.org/en/latest/dates.html?highlight=name%20of%20day#date-fields
`timeFormat` | True | string | `%H:%M` | Time Format on screensaver. Substring after `?` is displayed in a seperate smaller textbox. Useful for 12h time format with AM/PM <pre>`"%I:%M ?%p"`</pre>
`dateAdditonalTemplate` | True | string | `""` | Addional Text dispayed after Date, can contain a Homeassistant Template Example `" - {{ states('sun.sun') }}"`
`timeAdditonalTemplate` | True | string | `""` | Addional Text dispayed below Time, can contain a Homeassistant Template
`dateFormat` | True | string | `%A, %d. %B %Y` | date format used if babel is not installed
`cards` | False | complex | | configuration for cards that are displayed on panel; see docs for cards
`screensaver` | True | complex | | configuration for screensaver; see docs for screensaver
`hiddenCards` | True | complex | | configuration for cards that can be accessed though navigate items; see docs for cards
<details>
<summary>Details on sleepBrightness/screenBrightness and other configs related to screen brightness</summary>
<br>
It is possible to schedule a brightness change for the screen at specific times.
```yaml
sleepBrightness:
- time: "7:00:00"
value: 10
- time: "23:00:00"
value: 0
```
```yaml
sleepBrightness:
- time: "sunrise"
value: 10
- time: "sunset + 1:00:00"
value: 0
```
It is also possible to use a static value or an input_number/sensor with the range between 0 and 100 as value for sleepBrightness/screenBrightness:
```
sleepBrightness: input_number.brightness_nspanel
```
```
sleepBrightness: 50
```
`sleepTracking` overrides this setting and sets the brightness to 0 if the state of the configured Home Assistant entity is `off` or `not_home`. You may also use a [Home Assistant group](https://www.home-assistant.io/integrations/group) to track multiple entities.
`sleepOverride` overrides sleepBrightness but does not take precedence over sleepTracking. This is useful if, for example, you want your NSPanel to be brighter than usual if your light is on or if you want to override a panel dimming if you are in the room.
The following example configuration is turning off the screen after sunset, but in case the bedroom light is on the NSPanel brightness will be 20 instead of 0.
```yaml
sleepBrightness:
- time: "sunrise"
value: 20
- time: "sunset"
value: 0
sleepOverride:
entity: light.bedroomlight
brightness: 20
```
</details>
<details>
<summary>Supported keys for locale config</summary>
<p>
- `af_xx` - Afrikaans
- `ar_xx` - Arabic
- `bg_xx` - Bulgarian
- `ca_xx` - Catalan
- `cs_xx` - Czech
- `da_xx` - Danish
- `de_xx` - German
- `el_xx` - Greek
- `en_xx` - English
- `es_xx` - Spanish
- `et_xx` - Estonian
- `fa_xx` - Persian
- `fi_xx` - Finnish
- `fr_xx` - French
- `he_xx` - Hebrew
- `hr_xx` - Croatian
- `hu_xx` - Hungarian
- `hy_xx` - Armenian
- `id_xx` - Indonesian
- `is_xx` - Icelandic
- `it_xx` - Italian
- `lb_xx` - Luxembourgish
- `lt_xx` - Lithuanian
- `lv_xx` - Latvian
- `nb_xx` - Norwegian
- `nl_xx` - Dutch
- `nn_xx` - Norwegian
- `pl_xx` - Polish
- `pt_xx` - Portuguese
- `ro_xx` - Romanian
- `ru_xx` - Russian
- `sk_xx` - Slovak
- `sl_xx` - Slovenian
- `sv_xx` - Swedish
- `th_xx` - Thai
- `tr_xx` - Turkish
- `uk_xx` - Ukrainian
- `vi_xx` - Vietnamese
- `zh_CN` - Simplified Chinese
- `zh_TW` - Traditional Chinese
</p>
</details>

163
docs/config-screensaver.md Normal file
View File

@@ -0,0 +1,163 @@
#### Possible configuration values for screensaver config
key | optional | type | default | description
-- | -- | -- | -- | --
`entity` | True | string | `weather.example` | weather entity from homeassistant
`weatherUnit` | True | string | `celsius` | unit for temperature, valid values are `celsius` or `fahrenheit`
`weatherOverrideForecast1` | True | complex | `None` | sensor entity from home assistant here to overwrite the first weather forecast item on the screensaver
`weatherOverrideForecast2` | True | complex | `None` | sensor entity from home assistant here to overwrite the second weather forecast item on the screensaver
`weatherOverrideForecast3` | True | complex | `None` | sensor entity from home assistant here to overwrite the third weather forecast item on the screensaver
`weatherOverrideForecast4` | True | complex | `None` | sensor entity from home assistant here to overwrite the forth weather forecast item on the screensaver
`statusIcon1` | True | complex | `None` | status icon left to the date string, config similar to weatherOverride
`statusIcon2` | True | complex | `None` | status icon right to the date string, config similar to weatherOverride
`doubleTapToUnlock` | True | boolean | `False` | requires to tap screensaver two times
`alternativeLayout` | True | boolean | `False` | alternative layout with humidity
`theme` | True | complex | | configuration for theme
`defaultCard` | True | string | `None` | default page after exiting screensaver; only works with top level cards defined in cards; needs to be a navigation item, see subpages (navigate.type_key) This config option will also be evaluated as a HomeAssistant Template.
`key` | True | string | `None` | Used by navigate items
Example for the weatherOverride config options:
```yaml
weatherOverrideForecast4:
entity: sensor.example_item
name: name
icon: mdi:lightbulb
```
#### Possible configuration values for screensaver theme config
key | option | type | default | description
-- | -- | -- | -- | --
`background` | True | list | Black | `[R, G, B]`
`time` | True | list | White | `[R, G, B]`
`timeAMPM` | True | list | White | `[R, G, B]`
`date` | True | list | White | `[R, G, B]`
`tMainIcon` | True | list | White | `[R, G, B]`
`tMainText` | True | list | White | `[R, G, B]`
`tForecast1` | True | list | White | `[R, G, B]`
`tForecast2` | True | list | White | `[R, G, B]`
`tForecast3` | True | list | White | `[R, G, B]`
`tForecast4` | True | list | White | `[R, G, B]`
`tF1Icon` | True | list | White | `[R, G, B]`
`tF2Icon` | True | list | White | `[R, G, B]`
`tF3Icon` | True | list | White | `[R, G, B]`
`tF4Icon` | True | list | White | `[R, G, B]`
`tForecast1Val` | True | list | White | `[R, G, B]`
`tForecast2Val` | True | list | White | `[R, G, B]`
`tForecast3Val` | True | list | White | `[R, G, B]`
`tForecast4Val` | True | list | White | `[R, G, B]`
`bar` | True | list | White | `[R, G, B]`
`tMainIconAlt` | True | list | White | `[R, G, B]`
`tMainTextAlt` | True | list | White | `[R, G, B]`
`tMRIcon` | True | list | White | `[R, G, B]`
`tMR` | True | list | White | `[R, G, B]`
`autoWeather` | True | boolean | false | Set to `true` to enable weather icons to change depending on state e.g. blue for rainy. Any custom colors in `tMainIcon` `tF1Icon` `tF2Icon` `tF3Icon` `tF4Icon` take precedence.
If `autoWeather: true` is set. You may also overwrite the default color mapping for any valid weather state provided by homeassistant e.g. `rainy: [50, 50, 255]` or `sunny: [255, 255, 0]`
Specify colours as red green and blue values from 0-255 e.g. `[255, 0, 0]` for red or `[0, 0, 255]` for blue. These are translated internally to RGB565 (note that this has lower color depth so the colours may not appear the same). Also note that the screen has a low contrast ratio, so colors look sigificantly different at full display brightness and lowest brightness.
Example for the theme config:
```yaml
screensaver:
theme:
autoWeather: true
```
<details>
<summary>Config Example for configured weatherOverrides</summary>
<br>
```
config:
screensaver:
entity: weather.k3ll3r
weatherOverrideForecast4:
entity: sensor.example_item
name: name
icon: lightbulb
alternativeLayout: True
```
</details>
<details>
<summary>Config Example for configured statusIcons</summary>
<br>
```
config:
screensaver:
entity: weather.k3ll3r
statusIcon1:
entity: switch.example_item
statusIcon2:
entity: binary_sensor.example_item
```
</details>
<details>
<summary>Config Example for configured theme (colored weather icons)</summary>
<br>
```
config:
screensaver:
entity: weather.k3ll3r
theme:
autoWeather: true
```
</details>
<details>
<summary>Config Example for configured theme (custom)</summary>
<br>
```
config:
screensaver:
entity: weather.k3ll3r
screensaver:
entity: weather.k3ll3r
theme:
#time: [220, 0, 255]
#timeAMPM: [220, 0, 255]
#date: [220, 0, 255]
#tMainIcon: [220, 0, 255]
#tMainText: [220, 0, 255]
#tForecast1: [220, 0, 255]
#tForecast2: [220, 0, 255]
#tForecast3: [220, 0, 255]
#tForecast4: [220, 0, 255]
#tF1Icon: [220, 0, 255]
#tF2Icon: [220, 0, 255]
#tF3Icon: [220, 0, 255]
#tF4Icon: [220, 0, 255]
#tForecast1Val: [220, 0, 255]
#tForecast2Val: [220, 0, 255]
#tForecast3Val: [220, 0, 255]
#tForecast4Val: [220, 0, 255]
#bar: [220, 0, 255]
#tMRIcon: [220, 0, 255]
#tMR: [220, 0, 255]
#autoWeather automatically colors the screensaver weather icons based upon weather. Uncomment the following line to enable.
#autoWeather: true
#If you have enabled autoWeather, the following options allow you to customise the colors used for autoWeather.
#clear-night: [150, 150, 100]
#cloudy: [75, 75, 75]
#exceptional: [255, 50, 50]
#fog: [150, 150, 150]
#hail: [200, 200, 200]
#lightning: [200, 200, 0]
#lightning-rainy: [200, 200, 150]
#partlycloudy: [150, 150, 150]
#pouring: [50, 50, 255]
#rainy: [100, 100, 255]
#snowy: [150, 150, 150]
#snowy-rainy: [150, 150, 255]
#sunny: [255, 255, 0]
#windy: [150, 150, 150]
#windy-variant: [255, 125, 125]
```
</details>

84
docs/configure_mqtt.md Normal file
View File

@@ -0,0 +1,84 @@
# Configure MQTT on Tasmota
Configure your MQTT Server in Tasmota.
See Tasmota [MQTT Documentation](https://tasmota.github.io/docs/MQTT/) for more details.
![tasmota-mqtt-config](img/tasmota-mqtt-config.png)
Please leave the Full Topic as it is in default configuration (and on the screenshot).
Change the topic to something unique for your panel, you will need this topic later in the configuration of your panel in appdaemon / apps.yaml
# Configure MQTT Connection on AppDaemon
For the app to work you need a working MQTT Configuration in AppDaemon. Please add the configuration of your mqtt server, user and password to your existing `appdaemon.yaml`
NOTE: This are not the options of the AppDaemon Addon in Home Assistant.
You will find this file in the following location: `config/appdaemon/appdeamon.yaml`
```yaml
---
secrets: /config/secrets.yaml
appdaemon:
latitude: 52.0
longitude: 4.0
elevation: 2
time_zone: Europe/Berlin
plugins:
HASS:
type: hass
MQTT:
type: mqtt
namespace: mqtt
client_id: "appdaemon"
client_host: 192.168.75.30
client_port: 1883
client_user: "mqttuser"
client_password: "mqttpassword"
client_topics: NONE
http:
url: http://127.0.0.1:5050
admin:
api:
hadashboard:
```
# Configure NsPanel on AppDaemon
Please add the following minimal configuration to your apps.yaml, which is located in `config/appdaemon/apps/apps.yaml`
```yaml
---
nspanel-1:
module: nspanel-lovelace-ui
class: NsPanelLovelaceUIManager
config:
panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT"
panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend"
```
Please adjust `tasmota_your_mqtt_topic` to the topic used in Tasmota MQTT Configuration.
If your configuration is correct you should get the following screens on your panel:
![hacs-main](img/mqtt-config-sucess.png)
<details>
<summary>Note: You can add multiple panels to this configuration:</summary>
<br>
```yaml
---
nspanel-1:
module: nspanel-lovelace-ui
class: NsPanelLovelaceUIManager
config:
panelRecvTopic: "tele/first-nspanel-topic/RESULT"
panelSendTopic: "cmnd/first-nspanel-topic/CustomSend"
nspanel-2:
module: nspanel-lovelace-ui
class: NsPanelLovelaceUIManager
config:
panelRecvTopic: "tele/second-nspanel-topic/RESULT"
panelSendTopic: "cmnd/second-nspanel-topic/CustomSend"
```
</details>

54
docs/entities.md Normal file
View File

@@ -0,0 +1,54 @@
# Entities
Entities are mainly used on cardEntities, cardGrid and cardGrid.
It is possible to overwrite and configure varrious things on Entities.
## Possible configuration values for entities key:
key | optional | type | default | description
-- | -- | -- | -- | --
`entity` | False | string | `None` | name of ha entity
`name` | True | string | `None` | Used to override names
`icon` | True | string | `None` | Used to override icons
`color` | True | array | `None` | Overwrite color of entity `color: [255, 0, 0]`
`state` | True | string | `None` | Only displayed if Entity state is equal to this value
`state_not` | True | string | `None` | Only displayed if Entity state is unequal to this value
`status` | True | string | `None` | Only valid for navigate items, adds a entity to track state for the icon
## Override Icons or Names
To overwrite Icons or Names of entities you can configure an icon and/or name in your configuration, please see the following example.
Only the icons listed in the [Icon Cheatsheet](https://htmlpreview.github.io/?https://github.com/joBr99/nspanel-lovelace-ui/blob/main/HMI/icon-cheatsheet.html) are useable.
```yaml
entities:
- entity: light.test_item
name: NameOverride
icon: mdi:lightbulb
```
It is also possible to configure different icon overwrites per state:
```yaml
icon:
"on": mdi:lightbulb
"off": mdi:lightbulb
```
# Hide item based on state
This sensor will only be shown on the card if it's state is equal to `off`
```yaml
- entity: binary_sensor.sensor_bad_contact
state: "off"
```
This sensor will only be shown on the card if it's state is not equal to `on`
```yaml
- entity: binary_sensor.sensor_kueche_contact
state_not: "on"
```

58
docs/faq.md Normal file
View File

@@ -0,0 +1,58 @@
# FAQ - Frequently Asked Questions
## Waiting for content - This is taking longer than usual on the screen
Please check your MQTT Topics in your apps.yaml and your mqtt configuration on tasmota.
## How to update
### Update AppDaemon Script
HACS will show you that there is an update avalible and ask you to update. It is important to restart the AppDaemon Container afterwards.
### Update Display Firmware
You should get an notification on the screen, asking you to update the firmware. In case you want to update manually you can use the following commands.
EU Version: `FlashNextion http://nspanel.pky.eu/lui-release.tft`
US Version Portrait: `FlashNextion http://nspanel.pky.eu/lui-us-p-release.tft`
US Version Landscape: `FlashNextion http://nspanel.pky.eu/lui-us-l-release.tft`
### Update Tasmota Berry Driver
You should get an notification on the screen, asking you to update the driver, if an update is needed.
You can update the berry driver directly from the Tasmota Console with the following command.
`UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be`
## How to upgrade from a release to the current development version
1. Update App in HACS to main
Click redownload in the menu of the app in HACS.
Select main version.
**!!! Wait for it to load, dropdown needs to be selectable again, otherwise it will download the latest release !!!**
![hacs-main](img/hacs-main.png)
**!!! Wait for it to load, dropdown needs to be selectable again, otherwise it will download the latest release !!!**
Click download.
2. Restart AppDaemon
3. Flash current Development Firmware in Tasmota Console. DO NOT USE THIS URL (only if you are on main/dev)
`FlashNextion http://nspanel.pky.eu/lui.tft` DO NOT USE THIS URL (only if you are on main/dev)
Development happens in the EU version, so it is possible that the US Version isn't up to date with the current development version of the EU firmware, the lastet US versions are still downloadable with the following links:
`FlashNextion http://nspanel.pky.eu/lui-us-l.tft` DO NOT USE THIS URL (only if you are on main/dev)
`FlashNextion http://nspanel.pky.eu/lui-us-p.tft` DO NOT USE THIS URL (only if you are on main/dev)

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
docs/img/card-entities.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
docs/img/card-grid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
docs/img/card-thermo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
docs/img/hacs-main.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
docs/img/message-flow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
docs/img/nspanel-rl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 985 KiB

BIN
docs/img/screens-us-p.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
docs/img/screens.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

54
docs/index.md Normal file
View File

@@ -0,0 +1,54 @@
# Overview
If you like this project consider buying me a pizza 🍕 <a href="https://paypal.me/joBr99" target="_blank"><img src="https://img.shields.io/static/v1?logo=paypal&label=&message=donate&color=slategrey"></a>
[![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg)](https://github.com/hacs/integration)
![hacs validation](https://github.com/joBr99/nspanel-lovelace-ui/actions/workflows/hacs-validation.yaml/badge.svg)
[![Man Hours](https://img.shields.io/endpoint?url=https%3A%2F%2Fmh.jessemillar.com%2Fhours%3Frepo%3Dhttps%3A%2F%2Fgithub.com%2FjoBr99%2Fnspanel-lovelace-ui.git)](https://jessemillar.com/r/man-hours)
NsPanel Lovelace UI is a Firmware for the nextion screen inside of NSPanel in the Design of [HomeAssistant](https://www.home-assistant.io/)'s Lovelace UI Design.
**EU Model and US Model supported (in portrait and landscape orientation)**
Content of the screen is controlled by a AppDaemon Python Script installed on your HomeAssistant Instance.
Or an TypeScript on your ioBroker Instance in case you are an ioBroker User.
NsPanel needs to be flashed with Tasmota (or upcoming with ESPHome)
![nspanel-rl](img/nspanel-rl.png)
## Features
- Entities Page
- Grid Page
- Detail Pages for Lights (Brightness, Temperature and Color of the Light) and for Covers (Position)
- Thermostat Page
- Media Player Card
- Alarm Control Card
- Screensaver Page with Time, Date and Weather Information
- Card with QrCode to display WiFi Information
- Localization (currently 40 languages)
- **Everything is dynamically configurable by a yaml config, no need to code or touch Nextion Editor**
It works with [Tasmota](https://tasmota.github.io/docs/) and MQTT.
To control the panel and update it with content from HomeAssistant there is an [AppDaemon](https://github.com/AppDaemon/appdaemon) App.
See the following picture to get an idea of the look of this firmware for NSPanel.
![screens](img/screens.png)
Some (not all) screenshots from the US Portrait Version:
![screens-us-p](img/screens-us-p.png)
## Requirements
- NSPanel
- USB to Serial TTL Adapter
- Running Instance of the Home Automation Platform of your Choise
- Running [Home Assistant Instance](https://www.home-assistant.io/installation/)
- with installed [MQTT Broker](https://www.home-assistant.io/docs/mqtt/broker)
- Running [ioBroker Instance](https://www.iobroker.net/#en/documentation)
- with installed MQTT Broker

255
docs/iobroker-install.md Normal file
View File

@@ -0,0 +1,255 @@
# Installation - ioBroker
The Backend for ioBroker is maintained by [britzelpuf](https://github.com/britzelpuf) and [armilar](https://github.com/armilar)
https://forum.iobroker.net/topic/50888/sonoff-nspanel/612?_=1654980976439
**Step für Step - Anleitung zur Einrichtung eines Sonoff NSPanel mit Lovelace UI unter ioBroker**
![219c8bad-2af0-42e6-a041-b4ba319ca96d-image.png](img/ioBroker/1653910838009-219c8bad-2af0-42e6-a041-b4ba319ca96d-image.png)
**1. Voraussetzungen für den ioBroker**
Für den Betrieb benötigst du „keinen“ ioBroker-lovelace-Adapter. Die komplette lovelace-Integration erfolgt über die TFT-Firmware und die nachfolgenden ioBroker-Adapter.
* **%(#666)[MQTT-Adapter]**
![3ccd8404-afe3-4182-953c-2172ca1f0a09-image.png](img/ioBroker/1653911602309-3ccd8404-afe3-4182-953c-2172ca1f0a09-image.png)
Die Kommunikation zwischen dem NSPanel und ioBroker erfolgt mittels MQTT über Tasmota. Da der Datenpunkt „CustomSend“ erforderlich ist und dieser nicht im Sonoff-Adapter vorhanden ist und auch nicht durch das Skript angelegt werden kann, erfolgt die Kommunikation „nicht“ über den Sonoff-Adapter --> später mehr …
* **%(#666)[Javascript-Adapter]**
Es werden zwei Type-Skripte (TS = das etwas mächtigere Javascript) benötigt. Zum Einen ein Icon-Skript, da alle verwendeten Icons nicht als „echte Grafiken“ im Panel hinterlegt sind, sondern als Schriftzeichen-Symbole. Des Weiteren ein TS-Skript mit dem eigentlichen Laufzeit-Code, welches für jedes eingesetzte NSPanel vorhanden und konfiguriert sein sollte --> später mehr …
* **%(#666)[Geräte verwalten“-Adapter]**
![bae0913f-fb3f-4856-90d1-eebb70b5a89a-image.png](img/ioBroker/1653911536657-bae0913f-fb3f-4856-90d1-eebb70b5a89a-image.png)
Über diesen Adapter sollten die Aliase später (mit Ausnahme des Media-Alias für Alexa & Co.) erstellt werden --> später mehr …
* **%(#666)[Accu-Weather-Adapter]**
![1f0dbb8b-a057-4237-a5c7-df7728a255c6-image.png](img/ioBroker/1653911665919-1f0dbb8b-a057-4237-a5c7-df7728a255c6-image.png)
Spielt in erster Linie eine Rolle beim Screensaver-Wetter, da zum Ersten die Icons und die Temperatur-Informationen für den Forecast ausgelesen werden (falls genutzt) und zum Zweiten das aktuelle Wettericon für den Screensaver benötigt wird. Wer keine Wetterstation oder Außentemperatursensor hat, kann auch die Temperatur aus Accu-Weather importieren --> später mehr …
* **%(#666)[Alexa2-Adapter]**
Zur Visualisierung des Media-Players sollte der Alexa2-Adapter installiert sein. Wenn du statt Alexa-Devices andere Hersteller wie z.B. Google-Home-Geräte oder in erster Linie der Spotify-Premium-Adapter im Einsatz hast, so ist es auch möglich mit einem entsprechend, alternativen Media-Adapter den Media-Player zu betreiben --> später mehr …
**2. Panel mit Tasmota flashen.**
Hierzu eignet sich für den "Hardwareteil" die Anleitung von haus-automatisierung.com
(**https://www.youtube.com/watch?v=uqPz08ZpFW8**). Video bis 11 Minuten und 30 Sekunden befolgen!
Die Beschreibung, wie man das Panel mit Tasmota flashen kann, ohne einen Kurzschluss zu erzeugen, ist schon sehr gut erklärt.
Du installierst gleich einen „abweichenden“ Berry-Treiber (autoexec.be) als in der Video-Beschreibung genannt. Wenn du Tasmota und „noch nicht der Berry-Treiber“ installiert hast, bitte mit der Youtube-Video-Anleitung von Matthias ab Zeit=11:30 aufhören. Ich verwende in meinen Panels die Version „tasmota32-DE.bin“. Du kannst aber auch die „tasmota32-nspanel.bin“ verwenden.
Zur MQTT-Konfiguration kommen wir im Punkt 4
An dieser Stelle solltest du aber bereits die grundsätzliche Tasmota Konfiguration vornehmen:
a) Unter „Sonstige Einstellungen“ trägst du im Feld Vorlage
```
{"NAME":"NSPanel","GPIO":[0,0,0,0,3872,0,0,0,0,0,32,0,0,0,0,225,0,480,224,1,0,0,0,33,0,0,0,0,0,0,0,0,0,0,4736,0],"FLAG":0,"BASE":1}
```
ein, hakst Aktivieren "an" und klickst auf Speichern. Du kannst natürlich auch noch Device und Friendly Name vergeben
![3ca891dc-0892-4ed4-8c44-384899cbb460-image.png](img/ioBroker/1653916806795-3ca891dc-0892-4ed4-8c44-384899cbb460-image.png)
b) Unter Logging fügst du die IP von deinem ioBroker unter Sys-Log Host () ein und klickst auf Speichern.
c) Unter Konsolen/Konsole kannst du natürlich auch noch weitere Einstellungen vornehmen (ipaddress1 192.168.X.X für statische IPs, setOptions, etc.)
**3. Berry-Treiber installieren**
Im Tasmota findest du unter „Konsolen“ den Button „Verwalte Dateisystem“. Wenn du diesen anklickst, siehst du einen weiteren Button „Datei erstellen und bearbeiten“. Du änderst den Dateinamen „neue-datei.txt“ in „autoexec.be“ und fügst den Inhalt aus dem folgenden Link ein:
**https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be**
![bbf8f99d-8f37-4903-9aa8-3b7decab2577-image.png](img/ioBroker/1653912758425-bbf8f99d-8f37-4903-9aa8-3b7decab2577-image.png)
Danach klickst du auf „Speichern“ und dann solltest du Tasmota rebooten.
Wenn das Panel bereits unter einer anderen Variante (z.B. haus-automatisierung.com) installiert war, dann bitte alle Dateien (insbesondere autoexec.be und autoexec.bec) vorher über das Flammensymbol hinter dem Dateinamen löschen. Und von vorne mit dem Punkt 3 beginnen
![e0c99373-2e72-4f18-827d-5050f8d41962-image.png](img/ioBroker/1653912663013-e0c99373-2e72-4f18-827d-5050f8d41962-image.png)
**4. MQTT im Tasmota konfigurieren**
Im Tasmota unter „Einstellungen/MQTT konfigurieren“:
a) Host deines ioBrokers vergeben
b) Den Port deiner ioBroker-MQTT-Adapter-Instanz eingeben (für mqtt.0.). Wenn du noch keinen MQTT-Adapter installiert hast, dann verwende bitte nicht unbedingt den Standard-Port 1883. Dieser Port wird auch von anderen Pseudo-MQTT-Adaptern (Sonoff/Shelly/etc.) ebenfalls verwendet und führt im parallelen Betrieb mit anderen MQTT-Devices später unweigerlich zu Komplikationen. Ich verwende für die MQTT-Instanzen gerne einen Port ab 1886 oder 1887 oder 1888 oder höher. Das Problem zeigt sich in der Regel ab dem Zeitpunkt, an dem der „CustomSend“ nicht von deiner mqtt.0.-Instanz abonniert wird.
c) Benutzer und Passwort aus der ioBroker-MQTT-Instanz eintragen
d) Bei Client und topic trage ich in der Regel „NSPanel_X“ ein. (X = 1, 2, 3 oder WZ für Wohnzimmer, etc.)
e) Für den full topic verwende ich in der Regel „SmartHome/%topic%/%prefix%/“.
f) Speichern klicken und Einstellungen verlassen
![76749e7d-c630-406c-9d2b-a2424521fa96-image.png](img/ioBroker/1653909770906-76749e7d-c630-406c-9d2b-a2424521fa96-image.png)
**5. TFT-Firmware auf das Panel flashen**
Tasmota „Konsolen/Konsole“ öffnen und in die Kommandozeile
```
FlashNextion http://nspanel.pky.eu/lovelace-ui/github/nspanel-v2.9.0.tft
```
eingeben, mit Enter bestätigen. Das Panel installiert jetzt die TFT-Firmware (Kann beim ersten Mal ein paar Minuten dauern Fortschritt beobachten am Ende erfolgt ein Reboot und das Panel wechselt in einen Screen „Waiting for Content“
![4f4f6005-7cfd-444d-9b9a-14703194781d-image.png](img/ioBroker/1653913546138-4f4f6005-7cfd-444d-9b9a-14703194781d-image.png)
Das Panel wartet jetzt auf den Input von deinem ioBroker-Skript (Installierst du in einem der nächsten Punkte …)
**6. MQTT im ioBroker installieren und konfigurieren**
Wenn du bereits eine Instanz des MQTT-Adapters (z.B. mqtt.0.) nutzt, dann bitte den Port der MQTT-Adapter-Instanz auch im Tasmota-MQTT verwenden. Bitte auch hier den Hinweis aus Punkt 4b beachten und ggf. einen anderen Port für die Kommunikation eintragen.
Ansonsten wählst du im ioBroker-Menü unter „Adapter“ den mqtt-Adapter aus und erstellst wie gewohnt eine Instanz des Adapters. Du kannst dir natürlich auch eine zusätzliche Instanz (z.B. mqtt.1. oder mqtt.2. etc.) erstellen.
Meine Einstellungen im Reiter Verbindung sind z.B.:
a) IP = Server/Broker
b) WebSockets benutzen (angehakt)
c) IP Adresse des ioBrokers (wahrscheinlich eth0 oder eth1) auswählen
d) Port 1886 (analog Port aus Tasmota/MQTT)
e) Benutzer (analog Benutzer aus Tasmota/MQTT)
f) Kennwort + Kennwort wiederholen (analog Passwort aus Tasmota/MQTT)
![8182d534-bbe0-42a3-89b6-864bc30f9a17-image.png](img/ioBroker/1653909648857-8182d534-bbe0-42a3-89b6-864bc30f9a17-image.png)
Meine Einstellungen im Reiter MQTT-Einstellungen sind:
a) Maske zum Bekanntgeben eigener States: mqtt.0.* (Bei zusätzlicher Instanz entsprechend höher (mqtt.1.* etc.)
b) Eigene States beim Verbinden publizieren (angehakt)
c) States bei subscribe publizieren (angehakt)
d) Leere Session erzwingen: Client-Einstellungen verwenden
![f184fc26-229d-4a75-84cc-74fda631c527-image.png](img/ioBroker/1653909565560-f184fc26-229d-4a75-84cc-74fda631c527-image.png)
**7. CustomSend anlegen**
Der MQTT Datenpunkt wird benötigt und muss vom MQTT-Adapter angelegt werden. Ein manuelles Anlegen unter „Objekte“ oder „createState“ ist im ioBroker „nicht mehr“ möglich. Um den Datenpunkt zu erzeugen, öffnest du im Tasmota die Konsole und gibst ohne die Anführungszeichen
```
„CustomSend time~12:00“
```
ein. Alternativ kann auch der MQTT-Explorer genutzt werden und ein payload unter .../cmnd abgesendet werden. Danach sollte im MQTT-Adapter unter Objekte ein Datenpunkt: „**SmartHome/NSPanel_X/cmnd/CustomSend**“ erscheinen. Falls nicht, solange wiederholen bis dieser Datenpunkt abonniert wurde, oder ggfs. Nochmals die MQTT-Einstellungen überprüfen. In den Vergangenen Fragen dieses Topics ging es häufiger um diesen Punkt.
**8. Icon „TypeScript“ unter „Skripte“ im Verzeichnis „global“ anlegen**
Wie bereits in der Einleitung erwähnt, werden zwei TypeScripts (TS) benötigt. Das erste ist das Icon-Skript. Das Icon-Skript dient zur Übersetzung von Schriftzeichensymbolen zwischen dem Skript und der TFT-Firmware.
Unter dem grünen Vezeichnisbaum „global“ im ioBroker-Menüpunkt Skripte erzeugst du ein Skript mit dem Namen „IconsSelector“ vom Typ: TypeScript (TS). Dort fügst du den Inhalt der Datei:
**https://github.com/Armilar/nspanel-lovelace-ui/blob/main/ioBroker/icon_mapping.ts**
ein und startest das Skript.
Nur zur Info: Du kannst die einzelnen Icon-Symbolnamen (aktuell 6896 unterschiedliche Icon-Symbole) auf
**https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html**
einsehen und später (kommen wir bei der Alias-Erstellung noch zu) auch jedes Icon in deinem Panel an entsprechender Stelle verwenden. Für die Einbindung sind die „Namen“ der Icons wichtig.
**9. TypeScript „NSPanelTs.ts“ anlegen**
Unter dem regulären Vezeichnisbaum „common“ im ioBroker-Menüpunkt Skripte erzeugst du (gerne auch in weiteren Unterverzeichnissen) ein weiteres Skript (Aktuell in für die TFT-Version 2.9.0) mit dem Inhalt:
**https://github.com/jobr99/nspanel-lovelace-ui/blob/main/ioBroker/NsPanelTs.ts**
Für jedes einzelne NSPanel das du konfigurieren möchtest, musst du dieses Skript anlegen und speziell für dieses jeweilige NSPanel entsprechende Einstellungen vornehmen. Für den Skriptnamen verwende ich in der Regel eine Kombination aus Panel und Skriptversion, wie z.B.: NSPANEL_1_2.9.0
(Es kommen in regelmäßigen Abständen weitere NSPanel-Features und Bug-Fixes in das GitHub-Skript in denen dann nur noch der untere Teil (--- ab hier keine Konfiguration mehr ---) ausgetauscht werden muss und die NSPanel-Parameter erhalten bleiben)
Die aktuelle Änderung von 2.8.0 auf 2.9.0 ist z.B.:
* Steuerung von Klimageräten/Klimaanlagen
![0735190e-11c3-4bc2-bfd1-5899b8ee0eed-image.png](img/ioBroker/1653910414137-0735190e-11c3-4bc2-bfd1-5899b8ee0eed-image.png)
* QR-Code für z.B. Gäste WLAN
![a43e9656-891a-42ef-90cc-f9ed61850d4b-image.png](img/ioBroker/1653910476255-a43e9656-891a-42ef-90cc-f9ed61850d4b-image.png)
* Neues Design für Thermostate
![abd817a4-db10-45dc-9d5c-9adf6151dac5-image.png](img/ioBroker/1653910570137-abd817a4-db10-45dc-9d5c-9adf6151dac5-image.png)
* etc.
Im oberen Teil des Skripts sind die grundsätzlichen Teile der zu erstellenden Aliase, Konstanten und Variablen (auch Seiten) enthalten. An dieser Stelle ist zunächst wichtig, die Kommunikationsparameter für die MQTT-Kommunikation zu parametrieren (ab ca. Zeile 400) beginnend mit
```
„export const config: Config = {
```
Hier musst du die beiden nachfolgenden Kommunikations-Datenpunkte aus dem MQTT-Adapter eintragen:
```
panelRecvTopic: "mqtt.0.SmartHome.NSPanel_1.tele.RESULT", //bitte anpassen
panelSendTopic: "mqtt.0.SmartHome.NSPanel_1.cmnd.CustomSend", //bitte anpassen
```
Falls abweichend, dann am besten direkt unter Objekte herauskopieren
Bitte starte das Skript. Alle weiteren Parameter stellen wir später ein. Ab jetzt sollte der Startup-Screen „Waiting for Connection“ in den Sreensaver wechseln und minütlich die Uhrzeit an den Screensaver übertragen und das Datum aktualisiert werden.
**10. TypeScript konfigurieren**
Im Punkt 9 haben wir zunächst die nur Kommunikation zwischen Panel und Skript über MQTT hergestellt. Jetzt kommen wir zum Inhalt des Panels:
**Der untere Bereich vom Screensaver:**
**a) Die 4 kleineren Icons**
Hier kannst du dich entscheiden, ob du die Wettervorhersage oder eigene Werte visualisieren möchtest. Wenn du dich für den Forecast entscheidest, dann muss die Variable
```
var weatherForecast
```
auf „true“ stehen. Ebenfalls sollte die Adapter-Instanz von Accu-Weather funktionsfähig eingerichtet sein. Für diese Werte ist kein Alias notwendig, da diese zur Laufzeit direkt aus dem Adapter ausgelesen werden.
Möchtest du an dieser Stelle eigene Werte visualisieren, dann muss die Variable
```
var weatherForecast
```
auf „false“ stehen. Jetzt kannst du im Block beginnend mit
```
export const config: Config = {
```
die Datenpunkte ***firstScreensaverEntity bis fourthScreensaverEntity*** mit eigenen Datenpunkten füllen.
Eine Ausnahme stellt das große Wetter-Icon und der Wert für die aktuelle Temperatur im Screensaver dar. Hierfür benötigen wir einen Alias (im nächsten Punkt)
**b) Diverse Datenpunkte**
Beim ersten Start des Scripts erzeugt das Skript unter 0_userdata diverse Datenpunkte für Screensaver Dimmode, interne Sensoren, Tasmota-Statuswerte, etc.
Der Pfad kann im Skript unter „NSPanel_Path“ angepasst werden.
**c) Alexa**
Wenn du Alexa-Devices mit dem Media-Player nutzen möchtest, dann stelle noch das Standard-Alexa-Device (Seriennummer unter „var alexaDevice“) ein.
Ebenso kannst du unter alexaSpeakerList eine Liste mit vorhandenen Alexa-Devices (und/oder Gruppen) anlegen, die von diesem NSPanel-MediaPlayer aus bedient werden sollen. Bleibt diese Liste leer, werden automatisch alle Devices aus dem Alexa2-Adapter importiert.
**11. Aliase Anlegen**
Jetzt kommt der eigentliche Teil der Seitengestaltung. Es werden keine Datenpunkte benötigt, sondern Aliase.
Ein Alias ist „kein“ Datenpunkt, sondern ein Objekt mit mehreren Datenpunkten.
Das Skript setzt entsprechende Trigger auf die Alias-Datenpunkte .SET, .GET, .ACTUAL usw. Deshalb werden deine Steuerelemente im Panel nicht greifen, wenn du mit einzelnen Datenpunkten aus den verschiedenen Adaptern arbeitest.
Ich habe im Verlauf diverse Aliase erzeugt und auch in den ChangeLogs der jeweiligen Skript-Version sind die möglichen Aliase aufgeführt, daher gehe ich hier nicht (würde die Anleitung auch sprengen) im Detail auf die Aliase ein.
Was brauche ich für einen Alias:
a) Zunächst installierst du dir eine Instanz des Adapters „Geräte verwalten“
b) Dann erstellst du dir einen Alias (Beispiel Wetter-Icon und aktueller Wert der Außentemperatur) Dieser Alias muss nur einmalig angelegt werden und funktioniert somit auch in jedem weiteren Panel.
![56982014-6811-49cc-9be3-bed78436ef57-image.png](/assets/uploads/files/1653912015692-56982014-6811-49cc-9be3-bed78436ef57-image.png)
und etwas tiefer:
![a9814dc5-887b-4f8b-bb5b-742e104897b3-image.png](/assets/uploads/files/1653912072019-a9814dc5-887b-4f8b-bb5b-742e104897b3-image.png)
c) Wenn du einen Alias für den Media-Player benötigst, dann erstelle die diesen Alias besser über den Adapter „Alias-Manager“,
![07fe0047-d38f-45c9-92f9-3811c80be0e8-image.png](/assets/uploads/files/1653912124055-07fe0047-d38f-45c9-92f9-3811c80be0e8-image.png)
da der Adapter „Geräte verwalten“ bei diesem Alias nicht ordentlich arbeitet. Jedoch ist der auch so Komplex, das es für Alias-Anfänger schwer ist, einen Alias mit den korrekten Datenpunkten zu füllen.
**12. Seitengestaltung**
Am Besten benutzt ihr die Beispiele im Skript und legt entsprechende Aliase hierzu an, die auch in diesem ioBroker-Community-Topic innerhalb der letzten Wochen beschrieben wurden.
Und noch ein paar Bilderchen:
cardEntities mit Alias Lampe/Dimmer/Switch
![d8fcfee4-3137-4bae-85ba-6b70106c77c1-image.png](img/ioBroker/1653912863870-d8fcfee4-3137-4bae-85ba-6b70106c77c1-image.png)
cardEntities mit RGB und HUE Aliasen (Color)
![7f1f6db2-1d67-4b59-86c6-c06d4e8f4c2a-image.png](img/ioBroker/1653912902052-7f1f6db2-1d67-4b59-86c6-c06d4e8f4c2a-image.png)
popupLight mit Farbtemperatur und Brightness
![da3057b5-db2c-4b61-8716-8b2114e09aee-image.png](img/ioBroker/1653912933681-da3057b5-db2c-4b61-8716-8b2114e09aee-image.png)
popupLight mit ColorWheel
![1ba6c1ff-d682-4368-b36a-4952aed4bcbe-image.png](img/ioBroker/1653912960049-1ba6c1ff-d682-4368-b36a-4952aed4bcbe-image.png)
cardGrid mit Radiosendern/Playlists (Alias Taste)
![6b8c8b7a-331e-4fc1-867b-4ce69705fd0a-image.png](img/ioBroker/1653929221491-6b8c8b7a-331e-4fc1-867b-4ce69705fd0a-image.png)
cardEntities mit Aliasen Lautstärke und Info
![9c36cfd7-b586-41db-8b4a-d68734dbbaae-image.png](img/ioBroker/1653912981365-9c36cfd7-b586-41db-8b4a-d68734dbbaae-image.png)
cardEntities mit Fenster, Tür, Jalousie und Verschluss
![d874876a-a190-4fab-b2a2-5a0f0bb0f62a-image.png](img/ioBroker/1653913018089-d874876a-a190-4fab-b2a2-5a0f0bb0f62a-image.png)
cardEntities mit Abfallkalender
![098059be-4996-403b-a7a7-653915f10204-image.png](img/ioBroker/1653936380574-098059be-4996-403b-a7a7-653915f10204-image.png)
cardMedia
![9e702c46-e5d1-452b-a60b-e5068cb64750-image.png](img/ioBroker/1653913181184-9e702c46-e5d1-452b-a60b-e5068cb64750-image.png)
cardAlarm
![8f8e9ecc-a4b2-48f1-b9b1-4fe68b4b2574-image.png](img/ioBroker/1653913221457-8f8e9ecc-a4b2-48f1-b9b1-4fe68b4b2574-image.png)
cardGrid
![8a0ce26c-c49c-4bc3-b2ca-bc4897febd09-image.png](img/ioBroker/1653929268828-8a0ce26c-c49c-4bc3-b2ca-bc4897febd09-image.png)
cardEntities
![7b7c21e6-02aa-4a3e-bb25-c8127689d801-image.png](img/ioBroker/1653913242372-7b7c21e6-02aa-4a3e-bb25-c8127689d801-image.png)
cardEntities als Subpage unter cardEntities (verschachtelt)
![bd7783f7-9365-4333-b5bc-872ca92fd4b7-image.png](img/ioBroker/1653913274663-bd7783f7-9365-4333-b5bc-872ca92fd4b7-image.png)
cardNotify
![2dca9c22-df47-4c29-8e16-bc0323101cb1-image.png](img/ioBroker/1653914178326-2dca9c22-df47-4c29-8e16-bc0323101cb1-image.png)

85
docs/notifications.md Normal file
View File

@@ -0,0 +1,85 @@
# Sending Notifications to the Panel
There are two notification types, that can be triggered by sending a command over mqtt to the panel here are examples for homeassistant scripts:
<details>
<summary>Seperate Page</summary>
<br>
This is the notification used by the backend for updates, opening it requires to the following commands to the CustomSend Topic:
`pageType popupNotify`
`entityUpdateDetail~internalName~heading~headingColor~button1text~button1color~button2text~tB2Color~notificationText~textColor~sleepTimeout`
It is possible to exit from the page by sending `exitPopup`
Send Message to the Panel combined with a buzzer sound:
```yaml
nspanel_popup_notification:
alias: Popup Notification
sequence:
- service: mqtt.publish
data:
topic: cmnd/tasmota_NsPanelTerrasse/Backlog
payload: CustomSend pageType~popupNotify; CustomSend entityUpdateDetail~id~{{
title }}~65535~~~~~{{ message }}~65535~{{ timeout }}; Buzzer 2,2,2
mode: single
icon: mdi:message-badge
```
Send Message to the Panel:
```yaml
nspanel_popup_notification:
alias: Popup Notification
sequence:
- service: mqtt.publish
data:
topic: cmnd/tasmota_NsPanelTerrasse/Backlog
payload: CustomSend pageType~popupNotify; CustomSend entityUpdateDetail~id~{{
title }}~65535~~~~~{{ message }}~65535~{{ timeout }}
mode: single
icon: mdi:message-badge
```
</details>
<details>
<summary>Notification on screensaver</summary>
<br>
The screensaver can display Notifications by sending this command to the CustomSend topic: `notify~heading~text`
Send Message to the Screensaver combined with a buzzer sound:
```yaml
nspanel_screensaver_notification:
alias: Screensaver Notification
sequence:
- service: mqtt.publish
data:
topic: cmnd/tasmota_NsPanelTerrasse/Backlog
payload: CustomSend notify~{{ heading }}~{{ message }}; Buzzer 2,2,2
mode: single
icon: mdi:message-badge
```
Send Message to the Screensaver:
```yaml
nspanel_screensaver_notification:
alias: Screensaver Notification
sequence:
- service: mqtt.publish
data:
topic: cmnd/tasmota_NsPanelTerrasse/Backlog
payload: CustomSend notify~{{ heading }}~{{ message }}
mode: single
icon: mdi:message-badge
```
</details>

29
docs/phys-btn.md Normal file
View File

@@ -0,0 +1,29 @@
# Change behaviour of hardware buttons
## Tasmota Rules
You can configure the buttons to mimic an UI element on the screen by configuring tasmota rules.
The following rule will change the behaviour of the two buttons to do page navigation.
```
Rule2 on Button1#state do Publish tele/%topic%/RESULT {"CustomRecv":"event,buttonPress2,hwbtn,bPrev"} endon on Button2#state do Publish tele/%topic%/RESULT {"CustomRecv":"event,buttonPress2,hwbtn,bNext"} endon
Rule2 1
```
## Decouple buttons from controlling power outputs
If you do not want your NSPanel physical buttons to trigger the relays and prefer to have them as software configurable buttons, open the Tasmota console of your NSPanel and enter the following:
`SetOption73 1`
Your relays will now appear as switches in HomeAssistant and you can control your buttons by using automations:
![image](https://user-images.githubusercontent.com/57167030/169677954-5b811d12-dab8-4415-89aa-e4196732765e.png)
You may reverse this change by entering the following in the Tasmota console of your NSPanel:
`SetOption73 0`
Please note: Doing this will mean that if HomeAssistant is not working for any reason your buttons will not function correctly.

57
docs/prepare_ha.md Normal file
View File

@@ -0,0 +1,57 @@
# Setup Home Assistant
## Installing AppDaemon
The backend application for HomeAssistant is written in a python for [AppDaemon](https://github.com/AppDaemon/appdaemon).
This means it requires a working and running installation of AppDaemon.
The easiest way to install it is through Home Assistant's Supervisor Add-on Store, it will be automaticly connected to your Home Assistant Instance.
![hass-add-on-store](img/hass-add-on-store.png)
### Add babel package to AppDaemon Container (Optional)
For localisation (date in your local language) you need to add the python package babel to your AppDaemon Installation.
![appdaemon-babel](img/appdaemon-babel.png)
## Installing Studio Code Server
You will need a way to edit the `apps.yaml` config file in the Appdaemon folder.
Install Studio Code Server from Home Assistant's Supervisor Add-on Store to easily edit configuration Files on your HomeAssistant Instance.
## Installing HomeAssistant Community Store
HACS is the Home Assistant Community Store and allows for community integrations and
automations to be updated easily from the Home Assistant web user interface.
You will be notified of updates, and they can be installed by a click on a button.
## Installing Lovelace AppDaemon Backend Application
To install Lovelace UI Backend App with HACS, you will need to make sure that you enabled
AppDaemon automations in HACS, as these are not enabled by default:
1. Click on `Configuration` on the left menu bar in Home Assistant Web UI
2. Select `Devices & Services`
3. Select `Integrations`
4. Find `HACS` and click on `Configure`
5. In the window that opens, make sure that `Enable AppDaemon apps discovery & tracking`
is checked, or check it and click `Submit`
6. If you just enabled this (or just installed HACS), you might have to wait a few minutes
as all repositories are being fetched; you might hit a GitHub rate limit, which might
then require you to wait a few hours for HACS to be fully configured. In this case,
you won't be able to proceed to the next steps until HACS is ready.
Now, to install NSPanel Lovelace UI Backend with HACS, follow these steps:
1. Click on `HACS` on the left menu bar in Home Assistant Web UI
2. Click on `Automations` in the right panel
3. Click on `Explore & download repositories` in the bottom right corner
4. Search for `NSPanel`, and click on `NSPanel Lovelace UI Backend` in the list that appears
5. In the bottom right corner of the panel that appears, click on
`Download this repository with HACS`
6. A confirmation panel will appear, click on `Download`, and wait for HACS to
proceed with the download
7. The Backend Application is now installed, and HACS will inform you when updates are available

51
docs/prepare_nspanel.md Normal file
View File

@@ -0,0 +1,51 @@
# Flash Tasmota to your NSPanel
You need to connect to your nspanel via serial and flash tasmtoa [tasmota32-nspanel.factory.bin](https://tasmota.github.io/install/firmware/development/tasmota32-nspanel.factory.bin) to your NSPanel.
You can use the Tasmota Web Installer to do so. [Tasmota Web Installer](https://tasmota.github.io/install/)
Checkout Blakadders Template Repo for more information on flashing, do not use the autoexec.be from this page.
[NSPanel Page of the Tasmota Template Repository](https://templates.blakadder.com/sonoff_NSPanel.html)
## Configure Tasmota Template for NSPanel
Configure the NSPanel template for Tasmota. (Go to Configuration and Configure Other and paste the template there, make sure to tick the activate checkbox)
![tasmota-template-config](img/tasmota-template-config.png)
You can use the following template or copy the one on the [Tasmota Template Repo Site](https://templates.blakadder.com/sonoff_NSPanel.html).
`{"NAME":"NSPanel","GPIO":[0,0,0,0,3872,0,0,0,0,0,32,0,0,0,0,225,0,480,224,1,0,0,0,33,0,0,0,0,0,0,0,0,0,0,4736,0],"FLAG":0,"BASE":1,"CMND":"ADCParam 2,11200,10000,3950 | Sleep 0 | BuzzerPWM 1"}`
After a reboot of tasmota your screen will light up with the stock display firmware.
## Upload Berry Driver to Tasmota
1. Download the autoexec.be from the repository: [Berry Driver](https://github.com/joBr99/nspanel-lovelace-ui/blob/main/tasmota/autoexec.be)
2. Go to `Consoles` > `Manage File System` in Tasmota and upload the previously downloaded file.
3. Restart your NSPanel
## Flash Firmware to Nextion Screen
Due the limitations of Berry, it's not possible to download the tft file directly from github, so I'm also renting a small server where you can download the file via HTTP.
Use the one following commands to flash the latest release from this repository, just execute the following Command in Tasmota:
EU Version: `FlashNextion http://nspanel.pky.eu/lui-release.tft`
US Version Portrait: `FlashNextion http://nspanel.pky.eu/lui-us-p-release.tft`
US Version Landscape: `FlashNextion http://nspanel.pky.eu/lui-us-l-release.tft`
<details>
<summary>Alternatively you can use your own webserver or the one build into HomeAssistant:</summary>
<br>
Upload the nspanel.tft from the lastest release to a Webserver (for example www folder of Home Assistant) and execute the following command in Tasmota Console. (Development Version: [tft file from HMI folder](HMI/nspanel.tft))
**Webserver must be HTTP, HTTPS is not supported, due to limitations of berry lang on tasmota**
`FlashNextion http://ip-address-of-your-homeassistant:8123/local/nspanel.tft`
</details>

51
docs/prepare_nspanel2.md Normal file
View File

@@ -0,0 +1,51 @@
# Flash Tasmota to your NSPanel
You need to connect to your nspanel via serial and flash tasmtoa [tasmota32-nspanel.factory.bin](https://tasmota.github.io/install/firmware/development/tasmota32-nspanel.factory.bin) to your NSPanel.
You can use the Tasmota Web Installer to do so. [Tasmota Web Installer](https://tasmota.github.io/install/)
Checkout Blakadders Template Repo for more information on flashing, do not use the autoexec.be from this page.
[NSPanel Page of the Tasmota Template Repository](https://templates.blakadder.com/sonoff_NSPanel.html)
## Configure Tasmota Template for NSPanel
Configure the NSPanel template for Tasmota. (Go to Configuration and Configure Other and paste the template there, make sure to tick the activate checkbox)
![tasmota-template-config](img/tasmota-template-config.png)
You can use the following template or copy the one on the [Tasmota Template Repo Site](https://templates.blakadder.com/sonoff_NSPanel.html).
`{"NAME":"NSPanel","GPIO":[0,0,0,0,3872,0,0,0,0,0,32,0,0,0,0,225,0,480,224,1,0,0,0,33,0,0,0,0,0,0,0,0,0,0,4736,0],"FLAG":0,"BASE":1,"CMND":"ADCParam 2,11200,10000,3950 | Sleep 0 | BuzzerPWM 1"}`
After a reboot of tasmota your screen will light up with the stock display firmware.
## Upload Berry Driver to Tasmota
1. Download the autoexec.be from the repository: [Berry Driver](https://github.com/joBr99/nspanel-lovelace-ui/blob/main/tasmota/autoexec.be)
2. Go to `Consoles` > `Manage File System` in Tasmota and upload the previously downloaded file.
3. Restart your NSPanel
## Flash Firmware to Nextion Screen
Due the limitations of Berry, it's not possible to download the tft file directly from github, so I'm also renting a small server where you can download the file via HTTP.
Use the one following commands to flash the latest release from this repository, just execute the following Command in Tasmota:
EU Version: `FlashNextion http://nspanel.pky.eu/lui-release.tft`
US Version Portrait: `FlashNextion http://nspanel.pky.eu/lui-us-p-release.tft`
US Version Landscape: `FlashNextion http://nspanel.pky.eu/lui-us-l-release.tft`
<details>
<summary>Alternatively you can use your own webserver or the one build into HomeAssistant:</summary>
<br>
Upload the nspanel.tft from the lastest release to a Webserver (for example www folder of Home Assistant) and execute the following command in Tasmota Console. (Development Version: [tft file from HMI folder](HMI/nspanel.tft))
**Webserver must be HTTP, HTTPS is not supported, due to limitations of berry lang on tasmota**
`FlashNextion http://ip-address-of-your-homeassistant:8123/local/nspanel.tft`
</details>

18
docs/subpages.md Normal file
View File

@@ -0,0 +1,18 @@
# Subpages
You can configure entities with with the prefix `navigate`, that are navigating to cards, in case it's hidden card, the navigation items will change and the arrow is bringing you back to the privious page.
```yaml
- entity: navigate.cardGrid_testKey
```
will allow you to navigate to a cardGrid page with the configured key testKey
```yaml
hiddenCards:
- type: cardGrid
title: Exmaple Grid
entities:
- entity: light.test_item
key: testKey
```

View File

@@ -1,7 +0,0 @@
attributes = {
"id": {
"ignore": True,
"name": "ID",
"struct": "i",
}
}

88
mkdocs.yml Normal file
View File

@@ -0,0 +1,88 @@
# https://squidfunk.github.io/mkdocs-material/getting-started
# https://squidfunk.github.io/mkdocs-material/reference/admonitions
# https://github.com/squidfunk/mkdocs-material/blob/master/mkdocs.yml
site_name: NsPanel Lovelace UI Docs
site_description: Custom Firmware for NsPanel with the design of HomeAssistant's lovelace UI in mind, works with Tasmota.
site_author: Johannes Braun
site_url: https://jobr99.github.io/nspanel-lovelace-ui
repo_name: jobr99/nspanel-lovelace-ui
repo_url: https://github.com/jobr99/nspanel-lovelace-ui
edit_uri: ""
copyright: "Copyright &copy; 2022 Johannes Braun"
docs_dir: docs
theme:
#logo: _assets/logo.png
#favicon: _assets/favicon.ico
name: material
palette:
accent: blue
font:
text: "arial, sans-serif"
code: monospace
features:
- navigation.indexes
- navigation.sections
- navigation.top
- navigation.tracking
- navigation.expand
- search.highlight
- search.share
- search.suggest
extra_css:
- _assets/user.css
markdown_extensions:
- admonition
- def_list
- attr_list
- pymdownx.tilde
- pymdownx.details
- pymdownx.superfences
- pymdownx.magiclink
- toc:
permalink: true
- codehilite:
guess_lang: false
- markdown_include.include:
base_path: docs
plugins:
- search:
lang: en
- mkdocs-video
nav:
- "Overview": index.md
- "Getting started (HA)":
- "First steps":
- "Prepare NsPanel": prepare_nspanel.md
- "Prepare Home Assistant": prepare_ha.md
- "Configure MQTT": configure_mqtt.md
- "FAQ": faq.md
- "Configuration - apps.yaml (HA)":
- "Overview": config-overview.md
- "Screensaver": config-screensaver.md
- "Cards":
- "Entities Card": card-entities.md
- "Grid Card": card-grid.md
- "Climate/Thermo Card": card-climate.md
- "Media Card": card-media.md
- "Alarm Card": card-alarm.md
- "Wifi/QR Card": card-qr.md
- "Special Settings for Entities": entities.md
- "Subpages": subpages.md
- "Notifications": notifications.md
- "Physical Buttons": phys-btn.md
- "Getting started (ioBroker)":
- "Prepare NsPanel": prepare_nspanel2.md
- "Prepare ioBroker": iobroker-install.md

320
out.txt
View File

@@ -1,320 +0,0 @@
// data available
if(usize>1)
{
bufferPos=0
while(bufferPos<usize)
{
// check for 0x55 0xBB - Command Init Secuence
if(u[bufferPos]==187&&u[bufferPos-1]==85)
{
//remove garbage at the start of the buffer if there's any to free buffer for command
if(u[bufferPos]!=1)
{
udelete bufferPos-1
}
//instruction is now aligned with buffer, because we deleted garbage before instrcution
//get length after init sequence (check if there are more than to bytes in buffer)
if(3<usize)
{
// check if serial buffer has reached the announced length
ucopy payloadLength,2,2,0
// we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
payloadLength+=3
// payload length does also not contain crc, so we are adding another 2 bytes for crc
payloadLength+=2
if(payloadLength<usize)
{
// calculate crc
crcrest 1,0xFFFF
// u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
//crcputu 3,u[2]
// u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
crcputu 0,payloadLength-1
// get recived crc to be able to compare it
ucopy recvCrc,payloadLength-1,2,0
// compare crc with recived value
if(crcval==recvCrc)
{
// crc is okay
// here is the location where acual code should be
// write command to variable strCommand
ucopy strCommand.txt,4,payloadLength-5,0
// write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
spstr strCommand.txt,tInstruction.txt,"~",0
if(tInstruction.txt=="entityUpd")
{
// command format: entityUpd,heading,navigation,[,type,internalName,iconId,iconColor,displayName,optionalValue]x6
spstr strCommand.txt,tHeading.txt,"~",1
// navigation icons
spstr strCommand.txt,tId.txt,"~",2
spstr tId.txt,tTmp.txt,"|",0
if(tTmp.txt=="0")
{
vis bPrev,0
tsw mSwipePrev,0
tsw mSwipeUp,0
}
if(tTmp.txt=="1")
{
vis bPrev,1
tsw mSwipePrev,1
tsw mSwipeUp,0
bPrev.txt=""
}
if(tTmp.txt=="2")
{
vis bPrev,1
tsw mSwipePrev,0
tsw mSwipeUp,1
bPrev.txt=""
}
spstr tId.txt,tTmp.txt,"|",1
if(tTmp.txt=="0")
{
vis bNext,0
tsw mSwipeNext,0
}
if(tTmp.txt=="1")
{
vis bNext,1
tsw mSwipeNext,1
bNext.txt=""
}
// get Type
spstr strCommand.txt,type1.txt,"~",3
// get internal name
spstr strCommand.txt,entn1.txt,"~",4
if(type1.txt=="delete"||type1.txt=="")
{
vis tEntity1,0
vis bEntity1,0
}else
{
// change icon
spstr strCommand.txt,bEntity1.txt,"~",5
vis bEntity1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",6
covx tTmp.txt,sys0,0,0
bEntity1.pco=sys0
// set name
spstr strCommand.txt,tEntity1.txt,"~",7
vis tEntity1,1
}
// get Type
spstr strCommand.txt,type2.txt,"~",9
// get internal name
spstr strCommand.txt,entn2.txt,"~",10
if(type2.txt=="delete"||type2.txt=="")
{
vis tEntity2,0
vis bEntity2,0
}else
{
// change icon
spstr strCommand.txt,bEntity2.txt,"~",11
vis bEntity2,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",12
covx tTmp.txt,sys0,0,0
bEntity2.pco=sys0
// set name
spstr strCommand.txt,tEntity2.txt,"~",13
vis tEntity2,1
}
// get Type
spstr strCommand.txt,type3.txt,"~",15
// get internal name
spstr strCommand.txt,entn3.txt,"~",16
if(type3.txt=="delete"||type3.txt=="")
{
vis tEntity3,0
vis bEntity3,0
}else
{
// change icon
spstr strCommand.txt,bEntity3.txt,"~",17
vis bEntity3,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",18
covx tTmp.txt,sys0,0,0
bEntity3.pco=sys0
// set name
spstr strCommand.txt,tEntity3.txt,"~",19
vis tEntity3,1
}
// get Type
spstr strCommand.txt,type4.txt,"~",21
// get internal name
spstr strCommand.txt,entn4.txt,"~",22
if(type4.txt=="delete"||type4.txt=="")
{
vis tEntity4,0
vis bEntity4,0
}else
{
// change icon
spstr strCommand.txt,bEntity4.txt,"~",23
vis bEntity4,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",24
covx tTmp.txt,sys0,0,0
bEntity4.pco=sys0
// set name
spstr strCommand.txt,tEntity4.txt,"~",25
vis tEntity4,1
}
// get Type
spstr strCommand.txt,type5.txt,"~",27
// get internal name
spstr strCommand.txt,entn5.txt,"~",28
if(type5.txt=="delete"||type5.txt=="")
{
vis tEntity5,0
vis bEntity5,0
}else
{
// change icon
spstr strCommand.txt,bEntity5.txt,"~",29
vis bEntity5,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",30
covx tTmp.txt,sys0,0,0
bEntity5.pco=sys0
// set name
spstr strCommand.txt,tEntity5.txt,"~",31
vis tEntity5,1
}
// get Type
spstr strCommand.txt,type6.txt,"~",33
// get internal name
spstr strCommand.txt,entn6.txt,"~",34
if(type6.txt=="delete"||type6.txt=="")
{
vis tEntity6,0
vis bEntity6,0
}else
{
// change icon
spstr strCommand.txt,bEntity6.txt,"~",35
vis bEntity6,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",36
covx tTmp.txt,sys0,0,0
bEntity6.pco=sys0
// set name
spstr strCommand.txt,tEntity6.txt,"~",37
vis tEntity6,1
}
}
if(tInstruction.txt=="pageType")
{
//command format pageType,specialPageName
//write name of speical page to tId
spstr strCommand.txt,tId.txt,"~",1
//save second arg if there's one
spstr strCommand.txt,tTmp.txt,"~",2
//save third arg if there's one
spstr strCommand.txt,pageIcons.tTmp2.txt,"~",3
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
udelete payloadLength-1
bufferPos=0
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="screensaver")
{
page screensaver
}
if(tId.txt=="cardEntities")
{
page cardEntities
}
if(tId.txt=="cardGrid")
{
page cardGrid
}
if(tId.txt=="popupLight")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupLight
}
if(tId.txt=="popupShutter")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupShutter
}
if(tId.txt=="popupNotify")
{
page popupNotify
}
if(tId.txt=="cardThermo")
{
page cardThermo
}
if(tId.txt=="cardMedia")
{
page cardMedia
}
if(tId.txt=="cardAlarm")
{
page cardAlarm
}
if(tId.txt=="cardQR")
{
page cardQR
}
}
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,dimValue,0,0
}
if(tInstruction.txt=="timeout")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,sleepTimeout,0,0
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
}