diff --git a/HMI/README.md b/HMI/README.md
index 4801898a..60a9a987 100644
--- a/HMI/README.md
+++ b/HMI/README.md
@@ -9,6 +9,7 @@ Messages from the Panel are send to the `tele/XXX/RESULT` Topic, encoded in json
## Startup
On startup the panel will send `{"CustomRecv":"event,startup,39,eu"}` every few seconds.
+
```
event, #Every message from the screen will start with `event`
startup, #Startup Event
@@ -20,15 +21,13 @@ You can answer this message in many different ways, but in general the goal is t
Send the following messages to the CustomSend Topic. (You can also send them on tasmota console for testing)
-
-
### Some preperation before we are acually navigating away:
Send this every minute: `time~18:17`
Send this at least once at midnight: `date~Donnerstag, 25. August 2022`
-Send theese message once after receiving the startup event (parameters will be explained later):
+Send theese message once after receiving the startup event (parameters will be explained later):
`timeout~20`
@@ -36,7 +35,7 @@ Send theese message once after receiving the startup event (parameters will be e
### Navigate from the startup page to the screensaver, by sending this command to the CustomSend Topic.
-`pageType~screensaver`
+`pageType~screensaver`
After sending this command you should already see the time and date.
To also show weather data you have to send them with weatherUpdate, but we will skip this for now.
@@ -53,7 +52,6 @@ You can answer this by sending theese commands to the CustomSend Topic.
`entityUpd~test~1|1~light~light.schreibtischlampe~X~17299~Schreibtischlampe~0~text~sensor.server_energy_power~Y~17299~Server ENERGY Power~155 W~shutter~cover.rolladenfenster_cover_1~Z~17299~Fenster Eingang~A|B|C|disable|enable|enable~switch~switch.bad~D~63142~Bad~1`
-
## Messages to Nextion Display
### General Commands, implemented on all pages
@@ -104,93 +102,1993 @@ change the page type:
### cardEntities Page
-The following message can be used to update the content on the cardEntities Page
+Structure (Category): `entityUpd~title~[navigation]~[entity_information]`
+Example with 4 Entities:
+```
+entityUpd~LightTest~button~navigate.prev~<~65535~~~button~navigate.next~>~65535~~light~light.bed_light~A~17299~Bed Light~0~light~light.ceiling_lights~B~52231~Ceiling Lights~1~switch~switch.ac~C~17299~AC~0~switch~switch.decorative_lights~D~65222~Decorative Lights~1
+```
-`entityUpd~heading~navigation~[~*type*~*internalNameEntity*~*iconId*~*iconColor*~*displayNameEntity*~*optionalValue*]x4`
+
+
+
+ | Number |
+ Category |
+ Location |
+ Type |
+ Field |
+ Addional Information |
+
+
+
+
+ | 0 |
+ instruction |
+ |
+ instruction |
+ entityUpd |
+ |
+
+
+ | 1 |
+ title |
+ title |
+ title |
+ title |
+ |
+
+
+ | 2 |
+ Navigation |
+ Upper Left Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 3 |
+ intNameEntity |
+
+
+ | 4 |
+ icon |
+ |
+
+
+ | 5 |
+ iconColor |
+ |
+
+
+ | 6 |
+ displayName |
+ ignored |
+
+
+ | 7 |
+ optionalValue |
+ ignored |
+
+
+ | 8 |
+ Upper Right Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 9 |
+ intNameEntity |
+
+
+ | 10 |
+ icon |
+ |
+
+
+ | 11 |
+ iconColor |
+ |
+
+
+ | 12 |
+ displayName |
+ ignored |
+
+
+ | 13 |
+ optionalValue |
+ ignored |
+
+
+ | 14 |
+ Entities |
+ First Entity |
+ Entity Definition |
+ type |
+ |
+
+
+ | 15 |
+ intNameEntity |
+
+
+ | 16 |
+ icon |
+ |
+
+
+ | 17 |
+ iconColor |
+ |
+
+
+ | 18 |
+ displayName |
+ |
+
+
+ | 19 |
+ optionalValue |
+
+
+ | 20 |
+ Second Entity |
+ Entity Definition |
+ type |
+ |
+
+
+ | 21 |
+ intNameEntity |
+
+
+ | 22 |
+ icon |
+ |
+
+
+ | 23 |
+ iconColor |
+ |
+
+
+ | 24 |
+ displayName |
+ |
+
+
+ | 25 |
+ optionalValue |
+
+
+ | 26 |
+ Thrid Entity |
+ Entity Definition |
+ type |
+ |
+
+
+ | 27 |
+ intNameEntity |
+
+
+ | 28 |
+ icon |
+ |
+
+
+ | 29 |
+ iconColor |
+ |
+
+
+ | 30 |
+ displayName |
+ |
+
+
+ | 31 |
+ optionalValue |
+
+
+ | 32 |
+ Forth Entiry |
+ Entity Definition |
+ type |
+ |
+
+
+ | 33 |
+ intNameEntity |
+
+
+ | 34 |
+ icon |
+ |
+
+
+ | 35 |
+ iconColor |
+ |
+
+
+ | 36 |
+ displayName |
+ |
+
+
+ | 37 |
+ optionalValue |
+
+
+ | 38 |
+ Fifth Entiy (US Portrait Version) |
+ Entity Definition |
+ type |
+ |
+
+
+ | 39 |
+ intNameEntity |
+
+
+ | 40 |
+ icon |
+ |
+
+
+ | 41 |
+ iconColor |
+ |
+
+
+ | 42 |
+ displayName |
+ |
+
+
+ | 43 |
+ optionalValue |
+
+
+ | 44 |
+ Sixth Entiy (US Portrait Version) |
+ Entity Definition |
+ type |
+ |
+
+
+ | 45 |
+ intNameEntity |
+
+
+ | 46 |
+ icon |
+ |
+
+
+ | 47 |
+ iconColor |
+ |
+
+
+ | 48 |
+ displayName |
+ |
+
+
+ | 49 |
+ optionalValue |
+
+
+
-`~light~light.entityName~1~17299~Light1~0`
+### cardGird Page
-`~shutter~cover.entityName~0~17299~Shutter2~iconUp|iconStop|iconDown`
+cardGrid is using the exact same message cardEntities is using; it ignores the information supplied in optionalValue, because it isn't needed for cardGrid
-`~delete~~~~~`
+
+
+
+ | Parameter Number |
+ Category |
+ Location |
+ Type |
+ Field |
+ Addional Information |
+
+
+
+
+ | 0 |
+ instruction |
+ |
+ instruction |
+ entityUpd |
+ |
+
+
+ | 1 |
+ title |
+ title |
+ title |
+ title |
+ |
+
+
+ | 2 |
+ Navigation |
+ Upper Left Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 3 |
+ intNameEntity |
+
+
+ | 4 |
+ icon |
+ |
+
+
+ | 5 |
+ iconColor |
+ |
+
+
+ | 6 |
+ displayName |
+ ignored |
+
+
+ | 7 |
+ optionalValue |
+ ignored |
+
+
+ | 8 |
+ Upper Right Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 9 |
+ intNameEntity |
+
+
+ | 10 |
+ icon |
+ |
+
+
+ | 11 |
+ iconColor |
+ |
+
+
+ | 12 |
+ displayName |
+ ignored |
+
+
+ | 13 |
+ optionalValue |
+ ignored |
+
+
+ | 14 |
+ Entities |
+ First Entity |
+ Entity Definition |
+ type |
+ |
+
+
+ | 15 |
+ intNameEntity |
+
+
+ | 16 |
+ icon |
+ |
+
+
+ | 17 |
+ iconColor |
+ |
+
+
+ | 18 |
+ displayName |
+ |
+
+
+ | 19 |
+ optionalValue |
+ ignored |
+
+
+ | 20 |
+ Second Entity |
+ Entity Definition |
+ type |
+ |
+
+
+ | 21 |
+ intNameEntity |
+
+
+ | 22 |
+ icon |
+ |
+
+
+ | 23 |
+ iconColor |
+ |
+
+
+ | 24 |
+ displayName |
+ |
+
+
+ | 25 |
+ optionalValue |
+ ignored |
+
+
+ | 26 |
+ Thrid Entity |
+ Entity Definition |
+ type |
+ |
+
+
+ | 27 |
+ intNameEntity |
+
+
+ | 28 |
+ icon |
+ |
+
+
+ | 29 |
+ iconColor |
+ |
+
+
+ | 30 |
+ displayName |
+ |
+
+
+ | 31 |
+ optionalValue |
+ ignored |
+
+
+ | 32 |
+ Forth Entiry |
+ Entity Definition |
+ type |
+ |
+
+
+ | 33 |
+ intNameEntity |
+
+
+ | 34 |
+ icon |
+ |
+
+
+ | 35 |
+ iconColor |
+ |
+
+
+ | 36 |
+ displayName |
+ |
+
+
+ | 37 |
+ optionalValue |
+ ignored |
+
+
+ | 38 |
+ Fifth Entiy (US Portrait Version) |
+ Entity Definition |
+ type |
+ |
+
+
+ | 39 |
+ intNameEntity |
+
+
+ | 40 |
+ icon |
+ |
+
+
+ | 41 |
+ iconColor |
+ |
+
+
+ | 42 |
+ displayName |
+ |
+
+
+ | 43 |
+ optionalValue |
+ ignored |
+
+
+ | 44 |
+ Sixth Entiy (US Portrait Version) |
+ Entity Definition |
+ type |
+ |
+
+
+ | 45 |
+ intNameEntity |
+
+
+ | 46 |
+ icon |
+ |
+
+
+ | 47 |
+ iconColor |
+ |
+
+
+ | 48 |
+ displayName |
+ |
+
+
+ | 49 |
+ optionalValue |
+ ignored |
+
+
+
-`~text~sensor.entityName~3~17299~Temperature~content`
+### cardMedia
-`~button~button.entityName~3~17299~bt-name~bt-text`
+Example without icons in bottom row: `entityUpd~Kitchen~button~navigation.up~U~65535~~~delete~~~~~~media_player.kitchen~I'm a Hurricane~~Wellmess~~100~A~64704~B~media_pl~media_player.kitchen~C~17299~Kitchen~`
-`~switch~switch.entityName~4~17299~Switch1~0`
+
+
+
+ | Parameter Number |
+ Category |
+ Location |
+ Type |
+ Field |
+ Addional Information |
+
+
+
+
+ | 0 |
+ instruction |
+ |
+ instruction |
+ entityUpd |
+ |
+
+
+ | 1 |
+ title |
+ title |
+ title |
+ title |
+ |
+
+
+ | 2 |
+ Navigation |
+ Upper Left Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 3 |
+ intNameEntity |
+ |
+
+
+ | 4 |
+ icon |
+ |
+
+
+ | 5 |
+ iconColor |
+ |
+
+
+ | 6 |
+ displayName |
+ ignored |
+
+
+ | 7 |
+ optionalValue |
+ ignored |
+
+
+ | 8 |
+ Upper Right Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 9 |
+ intNameEntity |
+ |
+
+
+ | 10 |
+ icon |
+ |
+
+
+ | 11 |
+ iconColor |
+ |
+
+
+ | 12 |
+ displayName |
+ ignored |
+
+
+ | 13 |
+ optionalValue |
+ ignored |
+
+
+ | 14 |
+ cardMedia specific |
+ |
+ cardMedia specific |
+ intNameEntity |
+ |
+
+
+ | 15 |
+ 1st text row |
+ title |
+ |
+
+
+ | 16 |
+ titleColor |
+ |
+
+
+ | 17 |
+ 2nd text row |
+ author |
+ |
+
+
+ | 18 |
+ authorColor |
+ |
+
+
+ | 19 |
+ slider |
+ volume |
+ 0-100 |
+
+
+ | 20 |
+ icon middle |
+ playPauseIcon |
+ |
+
+
+ | 21 |
+ icon right side |
+ onOffBtn |
+ "disable" or color |
+
+
+ | 22 |
+ icon left side |
+ iconShuffle |
+ "disable" or icon |
+
+
+ | 23 |
+ Entities |
+ upper left corner media icon |
+ Entity Definition |
+ type |
+ |
+
+
+ | 24 |
+ intNameEntity |
+ |
+
+
+ | 25 |
+ icon |
+ |
+
+
+ | 26 |
+ iconColor |
+ |
+
+
+ | 27 |
+ displayName |
+ only used for popups |
+
+
+ | 28 |
+ optionalValue |
+ ignored |
+
+
+ | 29 |
+ First Entity |
+ Entity Definition |
+ type |
+ |
+
+
+ | 30 |
+ intNameEntity |
+ |
+
+
+ | 31 |
+ icon |
+ |
+
+
+ | 32 |
+ iconColor |
+ |
+
+
+ | 33 |
+ displayName |
+ only used for popups |
+
+
+ | 34 |
+ optionalValue |
+ ignored |
+
+
+ | 35 |
+ Second Entity |
+ Entity Definition |
+ type |
+ |
+
+
+ | 36 |
+ intNameEntity |
+ |
+
+
+ | 37 |
+ icon |
+ |
+
+
+ | 38 |
+ iconColor |
+ |
+
+
+ | 39 |
+ displayName |
+ only used for popups |
+
+
+ | 40 |
+ optionalValue |
+ ignored |
+
+
+ | 41 |
+ Thrid Entity |
+ Entity Definition |
+ type |
+ |
+
+
+ | 42 |
+ intNameEntity |
+ |
+
+
+ | 43 |
+ icon |
+ |
+
+
+ | 44 |
+ iconColor |
+ |
+
+
+ | 45 |
+ displayName |
+ only used for popups |
+
+
+ | 46 |
+ optionalValue |
+ ignored |
+
+
+ | 47 |
+ Forth Entiry |
+ Entity Definition |
+ type |
+ |
+
+
+ | 48 |
+ intNameEntity |
+ |
+
+
+ | 49 |
+ icon |
+ |
+
+
+ | 50 |
+ iconColor |
+ |
+
+
+ | 51 |
+ displayName |
+ only used for popups |
+
+
+ | 52 |
+ optionalValue |
+ ignored |
+
+
+ | 53 |
+ Fifth Entiy |
+ Entity Definition |
+ type |
+ |
+
+
+ | 54 |
+ intNameEntity |
+ |
+
+
+ | 55 |
+ icon |
+ |
+
+
+ | 56 |
+ iconColor |
+ |
+
+
+ | 57 |
+ displayName |
+ only used for popups |
+
+
+ | 58 |
+ optionalValue |
+ ignored |
+
+
+
-`~number~input_number.entityName~4~17299~Number123~value|min|max`
+### cardThermo
-`~input_sel~input_select.entityName~3~17299~sel-name~sel-text`
+Serial Protocol of cardThermo is about to change; table will be completed later
-### popupLight Page
+
+
+
+ | Parameter Number |
+ Category |
+ Location |
+ Type |
+ Field |
+ Addional Information |
+
+
+
+
+ | 0 |
+ instruction |
+ |
+ instruction |
+ entityUpd |
+ |
+
+
+ | 1 |
+ title |
+ title |
+ title |
+ title |
+ |
+
+
+ | 2 |
+ Navigation |
+ Upper Left Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 3 |
+ intNameEntity |
+ |
+
+
+ | 4 |
+ icon |
+ |
+
+
+ | 5 |
+ iconColor |
+ |
+
+
+ | 6 |
+ displayName |
+ ignored |
+
+
+ | 7 |
+ optionalValue |
+ ignored |
+
+
+ | 8 |
+ Upper Right Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 9 |
+ intNameEntity |
+ |
+
+
+ | 10 |
+ icon |
+ |
+
+
+ | 11 |
+ iconColor |
+ |
+
+
+ | 12 |
+ displayName |
+ ignored |
+
+
+ | 13 |
+ optionalValue |
+ ignored |
+
+
+ | 14 |
+ cardThermo specific |
+ |
+ cardThermo specific |
+ intNameEntity |
+ |
+
+
+ | 15 |
+ |
+ currentTemp |
+ |
+
+
+ | 16 |
+ dstTemp |
+ current temp; multiplied by 10 |
+
+
+ | 17 |
+ 4th Text Box Left Side |
+ status |
+ |
+
+
+ | 18 |
+ minTemp |
+ min temp; multiplied by 10 |
+
+
+ | 19 |
+ |
+ maxTemp |
+ max temp; multiplied by 10 |
+
+
+ | 20 |
+ |
+ tempStep |
+ temp adj per step; multiplied by 10 |
+
+
+ | 21 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 22 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 23 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 24 |
+ |
+ |
+
+
+ | 25 |
+ |
+ |
+
+
+ | 26 |
+ |
+ |
+
+
+ | 27 |
+ |
+ |
+
+
+ | 28 |
+ |
+ |
+
+
+ | 29 |
+ |
+ |
+ |
+ |
+
+
+ | 30 |
+ |
+ |
+
+
+ | 31 |
+ |
+ |
+
+
+ | 32 |
+ |
+ |
+
+
+ | 33 |
+ |
+ |
+
+
+ | 34 |
+ |
+ |
+
+
+ | 35 |
+ |
+ |
+ |
+ |
+
+
+ | 36 |
+ |
+ |
+
+
+ | 37 |
+ |
+ |
+
+
+ | 38 |
+ |
+ |
+
+
+ | 39 |
+ |
+ |
+
+
+ | 40 |
+ |
+ |
+
+
+ | 41 |
+ |
+ |
+ |
+ |
+
+
+ | 42 |
+ |
+ |
+
+
+ | 43 |
+ |
+ |
+
+
+ | 44 |
+ |
+ |
+
+
+ | 45 |
+ |
+ |
+
+
+ | 46 |
+ |
+ |
+
+
+ | 47 |
+ |
+ |
+ |
+ |
+
+
+ | 48 |
+ |
+ |
+
+
+ | 49 |
+ |
+ |
+
+
+ | 50 |
+ |
+ |
+
+
+ | 51 |
+ |
+ |
+
+
+ | 52 |
+ |
+ |
+
+
+ | 53 |
+ |
+ |
+ |
+ |
+
+
+ | 54 |
+ |
+ |
+
+
+ | 55 |
+ |
+ |
+
+
+ | 56 |
+ |
+ |
+
+
+ | 57 |
+ |
+ |
+
+
+ | 58 |
+ |
+ |
+
+
+ | 59 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 60 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 61 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 62 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 63 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 64 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 65 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 66 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 67 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 68 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 69 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 70 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 71 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 72 |
+ |
+ |
+ |
+ |
+ |
+
+
+ | 73 |
+ |
+ |
+ |
+ |
+ |
+
+
+
-`entityUpdateDetail~entityName~*ignored*~*iconColor*~*buttonState*~*sliderBrightnessPos*~*sliderColorTempPos*~*colorMode*~*color_translation*~*color_temp_translation*~*brightness_translation*`
+### cardAlarm
-`entityUpdateDetail~1~17299~1~100~78~enable`
+
+
+
+ | Parameter Number |
+ Category |
+ Location |
+ Type |
+ Field |
+ Addional Information |
+
+
+
+
+ | 0 |
+ instruction |
+ |
+ instruction |
+ entityUpd |
+ |
+
+
+ | 1 |
+ title |
+ title |
+ title |
+ intNameEntity |
+ |
+
+
+ | 2 |
+ Navigation |
+ Upper Left Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 3 |
+ intNameEntity |
+ |
+
+
+ | 4 |
+ icon |
+ |
+
+
+ | 5 |
+ iconColor |
+ |
+
+
+ | 6 |
+ displayName |
+ ignored |
+
+
+ | 7 |
+ optionalValue |
+ ignored |
+
+
+ | 8 |
+ Upper Right Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 9 |
+ intNameEntity |
+ |
+
+
+ | 10 |
+ icon |
+ |
+
+
+ | 11 |
+ iconColor |
+ |
+
+
+ | 12 |
+ displayName |
+ ignored |
+
+
+ | 13 |
+ optionalValue |
+ ignored |
+
+
+ | 14 |
+ cardAlarm specific |
+ 1st button right side |
+ displayName |
+ |
+
+
+ | 15 |
+ intId |
+ |
+
+
+ | 16 |
+ 2nd button right side |
+ displayName |
+ |
+
+
+ | 17 |
+ intId |
+ |
+
+
+ | 18 |
+ 3rd button right side |
+ displayName |
+ |
+
+
+ | 19 |
+ intId |
+ |
+
+
+ | 20 |
+ 4th button right side |
+ displayName |
+ |
+
+
+ | 21 |
+ intId |
+ |
+
+
+ | 22 |
+ icon next to code display |
+ icon |
+ |
+
+
+ | 23 |
+ iconColor |
+ |
+
+
+ | 24 |
+ numpad |
+ numpadStatus |
+ "disable" or "enable" |
+
+
+ | 25 |
+ flashing of icon next to code |
+ flashing status |
+ "enable" or "disable" |
+
+
+ | 26 |
+ button bottom left corner |
+ icon |
+ |
+
+
+ | 27 |
+ iconColor |
+ |
+
+
+ | 28 |
+ intNameEntity |
+ |
+
+
+
-`entityUpdateDetail~1~17299~1~100~disable`
+### cardQR
-### popupShutter Page
+Example: `entityUpd~Guest Wifi~button~navigate.prev~<~65535~~~button~navigate.next~>~65535~~~WIFI:S:test_ssid;T:WPA;P:test_pw;;~text~iText.test_ssid~���~17299~Name~test_ssid~text~iText.test_pw~���~17299~Password~test_pw`
-`entityUpdateDetail~entityName~*sliderPos*~2ndrow~textPosition~icon1~iconUp~iconStop~iconDown~iconUpStatus~iconStopStatus~iconDownStatus~textTilt~iconTiltLeft~iconTiltStop~iconTiltRight~iconTiltLeftStatus~iconTiltStopStatus~iconTiltLeftStatus~tiltPos`
-
-`entityUpdateDetail~1~77`
-
-### popupNotify Page
-
-`entityUpdateDetail~*internalName*~*tHeading*~*tHeadingColor*~*b1*~*tB1Color*~*b2*~*tB2Color*~*tText*~*tTextColor*~*sleepTimeout*~*font*~*alt_icon*~*altIconColor*`
-
-`exitPopup`
-
-### popupThermo Page
-
-`entityUpdateDetail~{entity_id}~{icon_id}~{icon_color}~{heading}~{mode}~mode1~mode1?mode2?mode3~{heading}~{mode}~mode1~mode1?mode2?mode3~{heading}~{mode}~mode1~mode1?mode2?mode3~`
-
-### popupInSel Page (input_select detail page)
-
-`entityUpdateDetail2~*entity_id*~~*icon_color*~*input_sel*~*state*~*options*`
-
-options are ? seperated
-
-### popupTimer
-
-editable is 0 or 1
-
-action fields are in the answer on the button press
-
-in case action is empty the button will be hidden
-
-`entityUpdateDetail~{entity_id}~~{icon_color}~{entity_id}~{min_remaining}~{sec_remaining}~{editable}~{action1}~{action2}~{action3}~{label1}~{label2}~{label3}`
+
+
+
+ | Parameter Number |
+ Category |
+ Location |
+ Type |
+ Field |
+ Addional Information |
+
+
+
+
+ | 0 |
+ instruction |
+ |
+ instruction |
+ entityUpd |
+ |
+
+
+ | 1 |
+ title |
+ title |
+ title |
+ intNameEntity |
+ |
+
+
+ | 2 |
+ Navigation |
+ Upper Left Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 3 |
+ intNameEntity |
+ |
+
+
+ | 4 |
+ icon |
+ |
+
+
+ | 5 |
+ iconColor |
+ |
+
+
+ | 6 |
+ displayName |
+ ignored |
+
+
+ | 7 |
+ optionalValue |
+ ignored |
+
+
+ | 8 |
+ Upper Right Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 9 |
+ intNameEntity |
+ |
+
+
+ | 10 |
+ icon |
+ |
+
+
+ | 11 |
+ iconColor |
+ |
+
+
+ | 12 |
+ displayName |
+ ignored |
+
+
+ | 13 |
+ optionalValue |
+ ignored |
+
+
+ | 14 |
+ cardQR specific |
+ qrcode text |
+ |
+
+
+ | 15 |
+ Entities |
+ 1st Entity |
+ Entity Definition |
+ type |
+ |
+
+
+ | 16 |
+ intNameEntity |
+ |
+
+
+ | 17 |
+ icon |
+ |
+
+
+ | 18 |
+ iconColor |
+ |
+
+
+ | 19 |
+ displayName |
+ |
+
+
+ | 20 |
+ optionalValue |
+ |
+
+
+ | 21 |
+ 2nd Entity |
+ Entity Definition |
+ type |
+ |
+
+
+ | 22 |
+ intNameEntity |
+ |
+
+
+ | 23 |
+ icon |
+ |
+
+
+ | 24 |
+ iconColor |
+ |
+
+
+ | 25 |
+ displayName |
+ |
+
+
+ | 26 |
+ optionalValue |
+ |
+
+
+
-### cardThermo Page
+### cardPower (in development)
-`entityUpd~*heading*~*navigation*~*internalNameEntiy*~*currentTemp*~*destTemp*~*status*~*minTemp*~*maxTemp*~*stepTemp*[[~*iconId*~*activeColor*~*state*~*hvac_action*]]~tCurTempLbl~tStateLbl~tALbl~iconTemperature~dstTempTwoTempMode~btDetail`
-
-`[[]]` are not part of the command~ this part repeats 8 times for the buttons
-
-### cardMedia Page
-
-onoffbtn has to be`disable` to disable the on off btn
-tIconBtnEntityName is the entiy name used in the button event for pressing the upper left icon
-
-`entityUpd~*heading*~*navigation*~*internalNameEntiy*~*title*~titlecolor~*author*~authorcolor~*volume*~*playpauseicon*~onoffbtn~iconShuffle~*type*~*internalNameEntity*~*iconId*~*iconColor*~~[~*type*~*internalNameEntity*~*iconId*~*iconColor*~*displayNameEntity*~*optionalValue*]x4`
-
-### cardAlarm Page
-
-`entityUpd~*internalNameEntity*~*navigation*~*arm1*~*arm1ActionName*~*arm2*~*arm2ActionName*~*arm3*~*arm3ActionName*~*arm4*~*arm4ActionName*~*icon*~*iconcolor*~*numpadStatus*~*flashing*`
-
-### cardQR Page
-
-`entityUpd~heading~navigation~textQR[~type~internalName~iconId~displayName~optionalValue]x2`
-
-### cardPower Page
-
-`entityUpd~heading~navigation~colorHome~iconHome~textHome[~iconColor~icon~speed~valueDown]x6`
-
-`entityUpd~test~1|1~6666~A~hu~8888~B~1~t0u~9999~C~2~t1u~1111~D~3~t2u~33333~E~-1~t3u~3333~F~-2~t4u~4444~G~-3~t5u`
+
+
+
+ | Parameter Number |
+ Category |
+ Location |
+ Type |
+ Field |
+ Addional Information |
+
+
+
+
+ | 0 |
+ instruction |
+ |
+ instruction |
+ entityUpd |
+ |
+
+
+ | 1 |
+ title |
+ title |
+ title |
+ intNameEntity |
+ |
+
+
+ | 2 |
+ Navigation |
+ Upper Left Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 3 |
+ intNameEntity |
+ |
+
+
+ | 4 |
+ icon |
+ |
+
+
+ | 5 |
+ iconColor |
+ |
+
+
+ | 6 |
+ displayName |
+ ignored |
+
+
+ | 7 |
+ optionalValue |
+ ignored |
+
+
+ | 8 |
+ Upper Right Icon |
+ Entity Definition |
+ type |
+ (ignored)¹ |
+
+
+ | 9 |
+ intNameEntity |
+ |
+
+
+ | 10 |
+ icon |
+ |
+
+
+ | 11 |
+ iconColor |
+ |
+
+
+ | 12 |
+ displayName |
+ ignored |
+
+
+ | 13 |
+ optionalValue |
+ ignored |
+
+
+ | 14 |
+ cardPower specific |
+ Home Icon Middle |
+ |
+ iconColor |
+ |
+
+
+ | 15 |
+ |
+ icon |
+ |
+
+
+ | 16 |
+ |
+ text |
+ |
+
+
+ | 17 |
+ 1st Item Upper Left |
+ Power Entity Definition |
+ iconColor |
+ |
+
+
+ | 18 |
+ icon |
+ |
+
+
+ | 19 |
+ speed |
+ numbers (-2,-1,0,1,2) |
+
+
+ | 20 |
+ text |
+ |
+
+
+ | 21 |
+ 2nd Item Middle Left |
+ Power Entity Definition |
+ iconColor |
+ |
+
+
+ | 22 |
+ icon |
+ |
+
+
+ | 23 |
+ speed |
+ numbers (-2,-1,0,1,2) |
+
+
+ | 24 |
+ text |
+ |
+
+
+ | 25 |
+ 3rd Item Bottom Left |
+ Power Entity Definition |
+ iconColor |
+ |
+
+
+ | 26 |
+ icon |
+ |
+
+
+ | 27 |
+ speed |
+ numbers (-2,-1,0,1,2) |
+
+
+ | 28 |
+ text |
+ |
+
+
+ | 29 |
+ 4th Item Upper Right |
+ Power Entity Definition |
+ iconColor |
+ |
+
+
+ | 30 |
+ icon |
+ |
+
+
+ | 31 |
+ speed |
+ numbers (-2,-1,0,1,2) |
+
+
+ | 32 |
+ text |
+ |
+
+
+ | 33 |
+ 5thItem Middle Right |
+ Power Entity Definition |
+ iconColor |
+ |
+
+
+ | 34 |
+ icon |
+ |
+
+
+ | 35 |
+ speed |
+ numbers (-2,-1,0,1,2) |
+
+
+ | 36 |
+ text |
+ |
+
+
+ | 37 |
+ 6th Item Bottom Right |
+ Power Entity Definition |
+ iconColor |
+ |
+
+
+ | 38 |
+ icon |
+ |
+
+
+ | 39 |
+ speed |
+ numbers (-2,-1,0,1,2) |
+
+
+ | 40 |
+ text |
+ |
+
+
+
### cardChart Page
`entityUpd~heading~navigation~color~yAxisLabel~yAxisTick:[yAxisTick]*[~value[:xAxisLabel]?]*`
@@ -279,16 +2177,8 @@ tIconBtnEntityName is the entiy name used in the button event for pressing the u
`event,buttonPress2,internalNameEntity,actionName,code`
-# Design Guidelines for Nextion HMI Project
-
-Background Color is
-- RGB565: 6371 [18e3] (HEX: #1C1C1C, RGB: 28,28,28)
-
-Source for Icons is the Material Design Font, used by HASPone
-https://github.com/HASwitchPlate/HASPone
-
-
# Custom Protocol
+
```
55 BB [payload length] [payload length] [payload] [crc] [crc]
```
@@ -301,8 +2191,9 @@ This protocol does not try to implement broken JSON Commands with a specified ty
Instead the commands are plain text commands with parameters.
## Example for valid Message
+
This message has to be generated for the Message "1337" (1337 is not a valid command~ this is just an example)
+
```
55 BB 04 00 31 33 33 37 5F 5B
```
-
diff --git a/HMI/code_gen/pages/cardEntitiesSerial.py b/HMI/code_gen/pages/cardEntitiesSerial.py
index ac19e8d7..05ca2253 100644
--- a/HMI/code_gen/pages/cardEntitiesSerial.py
+++ b/HMI/code_gen/pages/cardEntitiesSerial.py
@@ -6,8 +6,8 @@ head = sharedhead + """
spstr strCommand.txt,tHeading.txt,"~",1
""" + navigation
print(head)
-start = 3
-for i in range(1,7):
+start = 14
+for i in range(1,5):
idxstart = start + (i-1)*6
item = f"""
// get Type
diff --git a/HMI/code_gen/pages/cardGridSerial.py b/HMI/code_gen/pages/cardGridSerial.py
index ab3c6778..2ba08725 100644
--- a/HMI/code_gen/pages/cardGridSerial.py
+++ b/HMI/code_gen/pages/cardGridSerial.py
@@ -6,7 +6,7 @@ head = sharedhead + """
spstr strCommand.txt,tHeading.txt,"~",1
""" + navigation
print(head)
-start = 3
+start = 14
for i in range(1,7):
idxstart = start + (i-1)*6
item = f"""
diff --git a/HMI/code_gen/pages/cardMedia.py b/HMI/code_gen/pages/cardMedia.py
index 6e6b5905..4367508d 100644
--- a/HMI/code_gen/pages/cardMedia.py
+++ b/HMI/code_gen/pages/cardMedia.py
@@ -8,31 +8,31 @@ head = sharedhead + """
print(head)
print("""
//entity name
- spstr strCommand.txt,entn.txt,"~",3
+ spstr strCommand.txt,entn.txt,"~",14
//title
- spstr strCommand.txt,tTitle.txt,"~",4
+ spstr strCommand.txt,tTitle.txt,"~",15
//title farbe
- spstr strCommand.txt,tTmp.txt,"~",5
+ spstr strCommand.txt,tTmp.txt,"~",16
if(tTmp.txt!="")
{
covx tTmp.txt,tTitle.pco,0,0
}
//author
- spstr strCommand.txt,tAuthor.txt,"~",6
+ spstr strCommand.txt,tAuthor.txt,"~",17
//author farbe
- spstr strCommand.txt,tTmp.txt,"~",7
+ spstr strCommand.txt,tTmp.txt,"~",18
if(tTmp.txt!="")
{
covx tTmp.txt,tAuthor.pco,0,0
}
//volume
- spstr strCommand.txt,tTmp.txt,"~",8
+ spstr strCommand.txt,tTmp.txt,"~",19
covx tTmp.txt,sys0,0,0
hVolume.val=sys0
//icon
- spstr strCommand.txt,tPlayPause.txt,"~",9
+ spstr strCommand.txt,tPlayPause.txt,"~",20
// on off button
- spstr strCommand.txt,tTmp.txt,"~",10
+ spstr strCommand.txt,tTmp.txt,"~",21
if(tTmp.txt=="disable")
{
vis t5,0
@@ -42,7 +42,7 @@ print("""
covx tTmp.txt,t5.pco,0,0
}
// shuffel btn
- spstr strCommand.txt,tTmp.txt,"~",11
+ spstr strCommand.txt,tTmp.txt,"~",22
if(tTmp.txt=="disable")
{
vis tShuffle,0
@@ -54,7 +54,7 @@ print("""
""")
-start = 12
+start = 23
for i in range(1,7):
idxstart = start + (i-1)*6
item = f"""
diff --git a/HMI/code_gen/pages/cardPower.py b/HMI/code_gen/pages/cardPower.py
index 3dfad24a..d917e174 100644
--- a/HMI/code_gen/pages/cardPower.py
+++ b/HMI/code_gen/pages/cardPower.py
@@ -5,16 +5,16 @@ head = sharedhead + """
// command format: entityUpd,heading,navigation,colorHome,iconHome[,iconColor,icon,speed,valueUp,valueDown]x6
spstr strCommand.txt,tHeading.txt,"~",1
""" + navigation + """
- // icon color home
- spstr strCommand.txt,tTmp.txt,"~",3
+ // icon color home
+ spstr strCommand.txt,tTmp.txt,"~",14
covx tTmp.txt,t1.pco,0,0
// icon home
- spstr strCommand.txt,t1.txt,"~",4
+ spstr strCommand.txt,t1.txt,"~",15
// text home
- spstr strCommand.txt,tHome.txt,"~",5
+ spstr strCommand.txt,tHome.txt,"~",16
"""
print(head)
-start = 6
+start = 17
for i in range(0,6):
idxstart = start + (i)*4
item = f"""
diff --git a/HMI/code_gen/pages/cardThermo.py b/HMI/code_gen/pages/cardThermo.py
index 968b44aa..8cff1568 100644
--- a/HMI/code_gen/pages/cardThermo.py
+++ b/HMI/code_gen/pages/cardThermo.py
@@ -8,23 +8,23 @@ text = sharedhead + """
text += """
//entity name
- spstr strCommand.txt,entn.txt,"~",3
+ spstr strCommand.txt,entn.txt,"~",14
//currentTemp
- spstr strCommand.txt,tCurTemp.txt,"~",4
+ spstr strCommand.txt,tCurTemp.txt,"~",15
//dstTemp
- spstr strCommand.txt,tTmp.txt,"~",5
+ spstr strCommand.txt,tTmp.txt,"~",16
covx tTmp.txt,xTempDest1.val,0,0
xTempDest.val=xTempDest1.val
//status
- spstr strCommand.txt,tStatus.txt,"~",6
+ spstr strCommand.txt,tStatus.txt,"~",17
//minTemp
- spstr strCommand.txt,tTmp.txt,"~",7
+ spstr strCommand.txt,tTmp.txt,"~",18
covx tTmp.txt,xTempMin1.val,0,0
//maxTemp
- spstr strCommand.txt,tTmp.txt,"~",8
+ spstr strCommand.txt,tTmp.txt,"~",19
covx tTmp.txt,xTempMax1.val,0,0
//tempStep
- spstr strCommand.txt,tTmp.txt,"~",9
+ spstr strCommand.txt,tTmp.txt,"~",20
covx tTmp.txt,xTempStep1.val,0,0
// disable all buttons
vis bt0,0
@@ -37,7 +37,7 @@ text += """
vis bt7,0
"""
-start = 10
+start = 21
for i in range(0,8):
idxstart = start + i*4
text += f"""
@@ -59,17 +59,17 @@ for i in range(0,8):
text += """
//Text tCurTempLbl
- spstr strCommand.txt,tCurTempLbl.txt,"~",42
+ spstr strCommand.txt,tCurTempLbl.txt,"~",53
//Text tStateLbl
- spstr strCommand.txt,tStateLbl.txt,"~",43
+ spstr strCommand.txt,tStateLbl.txt,"~",54
//Text tALbl
- spstr strCommand.txt,tALbl.txt,"~",44
+ spstr strCommand.txt,tALbl.txt,"~",55
//Text tCF
- spstr strCommand.txt,tCF.txt,"~",45
+ spstr strCommand.txt,tCF.txt,"~",56
tCF1.txt=tCF.txt
tCF2.txt=tCF.txt
//Second Temperature
- spstr strCommand.txt,tTmp.txt,"~",46
+ spstr strCommand.txt,tTmp.txt,"~",57
if(tTmp.txt!="")
{
covx tTmp.txt,xTempDest2.val,0,0
@@ -87,7 +87,7 @@ text += """
vis tCF2,1
}
//Show btDetail
- spstr strCommand.txt,tTmp.txt,"~",47
+ spstr strCommand.txt,tTmp.txt,"~",58
if(tTmp.txt!="1")
{
vis btDetail,1
diff --git a/HMI/code_gen/pages/out.txt b/HMI/code_gen/pages/out.txt
new file mode 100644
index 00000000..97b638ce
--- /dev/null
+++ b/HMI/code_gen/pages/out.txt
@@ -0,0 +1,360 @@
+
+// data available
+if(usize>1)
+{
+ bufferPos=0
+ while(bufferPos= 2:
self._current_card = self._previous_cards.pop()
@@ -227,28 +225,14 @@ class LuiController(object):
if button_type == "bExit":
self._pages_gen.render_card(self._current_card)
- if button_type == "bUp":
- if self._previous_cards:
- self._current_card = self._previous_cards.pop()
- else:
- self._current_card = self._config.getCard(0)
- self._pages_gen.render_card(self._current_card)
- if button_type == "bHome":
- if self._previous_cards:
- self._current_card = self._previous_cards[0]
- self._previous_cards.clear()
- else:
- self._current_card = self._config.getCard(0)
- self._pages_gen.render_card(self._current_card)
-
- if button_type == "bNext":
- card = self._config.getCard(self._current_card.pos+1)
- self._current_card = card
- self._pages_gen.render_card(card)
- if button_type == "bPrev":
- card = self._config.getCard(self._current_card.pos-1)
- self._current_card = card
- self._pages_gen.render_card(card)
+ #if button_type == "bHome":
+ # if self._previous_cards:
+ # self._current_card = self._previous_cards[0]
+ # self._previous_cards.clear()
+ # else:
+ # self._current_card = self._config.getCard(0)
+ # self._pages_gen.render_card(self._current_card)
+
elif entity_id == "updateDisplayNoYes" and value == "no":
self._pages_gen.render_card(self._current_card)
@@ -295,14 +279,25 @@ class LuiController(object):
entity_id = le.entityId
if entity_id.startswith('navigate'):
+ # internal navigation for next/prev
+ if entity_id.startswith('navigate.uuid'):
+ dstCard = self._config.get_card_by_uuid(entity_id.replace('navigate.',''))
# internal for navigation to nested pages
- dstCard = self._config.searchCard(entity_id)
+ else:
+ dstCard = self._config.searchCard(entity_id)
if dstCard is not None:
- self._previous_cards.append(self._current_card)
+ if dstCard.hidden:
+ self._previous_cards.append(self._current_card)
self._current_card = dstCard
self._pages_gen.render_card(self._current_card)
else:
apis.ha_api.log(f"No page with key {entity_id} found")
+ if entity_id.startswith('navUp'):
+ if self._previous_cards:
+ self._current_card = self._previous_cards.pop()
+ else:
+ self._current_card = self._config.get_default_card()
+ self._pages_gen.render_card(self._current_card)
elif entity_id.startswith('scene'):
apis.ha_api.get_entity(entity_id).call_service("turn_on")
elif entity_id.startswith('script'):
diff --git a/apps/nspanel-lovelace-ui/luibackend/mqtt.py b/apps/nspanel-lovelace-ui/luibackend/mqtt.py
index c1efada6..30eb6656 100644
--- a/apps/nspanel-lovelace-ui/luibackend/mqtt.py
+++ b/apps/nspanel-lovelace-ui/luibackend/mqtt.py
@@ -1,18 +1,19 @@
import json
+import apis
class LuiMqttListener(object):
- def __init__(self, mqtt_api, topic, controller, updater):
+ def __init__(self, topic, controller, updater):
self._controller = controller
self._updater = updater
- self._mqtt_api = mqtt_api
+
# Setup, mqtt subscription and callback
- mqtt_api.mqtt_subscribe(topic=topic)
- mqtt_api.listen_event(self.mqtt_event_callback, "MQTT_MESSAGE", topic=topic, namespace='mqtt')
+ apis.mqtt_api.mqtt_subscribe(topic=topic)
+ apis.mqtt_api.listen_event(self.mqtt_event_callback, "MQTT_MESSAGE", topic=topic, namespace='mqtt')
def mqtt_event_callback(self, event_name, data, kwargs):
- self._mqtt_api.log(f'MQTT callback for: {data}')
+ apis.mqtt_api.log(f'MQTT callback for: {data}')
# Parse Json Message from Tasmota and strip out message from nextion display
data = json.loads(data["payload"])
if("nlui_driver_version" in data):
@@ -22,7 +23,7 @@ class LuiMqttListener(object):
if("CustomRecv" not in data):
return
msg = data["CustomRecv"]
- self._mqtt_api.log(f"Received Message from Screen: {msg}")
+ apis.mqtt_api.log(f"Received Message from Screen: {msg}")
# Split message into parts seperated by ","
msg = msg.split(",")
# run action based on received command
@@ -30,9 +31,7 @@ class LuiMqttListener(object):
if msg[1] == "startup":
self._updater.request_berry_driver_version()
display_firmware_version = int(msg[2])
- model = None
- if display_firmware_version >= 23:
- model = msg[3]
+ model = msg[3]
self._updater.set_current_display_firmware_version(display_firmware_version, model)
# check for updates
msg_send = self._updater.check_updates()
@@ -60,9 +59,8 @@ class LuiMqttListener(object):
self._controller.detail_open(msg[2], msg[3])
class LuiMqttSender(object):
- def __init__(self, api, mqttapi, topic_send):
+ def __init__(self, api, topic_send):
self._ha_api = api
- self._mqtt_api = mqttapi
self._topic_send = topic_send
self._prev_msg = ""
@@ -73,4 +71,4 @@ class LuiMqttSender(object):
if topic is None:
topic = self._topic_send
self._ha_api.log(f"Sending MQTT Message: {msg}")
- self._mqtt_api.mqtt_publish(topic, msg)
\ No newline at end of file
+ apis.mqtt_api.mqtt_publish(topic, msg)
\ No newline at end of file
diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py
index b04ffb14..70c06bd4 100644
--- a/apps/nspanel-lovelace-ui/luibackend/pages.py
+++ b/apps/nspanel-lovelace-ui/luibackend/pages.py
@@ -9,6 +9,7 @@ from icons import get_icon, get_icon_ha
from icons import get_action_icon
from helper import scale, rgb_dec565, rgb_brightness, get_attr_safe, convert_temperature
from localization import get_translation
+from config import Entity
# check Babel
import importlib
@@ -32,43 +33,46 @@ class LuiPagesGen(object):
for overwrite_state, overwrite_val in overwrite.items():
if overwrite_state == state:
return rgb_dec565(overwrite_val)
+ if isinstance(entity, str):
+ default_color = rgb_dec565([68, 115, 158])
+ return default_color
+ else:
+ attr = entity.attributes
+ default_color_on = rgb_dec565([253, 216, 53])
+ default_color_off = rgb_dec565([68, 115, 158])
+ icon_color = default_color_on if entity.state in ["on", "unlocked", "above_horizon", "home", "active"] else default_color_off
- attr = entity.attributes
- default_color_on = rgb_dec565([253, 216, 53])
- default_color_off = rgb_dec565([68, 115, 158])
- icon_color = default_color_on if entity.state in ["on", "unlocked", "above_horizon", "home", "active"] else default_color_off
+ if ha_type == "alarm_control_panel":
+ if entity.state == "disarmed":
+ icon_color = rgb_dec565([13,160,53])
+ if entity.state == "arming":
+ icon_color = rgb_dec565([244,180,0])
+ if entity.state in ["armed_home", "armed_away", "armed_night", "armed_vacation", "pending", "triggered"]:
+ icon_color = rgb_dec565([223,76,30])
- if ha_type == "alarm_control_panel":
- if entity.state == "disarmed":
- icon_color = rgb_dec565([13,160,53])
- if entity.state == "arming":
- icon_color = rgb_dec565([244,180,0])
- if entity.state in ["armed_home", "armed_away", "armed_night", "armed_vacation", "pending", "triggered"]:
- icon_color = rgb_dec565([223,76,30])
+ if ha_type == "climate":
+ if entity.state in ["auto", "heat_cool"]:
+ icon_color = 1024
+ if entity.state == "heat":
+ icon_color = 64512
+ if entity.state == "off":
+ icon_color = 35921
+ if entity.state == "cool":
+ icon_color = 11487
+ if entity.state == "dry":
+ icon_color = 60897
+ if entity.state == "fan_only":
+ icon_color = 35921
- if ha_type == "climate":
- if entity.state in ["auto", "heat_cool"]:
- icon_color = 1024
- if entity.state == "heat":
- icon_color = 64512
- if entity.state == "off":
- icon_color = 35921
- if entity.state == "cool":
- icon_color = 11487
- if entity.state == "dry":
- icon_color = 60897
- if entity.state == "fan_only":
- icon_color = 35921
-
- if "rgb_color" in attr:
- color = attr.rgb_color
- if "brightness" in attr:
- color = rgb_brightness(color, attr.brightness)
- icon_color = rgb_dec565(color)
- elif "brightness" in attr:
- color = rgb_brightness([253, 216, 53], attr.brightness)
- icon_color = rgb_dec565(color)
- return icon_color
+ if "rgb_color" in attr:
+ color = attr.rgb_color
+ if "brightness" in attr:
+ color = rgb_brightness(color, attr.brightness)
+ icon_color = rgb_dec565(color)
+ elif "brightness" in attr:
+ color = rgb_brightness([253, 216, 53], attr.brightness)
+ icon_color = rgb_dec565(color)
+ return icon_color
def update_time(self, kwargs):
time = datetime.datetime.now().strftime(self._config.get("timeFormat"))
@@ -201,7 +205,7 @@ class LuiPagesGen(object):
state = None
self._send_mqtt_msg(get_screensaver_color_output(theme=theme, state=state))
- def generate_entities_item(self, item, cardType, temp_unit=""):
+ def generate_entities_item(self, item, cardType="cardGrid", temp_unit=""):
entityId = item.entityId
icon = item.iconOverride
colorOverride = item.colorOverride
@@ -230,7 +234,8 @@ class LuiPagesGen(object):
if icon_res[-1] == ".":
icon_res = icon_res[:-1]
else:
- icon_color = rgb_dec565(colorOverride) if colorOverride is not None and type(colorOverride) is list else 17299
+ #icon_color = rgb_dec565(colorOverride) if colorOverride is not None and type(colorOverride) is list else 17299
+ icon_color = self.get_entity_color(entityId, overwrite=colorOverride)
return f"~button~{entityId}~{icon_res}~{icon_color}~{name}~{text}"
else:
return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~page not found~"
@@ -631,20 +636,34 @@ class LuiPagesGen(object):
command += f"~{icon_color}~{icon}~{speed}~{entity.state}"
self._send_mqtt_msg(command)
- def render_card(self, card, send_page_type=True):
- apis.ha_api.log(f"Started rendering of page {card.pos} with type {card.cardType}")
-
- l = 1
- r = 1
+ def render_card(self, card, send_page_type=True):
+
+ l = self.generate_entities_item(Entity(
+ {
+ 'entity': f'navigate.{card.uuid_prev}',
+ 'icon': 'mdi:arrow-left-bold',
+ 'color': [255, 255, 255],
+ }
+ ))[1:]
+ r = self.generate_entities_item(Entity(
+ {
+ 'entity': f'navigate.{card.uuid_next}',
+ 'icon': 'mdi:arrow-right-bold',
+ 'color': [255, 255, 255],
+ }
+ ))[1:]
+
if len(self._config._config_cards) == 1:
- l = 0
- r = 0
- if card.pos is None:
- l = 2
- r = 0
- if self._config.get("homeButton"):
- r = 2
- navigation = f"{l}|{r}"
+ l = "delete~~~~~"
+ r = "delete~~~~~"
+
+ if card.hidden:
+ l = f"x~navUp~{get_icon_id('mdi:arrow-up-bold')}~65535~~"
+ r = "delete~~~~~"
+ # r = 0
+ # if self._config.get("homeButton"):
+ # r = 2
+ navigation = f"{l}~{r}"
# Switch to page
if send_page_type:
diff --git a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py
index e64a4865..ec248992 100644
--- a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py
+++ b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py
@@ -5,43 +5,44 @@ from luibackend.controller import LuiController
from luibackend.mqtt import LuiMqttListener, LuiMqttSender
from luibackend.updater import Updater
+import apis
+
class NsPanelLovelaceUIManager(hass.Hass):
def initialize(self):
self.log('Starting')
- mqtt_api = self._mqtt_api = self.get_plugin_api("MQTT")
+ apis.ha_api = self
+ apis.mqtt_api = self.get_plugin_api("MQTT")
+
cfg = self._cfg = LuiBackendConfig(self, self.args["config"])
topic_send = cfg.get("panelSendTopic")
- mqttsend = LuiMqttSender(self, mqtt_api, topic_send)
+ topic_recv = cfg.get("panelRecvTopic")
+
+ mqttsend = LuiMqttSender(self, topic_send)
# Request Tasmota Driver Version
- mqtt_api.mqtt_publish(topic_send.replace("CustomSend", "GetDriverVersion"), "x")
+ apis.mqtt_api.mqtt_publish(topic_send.replace("CustomSend", "GetDriverVersion"), "x")
controller = LuiController(cfg, mqttsend.send_mqtt_msg)
+ desired_tasmota_driver_version = 8
desired_display_firmware_version = 46
version = "v3.7.0"
model = cfg.get("model")
- if model == "us-l":
- # us landscape version
- desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-us-l-{version}.tft"
- elif model == "us-p":
- # us portrait version
- desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-us-p-{version}.tft"
- else:
- # eu version
- desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-{version}.tft"
-
- desired_tasmota_driver_version = 8
+ match model:
+ case "us-l":
+ desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-us-l-{version}.tft"
+ case "us-p":
+ desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-us-p-{version}.tft"
+ case _:
+ desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-{version}.tft"
desired_tasmota_driver_url = "https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be"
-
+
mode = cfg.get("updateMode")
- topic_send = cfg.get("panelSendTopic")
updater = Updater(self.log, mqttsend.send_mqtt_msg, topic_send, mode, desired_display_firmware_version, model, desired_display_firmware_url, desired_tasmota_driver_version, desired_tasmota_driver_url)
- topic_recv = cfg.get("panelRecvTopic")
- LuiMqttListener(mqtt_api, topic_recv, controller, updater)
+ LuiMqttListener(topic_recv, controller, updater)
self.log('Started')
diff --git a/docs/subpages.md b/docs/subpages.md
index 452099bd..0db867cc 100644
--- a/docs/subpages.md
+++ b/docs/subpages.md
@@ -1,9 +1,9 @@
# 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.
+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 previous page.
```yaml
- - entity: navigate.cardGrid_testKey
+ - entity: navigate.testKey
```
will allow you to navigate to a cardGrid page with the configured key testKey
@@ -22,6 +22,6 @@ will allow you to navigate to a cardGrid page with the configured key testKey
You can override the status of navigation items, to make them look like different entities.
```yaml
- - entity: navigate.cardThermo_test
+ - entity: navigate.test
status: climate.test
```