change default delimiter from , to ~

This commit is contained in:
joBr99
2022-04-01 16:57:51 +02:00
parent 4fe0d11ec9
commit f45e99eb2c
4 changed files with 98 additions and 98 deletions

View File

@@ -1,7 +1,7 @@
# NSPanel Lovelance UI # NSPanel Lovelance UI
The general idea is that the Nextion Display cycles though a page counter and the esp32 tells the display what to do. The general idea is that the Nextion Display cycles though a page counter and the esp32 tells the display what to do.
If you are changeing the page the nextion display will send and event to the esp32 and it has to answer with the messages, that will update the current page with it's desired components. This enables easy changes, without touching the HMI Project. If you are changeing the page the nextion display will send and event to the esp32 and it has to answer with the messages~ that will update the current page with it's desired components. This enables easy changes~ without touching the HMI Project.
# Message Flow # Message Flow
@@ -25,7 +25,7 @@ This protocol does not try to implement broken JSON Commands with a specified ty
Instead the commands are plain text commands with parameters. Instead the commands are plain text commands with parameters.
## Example for valid Message ## 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) 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 55 BB 04 00 31 33 33 37 5F 5B
``` ```
@@ -39,176 +39,176 @@ wake screen:
set brightness of screensaver: set brightness of screensaver:
`dimmode,0 - (screen off)` `dimmode~0 - (screen off)`
`dimmode,100 - (screen on with full brightness)` `dimmode~100 - (screen on with full brightness)`
set current time: set current time:
`time,22 : 26` `time~22 : 26`
set current date: set current date:
`date,?Di 24. Februar` `date~?Di 24. Februar`
set screensaver timeout (set time in sec, max 65): set screensaver timeout (set time in sec~ max 65):
`timeout,15 - timeout after 15 seconds` `timeout~15 - timeout after 15 seconds`
`timeout,0 - disable screensaver` `timeout~0 - disable screensaver`
change the page type: change the page type:
`pageType,pageStartup` `pageType~pageStartup`
`pageType,cardEntities` `pageType~cardEntities`
`pageType,cardThermo` `pageType~cardThermo`
`pageType,cardMedia` `pageType~cardMedia`
`pageType,popupLight,Schreibtischlampe,light.schreibtischlampe` `pageType~popupLight~Schreibtischlampe~light.schreibtischlampe`
`pageType,popupNotify` `pageType~popupNotify`
`pageType,screensaver` `pageType~screensaver`
### screensaver page ### screensaver page
`weatherUpdate,? tMainIcon? tMainText? tMRIcon? tMR? tForecast1? tF1Icon? tForecast1Val? tForecast2? tF2Icon? tForecast2Val?tForecast3? tF3Icon? tForecast3Val?tForecast4? tF4Icon? tForecast4Val?optionalLayoutIcon?optionalLayoutText` `weatherUpdate~? tMainIcon? tMainText? tMRIcon? tMR? tForecast1? tF1Icon? tForecast1Val? tForecast2? tF2Icon? tForecast2Val?tForecast3? tF3Icon? tForecast3Val?tForecast4? tF4Icon? tForecast4Val?optionalLayoutIcon?optionalLayoutText`
### cardEntities Page ### cardEntities Page
The following message can be used to update the content on the cardEntities Page The following message can be used to update the content on the cardEntities Page
`entityUpd,heading,navigation,[,*type*,*internalNameEntity*,*iconId*,*iconColor*,*displayNameEntity*,*optionalValue*]x4` `entityUpd~heading~navigation~[~*type*~*internalNameEntity*~*iconId*~*iconColor*~*displayNameEntity*~*optionalValue*]x4`
`,light,light.entityName,1,17299,Light1,0` `~light~light.entityName~1~17299~Light1~0`
`,shutter,cover.entityName,0,17299,Shutter2,` `~shutter~cover.entityName~0~17299~Shutter2~`
`,delete,,,,,` `~delete~~~~~`
`,text,sensor.entityName,3,17299,Temperature,content` `~text~sensor.entityName~3~17299~Temperature~content`
`,button,button.entityName,3,17299,bt-name,bt-text` `~button~button.entityName~3~17299~bt-name~bt-text`
`,switch,switch.entityName,4,17299,Switch1,0` `~switch~switch.entityName~4~17299~Switch1~0`
### popupLight Page ### popupLight Page
`entityUpdateDetail,*iconId*,*iconColor*,*buttonState*,*sliderBrightnessPos*,*sliderColorTempPos*,*colorMode*` `entityUpdateDetail~*iconId*~*iconColor*~*buttonState*~*sliderBrightnessPos*~*sliderColorTempPos*~*colorMode*`
`entityUpdateDetail,1,17299,1,100,78,enable` `entityUpdateDetail~1~17299~1~100~78~enable`
`entityUpdateDetail,1,17299,1,100,disable` `entityUpdateDetail~1~17299~1~100~disable`
### popupShutter Page ### popupShutter Page
`entityUpdateDetail,*ignored*,*sliderPos*` `entityUpdateDetail~*ignored*~*sliderPos*`
`entityUpdateDetail,1,77` `entityUpdateDetail~1~77`
### popupNotify Page ### popupNotify Page
`entityUpdateDetail,*internalName*,*tHeading*,*tHeadingColor*,*b1*,*tB1Color*,*b2*,*tB2Color*,*tText*,*tTextColor*,*sleepTimeout*` `entityUpdateDetail~*internalName*~*tHeading*~*tHeadingColor*~*b1*~*tB1Color*~*b2*~*tB2Color*~*tText*~*tTextColor*~*sleepTimeout*`
`exitPopup` `exitPopup`
### cardThermo Page ### cardThermo Page
`entityUpd,*heading*,*navigation*,*internalNameEntiy*,*currentTemp*,*destTemp*,*status*,*minTemp*,*maxTemp*,*stepTemp*[[,*iconId*,*activeColor*,*state*,*hvac_action*]]` `entityUpd~*heading*~*navigation*~*internalNameEntiy*~*currentTemp*~*destTemp*~*status*~*minTemp*~*maxTemp*~*stepTemp*[[~*iconId*~*activeColor*~*state*~*hvac_action*]]`
`[[]]` are not part of the command, this part repeats 9 times for the buttons `[[]]` are not part of the command~ this part repeats 9 times for the buttons
### cardMedia Page ### cardMedia Page
`entityUpd,|*heading*|*navigation*|*internalNameEntiy*|*icon*|*title*|*author*|*volume*|*playpauseicon*|currentSpeaker|speakerList-seperated-by-?` `entityUpd~|*heading*|*navigation*|*internalNameEntiy*|*icon*|*title*|*author*|*volume*|*playpauseicon*|currentSpeaker|speakerList-seperated-by-?`
### cardAlarm Page ### cardAlarm Page
`entityUpd,*internalNameEntity*,*navigation*,*arm1*,*arm1ActionName*,*arm2*,*arm2ActionName*,*arm3*,*arm3ActionName*,*arm4*,*arm4ActionName*,*icon*,*iconcolor*,*numpadStatus*,*flashing*` `entityUpd~*internalNameEntity*~*navigation*~*arm1*~*arm1ActionName*~*arm2*~*arm2ActionName*~*arm3*~*arm3ActionName*~*arm4*~*arm4ActionName*~*icon*~*iconcolor*~*numpadStatus*~*flashing*`
## Messages from Nextion Display ## Messages from Nextion Display
`event,buttonPress2,pageName,bNext` `event~buttonPress2~pageName~bNext`
`event,buttonPress2,pageName,bPrev` `event~buttonPress2~pageName~bPrev`
`event,buttonPress2,pageName,bExit,number_of_taps` `event~buttonPress2~pageName~bExit~number_of_taps`
`event,buttonPress2,pageName,sleepReached` `event~buttonPress2~pageName~sleepReached`
### startup page ### startup page
`event,startup,version,model` `event~startup~version~model`
### screensaver page ### screensaver page
`event,buttonPress2,screensaver,exit` - Touch Event on Screensaver `event~buttonPress2~screensaver~exit` - Touch Event on Screensaver
`event,screensaverOpen` - Screensaver has opened `event~screensaverOpen` - Screensaver has opened
### cardEntities Page ### cardEntities Page
`event,*eventName*,*entityName*,*actionName*,*optionalValue*` `event~*eventName*~*entityName*~*actionName*~*optionalValue*`
`event,buttonPress2,internalNameEntity,up` `event~buttonPress2~internalNameEntity~up`
`event,buttonPress2,internalNameEntity,down` `event~buttonPress2~internalNameEntity~down`
`event,buttonPress2,internalNameEntity,stop` `event~buttonPress2~internalNameEntity~stop`
`event,buttonPress2,internalNameEntity,OnOff,1` `event~buttonPress2~internalNameEntity~OnOff~1`
`event,buttonPress2,internalNameEntity,button` `event~buttonPress2~internalNameEntity~button`
### popupLight Page ### popupLight Page
`event,pageOpenDetail,popupLight,internalNameEntity` `event~pageOpenDetail~popupLight~internalNameEntity`
`event,buttonPress2,internalNameEntity,OnOff,1` `event~buttonPress2~internalNameEntity~OnOff~1`
`event,buttonPress2,internalNameEntity,brightnessSlider,50` `event~buttonPress2~internalNameEntity~brightnessSlider~50`
`event,buttonPress2,internalNameEntity,colorTempSlider,50` `event~buttonPress2~internalNameEntity~colorTempSlider~50`
`event,buttonPress2,internalNameEntity,colorWheel,x|y` `event~buttonPress2~internalNameEntity~colorWheel~x|y`
### popupShutter Page ### popupShutter Page
`event,pageOpenDetail,popupShutter,internalNameEntity` `event~pageOpenDetail~popupShutter~internalNameEntity`
`event,buttonPress2,internalNameEntity,positionSlider,50` `event~buttonPress2~internalNameEntity~positionSlider~50`
### popupNotify Page ### popupNotify Page
`event,buttonPress2,*internalName*,notifyAction,yes` `event~buttonPress2~*internalName*~notifyAction~yes`
`event,buttonPress2,*internalName*,notifyAction,no` `event~buttonPress2~*internalName*~notifyAction~no`
### cardThermo Page ### cardThermo Page
`event,buttonPress2,*entityName*,tempUpd,*temperature*` `event~buttonPress2~*entityName*~tempUpd~*temperature*`
`event,buttonPress2,*entityName*,hvac_action,*hvac_action*` `event~buttonPress2~*entityName*~hvac_action~*hvac_action*`
### cardMedia Page ### cardMedia Page
`event,buttonPress2,internalNameEntity,media-back` `event~buttonPress2~internalNameEntity~media-back`
`event,buttonPress2,internalNameEntity,media-pause` `event~buttonPress2~internalNameEntity~media-pause`
`event,buttonPress2,internalNameEntity,media-next` `event~buttonPress2~internalNameEntity~media-next`
`event,buttonPress2,internalNameEntity,volumeSlider,75` `event~buttonPress2~internalNameEntity~volumeSlider~75`
### cardAlarm Page ### cardAlarm Page
`event,buttonPress2,internalNameEntity,actionName,code` `event~buttonPress2~internalNameEntity~actionName~code`
# Icons IDs # Icons IDs
@@ -218,7 +218,7 @@ Please see Icon's int the [icons.md file](icons.md)
# Design Guidelines for Nextion HMI Project # Design Guidelines for Nextion HMI Project
Background Color is Background Color is
- RGB565: 6371 [18e3] (HEX: #1C1C1C, RGB: 28,28,28) - RGB565: 6371 [18e3] (HEX: #1C1C1C~ RGB: 28~28~28)
Source for Icons is the Material Design Font, used by HASPone Source for Icons is the Material Design Font~ used by HASPone
https://github.com/HASwitchPlate/HASPone https://github.com/HASwitchPlate/HASPone

Binary file not shown.

Binary file not shown.

View File

@@ -40,7 +40,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"))
self._send_mqtt_msg(f"time,{time}") self._send_mqtt_msg(f"time~{time}")
def update_date(self, kwargs): def update_date(self, kwargs):
global babel_spec global babel_spec
@@ -50,10 +50,10 @@ class LuiPagesGen(object):
else: else:
dateformat = self._config.get("dateFormat") dateformat = self._config.get("dateFormat")
date = datetime.datetime.now().strftime(dateformat) date = datetime.datetime.now().strftime(dateformat)
self._send_mqtt_msg(f"date,?{date}") self._send_mqtt_msg(f"date~?{date}")
def page_type(self, target_page): def page_type(self, target_page):
self._send_mqtt_msg(f"pageType,{target_page}") self._send_mqtt_msg(f"pageType~{target_page}")
def generate_screensaver_page(self): def generate_screensaver_page(self):
self.page_type("screensaver") self.page_type("screensaver")
@@ -100,7 +100,7 @@ class LuiPagesGen(object):
down = f"{entity.state} {unit_of_measurement}" down = f"{entity.state} {unit_of_measurement}"
weather_res+=f"?{up}?{icon}?{down}" weather_res+=f"?{up}?{icon}?{down}"
self._send_mqtt_msg(f"weatherUpdate,?{icon_cur}?{text_cur}{weather_res}") self._send_mqtt_msg(f"weatherUpdate~?{icon_cur}?{text_cur}{weather_res}")
def generate_entities_item(self, item): def generate_entities_item(self, item):
icon = None icon = None
@@ -114,7 +114,7 @@ class LuiPagesGen(object):
LOGGER.debug(f"Generating item command for {item} with type {item_type}",) LOGGER.debug(f"Generating item command for {item} with type {item_type}",)
# Internal Entities # Internal Entities
if item_type == "delete": if item_type == "delete":
return f",{item_type},,,,," return f"~{item_type}~~~~~"
if item_type == "navigate": if item_type == "navigate":
page_search = self._config.get_root_page().search_page_by_name(item) page_search = self._config.get_root_page().search_page_by_name(item)
if len(page_search) > 0: if len(page_search) > 0:
@@ -123,56 +123,56 @@ class LuiPagesGen(object):
name = page_data.get("heading") name = page_data.get("heading")
text = get_translation(self._locale,"PRESS") text = get_translation(self._locale,"PRESS")
icon_id = get_icon_id(icon) if icon is not None else get_icon_id(page_data.get("icon", "gesture-tap-button")) icon_id = get_icon_id(icon) if icon is not None else get_icon_id(page_data.get("icon", "gesture-tap-button"))
return f",button,{item},{icon_id},17299,{name},{text}" return f"~button~{item}~{icon_id}~17299~{name}~{text}"
else: else:
return f",text,{item},{get_icon_id('alert-circle-outline')},17299,page not found," return f"~text~{item}~{get_icon_id('alert-circle-outline')}~17299~page not found~"
if not self._ha_api.entity_exists(item): if not self._ha_api.entity_exists(item):
return f",text,{item},{get_icon_id('alert-circle-outline')},17299,Not found check, apps.yaml" return f"~text~{item}~{get_icon_id('alert-circle-outline')}~17299~Not found check~ apps.yaml"
# HA Entities # HA Entities
entity = self._ha_api.get_entity(item) entity = self._ha_api.get_entity(item)
name = name if name is not None else entity.attributes.friendly_name name = name if name is not None else entity.attributes.friendly_name
if item_type == "cover": if item_type == "cover":
icon_id = get_icon_id_ha("cover", state=entity.state, overwrite=icon) icon_id = get_icon_id_ha("cover", state=entity.state, overwrite=icon)
return f",shutter,{item},{icon_id},17299,{name}," return f"~shutter~{item}~{icon_id}~17299~{name}~"
if item_type in "light": if item_type in "light":
switch_val = 1 if entity.state == "on" else 0 switch_val = 1 if entity.state == "on" else 0
icon_color = self.get_entity_color(entity) icon_color = self.get_entity_color(entity)
icon_id = get_icon_id_ha("light", overwrite=icon) icon_id = get_icon_id_ha("light", overwrite=icon)
return f",{item_type},{item},{icon_id},{icon_color},{name},{switch_val}" return f"~{item_type}~{item}~{icon_id}~{icon_color}~{name}~{switch_val}"
if item_type in ["switch", "input_boolean"]: if item_type in ["switch", "input_boolean"]:
switch_val = 1 if entity.state == "on" else 0 switch_val = 1 if entity.state == "on" else 0
icon_color = self.get_entity_color(entity) icon_color = self.get_entity_color(entity)
icon_id = get_icon_id_ha(item_type, state=entity.state, overwrite=icon) icon_id = get_icon_id_ha(item_type, state=entity.state, overwrite=icon)
return f",switch,{item},{icon_id},{icon_color},{name},{switch_val}" return f"~switch~{item}~{icon_id}~{icon_color}~{name}~{switch_val}"
if item_type in ["sensor", "binary_sensor"]: if item_type in ["sensor", "binary_sensor"]:
device_class = entity.attributes.get("device_class", "") device_class = entity.attributes.get("device_class", "")
icon_id = get_icon_id_ha("sensor", state=entity.state, device_class=device_class, overwrite=icon) icon_id = get_icon_id_ha("sensor", state=entity.state, device_class=device_class, overwrite=icon)
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
icon_color = self.get_entity_color(entity) icon_color = self.get_entity_color(entity)
return f",text,{item},{icon_id},{icon_color},{name},{value}" return f"~text~{item}~{icon_id}~{icon_color}~{name}~{value}"
if item_type in ["button", "input_button"]: if item_type in ["button", "input_button"]:
icon_id = get_icon_id_ha("button", overwrite=icon) icon_id = get_icon_id_ha("button", overwrite=icon)
text = get_translation(self._locale,"PRESS") text = get_translation(self._locale,"PRESS")
return f",button,{item},{icon_id},17299,{name},{text}" return f"~button~{item}~{icon_id}~17299~{name}~{text}"
if item_type == "scene": if item_type == "scene":
icon_id = get_icon_id_ha("scene", overwrite=icon) icon_id = get_icon_id_ha("scene", overwrite=icon)
text = get_translation(self._locale,"ACTIVATE") text = get_translation(self._locale,"ACTIVATE")
return f",button,{item},{icon_id},17299,{name},{text}" return f"~button~{item}~{icon_id}~17299~{name}~{text}"
if item_type == "script": if item_type == "script":
icon_id = get_icon_id_ha("script", overwrite=icon) icon_id = get_icon_id_ha("script", overwrite=icon)
text = get_translation(self._locale,"run") text = get_translation(self._locale,"run")
return f",button,{item},{icon_id},17299,{name},{text}" return f"~button~{item}~{icon_id}~17299~{name}~{text}"
if item_type == "number": if item_type == "number":
icon_id = get_icon_id_ha("number", overwrite=icon) icon_id = get_icon_id_ha("number", overwrite=icon)
min_v = entity.attributes.get("min", 0) min_v = entity.attributes.get("min", 0)
max_v = entity.attributes.get("max", 100) max_v = entity.attributes.get("max", 100)
return f",number,{item},{icon_id},17299,{name},{entity.state}|{min_v}|{max_v}" return f"~number~{item}~{icon_id}~17299~{name}~{entity.state}|{min_v}|{max_v}"
def generate_entities_page(self, heading, items): def generate_entities_page(self, heading, items):
navigation = "" navigation = ""
command = f"entityUpd,{heading},{navigation}" command = f"entityUpd~{heading}~{navigation}"
# Get items and construct cmd string # Get items and construct cmd string
for item in items: for item in items:
command += self.generate_entities_item(item) command += self.generate_entities_item(item)
@@ -182,7 +182,7 @@ class LuiPagesGen(object):
def generate_thermo_page(self, item): def generate_thermo_page(self, item):
if not self._ha_api.entity_exists(item): if not self._ha_api.entity_exists(item):
command = f"entityUpd,{item},Not found,220,220,Not found,150,300,5" command = f"entityUpd~{item}~Not found~220~220~Not found~150~300~5"
else: else:
entity = self._ha_api.get_entity(item) entity = self._ha_api.get_entity(item)
heading = entity.attributes.friendly_name heading = entity.attributes.friendly_name
@@ -219,27 +219,27 @@ class LuiPagesGen(object):
state = 0 state = 0
if(mode == entity.state): if(mode == entity.state):
state = 1 state = 1
icon_res += f",{icon_id},{color_on},{state},{mode}" icon_res += f"~{icon_id}~{color_on}~{state}~{mode}"
len_hvac_modes = len(hvac_modes) len_hvac_modes = len(hvac_modes)
if len_hvac_modes%2 == 0: if len_hvac_modes%2 == 0:
# even # even
padding_len = int((4-len_hvac_modes)/2) padding_len = int((4-len_hvac_modes)/2)
icon_res = ","*4*padding_len + icon_res + ","*4*padding_len icon_res = "~"*4*padding_len + icon_res + "~"*4*padding_len
# use last 4 icons # use last 4 icons
icon_res = ","*4*5 + icon_res icon_res = "~"*4*5 + icon_res
else: else:
# uneven # uneven
padding_len = int((5-len_hvac_modes)/2) padding_len = int((5-len_hvac_modes)/2)
icon_res = ","*4*padding_len + icon_res + ","*4*padding_len icon_res = "~"*4*padding_len + icon_res + "~"*4*padding_len
# use first 5 icons # use first 5 icons
icon_res = icon_res + ","*4*4 icon_res = icon_res + "~"*4*4
command = f"entityUpd,{heading},,{item},{current_temp},{dest_temp},{status},{min_temp},{max_temp},{step_temp}{icon_res}" command = f"entityUpd~{heading}~~{item}~{current_temp}~{dest_temp}~{status}~{min_temp}~{max_temp}~{step_temp}{icon_res}"
self._send_mqtt_msg(command) self._send_mqtt_msg(command)
def generate_media_page(self, item): def generate_media_page(self, item):
if not self._ha_api.entity_exists(item): if not self._ha_api.entity_exists(item):
command = f"entityUpd,|{item}|Not found|{get_icon_id('alert-circle-outline')}|Please check your|apps.yaml in AppDaemon|50|{get_icon_id('alert-circle-outline')}" command = f"entityUpd~|{item}|Not found|{get_icon_id('alert-circle-outline')}|Please check your|apps.yaml in AppDaemon|50|{get_icon_id('alert-circle-outline')}"
else: else:
entity = self._ha_api.get_entity(item) entity = self._ha_api.get_entity(item)
heading = entity.attributes.friendly_name heading = entity.attributes.friendly_name
@@ -267,12 +267,12 @@ class LuiPagesGen(object):
onoffbutton = 1374 onoffbutton = 1374
else: else:
onoffbutton = rgb_dec565([255,255,255]) onoffbutton = rgb_dec565([255,255,255])
command = f"entityUpd,|{heading}||{item}|{icon}|{title}|{author}|{volume}|{iconplaypause}|{source}|{speakerlist[:200]}|{onoffbutton}" command = f"entityUpd~|{heading}||{item}|{icon}|{title}|{author}|{volume}|{iconplaypause}|{source}|{speakerlist[:200]}|{onoffbutton}"
self._send_mqtt_msg(command) self._send_mqtt_msg(command)
def generate_alarm_page(self, item): def generate_alarm_page(self, item):
if not self._ha_api.entity_exists(item): if not self._ha_api.entity_exists(item):
command = f"entityUpd,{item},Not found,Not found,Check your,Check your,apps.,apps.,yaml,yaml,0,,0" command = f"entityUpd~{item}~Not found~Not found~Check your~Check your~apps.~apps.~yaml~yaml~0~~0"
else: else:
entity = self._ha_api.get_entity(item) entity = self._ha_api.get_entity(item)
icon = get_icon_id("shield-off") icon = get_icon_id("shield-off")
@@ -323,11 +323,11 @@ class LuiPagesGen(object):
# add padding to arm buttons # add padding to arm buttons
arm_buttons = "" arm_buttons = ""
for b in supported_modes: for b in supported_modes:
arm_buttons += f",{get_translation(self._locale, b)},{b}" arm_buttons += f"~{get_translation(self._locale, b)}~{b}"
if len(supported_modes) < 4: if len(supported_modes) < 4:
arm_buttons += ","*((4-len(supported_modes))*2) arm_buttons += "~"*((4-len(supported_modes))*2)
navigation = "" navigation = ""
command = f"entityUpd,{item},{navigation}{arm_buttons},{icon},{color},{numpad},{flashing}" command = f"entityUpd~{item}~{navigation}{arm_buttons}~{icon}~{color}~{numpad}~{flashing}"
self._send_mqtt_msg(command) self._send_mqtt_msg(command)
def render_page(self, page, send_page_type=True): def render_page(self, page, send_page_type=True):
@@ -375,7 +375,7 @@ class LuiPagesGen(object):
color = "enable" color = "enable"
else: else:
color = "disable" color = "disable"
self._send_mqtt_msg(f"entityUpdateDetail,{get_icon_id('lightbulb')},{icon_color},{switch_val},{brightness},{color_temp},{color}") self._send_mqtt_msg(f"entityUpdateDetail~{get_icon_id('lightbulb')}~{icon_color}~{switch_val}~{brightness}~{color_temp}~{color}")
def generate_shutter_detail_page(self, entity): def generate_shutter_detail_page(self, entity):
entity = self._ha_api.get_entity(entity) entity = self._ha_api.get_entity(entity)
@@ -383,5 +383,5 @@ class LuiPagesGen(object):
self._send_mqtt_msg(f"entityUpdateDetail,{pos}") self._send_mqtt_msg(f"entityUpdateDetail,{pos}")
def send_message_page(self, id, heading, msg, b1, b2): def send_message_page(self, id, heading, msg, b1, b2):
self._send_mqtt_msg(f"pageType,popupNotify") self._send_mqtt_msg(f"pageType~popupNotify")
self._send_mqtt_msg(f"entityUpdateDetail,|{id}|{heading}|65535|{b1}|65535|{b2}|65535|{msg}|65535|0") self._send_mqtt_msg(f"entityUpdateDetail~|{id}|{heading}|65535|{b1}|65535|{b2}|65535|{msg}|65535|0")