diff --git a/HMI/README.md b/HMI/README.md index 8ceee328..7950e59f 100644 --- a/HMI/README.md +++ b/HMI/README.md @@ -1868,12 +1868,14 @@ Example: `entityUpd~Guest Wifi~button~navigate.prev~<~65535~~~button~navigate.ne -### cardPower (in development) +### cardPower + +```entityUpd~LightTest~button~navigate.prev~<~65535~~~button~navigate.next~>~65535~~~17299~C~1~100 W~17299~D~0~100 W~17299~E~3~3499.5 kWh~17299~F~-1~3499.5 kWh~17299~G~-2~3499.5 kWh~17299~H~-3~3499.5 kWh~17299~G~1~3499.5 kWh~17299~H~1~100 W``` - + @@ -1965,153 +1967,178 @@ Example: `entityUpd~Guest Wifi~button~navigate.prev~<~65535~~~button~navigate.ne - - - + + + - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/HMI/code_gen/pages/cardPower.py b/HMI/code_gen/pages/cardPower.py index d917e174..7adf81ed 100644 --- a/HMI/code_gen/pages/cardPower.py +++ b/HMI/code_gen/pages/cardPower.py @@ -6,15 +6,25 @@ head = sharedhead + """ spstr strCommand.txt,tHeading.txt,"~",1 """ + navigation + """ // icon color home - spstr strCommand.txt,tTmp.txt,"~",14 - covx tTmp.txt,t1.pco,0,0 - // icon home - spstr strCommand.txt,t1.txt,"~",15 - // text home - spstr strCommand.txt,tHome.txt,"~",16 + spstr strCommand.txt,tTmp.txt,"~",14 + covx tTmp.txt,t1.pco,0,0 + // icon home + spstr strCommand.txt,t1.txt,"~",15 + // speed 16 ignored + // text home + spstr strCommand.txt,tHome.txt,"~",17 + spstr tHome.txt,tHome2.txt," ",1 + spstr tHome.txt,tHome.txt," ",0 + // icon color 18 ignored + // icon 19 ignored + // speed 20 ignored + // text home + spstr strCommand.txt,tHomeO.txt,"~",21 + spstr tHomeO.txt,tHomeO2.txt," ",1 + spstr tHomeO.txt,tHomeO.txt," ",0 """ print(head) -start = 17 +start = 22 for i in range(0,6): idxstart = start + (i)*4 item = f""" diff --git a/HMI/nspanel.HMI b/HMI/nspanel.HMI index d808e980..07320188 100644 Binary files a/HMI/nspanel.HMI and b/HMI/nspanel.HMI differ diff --git a/HMI/nspanel.tft b/HMI/nspanel.tft index cad3ec5e..95f461a8 100644 Binary files a/HMI/nspanel.tft and b/HMI/nspanel.tft differ diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 45ad7fa1..55009fb1 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -630,19 +630,16 @@ class LuiPagesGen(object): def generate_power_page(self, navigation, heading, items): command = f"entityUpd~{heading}~{navigation}" - for idx, item in enumerate(items): + for item in items: entity = apis.ha_api.get_entity(item.entityId) icon_color = self.get_entity_color(entity, overwrite=item.colorOverride) - device_class = entity.attributes.get("device_class", "") icon = get_icon_ha(item.entityId, overwrite=item.iconOverride) speed = 0 if float(entity.state) > 0: - speed = item.entity_input_config.get("speed", 1) - apis.ha_api.log(f"{item.data}") - if idx == 0: - command += f"~{icon_color}~{icon}~{entity.state}" - else: - command += f"~{icon_color}~{icon}~{speed}~{entity.state}" + speed = str(item.entity_input_config.get("speed", 1)) + speed = apis.ha_api.render_template(speed) + unit = get_attr_safe(entity, "unit_of_measurement", "") + command += f"~{icon_color}~{icon}~{speed}~{entity.state} {unit}" self._send_mqtt_msg(command) def render_card(self, card, send_page_type=True):
Parameter   NumberParameter Number Category Location Type
14cardPower specificHome Icon MiddlecardPower specificHome Icon / Value below Home IconPower Entity Definition iconColor
15 icon
16speedignored
17 text
1718Value above Home IconPower Entity DefinitioniconColorignored
19iconignored
20speedignored
21text
22 1st Item Upper Left Power Entity Definition iconColor
1823 icon
1924 speed numbers (-2,-1,0,1,2)
2025 text
2126 2nd Item Middle Left Power Entity Definition iconColor
2227 icon
2328 speed numbers (-2,-1,0,1,2)
2429 text
2530 3rd Item Bottom Left Power Entity Definition iconColor
2631 icon
2732 speed numbers (-2,-1,0,1,2)
2833 text
2934 4th Item Upper Right Power Entity Definition iconColor
3035 icon
3136 speed numbers (-2,-1,0,1,2)
3237 text
3338 5thItem Middle Right Power Entity Definition iconColor
3439 icon
3540 speed numbers (-2,-1,0,1,2)
3641 text
3742 6th Item Bottom Right Power Entity Definition iconColor
3843 icon
3944 speed numbers (-2,-1,0,1,2)
4045 text