diff --git a/HMI/US/portrait/n2t-out-visual/pageIcons.txt b/HMI/US/portrait/n2t-out-visual/pageIcons.txt index 90aaf938..40ece9c0 100644 --- a/HMI/US/portrait/n2t-out-visual/pageIcons.txt +++ b/HMI/US/portrait/n2t-out-visual/pageIcons.txt @@ -57,7 +57,7 @@ Text tTmp1 Vertical Alignment : center Input Type : character Text : - Max. Text Size : 50 + Max. Text Size : 80 Word wrap : disabled Horizontal Spacing : 0 Vertical Spacing : 0 @@ -87,7 +87,7 @@ Text tTmp2 Vertical Alignment : center Input Type : character Text : - Max. Text Size : 50 + Max. Text Size : 80 Word wrap : disabled Horizontal Spacing : 0 Vertical Spacing : 0 diff --git a/HMI/US/portrait/n2t-out-visual/popupLight.txt b/HMI/US/portrait/n2t-out-visual/popupLight.txt index 2f6f60a6..ecf9a820 100644 --- a/HMI/US/portrait/n2t-out-visual/popupLight.txt +++ b/HMI/US/portrait/n2t-out-visual/popupLight.txt @@ -69,8 +69,8 @@ Variable (string) entn Attributes ID : 21 Scope : local - Text : newtxt - Max. Text Size: 50 + Text : + Max. Text Size: 80 Variable (int32) mode Attributes diff --git a/HMI/US/portrait/n2t-out-visual/popupShutter.txt b/HMI/US/portrait/n2t-out-visual/popupShutter.txt index 56924e11..b867b493 100644 --- a/HMI/US/portrait/n2t-out-visual/popupShutter.txt +++ b/HMI/US/portrait/n2t-out-visual/popupShutter.txt @@ -56,8 +56,8 @@ Variable (string) entn Attributes ID : 18 Scope : local - Text : newtxt - Max. Text Size: 50 + Text : + Max. Text Size: 80 Text tEntity Attributes @@ -322,7 +322,7 @@ Slider hPosition btlen tSend.txt,sys0 crcrest 1,0xffff // reset CRC crcputh 55 bb - crcputs sys0,1 + crcputs sys0,2 crcputs tSend.txt,0 //send cmd printh 55 bb diff --git a/HMI/US/portrait/n2t-out/pageIcons.txt b/HMI/US/portrait/n2t-out/pageIcons.txt index e5066db4..f6b260cf 100644 --- a/HMI/US/portrait/n2t-out/pageIcons.txt +++ b/HMI/US/portrait/n2t-out/pageIcons.txt @@ -30,7 +30,7 @@ Text tTmp1 Send Component ID : disabled Associated Keyboard : none Text : - Max. Text Size : 50 + Max. Text Size : 80 Text tTmp2 Attributes @@ -40,7 +40,7 @@ Text tTmp2 Send Component ID : disabled Associated Keyboard : none Text : - Max. Text Size : 50 + Max. Text Size : 80 Picture p0 Attributes diff --git a/HMI/US/portrait/n2t-out/popupLight.txt b/HMI/US/portrait/n2t-out/popupLight.txt index 06dba784..9cd4e3cd 100644 --- a/HMI/US/portrait/n2t-out/popupLight.txt +++ b/HMI/US/portrait/n2t-out/popupLight.txt @@ -59,8 +59,8 @@ Variable (string) strCommand Variable (string) entn Attributes Scope : local - Text : newtxt - Max. Text Size: 50 + Text : + Max. Text Size: 80 Variable (int32) mode Attributes diff --git a/HMI/US/portrait/n2t-out/popupShutter.txt b/HMI/US/portrait/n2t-out/popupShutter.txt index 2a5bf808..4d5aff2b 100644 --- a/HMI/US/portrait/n2t-out/popupShutter.txt +++ b/HMI/US/portrait/n2t-out/popupShutter.txt @@ -46,8 +46,8 @@ Variable (string) strCommand Variable (string) entn Attributes Scope : local - Text : newtxt - Max. Text Size: 50 + Text : + Max. Text Size: 80 Text tEntity Attributes @@ -147,7 +147,7 @@ Slider hPosition btlen tSend.txt,sys0 crcrest 1,0xffff // reset CRC crcputh 55 bb - crcputs sys0,1 + crcputs sys0,2 crcputs tSend.txt,0 //send cmd printh 55 bb diff --git a/HMI/nspanel.HMI b/HMI/nspanel.HMI index 0d2be96e..f857559d 100644 Binary files a/HMI/nspanel.HMI and b/HMI/nspanel.HMI differ diff --git a/HMI/nspanel.tft b/HMI/nspanel.tft index da064695..0dcbe05a 100644 Binary files a/HMI/nspanel.tft and b/HMI/nspanel.tft differ diff --git a/README.md b/README.md index df68bd13..639f2661 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ NsPanel needs to be flashed with Tasmota (or upcoming with ESPHome) ## Features -- Entities Page with support for cover, switch, input_boolean, binary_sensor, sensor, button, number, scenes, script, input_button and light, input_text (read-only), lock +- Entities Page with support for cover, switch, input_boolean, binary_sensor, sensor, button, number, scenes, script, input_button and light, input_text (read-only), lock, fan - Grid Page with support for cover, switch, input_boolean, button, scenes, light and lock - Detail Pages for Lights (Brightness, Temperature and Color of the Light) and for Covers (Position) - Thermostat Page diff --git a/apps/nspanel-lovelace-ui/luibackend/controller.py b/apps/nspanel-lovelace-ui/luibackend/controller.py index c71040a0..544f590a 100644 --- a/apps/nspanel-lovelace-ui/luibackend/controller.py +++ b/apps/nspanel-lovelace-ui/luibackend/controller.py @@ -182,7 +182,10 @@ class LuiController(object): self._ha_api.turn_off(entity_id) if button_type == "number-set": - self._ha_api.get_entity(entity_id).call_service("set_value", value=value) + if entity_id.startswith('fan'): + self._ha_api.get_entity(entity_id).call_service("set_percentage", percentage=value) + else: + self._ha_api.get_entity(entity_id).call_service("set_value", value=value) # for shutter / covers if button_type == "up": diff --git a/apps/nspanel-lovelace-ui/luibackend/icons.py b/apps/nspanel-lovelace-ui/luibackend/icons.py index 92882198..849d826e 100644 --- a/apps/nspanel-lovelace-ui/luibackend/icons.py +++ b/apps/nspanel-lovelace-ui/luibackend/icons.py @@ -47,6 +47,8 @@ def map_to_mdi_name(ha_type, state=None, device_class=None): return "ray-vertex" if ha_type == "light": return "lightbulb" + if ha_type == "fan": + return "fan" if ha_type == "input_boolean": return "check-circle-outline" if state == "on" else "close-circle-outline" if ha_type == "cover": diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index cdd82bab..448feef6 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -181,6 +181,9 @@ class LuiPagesGen(object): min_v = entity.attributes.get("min", 0) max_v = entity.attributes.get("max", 100) return f"~number~{entityId}~{icon_id}~17299~{name}~{entity.state}|{min_v}|{max_v}" + if entityType == "fan": + icon_id = get_icon_id_ha("fan", overwrite=icon) + return f"~number~{entityId}~{icon_id}~17299~{name}~{entity.percentage}|0|100" if entityType == "input_text": icon_id = get_icon_id_ha("input_text", overwrite=icon) value = entity.state