mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-24 08:24:25 +01:00
Compare commits
99 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52c695cf1c | ||
|
|
8805e2189c | ||
|
|
341cdb47ab | ||
|
|
3b25d47bc7 | ||
|
|
a721d4ccd7 | ||
|
|
044abda65b | ||
|
|
155b08d6d5 | ||
|
|
c038745d1b | ||
|
|
154c9aced1 | ||
|
|
f5119f86ac | ||
|
|
77b7400b04 | ||
|
|
995e7eebd2 | ||
|
|
c91ca0912a | ||
|
|
a6742f88c8 | ||
|
|
9f146ec8b3 | ||
|
|
0cccfac4a6 | ||
|
|
fbe5f9658e | ||
|
|
603d207e12 | ||
|
|
338c3af940 | ||
|
|
ce6ff734d1 | ||
|
|
4308c12508 | ||
|
|
ea0f3cc411 | ||
|
|
2b4c8d3b94 | ||
|
|
ff25f07b8f | ||
|
|
59efd21251 | ||
|
|
20ae492cf3 | ||
|
|
512a89b7d6 | ||
|
|
a6c366ed41 | ||
|
|
e13d1aaecb | ||
|
|
3b6d53c78c | ||
|
|
f789e33fe5 | ||
|
|
22455546f6 | ||
|
|
e0e9815911 | ||
|
|
3e0d0e8854 | ||
|
|
98f70b20f0 | ||
|
|
4c02b5bc26 | ||
|
|
fb841abf45 | ||
|
|
bff89f0364 | ||
|
|
27ccc0cfe7 | ||
|
|
22a54c88c8 | ||
|
|
87c58cc62d | ||
|
|
1ee19213bd | ||
|
|
0c3d173f40 | ||
|
|
cc201fb7fe | ||
|
|
44d2c6fbfc | ||
|
|
9cd2f6a464 | ||
|
|
7473d13762 | ||
|
|
f57b3fe8e4 | ||
|
|
9b1558c9a6 | ||
|
|
6181dec958 | ||
|
|
a94cf0cef3 | ||
|
|
d01ccede57 | ||
|
|
65be5ffeb0 | ||
|
|
d53afb0b20 | ||
|
|
9822870fc9 | ||
|
|
8a54d1422c | ||
|
|
3f573557f0 | ||
|
|
c2ca3b26d1 | ||
|
|
476a252a92 | ||
|
|
0af779973b | ||
|
|
8e0609a781 | ||
|
|
5dab816259 | ||
|
|
5f8409f5f1 | ||
|
|
3d85e86a95 | ||
|
|
85de880cda | ||
|
|
98269b19aa | ||
|
|
d77382ee88 | ||
|
|
e925d133d2 | ||
|
|
5ef3e8132b | ||
|
|
662b79a389 | ||
|
|
c984ff53a3 | ||
|
|
f8b748a418 | ||
|
|
bc31670760 | ||
|
|
cbf6abf4dd | ||
|
|
5c85e4a6e1 | ||
|
|
cbede2412e | ||
|
|
82d22743cc | ||
|
|
640d0dfa14 | ||
|
|
ccc62d1e6a | ||
|
|
6cec0245a3 | ||
|
|
f3c98adf06 | ||
|
|
f4487e4285 | ||
|
|
8e2780b2cb | ||
|
|
0372221973 | ||
|
|
947ef2d592 | ||
|
|
a1f39236c4 | ||
|
|
4cdd1ed586 | ||
|
|
1836d29931 | ||
|
|
fca29cfbd8 | ||
|
|
b27910c1af | ||
|
|
f046ae6031 | ||
|
|
4475ab1277 | ||
|
|
9afdb71a7c | ||
|
|
c84d78551f | ||
|
|
5e2a4b17ae | ||
|
|
acdba468b3 | ||
|
|
5803a489f5 | ||
|
|
54c8d302a8 | ||
|
|
8059905579 |
4
.github/workflows/builder.yaml
vendored
4
.github/workflows/builder.yaml
vendored
@@ -92,7 +92,7 @@ jobs:
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
if: env.BUILD_ARGS != '--test'
|
||||
uses: docker/login-action@v3.3.0
|
||||
uses: docker/login-action@v3.5.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
|
||||
- name: Build ${{ matrix.addon }} add-on
|
||||
if: steps.check.outputs.build_arch == 'true'
|
||||
uses: home-assistant/builder@2024.08.2
|
||||
uses: home-assistant/builder@2025.03.0
|
||||
with:
|
||||
args: |
|
||||
${{ env.BUILD_ARGS }} \
|
||||
|
||||
@@ -151,7 +151,7 @@ class LuiController(object):
|
||||
items = self._config.get_all_entity_names()
|
||||
apis.ha_api.log(f"gtest123: {items}")
|
||||
prefixes = ("navigate.", "delete", "iText")
|
||||
items = [x for x in items if not (x is None or x.startswith(prefixes))]
|
||||
items = set([x for x in items if not (x is None or x.startswith(prefixes))])
|
||||
apis.ha_api.log(f"Registering callbacks for the following items: {items}")
|
||||
for item in items:
|
||||
if apis.ha_api.entity_exists(item):
|
||||
@@ -334,6 +334,11 @@ class LuiController(object):
|
||||
apis.ha_api.get_entity(entity_id).call_service("return_to_base")
|
||||
elif entity_id.startswith('service'):
|
||||
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
|
||||
if button_type == "media-next":
|
||||
|
||||
@@ -159,8 +159,8 @@ alarm_control_panel_mapping = {
|
||||
}
|
||||
|
||||
climate_mapping = {
|
||||
'auto': 'calendar-sync',
|
||||
'heat_cool': 'calendar-sync',
|
||||
'auto': 'fan-auto',
|
||||
'heat_cool': 'sun-snowflake-variant',
|
||||
'heat': 'fire',
|
||||
'off': 'power',
|
||||
'cool': 'snowflake',
|
||||
|
||||
@@ -25,7 +25,7 @@ class LuiPagesGen(object):
|
||||
self._config = config
|
||||
self._locale = config.get("locale")
|
||||
self._send_mqtt_msg = send_mqtt_msg
|
||||
|
||||
|
||||
def get_entity_color(self, entity, ha_type=None, stateOverwrite=None, overwrite=None):
|
||||
if overwrite is not None:
|
||||
if type(overwrite) in [str, list]:
|
||||
@@ -82,7 +82,7 @@ class LuiPagesGen(object):
|
||||
icon_color = 63878 #red
|
||||
if state == "fog":
|
||||
icon_color = 38066 #75% grey
|
||||
if state in ["hail", "snowy"]:
|
||||
if state in ["hail", "snowy"]:
|
||||
icon_color = 65535 #white
|
||||
if state == "lightning":
|
||||
icon_color = 65120 #golden-yellow
|
||||
@@ -128,7 +128,7 @@ class LuiPagesGen(object):
|
||||
else:
|
||||
dateformat = self._config.get("dateFormat")
|
||||
date = datetime.datetime.now().strftime(dateformat)
|
||||
|
||||
|
||||
addTemplate = self._config.get("dateAdditionalTemplate")
|
||||
addDateText = apis.ha_api.render_template(addTemplate)
|
||||
self._send_mqtt_msg(f"date~{date}{addDateText}")
|
||||
@@ -137,7 +137,7 @@ class LuiPagesGen(object):
|
||||
if target_page == "cardUnlock":
|
||||
target_page = "cardAlarm"
|
||||
self._send_mqtt_msg(f"pageType~{target_page}")
|
||||
|
||||
|
||||
def update_screensaver_weather(self, theme):
|
||||
entities = self._config._config_screensaver.entities
|
||||
|
||||
@@ -150,7 +150,7 @@ class LuiPagesGen(object):
|
||||
item_str = ""
|
||||
for item in entities:
|
||||
item_str += self.generate_entities_item(item, "cardEntities", mask=["type", "entityId"])
|
||||
|
||||
|
||||
self._send_mqtt_msg(f"weatherUpdate{item_str}")
|
||||
# send color if configured in screensaver
|
||||
if theme is not None:
|
||||
@@ -180,11 +180,11 @@ class LuiPagesGen(object):
|
||||
colorOverride = item.colorOverride
|
||||
name = item.nameOverride
|
||||
uuid = item.uuid
|
||||
|
||||
|
||||
# check ha template for name
|
||||
if item.nameOverride is not None and ("{" in item.nameOverride and "}" in item.nameOverride):
|
||||
name = apis.ha_api.render_template(item.nameOverride)
|
||||
|
||||
|
||||
# type of the item is the string before the "." in the entityId
|
||||
if entityId is not None:
|
||||
entityType = entityId.split(".")[0]
|
||||
@@ -256,7 +256,7 @@ class LuiPagesGen(object):
|
||||
if entity is None:
|
||||
return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~Not found check~ apps.yaml"
|
||||
|
||||
|
||||
|
||||
# HA Entities
|
||||
# common res vars
|
||||
entityTypePanel = "text"
|
||||
@@ -308,13 +308,18 @@ class LuiPagesGen(object):
|
||||
device_class = entity.attributes.get("device_class", "")
|
||||
unit_of_measurement = entity.attributes.get("unit_of_measurement", "")
|
||||
value = entity.state
|
||||
|
||||
|
||||
try:
|
||||
value = str(round(float(value), 1))
|
||||
except:
|
||||
print("An exception occurred")
|
||||
|
||||
# limit value to 4 chars on us-p
|
||||
if self._config.get("model") == "us-p" and cardType == "cardEntities":
|
||||
value = entity.state[:4]
|
||||
if value[-1] == ".":
|
||||
value = value[:-1]
|
||||
|
||||
|
||||
if device_class != "temperature":
|
||||
value = value + " "
|
||||
value = value + unit_of_measurement
|
||||
@@ -382,20 +387,51 @@ class LuiPagesGen(object):
|
||||
elif entityType == "weather":
|
||||
entityTypePanel = "text"
|
||||
unit = get_attr_safe(entity, "temperature_unit", "")
|
||||
if type(item.stype) == int and len(entity.attributes['forecast']) >= item.stype:
|
||||
fdate = dp.parse(entity.attributes['forecast'][item.stype]['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)
|
||||
rt = None
|
||||
index = item.stype
|
||||
if type(item.stype) == str and ":" in item.stype and len(item.stype.split(":")) == 2:
|
||||
spintstr = item.stype.split(":")
|
||||
rt = spintstr[0]
|
||||
index = int(spintstr[1])
|
||||
if type(index) == 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) >= index:
|
||||
day_forecast = forecast[index]
|
||||
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:
|
||||
dateformat = "%a" if item.nameOverride is None else item.nameOverride
|
||||
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)
|
||||
value = f'{get_attr_safe(entity, "temperature", "")}{unit}'
|
||||
else:
|
||||
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:
|
||||
name = "unsupported"
|
||||
# Overwrite for value
|
||||
@@ -475,10 +511,10 @@ class LuiPagesGen(object):
|
||||
state_value += get_translation(self._locale, f"backend.component.climate.state._.{entity.state}")
|
||||
if hvac_action != "":
|
||||
state_value += ")"
|
||||
|
||||
|
||||
min_temp = int(get_attr_safe(entity, "min_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 = ""
|
||||
|
||||
@@ -503,7 +539,7 @@ class LuiPagesGen(object):
|
||||
state = 0
|
||||
if(mode == entity.state):
|
||||
state = 1
|
||||
|
||||
|
||||
icon_res_list.append(f"~{icon_id}~{color_on}~{state}~{mode}")
|
||||
|
||||
icon_res = "".join(icon_res_list)
|
||||
@@ -518,11 +554,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]
|
||||
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))
|
||||
|
||||
|
||||
currently_translation = get_translation(self._locale, "frontend.ui.card.climate.currently")
|
||||
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')
|
||||
|
||||
|
||||
detailPage = "1"
|
||||
if any(x in ["preset_modes", "swing_modes", "fan_modes"] for x in entity.attributes):
|
||||
detailPage = "0"
|
||||
@@ -606,7 +642,7 @@ class LuiPagesGen(object):
|
||||
item_str = ""
|
||||
for item in entities:
|
||||
item_str += self.generate_entities_item(item, "cardGrid")
|
||||
|
||||
|
||||
bck_override = entity.iconOverride
|
||||
if entity.status is not None:
|
||||
bck_entity = entity.entityId
|
||||
@@ -614,14 +650,14 @@ class LuiPagesGen(object):
|
||||
|
||||
entity.iconOverride = "mdi:speaker"
|
||||
item_str += self.generate_entities_item(entity, "cardGrid")
|
||||
|
||||
|
||||
entity.iconOverride = bck_override
|
||||
if entity.status is not None:
|
||||
entity.entityId = bck_entity
|
||||
|
||||
command = f"entityUpd~{heading}~{navigation}~{entityId}~{title}~~{author}~~{volume}~{iconplaypause}~{onoffbutton}~{shuffleBtn}{media_icon}{item_str}"
|
||||
self._send_mqtt_msg(command)
|
||||
|
||||
|
||||
def generate_alarm_page(self, navigation, title, entity, overwrite_supported_modes, alarmBtn):
|
||||
item = entity.entityId
|
||||
if not apis.ha_api.entity_exists(item):
|
||||
@@ -688,8 +724,8 @@ class LuiPagesGen(object):
|
||||
else:
|
||||
icon_color = rgb_dec565([243,179,0])
|
||||
add_btn=f"{iconnav}~{icon_color}~{entity}"
|
||||
|
||||
|
||||
|
||||
|
||||
# add padding to arm buttons
|
||||
arm_buttons = ""
|
||||
for b in supported_modes:
|
||||
@@ -699,12 +735,12 @@ class LuiPagesGen(object):
|
||||
arm_buttons += "~"*((4-len(supported_modes))*2)
|
||||
command = f"entityUpd~{title}~{navigation}~{item}{arm_buttons}~{icon}~{color}~{numpad}~{flashing}~{add_btn}"
|
||||
self._send_mqtt_msg(command)
|
||||
|
||||
|
||||
def generate_unlock_page(self, navigation, item, title, destination, pin):
|
||||
color = rgb_dec565([255,0,0])
|
||||
icon = get_icon_id("lock")
|
||||
supported_modes = ["cardUnlock-unlock"]
|
||||
|
||||
|
||||
# add padding to arm buttons
|
||||
arm_buttons = ""
|
||||
for b in supported_modes:
|
||||
@@ -743,8 +779,8 @@ class LuiPagesGen(object):
|
||||
if (time.time()-card.last_update) < card.cooldown:
|
||||
return
|
||||
card.last_update = time.time()
|
||||
|
||||
|
||||
|
||||
|
||||
leftBtn = "delete~~~~~"
|
||||
if card.uuid_prev is not None:
|
||||
leftBtn = self.generate_entities_item(Entity(
|
||||
@@ -790,7 +826,7 @@ class LuiPagesGen(object):
|
||||
self._send_mqtt_msg(f"timeout~{card.sleepTimeout}")
|
||||
else:
|
||||
self._send_mqtt_msg(f'timeout~{self._config.get("sleepTimeout")}')
|
||||
|
||||
|
||||
temp_unit = card.raw_config.get("temperatureUnit", "celsius")
|
||||
if card.cardType in ["cardEntities", "cardGrid", "cardGrid1","cardGrid2"]:
|
||||
self.generate_entities_page(navigation, card.title, card.entities, card.cardType, temp_unit)
|
||||
@@ -845,7 +881,7 @@ class LuiPagesGen(object):
|
||||
color = "disable"
|
||||
effect_supported = "disable"
|
||||
supported_color_modes = entity.attributes['supported_color_modes']
|
||||
|
||||
|
||||
if "onoff" not in supported_color_modes:
|
||||
brightness = 0
|
||||
if entity.state == "on":
|
||||
@@ -873,20 +909,20 @@ class LuiPagesGen(object):
|
||||
brightness_translation = get_translation(self._locale, "frontend.ui.card.light.brightness")
|
||||
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)
|
||||
|
||||
|
||||
def generate_shutter_detail_page(self, entity_id, is_open_detail=False):
|
||||
entity = apis.ha_api.get_entity(entity_id)
|
||||
entityType = "cover"
|
||||
device_class = entity.attributes.get("device_class", "window")
|
||||
icon_id = get_icon_ha(entity_id)
|
||||
|
||||
|
||||
pos = entity.attributes.get("current_position")
|
||||
if pos is None:
|
||||
pos_status = entity.state
|
||||
pos = "disable"
|
||||
else:
|
||||
pos_status = pos
|
||||
|
||||
|
||||
pos_translation = ""
|
||||
icon_up = ""
|
||||
icon_stop = ""
|
||||
@@ -990,7 +1026,7 @@ class LuiPagesGen(object):
|
||||
if modes:
|
||||
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):
|
||||
options_list = None
|
||||
@@ -1054,8 +1090,9 @@ class LuiPagesGen(object):
|
||||
label2 = get_translation(self._locale, "frontend.ui.card.timer.actions.cancel")
|
||||
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)
|
||||
|
||||
|
||||
def send_message_page(self, ident, heading, msg, b1, b2):
|
||||
self._send_mqtt_msg(f"pageType~popupNotify")
|
||||
self._send_mqtt_msg(f"entityUpdateDetail~{ident}~{heading}~65535~{b1}~65535~{b2}~65535~{msg}~65535~0")
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class NsPanelLovelaceUIManager(ad.ADBase):
|
||||
|
||||
desired_tasmota_driver_version = 8
|
||||
desired_display_firmware_version = 53
|
||||
version = "v4.3.3"
|
||||
version = "v4.7.3"
|
||||
|
||||
model = cfg.get("model")
|
||||
if model == "us-l":
|
||||
|
||||
@@ -94,37 +94,3 @@ Now, to install NSPanel Lovelace UI Backend with HACS, follow these steps:
|
||||
proceed with the download
|
||||
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
|
||||
```
|
||||

|
||||
|
||||
Adjust the entities in your apps.yaml that are accessing the forecast to the newly created trigger template:
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -1,65 +1,71 @@
|
||||
# Flash Tasmota to your NSPanel
|
||||
# Flash Tasmota to Your NSPanel
|
||||
|
||||
You need to connect to your nspanel via serial and flash tasmota [tasmota32-nspanel.bin](http://ota.tasmota.com/tasmota32/release/tasmota32-nspanel.bin) to your NSPanel.
|
||||
You can use the Tasmota Web Installer to do so. [Tasmota Web Installer](https://tasmota.github.io/install/)
|
||||
You need to connect to your NSPanel via serial and flash Tasmota using [tasmota32-nspanel.bin](http://ota.tasmota.com/tasmota32/release/tasmota32-nspanel.bin).
|
||||
You can use the [Tasmota Web Installer](https://tasmota.github.io/install/) to do so.
|
||||
|
||||
Checkout Blakadders Template Repo for more information on flashing, do not use the autoexec.be from this page.
|
||||
Check out Blakadder's Template Repo for more information on flashing. **Do not** use the autoexec.be from that page.
|
||||
[NSPanel Page of the Tasmota Template Repository](https://templates.blakadder.com/sonoff_NSPanel.html)
|
||||
|
||||
If you prefer EspHome over Tasmota, you can use this thrid party esphome component, which is replacing tasmota and the berry driver of this project.
|
||||
[ESPHome component](https://github.com/sairon/esphome-nspanel-lovelace-ui)
|
||||
If you prefer ESPHome over Tasmota, you can use this third-party ESPHome component, which replaces Tasmota and the Berry driver used in this project.
|
||||
[ESPHome Component](https://github.com/sairon/esphome-nspanel-lovelace-ui)
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Configure Tasmota Template for NSPanel
|
||||
|
||||
Configure the NSPanel template for Tasmota. (Go to Configuration and Configure Other and paste the template there, make sure to tick the activate checkbox)
|
||||
Configure the NSPanel template for Tasmota. (Go to Configuration > Configure Other, paste the template there, and make sure to tick the Activate checkbox.)
|
||||
|
||||

|
||||
|
||||
You can use the following template or copy the one on the [Tasmota Template Repo Site](https://templates.blakadder.com/sonoff_NSPanel.html).
|
||||
You can use the following template or copy the one from the [Tasmota Template Repo Site](https://templates.blakadder.com/sonoff_NSPanel.html):
|
||||
|
||||
`{"NAME":"NSPanel","GPIO":[0,0,0,0,3872,0,0,0,0,0,32,0,0,0,0,225,0,480,224,1,0,0,0,33,0,0,0,0,0,0,0,0,0,0,4736,0],"FLAG":0,"BASE":1,"CMND":"ADCParam 2,11200,10000,3950 | Sleep 0 | BuzzerPWM 1"}`
|
||||
{"NAME":"NSPanel","GPIO":[0,0,0,0,3872,0,0,0,0,0,32,0,0,0,0,225,0,480,224,1,0,0,0,33,0,0,0,0,0,0,0,0,0,0,4736,0],"FLAG":0,"BASE":1,"CMND":"ADCParam 2,11200,10000,3950 | Sleep 0 | BuzzerPWM 1"}
|
||||
|
||||
After a reboot of tasmota your screen will light up with the stock display firmware.
|
||||
After a reboot of Tasmota, your screen will light up with the stock display firmware.
|
||||
|
||||
---
|
||||
|
||||
## Upload Berry Driver to Tasmota
|
||||
|
||||
Go to `Consoles` > `Console` in Tasmota and execute the following command:
|
||||
Go to Consoles > Console in Tasmota and execute the following command:
|
||||
|
||||
```
|
||||
Backlog UrlFetch https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; SetOption151 0;Restart 1
|
||||
```
|
||||
Backlog UrlFetch https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; SetOption151 0; Restart 1
|
||||
|
||||
This will download the autoexec.be file from the repository and restart tasmota.
|
||||
This downloads the autoexec.be file from the repository and restarts Tasmota.
|
||||
|
||||
Note: The command is also disabling matter to free up memory, as it's most likely not used by any homeassistant users anyway.
|
||||
(Matter could cause memory issues during flashing of the Nextion Screen, but you can still enable it if you need to.)
|
||||
Note: This command also disables Matter to free up memory, as it's unlikely to be used by most Home Assistant users. (Matter can cause memory issues during flashing of the Nextion screen, but you can re-enable it later if needed.)
|
||||
|
||||
---
|
||||
|
||||
## Flash Firmware to Nextion Screen
|
||||
|
||||
Due the limitations of Berry, it's not possible to download the tft file directly from github, so I'm also renting a small server where you can download the file via HTTP.
|
||||
Due to the limitations of Berry, it's not possible to download the TFT file directly from GitHub. A small server is available to download the file via HTTP.
|
||||
|
||||
Use the one following commands in the tasmota console (not berry console) to flash the latest release from this repository:
|
||||
Use one of the following commands in the Tasmota console (not the Berry console) to flash the latest release from this repository:
|
||||
|
||||
EU Version: `FlashNextion http://nspanel.pky.eu/lui-release.tft`
|
||||
EU Version:
|
||||
FlashNextion http://nspanel.pky.eu/lui-release.tft
|
||||
|
||||
US Version Portrait: `FlashNextion http://nspanel.pky.eu/lui-us-p-release.tft`
|
||||
US Version Portrait:
|
||||
FlashNextion http://nspanel.pky.eu/lui-us-p-release.tft
|
||||
|
||||
US Version Landscape: `FlashNextion http://nspanel.pky.eu/lui-us-l-release.tft`
|
||||
US Version Landscape:
|
||||
FlashNextion http://nspanel.pky.eu/lui-us-l-release.tft
|
||||
|
||||
After sending the command, the screen should show a progress bar. The flashing progress takes around 5 minutes.
|
||||
After sending the command, the screen should show a progress bar. The flashing process takes around 5 minutes.
|
||||
|
||||
Note: For the US Version Users - keep in mind that you need to add the model config option to your apps.yaml later, more details on config overview page
|
||||
Note for US users: You'll need to add the model config option to your apps.yaml later. More details can be found on the config overview page.
|
||||
|
||||
---
|
||||
|
||||
<details>
|
||||
<summary>Alternatively you can use your own webserver or the one build into HomeAssistant:</summary>
|
||||
<summary>Alternatively, you can use your own web server or the one built into Home Assistant:</summary>
|
||||
<br>
|
||||
Upload the nspanel.tft from the lastest release to a Webserver (for example www folder of Home Assistant) and execute the following command in Tasmota Console. (Development Version: [tft file from HMI folder](HMI/nspanel.tft))
|
||||
Upload the nspanel.tft from the latest release to a web server (for example, the www folder of Home Assistant) and execute the following command in the Tasmota Console.
|
||||
(Development version: [TFT file from HMI folder](HMI/nspanel.tft))
|
||||
|
||||
**Webserver must be HTTP, HTTPS is not supported, due to limitations of berry lang on tasmota**
|
||||
**The web server must be HTTP. HTTPS is not supported due to Berry language limitations in Tasmota.**
|
||||
|
||||
`FlashNextion http://ip-address-of-your-homeassistant:8123/local/nspanel.tft`
|
||||
FlashNextion http://ip-address-of-your-homeassistant:8123/local/nspanel.tft
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user