Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bf810ad5a | ||
|
|
a9576adf2f | ||
|
|
470a3d5d9e | ||
|
|
780f61d1c7 | ||
|
|
7cbbbc5b36 | ||
|
|
e01b23640c | ||
|
|
964be86c5d | ||
|
|
8b37b3b669 | ||
|
|
709f916bec | ||
|
|
e7771ba599 |
@@ -16,7 +16,7 @@ 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 needs to be flashed with Tasmota (or upcoming with ESPHome)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@@ -44,4 +44,4 @@ Some (not all) screenshots from the US Portrait Version:
|
|||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Visit https://docs.nspanel.pky.eu/ for installation instructions and documentation of the configuration.
|
Visit https://docs.nspanel.pky.eu/ for installation instructions and documentation of the configuration.
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ class LuiBackendConfig(object):
|
|||||||
'locale': "en_US",
|
'locale': "en_US",
|
||||||
'timeFormat': "%H:%M",
|
'timeFormat': "%H:%M",
|
||||||
'dateFormatBabel': "full",
|
'dateFormatBabel': "full",
|
||||||
'dateAdditonalTemplate': "",
|
'dateAdditionalTemplate': "",
|
||||||
'timeAdditonalTemplate': "",
|
'timeAdditionalTemplate': "",
|
||||||
'dateFormat': "%A, %d. %B %Y",
|
'dateFormat': "%A, %d. %B %Y",
|
||||||
'cards': [{
|
'cards': [{
|
||||||
'type': 'cardEntities',
|
'type': 'cardEntities',
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class LuiPagesGen(object):
|
|||||||
|
|
||||||
def update_time(self, kwargs):
|
def update_time(self, kwargs):
|
||||||
time = datetime.datetime.now().strftime(self._config.get("timeFormat"))
|
time = datetime.datetime.now().strftime(self._config.get("timeFormat"))
|
||||||
addTemplate = self._config.get("timeAdditonalTemplate")
|
addTemplate = self._config.get("timeAdditionalTemplate")
|
||||||
addTimeText = self._ha_api.render_template(addTemplate)
|
addTimeText = self._ha_api.render_template(addTemplate)
|
||||||
self._send_mqtt_msg(f"time~{time}~{addTimeText}")
|
self._send_mqtt_msg(f"time~{time}~{addTimeText}")
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ class LuiPagesGen(object):
|
|||||||
dateformat = self._config.get("dateFormat")
|
dateformat = self._config.get("dateFormat")
|
||||||
date = datetime.datetime.now().strftime(dateformat)
|
date = datetime.datetime.now().strftime(dateformat)
|
||||||
|
|
||||||
addTemplate = self._config.get("dateAdditonalTemplate")
|
addTemplate = self._config.get("dateAdditionalTemplate")
|
||||||
addDateText = self._ha_api.render_template(addTemplate)
|
addDateText = self._ha_api.render_template(addTemplate)
|
||||||
self._send_mqtt_msg(f"date~{date}{addDateText}")
|
self._send_mqtt_msg(f"date~{date}{addDateText}")
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@ class LuiPagesGen(object):
|
|||||||
unit_of_measurement = entity.attributes.get("unit_of_measurement", "")
|
unit_of_measurement = entity.attributes.get("unit_of_measurement", "")
|
||||||
value = entity.state + " " + unit_of_measurement
|
value = entity.state + " " + unit_of_measurement
|
||||||
if cardType == "cardGrid" and entityType == "sensor":
|
if cardType == "cardGrid" and entityType == "sensor":
|
||||||
icon_id = entity.state[:4]
|
icon_id = entity.state[:3]
|
||||||
if icon_id[-1] == ".":
|
if icon_id[-1] == ".":
|
||||||
icon_id = icon_id[:-1]
|
icon_id = icon_id[:-1]
|
||||||
else:
|
else:
|
||||||
@@ -251,8 +251,9 @@ class LuiPagesGen(object):
|
|||||||
return f"~button~{entityId}~{icon_id}~17299~{name}~{text}"
|
return f"~button~{entityId}~{icon_id}~17299~{name}~{text}"
|
||||||
if entityType == "script":
|
if entityType == "script":
|
||||||
icon_id = get_icon_id_ha("script", overwrite=icon)
|
icon_id = get_icon_id_ha("script", overwrite=icon)
|
||||||
|
icon_color = self.get_entity_color(entity, overwrite=colorOverride)
|
||||||
text = get_translation(self._locale, "frontend.ui.card.script.run")
|
text = get_translation(self._locale, "frontend.ui.card.script.run")
|
||||||
return f"~button~{entityId}~{icon_id}~17299~{name}~{text}"
|
return f"~button~{entityId}~{icon_id}~{icon_color}~{name}~{text}"
|
||||||
if entityType == "lock":
|
if entityType == "lock":
|
||||||
icon_id = get_icon_id_ha("lock", state=entity.state, overwrite=icon)
|
icon_id = get_icon_id_ha("lock", state=entity.state, overwrite=icon)
|
||||||
icon_color = self.get_entity_color(entity, overwrite=colorOverride)
|
icon_color = self.get_entity_color(entity, overwrite=colorOverride)
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 985 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
@@ -16,4 +16,4 @@ key | optional | type | default | description
|
|||||||
`title` | True | string | `None` | Title of the Page
|
`title` | True | string | `None` | Title of the Page
|
||||||
`entity` | False | string | `None` | contains the entity of the current card
|
`entity` | False | string | `None` | contains the entity of the current card
|
||||||
`key` | True | string | `None` | Used by navigate items
|
`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.
|
`mediaControl` | True | complex | `None` | overwrites the action executed on pressing the left upper icon (red circle), icon is showing the current type of media and cannot be changed
|
||||||
@@ -62,8 +62,8 @@ key | optional | type | default | description
|
|||||||
`locale` | True | string | `en_US` | Used by babel to determinante Date format on screensaver, also used for localization.
|
`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
|
`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>
|
`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') }}"`
|
`dateAdditionalTemplate` | 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
|
`timeAdditionalTemplate` | 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
|
`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
|
`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
|
`screensaver` | True | complex | | configuration for screensaver; see docs for screensaver
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ It is also possible to configure different icon overwrites per state:
|
|||||||
"off": mdi:lightbulb
|
"off": mdi:lightbulb
|
||||||
```
|
```
|
||||||
|
|
||||||
# Hide item based on state
|
## Hide item based on state
|
||||||
|
|
||||||
This sensor will only be shown on the card if it's state is equal to `off`
|
This sensor will only be shown on the card if it's state is equal to `off`
|
||||||
|
|
||||||
|
|||||||
BIN
docs/img/card-alarm.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
docs/img/card-media.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
docs/img/card-qr.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
@@ -7,12 +7,13 @@ icon_mapping.ts: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroke
|
|||||||
ioBroker-Unterstützung: https://forum.iobroker.net/topic/50888/sonoff-nspanel
|
ioBroker-Unterstützung: https://forum.iobroker.net/topic/50888/sonoff-nspanel
|
||||||
|
|
||||||
ReleaseNotes:
|
ReleaseNotes:
|
||||||
Bugfixes und Erweiterungen seit letzter Verion:
|
Bugfixes und Erweiterungen seit letzter Version:
|
||||||
- cardQR (für Gäste WLAN)
|
- cardQR (für Gäste WLAN)
|
||||||
- cardThermo (Neues Design für Alias Thermostat und zusätzlich für Alias Klimaanlage)
|
- cardThermo (Neues Design für Alias Thermostat und zusätzlich für Alias Klimaanlage)
|
||||||
- 08.05.2022 - Menüpfeile bei HardwareButtons (button1Page; button2Page) mit Navigation auf Page 0
|
- 08.05.2022 - Menüpfeile bei HardwareButtons (button1Page; button2Page) mit Navigation auf Page 0
|
||||||
- 08.05.2022 - Standard-Brightness über neuen Parameter active einstellbar (Test mit 2.9.3)
|
- 08.05.2022 - Standard-Brightness über neuen Parameter active einstellbar (Test mit 2.9.3)
|
||||||
- 08.05.2022 - Schalter (Licht, Dimmer, Hue, etc) in cardGrid lassen sich wieder schalten
|
- 08.05.2022 - Schalter (Licht, Dimmer, Hue, etc) in cardGrid lassen sich wieder schalten
|
||||||
|
- 13.06.2022 - GitHub Issue #277 - HandleMessage -> pageOpenDetail does not work for Sub-Page
|
||||||
|
|
||||||
Known-Bugs --> Bugfix folgt:
|
Known-Bugs --> Bugfix folgt:
|
||||||
- Aktion auf Submenüs schaltet unmittelbar auf vorheriges Mainmenu
|
- Aktion auf Submenüs schaltet unmittelbar auf vorheriges Mainmenu
|
||||||
@@ -144,7 +145,7 @@ var weatherForecast = true; //true = WheatherForecast 5 Days --- false = Config
|
|||||||
|
|
||||||
//Alexa-Instanz
|
//Alexa-Instanz
|
||||||
var alexaInstanz = "alexa2.0"
|
var alexaInstanz = "alexa2.0"
|
||||||
var alexaDevice = "G0XXXXXXXXXXXXXXX"; //Primär zu steuerndes Device oder Gruppe aus alexa2-Adapter (Seriennummer)
|
var alexaDevice = "G0XXXXXXXXXXXXXX"; //Primär zu steuerndes Device oder Gruppe aus alexa2-Adapter (Seriennummer)
|
||||||
|
|
||||||
// Wenn alexaSpeakerList definiert, dann werden Einträge verwendet, sonst alle relevanten Devices aus Alexa-Instanz
|
// Wenn alexaSpeakerList definiert, dann werden Einträge verwendet, sonst alle relevanten Devices aus Alexa-Instanz
|
||||||
// Speakerwechsel funktioniert nicht bei Radio/TuneIn sonden bei Playlists
|
// Speakerwechsel funktioniert nicht bei Radio/TuneIn sonden bei Playlists
|
||||||
@@ -440,7 +441,6 @@ export const config: Config = {
|
|||||||
Buero_Seite_2,
|
Buero_Seite_2,
|
||||||
Buero_Seite_1,
|
Buero_Seite_1,
|
||||||
Buero_Klimaanlage,
|
Buero_Klimaanlage,
|
||||||
//WLAN,
|
|
||||||
Button_1,
|
Button_1,
|
||||||
Test_Licht,
|
Test_Licht,
|
||||||
Test_Funktionen,
|
Test_Funktionen,
|
||||||
@@ -451,6 +451,13 @@ export const config: Config = {
|
|||||||
Buero_Alarm,
|
Buero_Alarm,
|
||||||
Service
|
Service
|
||||||
],
|
],
|
||||||
|
subPages: [
|
||||||
|
Abfall,
|
||||||
|
WLAN,
|
||||||
|
NSPanel_Infos,
|
||||||
|
NSPanel_Einstellungen,
|
||||||
|
NSPanel_Firmware_Updates
|
||||||
|
],
|
||||||
button1Page: button1Page,
|
button1Page: button1Page,
|
||||||
button2Page: button2Page
|
button2Page: button2Page
|
||||||
};
|
};
|
||||||
@@ -845,6 +852,18 @@ function HandleMessage(typ: string, method: string, page: number, words: Array<s
|
|||||||
let pageItem = config.pages[pageId].items.find(e => e.id === words[3]);
|
let pageItem = config.pages[pageId].items.find(e => e.id === words[3]);
|
||||||
if (pageItem !== undefined)
|
if (pageItem !== undefined)
|
||||||
SendToPanel(GenerateDetailPage(words[2], pageItem));
|
SendToPanel(GenerateDetailPage(words[2], pageItem));
|
||||||
|
else {
|
||||||
|
config.subPages.every (sp => {
|
||||||
|
let pageItem = sp.items.find(e => e.id === words[3]);
|
||||||
|
if (pageItem !== undefined) {
|
||||||
|
SendToPanel(GenerateDetailPage(words[2], pageItem));
|
||||||
|
console.log(words[2] + " - " + pageItem);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
case "buttonPress2":
|
case "buttonPress2":
|
||||||
screensaverEnabled = false;
|
screensaverEnabled = false;
|
||||||
HandleButtonEvent(words);
|
HandleButtonEvent(words);
|
||||||
@@ -1983,6 +2002,17 @@ function HandleButtonEvent(words): void {
|
|||||||
if (existsObject(id)) {
|
if (existsObject(id)) {
|
||||||
let o = getObject(id);
|
let o = getObject(id);
|
||||||
let pageItem = config.pages[pageId].items.find(e => e.id === id);
|
let pageItem = config.pages[pageId].items.find(e => e.id === id);
|
||||||
|
if (pageItem == undefined) {
|
||||||
|
config.subPages.every (sp => {
|
||||||
|
pageItem = sp.items.find(e => e.id === id);
|
||||||
|
if (pageItem !== undefined) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
switch (o.common.role) {
|
switch (o.common.role) {
|
||||||
case "dimmer":
|
case "dimmer":
|
||||||
if (pageItem.minValueBrightness != undefined && pageItem.maxValueBrightness != undefined) {
|
if (pageItem.minValueBrightness != undefined && pageItem.maxValueBrightness != undefined) {
|
||||||
@@ -2011,6 +2041,16 @@ function HandleButtonEvent(words): void {
|
|||||||
(function () {if (timeoutSlider) {clearTimeout(timeoutSlider); timeoutSlider = null;}})();
|
(function () {if (timeoutSlider) {clearTimeout(timeoutSlider); timeoutSlider = null;}})();
|
||||||
timeoutSlider = setTimeout(async function () {
|
timeoutSlider = setTimeout(async function () {
|
||||||
let pageItem = config.pages[pageId].items.find(e => e.id === id);
|
let pageItem = config.pages[pageId].items.find(e => e.id === id);
|
||||||
|
if (pageItem == undefined) {
|
||||||
|
config.subPages.every (sp => {
|
||||||
|
pageItem = sp.items.find(e => e.id === id);
|
||||||
|
if (pageItem !== undefined) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
if (pageItem.minValueColorTemp !== undefined && pageItem.minValueColorTemp !== undefined) {
|
if (pageItem.minValueColorTemp !== undefined && pageItem.minValueColorTemp !== undefined) {
|
||||||
let colorTempK = Math.trunc(scale(parseInt(words[4]), 0, 100, pageItem.minValueColorTemp, pageItem.maxValueColorTemp));
|
let colorTempK = Math.trunc(scale(parseInt(words[4]), 0, 100, pageItem.minValueColorTemp, pageItem.maxValueColorTemp));
|
||||||
setIfExists(id + ".TEMPERATURE", (colorTempK));
|
setIfExists(id + ".TEMPERATURE", (colorTempK));
|
||||||
@@ -2903,6 +2943,7 @@ type Config = {
|
|||||||
defaultOnColor: RGB,
|
defaultOnColor: RGB,
|
||||||
defaultOffColor: RGB,
|
defaultOffColor: RGB,
|
||||||
pages: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid)[],
|
pages: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid)[],
|
||||||
|
subPages: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid)[],
|
||||||
button1Page: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | null),
|
button1Page: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | null),
|
||||||
button2Page: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | null),
|
button2Page: (PageThermo | PageMedia | PageAlarm | PageQR | PageEntities | PageGrid | null),
|
||||||
};
|
};
|
||||||
|
|||||||