Compare commits

..

66 Commits

Author SHA1 Message Date
dependabot[bot]
081d0c5a3b Bump actions/setup-python from 5 to 6
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 06:06:41 +00:00
Armilar
98f70b20f0 Merge pull request #1375 from ticaki/main
update sliderItems types
2025-08-26 22:47:15 +02:00
Armilar
4c02b5bc26 v4.9.5.2 - DEV Update NSPanelTs.ts
Add Bright Sky Weather Adapter
2025-08-21 11:45:31 +02:00
Armilar
fb841abf45 v4.9.5.1 - Update NsPanelTs.ts
- Add USERICONS and colorScale to Alias-Channel Slider
- Prevent version search to the old directory path (Berry-Driver) 
- Add cardThermo2 to Script
- Add Pirate-Weather Adapter
- TFT 58 / 4.9.5 - Add cardThermo2 (eu/us-l/us-p) to HMI (TFT)
2025-08-14 09:46:42 +02:00
Armilar
bff89f0364 v4.9.5 - DEV Update NSPanelTs.ts 2025-08-14 09:39:33 +02:00
dependabot[bot]
27ccc0cfe7 Bump docker/login-action from 3.4.0 to 3.5.0 (#1377)
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 3.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-13 22:12:20 +02:00
Armilar
22a54c88c8 v4.9.5.1 - DEV Update NSPanelTs.ts 2025-08-12 15:39:34 +02:00
Armilar
87c58cc62d v4.9.5.1 - DEV Update NSPanelTs.ts
Small fixes
2025-08-12 13:05:04 +02:00
Armilar
1ee19213bd v4.9.5.1 - DEV Update NSPanelTs.ts
Add cardThermo2
2025-08-11 22:14:21 +02:00
Armilar
0c3d173f40 v4.9.4.3 - DEV Update NSPanelTs.ts 2025-08-10 11:32:14 +02:00
Armilar
cc201fb7fe v4.9.4.3 - DEV Update NSPanelTs.ts 2025-08-10 11:31:10 +02:00
ticaki
44d2c6fbfc update sliderItems types 2025-08-06 17:03:59 +02:00
Armilar
9cd2f6a464 v4.9.4.2 - DEV Update NSPanelTs.ts
Update TFT US Versions
2025-08-05 17:16:03 +02:00
Armilar
7473d13762 v4.9.4.2 - DEV Update NSPanelTs.ts
* New Berry Update Path (RAW)
2025-08-05 14:14:53 +02:00
Armilar
f57b3fe8e4 v4.9.4.2 - DEV Update NSPanelTs.ts
Prevent version search to the old directory path (Berry-Driver)
2025-08-05 14:04:00 +02:00
Armilar
9b1558c9a6 v4.9.4.1 - DEV Update NSPanelTs.ts 2025-08-05 13:08:24 +02:00
Armilar
6181dec958 v4.49.4.1 - DEV Update NSPanelTs.ts
* Fix cardEntities Sliders in HMI
* Fix Sliders
* Add USERICONS and  colorScale to Alias-Channel slider
2025-08-05 13:05:53 +02:00
Johannes
a94cf0cef3 fixes #1373 2025-08-02 21:22:31 +02:00
Johannes
d01ccede57 Update nspanel-lovelace-ui.py 2025-07-31 20:39:04 +02:00
Johannes
65be5ffeb0 implements #1351 2025-07-31 20:37:31 +02:00
Johannes
d53afb0b20 fixes #1369 2025-07-31 20:11:02 +02:00
Armilar
9822870fc9 v4.9.3 - EU, US-L, US-P - Update NsPanelTs.ts 2025-07-31 17:54:36 +02:00
Armilar
8a54d1422c v4.9.3 - EU, US-p, US-l - Update NSPanelTs.ts 2025-07-31 17:52:14 +02:00
Armilar
3f573557f0 Merge pull request #1370 from ticaki/main
ready for 9.0.11
2025-07-30 22:06:08 +02:00
ticaki
c2ca3b26d1 fix 2025-07-30 21:59:16 +02:00
ticaki
476a252a92 ready for 9.0.11 2025-07-30 21:52:36 +02:00
Armilar
0af779973b v4.9.3 - DEV Update NSPanelTs.ts
popupShutter2 Changes (new Parameter shutterZeroIsClosed changing Direction of %-Value in HMI (0 <--> 100))
2025-07-30 14:01:04 +02:00
Armilar
8e0609a781 v4.9.3 - DEV Update NSPanelTs.ts
Some Shutter2 Changes
2025-07-30 13:59:25 +02:00
Armilar
5dab816259 v4.9.2.2 - Update NsPanelTs.ts 2025-07-28 14:11:29 +02:00
Armilar
5f8409f5f1 v4.9.2.3 - DEV Update NSPanelTs.ts
- 28.07.2025 - v4.9.2.3  Quick-Fix Errors with TypeScript in JS > 9.X (by ticaki)
2025-07-28 14:10:24 +02:00
Armilar
3d85e86a95 v4.9.2.3 - Update NsPanelTs.ts
Quick-Fix Errors with TypeScript (Bugs in JavaScript > 9.X) by ticaki
2025-07-28 10:17:57 +02:00
Armilar
85de880cda Merge pull request #1368 from ticaki/main
fix/ignore typescript errors
2025-07-28 00:15:53 +02:00
ticaki
98269b19aa fix/ignore typescript errors 2025-07-28 00:10:22 +02:00
Armilar
d77382ee88 v4.9.2.2 - Update NsPanelTs.ts
* Add Weather-Adapter OpenWeatherMap
* Accuweather deprecated
2025-07-25 21:49:57 +02:00
Armilar
e925d133d2 v4.9.2.2 - DEV Update NSPanelTs.ts
* Fix Examples
* Fix OpenWeatherMap fewclouds night
2025-07-25 21:43:23 +02:00
Armilar
5ef3e8132b v4.9.2.2 - DEV Update NSPanelTs.ts
* AccuWeather deprecated
* Add OpenWeatherMap
2025-07-25 16:03:06 +02:00
Armilar
662b79a389 v4.9.2 - DEV - Update NSPanelTs.ts 2025-07-24 14:11:30 +02:00
Armilar
c984ff53a3 v4.8.0 - Update NsPanelTs.ts
* Add popupShutter2
* Add popupLight2
* Add popupSlider (cardMedia EQ)
* Fix Demomodus cardPower
* Small Fixes
2025-06-30 12:40:43 +02:00
Armilar
f8b748a418 Merge pull request #1360 from ticaki/main
Types and variables for popupShutter2 changed.
2025-06-30 12:13:09 +02:00
Armilar
bc31670760 v4.9.0.1 - DEV Update NSPanelTs.ts
Small Fixes
2025-06-30 12:06:11 +02:00
Armilar
cbf6abf4dd v4.9.0 - DEV Update NSPanelTs.ts
Small Fixes
2025-06-30 12:02:17 +02:00
Armilar
5c85e4a6e1 Update NSPanelTs.ts
Change Release
2025-06-30 11:58:08 +02:00
Armilar
cbede2412e v4.9.0 - DEV Update NSPanelTs.ts
New Beta
2025-06-30 11:57:26 +02:00
ticaki
82d22743cc rename customIcons for shutter 2025-06-29 16:08:32 +02:00
ticaki
640d0dfa14 check customIcons 2025-06-29 15:43:19 +02:00
ticaki
ccc62d1e6a Types and variables for popupShutter2 changed. 2025-06-29 15:35:04 +02:00
Armilar
6cec0245a3 v4.7.5 - DEV Update NSPanelTs.ts
Add TFT US-P v4.7.5
2025-06-26 13:01:27 +02:00
Armilar
f3c98adf06 v4.7.5.1 - DEV Update NSPanelTs.ts 2025-06-25 23:48:29 +02:00
Armilar
f4487e4285 v4.7.5.1 - DEV Update NSPanelTs.ts
TFT EU + US-P
2025-06-25 23:46:34 +02:00
Armilar
8e2780b2cb Update NSPanelTs.ts DEV 4.7.5.1
Add popupLight2
2025-06-25 14:21:25 +02:00
Armilar
0372221973 Update NSPanelTs.ts DEV 4.7.4.1
- Add popupShutter2
2025-06-25 00:20:01 +02:00
Johannes
947ef2d592 Update pages.py 2025-06-24 20:28:23 +02:00
Johannes
a1f39236c4 implements #1350 2025-06-23 22:38:20 +02:00
Thomas
4cdd1ed586 Merge pull request #1357 from tt-tom17/main
v4.7.2.4 - DEV-Update NSPanel.ts
2025-06-21 12:28:25 +02:00
tt-tom17
1836d29931 v4.7.2.4 - DEV-Update NSPanel.ts
- fix DEMO mode check of Powerpage
2025-06-21 12:22:07 +02:00
tt-tom17
fca29cfbd8 v4.7.2.4 - DEV-Update NSPanel.ts
- fix DEMO mode check of Powerpage
2025-06-21 12:18:14 +02:00
Armilar
b27910c1af Merge pull request #1354 from ticaki/main
IconSelect left and indicatorScreensaverEntity added
2025-06-20 10:35:21 +02:00
ticaki
f046ae6031 IconSelect left and indicatorScreensaverEntity added 2025-06-20 10:28:46 +02:00
Thomas
4475ab1277 Merge pull request #1348 from ticaki/main
States only respond to any if ack = false
2025-06-13 00:23:53 +02:00
dependabot[bot]
9afdb71a7c Bump home-assistant/builder from 2024.08.2 to 2025.03.0 (#1317)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2024.08.2 to 2025.03.0.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2024.08.2...2025.03.0)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-12 20:08:47 +02:00
dependabot[bot]
c84d78551f Bump docker/login-action from 3.3.0 to 3.4.0 (#1316)
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.3.0...v3.4.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-12 20:08:35 +02:00
Johannes
5e2a4b17ae Update prepare_ha.md 2025-06-12 20:07:00 +02:00
Paweł Zubrycki
acdba468b3 Add weather service call functionality and fix weather forecast assignment (#1349) 2025-06-12 18:40:55 +02:00
ticaki
5803a489f5 States only respond to any if ack = false 2025-06-12 15:29:17 +02:00
patricknitsch
54c8d302a8 Add Entity Type "Valve" (#1347)
* Update pages.py

* Update controller.py

* Update pages.py

* Update pages.py
2025-06-06 19:24:56 +02:00
mikosoft83
8059905579 Update icons.py (#1343)
Climate icons improvement
2025-06-02 23:15:30 +02:00
10 changed files with 3390 additions and 896 deletions

View File

@@ -92,7 +92,7 @@ jobs:
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
if: env.BUILD_ARGS != '--test' if: env.BUILD_ARGS != '--test'
uses: docker/login-action@v3.3.0 uses: docker/login-action@v3.5.0
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
@@ -100,7 +100,7 @@ jobs:
- name: Build ${{ matrix.addon }} add-on - name: Build ${{ matrix.addon }} add-on
if: steps.check.outputs.build_arch == 'true' if: steps.check.outputs.build_arch == 'true'
uses: home-assistant/builder@2024.08.2 uses: home-assistant/builder@2025.03.0
with: with:
args: | args: |
${{ env.BUILD_ARGS }} \ ${{ env.BUILD_ARGS }} \

View File

@@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: actions/setup-python@v5 - uses: actions/setup-python@v6
with: with:
python-version: 3.x python-version: 3.x
- run: pip install mkdocs-material mkdocs-video markdown-include mike - run: pip install mkdocs-material mkdocs-video markdown-include mike

View File

@@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: actions/setup-python@v5 - uses: actions/setup-python@v6
with: with:
python-version: 3.x python-version: 3.x
- run: pip install mkdocs-material mkdocs-video markdown-include mike - run: pip install mkdocs-material mkdocs-video markdown-include mike

View File

@@ -334,6 +334,11 @@ class LuiController(object):
apis.ha_api.get_entity(entity_id).call_service("return_to_base") apis.ha_api.get_entity(entity_id).call_service("return_to_base")
elif entity_id.startswith('service'): elif entity_id.startswith('service'):
apis.ha_api.call_service(entity_id.replace('service.', '', 1).replace('.','/', 1), **entity_config.data) apis.ha_api.call_service(entity_id.replace('service.', '', 1).replace('.','/', 1), **entity_config.data)
elif entity_id.startswith('valve'):
if apis.ha_api.get_entity(entity_id).state == "open":
apis.ha_api.get_entity(entity_id).call_service("close_valve")
else:
apis.ha_api.get_entity(entity_id).call_service("open_valve")
# for media page # for media page
if button_type == "media-next": if button_type == "media-next":

View File

@@ -159,8 +159,8 @@ alarm_control_panel_mapping = {
} }
climate_mapping = { climate_mapping = {
'auto': 'calendar-sync', 'auto': 'fan-auto',
'heat_cool': 'calendar-sync', 'heat_cool': 'sun-snowflake-variant',
'heat': 'fire', 'heat': 'fire',
'off': 'power', 'off': 'power',
'cool': 'snowflake', 'cool': 'snowflake',

View File

@@ -25,7 +25,7 @@ class LuiPagesGen(object):
self._config = config self._config = config
self._locale = config.get("locale") self._locale = config.get("locale")
self._send_mqtt_msg = send_mqtt_msg self._send_mqtt_msg = send_mqtt_msg
def get_entity_color(self, entity, ha_type=None, stateOverwrite=None, overwrite=None): def get_entity_color(self, entity, ha_type=None, stateOverwrite=None, overwrite=None):
if overwrite is not None: if overwrite is not None:
if type(overwrite) in [str, list]: if type(overwrite) in [str, list]:
@@ -82,7 +82,7 @@ class LuiPagesGen(object):
icon_color = 63878 #red icon_color = 63878 #red
if state == "fog": if state == "fog":
icon_color = 38066 #75% grey icon_color = 38066 #75% grey
if state in ["hail", "snowy"]: if state in ["hail", "snowy"]:
icon_color = 65535 #white icon_color = 65535 #white
if state == "lightning": if state == "lightning":
icon_color = 65120 #golden-yellow icon_color = 65120 #golden-yellow
@@ -128,7 +128,7 @@ 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)
addTemplate = self._config.get("dateAdditionalTemplate") addTemplate = self._config.get("dateAdditionalTemplate")
addDateText = apis.ha_api.render_template(addTemplate) addDateText = apis.ha_api.render_template(addTemplate)
self._send_mqtt_msg(f"date~{date}{addDateText}") self._send_mqtt_msg(f"date~{date}{addDateText}")
@@ -137,7 +137,7 @@ class LuiPagesGen(object):
if target_page == "cardUnlock": if target_page == "cardUnlock":
target_page = "cardAlarm" target_page = "cardAlarm"
self._send_mqtt_msg(f"pageType~{target_page}") self._send_mqtt_msg(f"pageType~{target_page}")
def update_screensaver_weather(self, theme): def update_screensaver_weather(self, theme):
entities = self._config._config_screensaver.entities entities = self._config._config_screensaver.entities
@@ -150,7 +150,7 @@ class LuiPagesGen(object):
item_str = "" item_str = ""
for item in entities: for item in entities:
item_str += self.generate_entities_item(item, "cardEntities", mask=["type", "entityId"]) item_str += self.generate_entities_item(item, "cardEntities", mask=["type", "entityId"])
self._send_mqtt_msg(f"weatherUpdate{item_str}") self._send_mqtt_msg(f"weatherUpdate{item_str}")
# send color if configured in screensaver # send color if configured in screensaver
if theme is not None: if theme is not None:
@@ -180,11 +180,11 @@ class LuiPagesGen(object):
colorOverride = item.colorOverride colorOverride = item.colorOverride
name = item.nameOverride name = item.nameOverride
uuid = item.uuid uuid = item.uuid
# check ha template for name # check ha template for name
if item.nameOverride is not None and ("{" in item.nameOverride and "}" in item.nameOverride): if item.nameOverride is not None and ("{" in item.nameOverride and "}" in item.nameOverride):
name = apis.ha_api.render_template(item.nameOverride) name = apis.ha_api.render_template(item.nameOverride)
# type of the item is the string before the "." in the entityId # type of the item is the string before the "." in the entityId
if entityId is not None: if entityId is not None:
entityType = entityId.split(".")[0] entityType = entityId.split(".")[0]
@@ -256,7 +256,7 @@ class LuiPagesGen(object):
if entity is None: if entity is None:
return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~Not found check~ apps.yaml" return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~Not found check~ apps.yaml"
# HA Entities # HA Entities
# common res vars # common res vars
entityTypePanel = "text" entityTypePanel = "text"
@@ -308,13 +308,18 @@ class LuiPagesGen(object):
device_class = entity.attributes.get("device_class", "") device_class = entity.attributes.get("device_class", "")
unit_of_measurement = entity.attributes.get("unit_of_measurement", "") unit_of_measurement = entity.attributes.get("unit_of_measurement", "")
value = entity.state value = entity.state
try:
value = str(round(float(value), 1))
except:
print("An exception occurred")
# limit value to 4 chars on us-p # limit value to 4 chars on us-p
if self._config.get("model") == "us-p" and cardType == "cardEntities": if self._config.get("model") == "us-p" and cardType == "cardEntities":
value = entity.state[:4] value = entity.state[:4]
if value[-1] == ".": if value[-1] == ".":
value = value[:-1] value = value[:-1]
if device_class != "temperature": if device_class != "temperature":
value = value + " " value = value + " "
value = value + unit_of_measurement value = value + unit_of_measurement
@@ -382,20 +387,50 @@ class LuiPagesGen(object):
elif entityType == "weather": elif entityType == "weather":
entityTypePanel = "text" entityTypePanel = "text"
unit = get_attr_safe(entity, "temperature_unit", "") unit = get_attr_safe(entity, "temperature_unit", "")
if type(item.stype) == int and len(entity.attributes['forecast']) >= item.stype: rt = None
fdate = dp.parse(entity.attributes['forecast'][item.stype]['datetime']) if type(item.stype) == str and ":" in item.stype and len(item.stype.split(":")) == 2:
global babel_spec spintstr = item.stype.split(":")
if babel_spec is not None: rt = spintstr[0]
dateformat = "E" if item.nameOverride is None else item.nameOverride item.stype = int(spintstr[1])
name = babel.dates.format_datetime(fdate.astimezone(), dateformat, locale=self._locale) if type(item.stype) == int:
bits = get_attr_safe(entity, "supported_features", 0b0)
if not rt:
rt = "daily"
if bits & 0b001: #FORECAST_DAILY
rt = "daily"
elif bits & 0b010: #FORECAST_HOURLY
rt = "hourly"
elif bits & 0b100: #FORECAST_TWICE_DAILY
rt = "twice_daily"
results = apis.ha_api.call_service(
"weather/get_forecasts", target={"entity_id": entityId}, service_data={"type": rt}
)
forecast = results.get("result", {}).get("response", {}).get(entityId, {}).get('forecast') or entity.attributes.get('forecast', [])
if len(forecast) >= item.stype:
day_forecast = forecast[item.stype]
fdate = dp.parse(day_forecast['datetime'])
global babel_spec
if babel_spec is not None:
dateformat = "E" if item.nameOverride is None else item.nameOverride
name = babel.dates.format_datetime(fdate.astimezone(), dateformat, locale=self._locale)
else:
dateformat = "%a" if item.nameOverride is None else item.nameOverride
name = fdate.astimezone().strftime(dateformat)
icon_id = get_icon_ha(entityId, stateOverwrite=day_forecast['condition'])
value = f'{day_forecast.get("temperature", "")}{unit}'
color = self.get_entity_color(entity, ha_type=entityType, stateOverwrite=day_forecast['condition'], overwrite=colorOverride)
else: else:
dateformat = "%a" if item.nameOverride is None else item.nameOverride value = f'{get_attr_safe(entity, "temperature", "")}{unit}'
name = fdate.astimezone().strftime(dateformat)
icon_id = get_icon_ha(entityId, stateOverwrite=entity.attributes['forecast'][item.stype]['condition'])
value = f'{entity.attributes['forecast'][item.stype].get("temperature", "")}{unit}'
color = self.get_entity_color(entity, ha_type=entityType, stateOverwrite=entity.attributes['forecast'][item.stype]['condition'], overwrite=colorOverride)
else: else:
value = f'{get_attr_safe(entity, "temperature", "")}{unit}' value = f'{get_attr_safe(entity, "temperature", "")}{unit}'
elif entityType == "valve":
entityTypePanel = "valve"
value = get_translation(self._locale, f"backend.component.binary_sensor.state.door.{entity.state}")
if entity.state == "open":
icon_id = get_icon_id("valve-open")
else:
icon_id = get_icon_id("valve-closed")
else: else:
name = "unsupported" name = "unsupported"
# Overwrite for value # Overwrite for value
@@ -475,10 +510,10 @@ class LuiPagesGen(object):
state_value += get_translation(self._locale, f"backend.component.climate.state._.{entity.state}") state_value += get_translation(self._locale, f"backend.component.climate.state._.{entity.state}")
if hvac_action != "": if hvac_action != "":
state_value += ")" state_value += ")"
min_temp = int(get_attr_safe(entity, "min_temp", 0)*10) min_temp = int(get_attr_safe(entity, "min_temp", 0)*10)
max_temp = int(get_attr_safe(entity, "max_temp", 0)*10) max_temp = int(get_attr_safe(entity, "max_temp", 0)*10)
step_temp = int(get_attr_safe(entity, "target_temp_step", 0.5)*10) step_temp = int(get_attr_safe(entity, "target_temp_step", 0.5)*10)
icon_res_list = [] icon_res_list = []
icon_res = "" icon_res = ""
@@ -503,7 +538,7 @@ class LuiPagesGen(object):
state = 0 state = 0
if(mode == entity.state): if(mode == entity.state):
state = 1 state = 1
icon_res_list.append(f"~{icon_id}~{color_on}~{state}~{mode}") icon_res_list.append(f"~{icon_id}~{color_on}~{state}~{mode}")
icon_res = "".join(icon_res_list) icon_res = "".join(icon_res_list)
@@ -518,11 +553,11 @@ class LuiPagesGen(object):
icon_res = "~"*4 + icon_res_list[0] + "~"*4 + icon_res_list[1] + "~"*4 + icon_res_list[2] + "~"*4 + icon_res_list[3] icon_res = "~"*4 + icon_res_list[0] + "~"*4 + icon_res_list[1] + "~"*4 + icon_res_list[2] + "~"*4 + icon_res_list[3]
elif len(icon_res_list) >= 5 or self._config.get("model") == "us-p": elif len(icon_res_list) >= 5 or self._config.get("model") == "us-p":
icon_res = "".join(icon_res_list) + "~"*4*(8-len(icon_res_list)) icon_res = "".join(icon_res_list) + "~"*4*(8-len(icon_res_list))
currently_translation = get_translation(self._locale, "frontend.ui.card.climate.currently") currently_translation = get_translation(self._locale, "frontend.ui.card.climate.currently")
state_translation = get_translation(self._locale, "frontend.ui.panel.config.devices.entities.state") state_translation = get_translation(self._locale, "frontend.ui.panel.config.devices.entities.state")
action_translation = get_translation(self._locale, "frontend.ui.card.climate.operation").replace(' ','\r\n') action_translation = get_translation(self._locale, "frontend.ui.card.climate.operation").replace(' ','\r\n')
detailPage = "1" detailPage = "1"
if any(x in ["preset_modes", "swing_modes", "fan_modes"] for x in entity.attributes): if any(x in ["preset_modes", "swing_modes", "fan_modes"] for x in entity.attributes):
detailPage = "0" detailPage = "0"
@@ -606,7 +641,7 @@ class LuiPagesGen(object):
item_str = "" item_str = ""
for item in entities: for item in entities:
item_str += self.generate_entities_item(item, "cardGrid") item_str += self.generate_entities_item(item, "cardGrid")
bck_override = entity.iconOverride bck_override = entity.iconOverride
if entity.status is not None: if entity.status is not None:
bck_entity = entity.entityId bck_entity = entity.entityId
@@ -614,14 +649,14 @@ class LuiPagesGen(object):
entity.iconOverride = "mdi:speaker" entity.iconOverride = "mdi:speaker"
item_str += self.generate_entities_item(entity, "cardGrid") item_str += self.generate_entities_item(entity, "cardGrid")
entity.iconOverride = bck_override entity.iconOverride = bck_override
if entity.status is not None: if entity.status is not None:
entity.entityId = bck_entity entity.entityId = bck_entity
command = f"entityUpd~{heading}~{navigation}~{entityId}~{title}~~{author}~~{volume}~{iconplaypause}~{onoffbutton}~{shuffleBtn}{media_icon}{item_str}" command = f"entityUpd~{heading}~{navigation}~{entityId}~{title}~~{author}~~{volume}~{iconplaypause}~{onoffbutton}~{shuffleBtn}{media_icon}{item_str}"
self._send_mqtt_msg(command) self._send_mqtt_msg(command)
def generate_alarm_page(self, navigation, title, entity, overwrite_supported_modes, alarmBtn): def generate_alarm_page(self, navigation, title, entity, overwrite_supported_modes, alarmBtn):
item = entity.entityId item = entity.entityId
if not apis.ha_api.entity_exists(item): if not apis.ha_api.entity_exists(item):
@@ -688,8 +723,8 @@ class LuiPagesGen(object):
else: else:
icon_color = rgb_dec565([243,179,0]) icon_color = rgb_dec565([243,179,0])
add_btn=f"{iconnav}~{icon_color}~{entity}" add_btn=f"{iconnav}~{icon_color}~{entity}"
# add padding to arm buttons # add padding to arm buttons
arm_buttons = "" arm_buttons = ""
for b in supported_modes: for b in supported_modes:
@@ -699,12 +734,12 @@ class LuiPagesGen(object):
arm_buttons += "~"*((4-len(supported_modes))*2) arm_buttons += "~"*((4-len(supported_modes))*2)
command = f"entityUpd~{title}~{navigation}~{item}{arm_buttons}~{icon}~{color}~{numpad}~{flashing}~{add_btn}" command = f"entityUpd~{title}~{navigation}~{item}{arm_buttons}~{icon}~{color}~{numpad}~{flashing}~{add_btn}"
self._send_mqtt_msg(command) self._send_mqtt_msg(command)
def generate_unlock_page(self, navigation, item, title, destination, pin): def generate_unlock_page(self, navigation, item, title, destination, pin):
color = rgb_dec565([255,0,0]) color = rgb_dec565([255,0,0])
icon = get_icon_id("lock") icon = get_icon_id("lock")
supported_modes = ["cardUnlock-unlock"] supported_modes = ["cardUnlock-unlock"]
# add padding to arm buttons # add padding to arm buttons
arm_buttons = "" arm_buttons = ""
for b in supported_modes: for b in supported_modes:
@@ -743,8 +778,8 @@ class LuiPagesGen(object):
if (time.time()-card.last_update) < card.cooldown: if (time.time()-card.last_update) < card.cooldown:
return return
card.last_update = time.time() card.last_update = time.time()
leftBtn = "delete~~~~~" leftBtn = "delete~~~~~"
if card.uuid_prev is not None: if card.uuid_prev is not None:
leftBtn = self.generate_entities_item(Entity( leftBtn = self.generate_entities_item(Entity(
@@ -790,7 +825,7 @@ class LuiPagesGen(object):
self._send_mqtt_msg(f"timeout~{card.sleepTimeout}") self._send_mqtt_msg(f"timeout~{card.sleepTimeout}")
else: else:
self._send_mqtt_msg(f'timeout~{self._config.get("sleepTimeout")}') self._send_mqtt_msg(f'timeout~{self._config.get("sleepTimeout")}')
temp_unit = card.raw_config.get("temperatureUnit", "celsius") temp_unit = card.raw_config.get("temperatureUnit", "celsius")
if card.cardType in ["cardEntities", "cardGrid", "cardGrid1","cardGrid2"]: if card.cardType in ["cardEntities", "cardGrid", "cardGrid1","cardGrid2"]:
self.generate_entities_page(navigation, card.title, card.entities, card.cardType, temp_unit) self.generate_entities_page(navigation, card.title, card.entities, card.cardType, temp_unit)
@@ -845,7 +880,7 @@ class LuiPagesGen(object):
color = "disable" color = "disable"
effect_supported = "disable" effect_supported = "disable"
supported_color_modes = entity.attributes['supported_color_modes'] supported_color_modes = entity.attributes['supported_color_modes']
if "onoff" not in supported_color_modes: if "onoff" not in supported_color_modes:
brightness = 0 brightness = 0
if entity.state == "on": if entity.state == "on":
@@ -873,20 +908,20 @@ class LuiPagesGen(object):
brightness_translation = get_translation(self._locale, "frontend.ui.card.light.brightness") brightness_translation = get_translation(self._locale, "frontend.ui.card.light.brightness")
color_temp_translation = get_translation(self._locale, "frontend.ui.card.light.color_temperature") color_temp_translation = get_translation(self._locale, "frontend.ui.card.light.color_temperature")
self._send_mqtt_msg(f"entityUpdateDetail~{entity_id}~~{icon_color}~{switch_val}~{brightness}~{color_temp}~{color}~{color_translation}~{color_temp_translation}~{brightness_translation}~{effect_supported}", force=is_open_detail) self._send_mqtt_msg(f"entityUpdateDetail~{entity_id}~~{icon_color}~{switch_val}~{brightness}~{color_temp}~{color}~{color_translation}~{color_temp_translation}~{brightness_translation}~{effect_supported}", force=is_open_detail)
def generate_shutter_detail_page(self, entity_id, is_open_detail=False): def generate_shutter_detail_page(self, entity_id, is_open_detail=False):
entity = apis.ha_api.get_entity(entity_id) entity = apis.ha_api.get_entity(entity_id)
entityType = "cover" entityType = "cover"
device_class = entity.attributes.get("device_class", "window") device_class = entity.attributes.get("device_class", "window")
icon_id = get_icon_ha(entity_id) icon_id = get_icon_ha(entity_id)
pos = entity.attributes.get("current_position") pos = entity.attributes.get("current_position")
if pos is None: if pos is None:
pos_status = entity.state pos_status = entity.state
pos = "disable" pos = "disable"
else: else:
pos_status = pos pos_status = pos
pos_translation = "" pos_translation = ""
icon_up = "" icon_up = ""
icon_stop = "" icon_stop = ""
@@ -990,7 +1025,7 @@ class LuiPagesGen(object):
if modes: if modes:
modes_out += f"{heading}~{mode}~{cur_mode}~{modes_res}~" modes_out += f"{heading}~{mode}~{cur_mode}~{modes_res}~"
self._send_mqtt_msg(f"entityUpdateDetail~{entity_id}~{icon_id}~{icon_color}~{modes_out}", force=is_open_detail) self._send_mqtt_msg(f"entityUpdateDetail~{entity_id}~{icon_id}~{icon_color}~{modes_out}", force=is_open_detail)
def generate_input_select_detail_page(self, entity_id, is_open_detail=False): def generate_input_select_detail_page(self, entity_id, is_open_detail=False):
options_list = None options_list = None
@@ -1054,8 +1089,9 @@ class LuiPagesGen(object):
label2 = get_translation(self._locale, "frontend.ui.card.timer.actions.cancel") label2 = get_translation(self._locale, "frontend.ui.card.timer.actions.cancel")
label3 = get_translation(self._locale, "frontend.ui.card.timer.actions.finish") label3 = get_translation(self._locale, "frontend.ui.card.timer.actions.finish")
self._send_mqtt_msg(f"entityUpdateDetail~{entity_id}~~{icon_color}~{entity_id}~{min_remaining}~{sec_remaining}~{editable}~{action1}~{action2}~{action3}~{label1}~{label2}~{label3}", force=is_open_detail) self._send_mqtt_msg(f"entityUpdateDetail~{entity_id}~~{icon_color}~{entity_id}~{min_remaining}~{sec_remaining}~{editable}~{action1}~{action2}~{action3}~{label1}~{label2}~{label3}", force=is_open_detail)
def send_message_page(self, ident, heading, msg, b1, b2): def send_message_page(self, ident, heading, msg, b1, b2):
self._send_mqtt_msg(f"pageType~popupNotify") self._send_mqtt_msg(f"pageType~popupNotify")
self._send_mqtt_msg(f"entityUpdateDetail~{ident}~{heading}~65535~{b1}~65535~{b2}~65535~{msg}~65535~0") self._send_mqtt_msg(f"entityUpdateDetail~{ident}~{heading}~65535~{b1}~65535~{b2}~65535~{msg}~65535~0")

View File

@@ -34,7 +34,7 @@ class NsPanelLovelaceUIManager(ad.ADBase):
desired_tasmota_driver_version = 8 desired_tasmota_driver_version = 8
desired_display_firmware_version = 53 desired_display_firmware_version = 53
version = "v4.3.3" version = "v4.7.3"
model = cfg.get("model") model = cfg.get("model")
if model == "us-l": if model == "us-l":

View File

@@ -94,37 +94,3 @@ Now, to install NSPanel Lovelace UI Backend with HACS, follow these steps:
proceed with the download proceed with the download
7. The Backend Application is now installed, and HACS will inform you when updates are available 7. The Backend Application is now installed, and HACS will inform you when updates are available
# Workaround for HomeAssistant 2024.04
AppDaemon is using the old REST API that until AppDaemon moved on the the websocket API this woraround is needed to get weather forecast data from homeassistant. (https://github.com/AppDaemon/appdaemon/issues/1837)
To get the forecast data in appdaemon, there is a script needed in homeassistant's configuration.yaml:
```yaml
template:
- trigger:
- platform: time_pattern
hours: /1
- platform: homeassistant
event: start
action:
- service: weather.get_forecasts
data:
type: daily
target:
entity_id: weather.home # change to your weather entity
response_variable: daily
sensor:
- name: Weather Forecast Daily
unique_id: weather_forecast_daily
state: "{{ states('weather.home') }}" # # change to your weather entity in this line
attributes:
temperature: "{{ state_attr('weather.home', 'temperature') }}" # change to your weather entity
temperature_unit: "{{ state_attr('weather.home', 'temperature_unit') }}" # change to your weather entity
forecast: "{{ daily['weather.home'].forecast }}" # change to your weather entity
```
![image](https://github.com/joBr99/nspanel-lovelace-ui/assets/29555657/41f21db3-a6e2-4e4f-8dab-b9351ecd23e5)
Adjust the entities in your apps.yaml that are accessing the forecast to the newly created trigger template:
![image](https://github.com/joBr99/nspanel-lovelace-ui/assets/29555657/1cfd913d-88be-4cb0-9a68-0e864ee1ad4f)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff