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```
- | Parameter Number |
+ Parameter Number |
Category |
Location |
Type |
@@ -1965,153 +1967,178 @@ Example: `entityUpd~Guest Wifi~button~navigate.prev~<~65535~~~button~navigate.ne
| 14 |
- cardPower specific |
- Home Icon Middle |
- |
+ cardPower specific |
+ Home Icon / Value below Home Icon |
+ Power Entity Definition |
iconColor |
|
| 15 |
- |
icon |
|
| 16 |
- |
+ speed |
+ ignored |
+
+
+ | 17 |
text |
|
- | 17 |
+ 18 |
+ Value above Home Icon |
+ Power Entity Definition |
+ iconColor |
+ ignored |
+
+
+ | 19 |
+ icon |
+ ignored |
+
+
+ | 20 |
+ speed |
+ ignored |
+
+
+ | 21 |
+ text |
+ |
+
+
+ | 22 |
1st Item Upper Left |
Power Entity Definition |
iconColor |
|
- | 18 |
+ 23 |
icon |
|
- | 19 |
+ 24 |
speed |
numbers (-2,-1,0,1,2) |
- | 20 |
+ 25 |
text |
|
- | 21 |
+ 26 |
2nd Item Middle Left |
Power Entity Definition |
iconColor |
|
- | 22 |
+ 27 |
icon |
|
- | 23 |
+ 28 |
speed |
numbers (-2,-1,0,1,2) |
- | 24 |
+ 29 |
text |
|
- | 25 |
+ 30 |
3rd Item Bottom Left |
Power Entity Definition |
iconColor |
|
- | 26 |
+ 31 |
icon |
|
- | 27 |
+ 32 |
speed |
numbers (-2,-1,0,1,2) |
- | 28 |
+ 33 |
text |
|
- | 29 |
+ 34 |
4th Item Upper Right |
Power Entity Definition |
iconColor |
|
- | 30 |
+ 35 |
icon |
|
- | 31 |
+ 36 |
speed |
numbers (-2,-1,0,1,2) |
- | 32 |
+ 37 |
text |
|
- | 33 |
+ 38 |
5thItem Middle Right |
Power Entity Definition |
iconColor |
|
- | 34 |
+ 39 |
icon |
|
- | 35 |
+ 40 |
speed |
numbers (-2,-1,0,1,2) |
- | 36 |
+ 41 |
text |
|
- | 37 |
+ 42 |
6th Item Bottom Right |
Power Entity Definition |
iconColor |
|
- | 38 |
+ 43 |
icon |
|
- | 39 |
+ 44 |
speed |
numbers (-2,-1,0,1,2) |
- | 40 |
+ 45 |
text |
|
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):