Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
73e1b72c4b Bump stefanzweifel/git-auto-commit-action from 5 to 7
Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 5 to 7.
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v5...v7)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-13 06:07:58 +00:00
7 changed files with 879 additions and 1360 deletions

View File

@@ -28,7 +28,7 @@ jobs:
python HMI/code_gen/localization/iobroker.py python HMI/code_gen/localization/iobroker.py
mv ioBroker_NSPanel_locales.json ioBroker/ioBroker_NSPanel_locales.json mv ioBroker_NSPanel_locales.json ioBroker/ioBroker_NSPanel_locales.json
- uses: stefanzweifel/git-auto-commit-action@v5 - uses: stefanzweifel/git-auto-commit-action@v7
with: with:
commit_message: Update iobroker localization file commit_message: Update iobroker localization file
#file_pattern: "**.txt" #file_pattern: "**.txt"

View File

@@ -80,7 +80,7 @@ jobs:
find -name "**.txt" find -name "**.txt"
rm Nextion2Text.py* ignore-id.py out.txt rm Nextion2Text.py* ignore-id.py out.txt
- uses: stefanzweifel/git-auto-commit-action@v5 - uses: stefanzweifel/git-auto-commit-action@v7
with: with:
commit_message: ${{ steps.last-commit-message.outputs.msg }} (add nextion2text) commit_message: ${{ steps.last-commit-message.outputs.msg }} (add nextion2text)
#file_pattern: "**.txt" #file_pattern: "**.txt"

View File

@@ -151,7 +151,7 @@ class LuiController(object):
items = self._config.get_all_entity_names() items = self._config.get_all_entity_names()
apis.ha_api.log(f"gtest123: {items}") apis.ha_api.log(f"gtest123: {items}")
prefixes = ("navigate.", "delete", "iText") prefixes = ("navigate.", "delete", "iText")
items = set([x for x in items if not (x is None or x.startswith(prefixes))]) items = [x for x in items if not (x is None or x.startswith(prefixes))]
apis.ha_api.log(f"Registering callbacks for the following items: {items}") apis.ha_api.log(f"Registering callbacks for the following items: {items}")
for item in items: for item in items:
if apis.ha_api.entity_exists(item): if apis.ha_api.entity_exists(item):

View File

@@ -388,12 +388,11 @@ class LuiPagesGen(object):
entityTypePanel = "text" entityTypePanel = "text"
unit = get_attr_safe(entity, "temperature_unit", "") unit = get_attr_safe(entity, "temperature_unit", "")
rt = None rt = None
index = item.stype
if type(item.stype) == str and ":" in item.stype and len(item.stype.split(":")) == 2: if type(item.stype) == str and ":" in item.stype and len(item.stype.split(":")) == 2:
spintstr = item.stype.split(":") spintstr = item.stype.split(":")
rt = spintstr[0] rt = spintstr[0]
index = int(spintstr[1]) item.stype = int(spintstr[1])
if type(index) == int: if type(item.stype) == int:
bits = get_attr_safe(entity, "supported_features", 0b0) bits = get_attr_safe(entity, "supported_features", 0b0)
if not rt: if not rt:
rt = "daily" rt = "daily"
@@ -408,8 +407,8 @@ class LuiPagesGen(object):
"weather/get_forecasts", target={"entity_id": entityId}, service_data={"type": rt} "weather/get_forecasts", target={"entity_id": entityId}, service_data={"type": rt}
) )
forecast = results.get("result", {}).get("response", {}).get(entityId, {}).get('forecast') or entity.attributes.get('forecast', []) forecast = results.get("result", {}).get("response", {}).get(entityId, {}).get('forecast') or entity.attributes.get('forecast', [])
if len(forecast) >= index: if len(forecast) >= item.stype:
day_forecast = forecast[index] day_forecast = forecast[item.stype]
fdate = dp.parse(day_forecast['datetime']) fdate = dp.parse(day_forecast['datetime'])
global babel_spec global babel_spec
if babel_spec is not None: if babel_spec is not None:

View File

