From 18e1f508baf8feb0b98847dc894c78076be4b37a Mon Sep 17 00:00:00 2001 From: Johannes Date: Sun, 12 Jun 2022 13:28:00 +0200 Subject: [PATCH] fix climate --- apps/nspanel-lovelace-ui/luibackend/pages.py | 1 + docs/card-climate.md | 2 + docs/config-overview.md | 2 + docs/entities.md | 54 ++++++++++++++++++++ docs/index.md | 2 +- 5 files changed, 60 insertions(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 5e9d35cf..ac58edf2 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -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) diff --git a/docs/card-climate.md b/docs/card-climate.md index e69de29b..478b74be 100644 --- a/docs/card-climate.md +++ b/docs/card-climate.md @@ -0,0 +1,2 @@ +# Climate/Thermo Card + diff --git a/docs/config-overview.md b/docs/config-overview.md index 66c83d9f..cc82587d 100644 --- a/docs/config-overview.md +++ b/docs/config-overview.md @@ -164,6 +164,8 @@ The following example configuration is turning off the screen after sunset, but - `tr_xx` - Turkish - `uk_xx` - Ukrainian - `vi_xx` - Vietnamese + - `zh_CN` - Simplified Chinese + - `zh_TW` - Traditional Chinese

diff --git a/docs/entities.md b/docs/entities.md index e69de29b..2844f02b 100644 --- a/docs/entities.md +++ b/docs/entities.md @@ -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" +``` + diff --git a/docs/index.md b/docs/index.md index 57daeb9e..5ba8c7ea 100644 --- a/docs/index.md +++ b/docs/index.md @@ -28,7 +28,7 @@ NsPanel needs to be flashed with Tasmota (or upcoming with ESPHome) - Alarm Control Card - Screensaver Page with Time, Date and Weather Information - Card with QrCode to display WiFi Information -- Localization possible (currently 38 languages) +- Localization (currently 40 languages) - **Everything is dynamically configurable by a yaml config, no need to code or touch Nextion Editor**