@@ -1,71 +1,65 @@
# Flash Tasmota to Your NSPanel # Flash Tasmota to your NSPanel
You need to connect to your NSPanel via serial and flash Tasmota using [tasmota32-nspanel.bin](http://ota.tasmota.com/tasmota32/release/tasmota32-nspanel.bin). You need to connect to your nspanel via serial and flash tasmota [tasmota32-nspanel.bin](http://ota.tasmota.com/tasmota32/release/tasmota32-nspanel.bin) to your NSPanel.
You can use the [Tasmota Web Installer](https://tasmota.github.io/install/) to do so. You can use the Tasmota Web Installer to do so. [Tasmota Web Installer](https://tasmota.github.io/install/)
Check out Blakadder's Template Repo for more information on flashing. **Do not** use the autoexec.be from that page. 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) [NSPanel Page of the Tasmota Template Repository](https://templates.blakadder.com/sonoff_NSPanel.html)
If you prefer ESPHome over Tasmota, you can use this third-party ESPHome component, which replaces Tasmota and the Berry driver used in this project. If you prefer EspHome over Tasmota, you can use this thrid party esphome component, which is replacing tasmota and the berry driver of this project.
[ESPHome Component](https://github.com/sairon/esphome-nspanel-lovelace-ui) [ESPHome component](https://github.com/sairon/esphome-nspanel-lovelace-ui)
---
## Configure Tasmota Template for NSPanel ## Configure Tasmota Template for NSPanel
Configure the NSPanel template for Tasmota. (Go to Configuration > Configure Other, paste the template there, and make sure to tick the Activate checkbox.) 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) ![tasmota-template-config](img/tasmota-template-config.png)
You can use the following template or copy the one from the [Tasmota Template Repo Site](https://templates.blakadder.com/sonoff_NSPanel.html): 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"} `{"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. After a reboot of tasmota your screen will light up with the stock display firmware.
---
## Upload Berry Driver to Tasmota ## Upload Berry Driver to Tasmota
Go to Consoles > Console in Tasmota and execute the following command: Go to `Consoles` > `Console` in Tasmota and execute the following command:
Backlog UrlFetch https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; SetOption151 0; Restart 1 ```
Backlog UrlFetch https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; SetOption151 0;Restart 1
```
This downloads the autoexec.be file from the repository and restarts Tasmota. This will download the autoexec.be file from the repository and restart tasmota.
Note: This command also disables Matter to free up memory, as it's unlikely to be used by most Home Assistant users. (Matter can cause memory issues during flashing of the Nextion screen, but you can re-enable it later if needed.) Note: The command is also disabling matter to free up memory, as it's most likely not used by any homeassistant users anyway.
(Matter could cause memory issues during flashing of the Nextion Screen, but you can still enable it if you need to.)
---
## Flash Firmware to Nextion Screen ## Flash Firmware to Nextion Screen
Due to the limitations of Berry, it's not possible to download the TFT file directly from GitHub. A small server is available to download the file via HTTP. 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 one of the following commands in the Tasmota console (not the Berry console) to flash the latest release from this repository: Use the one following commands in the tasmota console (not berry console) to flash the latest release from this repository:
EU Version: EU Version: `FlashNextion http://nspanel.pky.eu/lui-release.tft`
FlashNextion http://nspanel.pky.eu/lui-release.tft
US Version Portrait: US Version Portrait: `FlashNextion http://nspanel.pky.eu/lui-us-p-release.tft`
FlashNextion http://nspanel.pky.eu/lui-us-p-release.tft
US Version Landscape: US Version Landscape: `FlashNextion http://nspanel.pky.eu/lui-us-l-release.tft`
FlashNextion http://nspanel.pky.eu/lui-us-l-release.tft
After sending the command, the screen should show a progress bar. The flashing process takes around 5 minutes. After sending the command, the screen should show a progress bar. The flashing progress takes around 5 minutes.
Note for US users: You'll need to add the model config option to your apps.yaml later. More details can be found on the config overview page. Note: For the US Version Users - keep in mind that you need to add the model config option to your apps.yaml later, more details on config overview page
---
<details> <details>
<summary>Alternatively, you can use your own web server or the one built into Home Assistant:</summary> <summary>Alternatively you can use your own webserver or the one build into HomeAssistant:</summary>
<br> <br>
Upload the nspanel.tft from the latest release to a web server (for example, the www folder of Home Assistant) and execute the following command in the Tasmota Console. 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))
(Development version: [TFT file from HMI folder](HMI/nspanel.tft))
**The web server must be HTTP. HTTPS is not supported due to Berry language limitations in Tasmota.** **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 `FlashNextion http://ip-address-of-your-homeassistant:8123/local/nspanel.tft`
</details> </details>

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
TypeScript v5.0.2.1 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @TT-Tom / @ticaki / @Britzelpuf / @Sternmiere / @ravenS0ne TypeScript v5.0.0.1 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @TT-Tom / @ticaki / @Britzelpuf / @Sternmiere / @ravenS0ne
- abgestimmt auf TFT 59 / v5.0.2 / BerryDriver 10 / Tasmota 15.0.1 - abgestimmt auf TFT 59 / v5.0.0 / BerryDriver 10 / Tasmota 15.0.1
Projekt: Projekt:
https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker
@@ -18,8 +18,6 @@ Achtung: Keine Beispiele mehr im Script. Die Beispiele sind jetzt unter nachfolg
Icons unter: https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html Icons unter: https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html
************************************************************************************************
Achtung Tasmota 15.1.0 lässt kein FlashNextion zu --> stattdessen v15.0.1 verwenden
************************************************************************************************ ************************************************************************************************
Achtung Änderung des Sonoff ESP-Temperatursensors Achtung Änderung des Sonoff ESP-Temperatursensors
!!! Bitte "SetOption146 1" in der Tasmota-Console ausführen !!! !!! Bitte "SetOption146 1" in der Tasmota-Console ausführen !!!
@@ -92,14 +90,12 @@ ReleaseNotes:
- 21.08.2025 - v4.9.5.2 Add Bright Sky Weather Adapter - 21.08.2025 - v4.9.5.2 Add Bright Sky Weather Adapter
- 05.09.2025 - v5.0.0 TFT 59 / 5.0.0 - EU Changes in cardMedia, popupInSel, card Grid 1, 2, 3 - 05.09.2025 - v5.0.0 TFT 59 / 5.0.0 - EU Changes in cardMedia, popupInSel, card Grid 1, 2, 3
- 08.09.2025 - v5.0.0 TFT 59 / 5.0.0 - US-L/US-P Changes in cardMedia, popupInSel, card Grid 1, 2, 3 - 08.09.2025 - v5.0.0 TFT 59 / 5.0.0 - US-L/US-P Changes in cardMedia, popupInSel, card Grid 1, 2, 3
- 19.09.2025 - v5.0.0.2 Remove Startup Scheedule at 3:30am / Small fix
- 19.10.2025 - v5.0.2.1 TFT 59 / 5.0.2 - EU/US-L/US-P - Fix cardAlarm Icon; Fix Notification in Advanced Screensaver; Fix Dimensions in cardChart/cardLChart
*************************************************************************************************************** ***************************************************************************************************************
* DE: Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObject" gesetzt sein! * * DE: Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObject" gesetzt sein! *
* EN: In order for the script to create the aliases, “setObject” must be set in the JavaScript instance! * * EN: In order for the script to create the aliases, “setObject” must be set in the JavaScript instance! *
*************************************************************************************************************** ***************************************************************************************************************{
Wenn Rule definiert, dann können die Hardware-Tasten ebenfalls für Seitensteuerung (dann nicht mehr als Relais) genutzt werden Wenn Rule definiert, dann können die Hardware-Tasten ebenfalls für Seitensteuerung (dann nicht mehr als Relais) genutzt werden
@@ -203,10 +199,10 @@ Install/Upgrades in Konsole:
Tasmota BerryDriver Install: Backlog UrlFetch https://raw.githubusercontent.com/ticaki/ioBroker.nspanel-lovelace-ui/refs/heads/main/tasmota/berry/10/autoexec.be; Restart 1 Tasmota BerryDriver Install: Backlog UrlFetch https://raw.githubusercontent.com/ticaki/ioBroker.nspanel-lovelace-ui/refs/heads/main/tasmota/berry/10/autoexec.be; Restart 1
Tasmota BerryDriver Update: Backlog UpdateDriverVersion https://raw.githubusercontent.com/ticaki/ioBroker.nspanel-lovelace-ui/refs/heads/main/tasmota/berry/10/autoexec.be; Restart 1 Tasmota BerryDriver Update: Backlog UpdateDriverVersion https://raw.githubusercontent.com/ticaki/ioBroker.nspanel-lovelace-ui/refs/heads/main/tasmota/berry/10/autoexec.be; Restart 1
TFT EU STABLE Version: FlashNextionAdv0 http://nspanel.de/nspanel-v5.0.2.tft TFT EU STABLE Version: FlashNextionAdv0 http://nspanel.de/nspanel-v5.0.0.tft
TFT US-L STABLE Version: FlashNextionAdv0 http://nspanel.de/nspanel-us-l-v5.0.2.tft TFT US-L STABLE Version: FlashNextionAdv0 http://nspanel.de/nspanel-us-l-v5.0.0.tft
TFT US-P STABLE Version: FlashNextionAdv0 http://nspanel.de/nspanel-us-p-v5.0.2.tft TFT US-P STABLE Version: FlashNextionAdv0 http://nspanel.de/nspanel-us-p-v5.0.0.tft
--------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------
*/ */
@@ -234,11 +230,10 @@ const tasmota_web_admin_password: string = '';
// DE: Setzen der bevorzugten Tasmota32-Version (für Updates) // DE: Setzen der bevorzugten Tasmota32-Version (für Updates)
// EN: Set preferred Tasmota32 version (for updates) // EN: Set preferred Tasmota32 version (for updates)
const tasmotaOtaVersion: string = 'tasmota32-nspanel.bin'; const tasmotaOtaVersion: string = 'tasmota32-DE.bin';
// DE: Es können ebenfalls andere Versionen verwendet werden wie zum Beispiel: // DE: Es können ebenfalls andere Versionen verwendet werden wie zum Beispiel:
// EN: 'tasmota32-DE.bin' oder 'tasmota32.bin' oder 'tasmota32-DE.bin' oder etc. // EN: Other versions can also be used, such as:
// DE: !!!Anmerkung!!! Seit Tasmota v15.0.X wird der 4Mb PSRAM im ESP32 nur noch in der tasmota32-nspanel.bin verwendet // 'tasmota32-nspanel.bin' or 'tasmota32.bin' or 'tasmota32-DE.bin' or etc.
// EN: !!!Note!!! Since Tasmota v15.0.X, the 4Mb PSRAM in the ESP32 is only used in the tasmota32-nspanel.bin
/***** 2. Directories in 0_userdata.0... *****/ /***** 2. Directories in 0_userdata.0... *****/
@@ -288,7 +283,7 @@ const DarkBlue: RGB = {red: 0, green: 0, blue: 136};
const Gray: RGB = {red: 136, green: 136, blue: 136}; const Gray: RGB = {red: 136, green: 136, blue: 136};
const Black: RGB = {red: 0, green: 0, blue: 0}; const Black: RGB = {red: 0, green: 0, blue: 0};
const Cyan: RGB = {red: 0, green: 255, blue: 255}; const Cyan: RGB = {red: 0, green: 255, blue: 255};
const Magenta: RGB = {red: 255, green: 0, blue: 255}; const Magenta: RGB = {red: 255, green: 0, blue: 255}
const Orange: RGB = {red: 255, green: 130, blue: 0}; const Orange: RGB = {red: 255, green: 130, blue: 0};
const colorSpotify: RGB = {red: 30, green: 215, blue: 96}; const colorSpotify: RGB = {red: 30, green: 215, blue: 96};
const colorAlexa: RGB = {red: 49, green: 196, blue: 243}; const colorAlexa: RGB = {red: 49, green: 196, blue: 243};
@@ -406,10 +401,10 @@ const defaultBackgroundColorParam: any = HMIDark;
- Servicemenü aus pages "NSPanel_Service" unter pages kommentieren ("//" hinzufügen) - Servicemenü aus pages "NSPanel_Service" unter pages kommentieren ("//" hinzufügen)
*/ */
/*********************************************************************************************** /*************************************************************************************************
** Service pages with auto alias (subsequent pages are automatically created with alias) ** ** Service pages with auto alias (subsequent pages are automatically created with alias) **
** https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Service-Men%C3%BC ** ** https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Service-Men%C3%BC **
***********************************************************************************************/ ************************************************************************************************/
/* EN: English /* EN: English
If the service menu needs to be secured, a cardUnlock can be installed upstream. If the service menu needs to be secured, a cardUnlock can be installed upstream.
@@ -822,7 +817,7 @@ export const config: Config = {
NSPanel_Wifi_Info_2, //Auto-Alias Service Page NSPanel_Wifi_Info_2, //Auto-Alias Service Page
NSPanel_Sensoren, //Auto-Alias Service Page NSPanel_Sensoren, //Auto-Alias Service Page
NSPanel_Hardware, //Auto-Alias Service Page NSPanel_Hardware, //Auto-Alias Service Page
NSPanel_IoBroker, //Auto-Alias Service Page NSPanel_IoBroker, //Auot-Alias Service Page
NSPanel_Einstellungen, //Auto-Alias Service Page NSPanel_Einstellungen, //Auto-Alias Service Page
NSPanel_Screensaver, //Auto-Alias Service Page NSPanel_Screensaver, //Auto-Alias Service Page
NSPanel_ScreensaverDimmode, //Auto-Alias Service Page NSPanel_ScreensaverDimmode, //Auto-Alias Service Page
@@ -992,8 +987,8 @@ export const config: Config = {
// _________________________________ DE: Ab hier keine Konfiguration mehr _____________________________________ // _________________________________ DE: Ab hier keine Konfiguration mehr _____________________________________
// _________________________________ EN: No more configuration from here _____________________________________ // _________________________________ EN: No more configuration from here _____________________________________
const scriptVersion: string = 'v5.0.2.1'; const scriptVersion: string = 'v5.0.0.1';
const tft_version: string = 'v5.0.2'; const tft_version: string = 'v5.0.0';
const desired_display_firmware_version = 59; const desired_display_firmware_version = 59;
const berry_driver_version = 10; const berry_driver_version = 10;
@@ -1062,6 +1057,7 @@ onStop(function scriptStop () {
if (scheduleSendTime != null) _clearSchedule(scheduleSendTime); if (scheduleSendTime != null) _clearSchedule(scheduleSendTime);
if (scheduleSendDate != null) _clearSchedule(scheduleSendDate); if (scheduleSendDate != null) _clearSchedule(scheduleSendDate);
if (scheduleSwichScreensaver != null) _clearSchedule(scheduleSwichScreensaver); if (scheduleSwichScreensaver != null) _clearSchedule(scheduleSwichScreensaver);
if (scheduleStartup != null) _clearSchedule(scheduleStartup);
if (scheduleCheckUpdates != null) _clearSchedule(scheduleCheckUpdates); if (scheduleCheckUpdates != null) _clearSchedule(scheduleCheckUpdates);
if (scheduleInitDimModeDay != null) _clearSchedule(scheduleInitDimModeDay); if (scheduleInitDimModeDay != null) _clearSchedule(scheduleInitDimModeDay);
if (scheduleInitDimModeNight != null) _clearSchedule(scheduleInitDimModeNight); if (scheduleInitDimModeNight != null) _clearSchedule(scheduleInitDimModeNight);
@@ -3467,6 +3463,11 @@ let scheduleSendDate = adapterSchedule(new Date().setMinutes(0, 0), 60 * 60, ()
SendDate(); SendDate();
}); });
// 3:30 a.m. Perform startup and receive current TFT version
let scheduleStartup = adapterSchedule({hour: 3, minute: 30}, 24 * 60 * 60, async () => {
setIfExists(config.panelSendTopic, 'pageType~pageStartup');
});
// Check for updates with Start // Check for updates with Start
get_locales(); get_locales();
get_locales_servicemenu(); get_locales_servicemenu();
@@ -3895,7 +3896,6 @@ function get_current_tasmota_ip_address () {
log('error at function get_current_tasmota_ip_address: ' + err.message, 'warn'); log('error at function get_current_tasmota_ip_address: ' + err.message, 'warn');
} }
} }
/** /**
* Retrieves the current IP address of the Tasmota device. * Retrieves the current IP address of the Tasmota device.
* *
@@ -4374,6 +4374,7 @@ on({id: config.panelRecvTopic}, async (obj) => {
}); });
/** /**
* Updates the Berry driver version on the NSPanel. * Updates the Berry driver version on the NSPanel.
* *
@@ -5227,7 +5228,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
/** /**
* The same extension can be found below in blind. vval=0 means closed / val=100 means open. If val is in between, icon3 is used. * The same extension can be found below in blind. vval=0 means closed / val=100 means open. If val is in between, icon3 is used.
* Icons in this part can be states and strings. The specifications are based on German shutters. * Icons in this part can be states and strings. The specifications are based on German shutters.
*/ */
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['window-shutter', 'window-shutter-open', 'window-shutter-alert']); iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['window-shutter', 'window-shutter-open', 'window-shutter-alert']);
iconColor = existsState(pageItem.id + '.COLORDEC') iconColor = existsState(pageItem.id + '.COLORDEC')
? getState(pageItem.id + '.COLORDEC').val ? getState(pageItem.id + '.COLORDEC').val
@@ -5337,7 +5338,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
if (role == 'temperature' || role == 'value.temperature' || role == 'thermostat') { if (role == 'temperature' || role == 'value.temperature' || role == 'thermostat') {
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['snowflake-thermometer', 'sun-thermometer', 'thermometer']); iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['snowflake-thermometer', 'sun-thermometer', 'thermometer']);
} else if (role == 'humidity' || role == 'value.humidity') { } else if (role == 'humidity' || role == 'value.humidity') {
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['water-off', 'water-percent-alert', 'water-percent']); iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['water-off', 'water-percent-alert' , 'water-percent']);
} }
iconColor = GetIconColor(pageItem, parseInt(optVal), useColors); iconColor = GetIconColor(pageItem, parseInt(optVal), useColors);
@@ -5444,7 +5445,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
if (pageItem.popupVersion !== undefined) { if (pageItem.popupVersion !== undefined) {
if (pageItem.popupVersion == 1) { if (pageItem.popupVersion == 1) {
type = 'light'; type = 'light';
} else if (pageItem.popupVersion == 2) { } else if (pageItem.popupVersion == 2){
type = 'light2'; type = 'light2';
} }
} }
@@ -5488,7 +5489,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
if (pageItem.popupVersion !== undefined) { if (pageItem.popupVersion !== undefined) {
if (pageItem.popupVersion == 1) { if (pageItem.popupVersion == 1) {
type = 'light'; type = 'light';
} else if (pageItem.popupVersion == 2) { } else if (pageItem.popupVersion == 2){
type = 'light2'; type = 'light2';
} }
} }
@@ -5528,7 +5529,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
if (pageItem.popupVersion !== undefined) { if (pageItem.popupVersion !== undefined) {
if (pageItem.popupVersion == 1) { if (pageItem.popupVersion == 1) {
type = 'light'; type = 'light';
} else if (pageItem.popupVersion == 2) { } else if (pageItem.popupVersion == 2){
type = 'light2'; type = 'light2';
} }
} }
@@ -5583,7 +5584,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
if (pageItem.popupVersion !== undefined) { if (pageItem.popupVersion !== undefined) {
if (pageItem.popupVersion == 1) { if (pageItem.popupVersion == 1) {
type = 'light'; type = 'light';
} else if (pageItem.popupVersion == 2) { } else if (pageItem.popupVersion == 2){
type = 'light2'; type = 'light2';
} }
} }
@@ -5610,7 +5611,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
if (Debug) log('CIE wurde zuletzt geändert - Lampe ist Color-Mode'); if (Debug) log('CIE wurde zuletzt geändert - Lampe ist Color-Mode');
if (getState(pageItem.id + '.CIE').val != null) { if (getState(pageItem.id + '.CIE').val != null) {
let cie: string = getState(pageItem.id + '.CIE').val; let cie: string = getState(pageItem.id + '.CIE').val;
let cieArray = (cie.substring(1, cie.length - 1)).split(','); let cieArray = (cie.substring(1, cie.length -1)).split(',');
let rgb: RGB = cie_to_rgb(parseFloat(cieArray[0]), parseFloat(cieArray[1]), 254); let rgb: RGB = cie_to_rgb(parseFloat(cieArray[0]), parseFloat(cieArray[1]), 254);
let cRGB: RGB = lightenDarkenColor(ConvertRGBtoHex(rgb.red, rgb.green, rgb.blue), (100 - brightness) * -1); let cRGB: RGB = lightenDarkenColor(ConvertRGBtoHex(rgb.red, rgb.green, rgb.blue), (100 - brightness) * -1);
iconColor = rgb_dec565(pageItem.interpolateColor !== undefined ? cRGB : config.defaultOnColor); iconColor = rgb_dec565(pageItem.interpolateColor !== undefined ? cRGB : config.defaultOnColor);
@@ -5637,7 +5638,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
if (pageItem.popupVersion !== undefined) { if (pageItem.popupVersion !== undefined) {
if (pageItem.popupVersion == 1) { if (pageItem.popupVersion == 1) {
type = 'light'; type = 'light';
} else if (pageItem.popupVersion == 2) { } else if (pageItem.popupVersion == 2){
type = 'light2'; type = 'light2';
} }
} }
@@ -5693,7 +5694,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
if (pageItem.popupVersion !== undefined) { if (pageItem.popupVersion !== undefined) {
if (pageItem.popupVersion == 1) { if (pageItem.popupVersion == 1) {
type = 'light'; type = 'light';
} else if (pageItem.popupVersion == 2) { } else if (pageItem.popupVersion == 2){
type = 'light2'; type = 'light2';
} }
} }
@@ -5719,7 +5720,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
if (pageItem.popupVersion !== undefined) { if (pageItem.popupVersion !== undefined) {
if (pageItem.popupVersion == 1) { if (pageItem.popupVersion == 1) {
type = 'shutter'; type = 'shutter';
} else if (pageItem.popupVersion == 2) { } else if (pageItem.popupVersion == 2){
type = 'shutter2'; type = 'shutter2';
} }
} }
@@ -5860,7 +5861,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
if (role == 'temperature' || role == 'value.temperature' || role == 'thermostat') { if (role == 'temperature' || role == 'value.temperature' || role == 'thermostat') {
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['snowflake-thermometer', 'sun-thermometer', 'thermometer']); iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['snowflake-thermometer', 'sun-thermometer', 'thermometer']);
} else if (role == 'humidity' || role == 'value.humidity') { } else if (role == 'humidity' || role == 'value.humidity') {
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['water-off', 'water-percent-alert', 'water-percent']); iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['water-off', 'water-percent-alert' , 'water-percent']);
} }
iconColor = GetIconColor(pageItem, parseInt(optVal), useColors); iconColor = GetIconColor(pageItem, parseInt(optVal), useColors);
@@ -5908,7 +5909,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
} }
} }
if (existsState(pageItem.id + '.ACTUAL') && (pageItem.icon2 != undefined || pageItem.useValue)) { if (existsState(pageItem.id + '.ACTUAL') && pageItem.icon2 != undefined) {
// Read Alias Datapoint Objectdata // Read Alias Datapoint Objectdata
let obj = getObject(pageItem.id + ".ACTUAL"); let obj = getObject(pageItem.id + ".ACTUAL");
// Read origin Datapoint Objectdata // Read origin Datapoint Objectdata
@@ -5920,22 +5921,16 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
if (obj2.type === 'state' && obj2.common.type == "boolean") { if (obj2.type === 'state' && obj2.common.type == "boolean") {
if (Debug) log(getState(obj.common.alias.id).val, 'info'); if (Debug) log(getState(obj.common.alias.id).val, 'info');
if (getState(obj.common.alias.id).val) { if (getState(obj.common.alias.id).val) {
if (!pageItem.useValue) iconId = pageItem.icon != undefined ? Icons.GetIcon(pageItem.icon) : iconId; iconId = pageItem.icon != undefined ? Icons.GetIcon(pageItem.icon) : iconId;
iconColor = pageItem.onColor != undefined ? rgb_dec565(pageItem.onColor) : iconColor; iconColor = pageItem.onColor != undefined ? rgb_dec565(pageItem.onColor) : iconColor;
} else { } else {
if (!pageItem.useValue) iconId = pageItem.icon2 != undefined ? Icons.GetIcon(pageItem.icon2) : iconId; iconId = pageItem.icon2 != undefined ? Icons.GetIcon(pageItem.icon2) : iconId;
iconColor = pageItem.offColor != undefined ? rgb_dec565(pageItem.offColor) : iconColor; iconColor = pageItem.offColor != undefined ? rgb_dec565(pageItem.offColor) : iconColor;
} }
} }
} }
} }
if (existsState(pageItem.id + '.COLORDEC')) {
if (Debug) log('iconcolor von ' + pageItem.id + '.COLORDEC: ' + getState(pageItem.id + '.COLORDEC').val, 'info');
RegisterEntityWatcher(pageItem.id + '.COLORDEC');
iconColor = getState(pageItem.id + '.COLORDEC').val;
}
if (Debug) log('CreateEntity Icon role info, humidity, temperature, value.temperature, value.humidity, sensor.door, sensor.window, thermostat', 'info'); if (Debug) log('CreateEntity Icon role info, humidity, temperature, value.temperature, value.humidity, sensor.door, sensor.window, thermostat', 'info');
if (Debug) log('CreateEntity ~' + type + '~' + placeId + '~' + iconId + '~' + iconColor + '~' + name + '~' + optVal + ' ' + unit, 'info'); if (Debug) log('CreateEntity ~' + type + '~' + placeId + '~' + iconId + '~' + iconColor + '~' + name + '~' + optVal + ' ' + unit, 'info');
return '~' + type + '~' + placeId + '~' + iconId + '~' + iconColor + '~' + name + '~' + optVal + ' ' + unit; return '~' + type + '~' + placeId + '~' + iconId + '~' + iconColor + '~' + name + '~' + optVal + ' ' + unit;
@@ -7038,7 +7033,7 @@ function GenerateThermo2Page (page: NSPanel.PageThermo2): NSPanel.Payload[] {
'~' + '~' +
getNavigationString(pageId) + // 2-13 Page Navigation getNavigationString(pageId) + // 2-13 Page Navigation
/*-Temp Control-----------------------------------*/ /*-Temp Control-----------------------------------*/
'~' + id + '~' + destTemp + '~' + minTemp + '~' + maxTemp + '~' + stepTemp + '~' + unit + '~' + /* 20 */ actualModeState + '~' + id + '~' + destTemp + '~' + minTemp + '~' + maxTemp + '~' + stepTemp + '~' + unit + '~' + '1' +
/* Entity 1 - Actual Temperature (Icon) */ /* Entity 1 - Actual Temperature (Icon) */
'~text~' + pageId + '?1~' + Icons.GetIcon('thermometer') + '~' + tempColor + '~~' + '~text~' + pageId + '?1~' + Icons.GetIcon('thermometer') + '~' + tempColor + '~~' +
/* Entity 2 - Actual Temperature (Temp) */ /* Entity 2 - Actual Temperature (Temp) */
@@ -7052,7 +7047,7 @@ function GenerateThermo2Page (page: NSPanel.PageThermo2): NSPanel.Payload[] {
/* Entity 6 - Actual Humidity (Unit) */ /* Entity 6 - Actual Humidity (Unit) */
'~text~' + pageId + '?6~' + humidityUnit + '~' + humColor + '~~' + '~text~' + pageId + '?6~' + humidityUnit + '~' + humColor + '~~' +
/* Entity 7 - Text-State */ /* Entity 7 - Text-State */
'~text~' + pageId + '?7~' + modeStatus + '~' + textStateColor + '~~' + /* 62 */ actualModeState; '~text~' + pageId + '?7~' + modeStatus + '~' + textStateColor + '~~' + actualModeState;
for (let i=0; i<9; i++) { for (let i=0; i<9; i++) {
if(page.items[i] != undefined) { if(page.items[i] != undefined) {
@@ -7158,7 +7153,6 @@ function subscribeMediaSubscriptionsSonosAdd (id: string): void {
} }
}); });
} }
/** /**
* Creates media aliases for a specific media device and adapter player instance. * Creates media aliases for a specific media device and adapter player instance.
* *
@@ -8015,9 +8009,9 @@ function GenerateMediaPage (page: NSPanel.PageMedia): NSPanel.Payload[] {
page.items[0].playList = getState(page.items[0].adapterPlayerInstance + 'playlists.playlistListString').val.split(';'); page.items[0].playList = getState(page.items[0].adapterPlayerInstance + 'playlists.playlistListString').val.split(';');
} else if (v2Adapter == 'mpd') { } else if (v2Adapter == 'mpd') {
let tempPL = getState(page.items[0].adapterPlayerInstance + 'listplaylists').val; let tempPL = getState(page.items[0].adapterPlayerInstance + 'listplaylists').val;
tempPL = tempPL.replace('[', ''); tempPL = tempPL.replace('[','');
tempPL = tempPL.replace(']', ''); tempPL = tempPL.replace(']','');
tempPL = tempPL.replaceAll('"', ''); tempPL = tempPL.replaceAll('"','');
page.items[0].playList = tempPL.split(','); page.items[0].playList = tempPL.split(',');
} }
playListIconCol = rgb_dec565(HMIOn); playListIconCol = rgb_dec565(HMIOn);
@@ -9100,7 +9094,6 @@ function triggerButton (id: string): boolean {
} }
return false; return false;
} }
// End Monobutton // End Monobutton
/** /**
@@ -11367,49 +11360,6 @@ function GenerateDetailPage (type: NSPanel.PopupType, optional: NSPanel.mediaOpt
hSlider3Visibility // If Slider Tap > --> tmSerial 28 hSlider3Visibility // If Slider Tap > --> tmSerial 28
}); });
} }
} else { // no Media Item
let tSlider2: string = "";
let tIconS2M: string = Icons.GetIcon("minus-box");
let tIconS2P: string = Icons.GetIcon("plus-box");
let hSlider2MinVal: number = pageItem.minValue ?? 0;
let hSlider2MaxVal: number = pageItem.maxValue ?? 100;
let hSlider2ZeroVal: number = 0;
let hSlider2CurVal: number = getState(id + '.ACTUAL').val;
let hSlider2Step: number = 1;
let hSlider2Visibility: string = "enable";
out_msgs.push({
payload:
'entityUpdateDetail' +
'~' + //entityUpdateDetail
tempId +
// Slider1
'~~~~~~~~~disable' +
// Slider2
'~' +
tSlider2 + // Slider2 Headline --> tmSerial 11
'~' +
tIconS2M + // Slider2 Left Icon --> tmSerial 12
'~' +
tIconS2P + // Slider2 Right Icon --> tmSerial 13
'~' +
hSlider2CurVal + // Slider2 Current Slider Value --> tmSerial 14
'~' +
hSlider2MinVal + // Slider2 Minimal Slider Value --> tmSerial 15
'~' +
hSlider2MaxVal + // Slider2 Maximal Slider Value --> tmSerial 16
'~' +
hSlider2ZeroVal + // If Slider2 0 is betweeb Min and Max --> tmSerial 17
'~' +
hSlider2Step + // If Slider2 Tap > 1 --> tmSerial 18
'~' +
hSlider2Visibility + // If Slider Tap > --> tmSerial 19
// Slider3
'~~~~~~~~~disable'
});
} }
} }
@@ -12674,7 +12624,7 @@ function HandleScreensaverUpdate (): void {
arraySunEvent[0] = getDateObject(getState('pirate-weather.' + weatherAdapterInstanceNumber + '.weather.daily.00.sunriseTime').val).getTime(); arraySunEvent[0] = getDateObject(getState('pirate-weather.' + weatherAdapterInstanceNumber + '.weather.daily.00.sunriseTime').val).getTime();
arraySunEvent[1] = getDateObject(getState('pirate-weather.' + weatherAdapterInstanceNumber + '.weather.daily.00.sunsetTime').val).getTime(); arraySunEvent[1] = getDateObject(getState('pirate-weather.' + weatherAdapterInstanceNumber + '.weather.daily.00.sunsetTime').val).getTime();
arraySunEvent[2] = getDateObject(getState('pirate-weather.' + weatherAdapterInstanceNumber + '.weather.daily.01.sunriseTime').val).getTime(); arraySunEvent[0] = getDateObject(getState('pirate-weather.' + weatherAdapterInstanceNumber + '.weather.daily.00.sunriseTime').val).getTime();
let j = 0; let j = 0;
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
@@ -12698,7 +12648,7 @@ function HandleScreensaverUpdate (): void {
arraySunEvent[0] = getDateObject(getState('brightsky.' + weatherAdapterInstanceNumber + '.daily.00.sunrise').val).getTime(); arraySunEvent[0] = getDateObject(getState('brightsky.' + weatherAdapterInstanceNumber + '.daily.00.sunrise').val).getTime();
arraySunEvent[1] = getDateObject(getState('brightsky.' + weatherAdapterInstanceNumber + '.daily.00.sunset').val).getTime(); arraySunEvent[1] = getDateObject(getState('brightsky.' + weatherAdapterInstanceNumber + '.daily.00.sunset').val).getTime();
arraySunEvent[2] = getDateObject(getState('brightsky.' + weatherAdapterInstanceNumber + '.daily.01.sunrise').val).getTime(); arraySunEvent[0] = getDateObject(getState('brightsky.' + weatherAdapterInstanceNumber + '.daily.00.sunrise').val).getTime();
let j = 0; let j = 0;
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
@@ -13921,7 +13871,6 @@ on({id: config.panelRecvTopic.substring(0, config.panelRecvTopic.length - 'RESUL
log('error Trigger reading senor-data: ' + err.message, 'warn'); log('error Trigger reading senor-data: ' + err.message, 'warn');
} }
}); });
//------------------End Read Internal Sensor Data //------------------End Read Internal Sensor Data
/** /**
@@ -14369,7 +14318,6 @@ function determineStatusIcon (
if (min === undefined || max === undefined) { if (min === undefined || max === undefined) {
return iconId; return iconId;
} }
function pickIcon(iconKey?: string, defIndex?: number): string { function pickIcon(iconKey?: string, defIndex?: number): string {
return ( return (
(iconKey && existsState(iconKey) && Icons.GetIcon(getState(iconKey).val)) || (iconKey && existsState(iconKey) && Icons.GetIcon(getState(iconKey).val)) ||
@@ -14410,7 +14358,6 @@ function spotifyGetDeviceID (vDeviceString: string): string {
let strDevID = arrayDeviceListIds[indexPos]; let strDevID = arrayDeviceListIds[indexPos];
return strDevID; return strDevID;
} }
/** /**
* Join arguments with ~ and return the string; * Join arguments with ~ and return the string;
* @param tokens unlimited numbers of strings * @param tokens unlimited numbers of strings
@@ -14486,7 +14433,6 @@ function _schedule (time: {hour?: number; minute?: number} | undefined | number,
const timeout = targetTime - new Date().getTime(); const timeout = targetTime - new Date().getTime();
scheduleList[ref] = setTimeout(_schedule, timeout, time, ref, repeatTime, callback); scheduleList[ref] = setTimeout(_schedule, timeout, time, ref, repeatTime, callback);
} }
/** /**
* Clears a scheduled task based on the reference ID. * Clears a scheduled task based on the reference ID.
* *
@@ -14501,7 +14447,6 @@ function _clearSchedule (ref: number): null {
delete scheduleList[ref]; delete scheduleList[ref];
return null; return null;
} }
const ArrayPlayerTypeWithMediaDevice = ['alexa2', 'sonos', 'squeezeboxrpc'] as const; const ArrayPlayerTypeWithMediaDevice = ['alexa2', 'sonos', 'squeezeboxrpc'] as const;
const ArrayPlayerTypeWithOutMediaDevice = ['spotify-premium', 'volumio', 'bosesoundtouch', 'mpd'] as const; const ArrayPlayerTypeWithOutMediaDevice = ['spotify-premium', 'volumio', 'bosesoundtouch', 'mpd'] as const;
@@ -14517,7 +14462,6 @@ const ArrayPlayerTypeWithOutMediaDevice = ['spotify-premium', 'volumio', 'boseso
function isPlayerWithMediaDevice (F: string | NSPanel._PlayerTypeWithMediaDevice): F is NSPanel._PlayerTypeWithMediaDevice { function isPlayerWithMediaDevice (F: string | NSPanel._PlayerTypeWithMediaDevice): F is NSPanel._PlayerTypeWithMediaDevice {
return ArrayPlayerTypeWithMediaDevice.indexOf(F as NSPanel._PlayerTypeWithMediaDevice) != -1; return ArrayPlayerTypeWithMediaDevice.indexOf(F as NSPanel._PlayerTypeWithMediaDevice) != -1;
} }
/** check if NSPanel.adapterPlayerInstanceType has all Playertypes */ /** check if NSPanel.adapterPlayerInstanceType has all Playertypes */
function checkSortedPlayerType (F: NSPanel.notSortedPlayerType) { function checkSortedPlayerType (F: NSPanel.notSortedPlayerType) {
const test: NSPanel.adapterPlayerInstanceType = F; const test: NSPanel.adapterPlayerInstanceType = F;
@@ -14603,12 +14547,10 @@ function isPopupType (F: NSPanel.PopupType | string): F is NSPanel.PopupType {
return false; return false;
} }
} }
// If u get a error here u forgot something in PagetypeType or PageType // If u get a error here u forgot something in PagetypeType or PageType
function checkPageType (F: NSPanel.PagetypeType, A: NSPanel.PageType) { function checkPageType (F: NSPanel.PagetypeType, A: NSPanel.PageType) {
A.type = F; A.type = F;
} }
function isPageMediaItem (F: NSPanel.PageItem | NSPanel.PageMediaItem): F is NSPanel.PageMediaItem { function isPageMediaItem (F: NSPanel.PageItem | NSPanel.PageMediaItem): F is NSPanel.PageMediaItem {
return 'adapterPlayerInstance' in F; return 'adapterPlayerInstance' in F;
} }
@@ -14620,7 +14562,6 @@ function isPageThermoItem (F: PageItem | NSPanel.PageThermoItem): F is NSPanel.P
function isPageMedia (F: NSPanel.PageType | NSPanel.PageMedia): F is NSPanel.PageMedia { function isPageMedia (F: NSPanel.PageType | NSPanel.PageMedia): F is NSPanel.PageMedia {
return F.type == 'cardMedia'; return F.type == 'cardMedia';
} }
function isPagePower (F: NSPanel.PageType | NSPanel.PagePower): F is NSPanel.PagePower { function isPagePower (F: NSPanel.PageType | NSPanel.PagePower): F is NSPanel.PagePower {
return F.type == 'cardPower'; return F.type == 'cardPower';
} }