Compare commits

..

1 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
7 changed files with 927 additions and 1569 deletions

View File

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

View File

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

View File

@@ -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 = set([x for x in items if not (x is None or x.startswith(prefixes))])
items = [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):

View File

@@ -388,12 +388,11 @@ class LuiPagesGen(object):
entityTypePanel = "text"
unit = get_attr_safe(entity, "temperature_unit", "")
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:
item.stype = int(spintstr[1])
if type(item.stype) == int:
bits = get_attr_safe(entity, "supported_features", 0b0)
if not rt:
rt = "daily"
@@ -408,8 +407,8 @@ class LuiPagesGen(object):
"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]
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:

View File

@@ -1,71 +1,65 @@
# Flash Tasmota to Your NSPanel
# Flash Tasmota to your NSPanel
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.
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/)
Check out Blakadder's Template Repo for more information on flashing. **Do not** use the autoexec.be from that page.
Checkout Blakadders Template Repo for more information on flashing, do not use the autoexec.be from this 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 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)
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)
---
## Configure Tasmota Template for NSPanel
Configure the NSPanel template for Tasmota. (Go to Configuration > Configure Other, paste the template there, and make sure to tick the Activate checkbox.)
Configure the NSPanel template for Tasmota. (Go to Configuration and Configure Other and paste the template there, make sure to tick the activate checkbox)
![tasmota-template-config](img/tasmota-template-config.png)
You can use the following template or copy the one from the [Tasmota Template Repo Site](https://templates.blakadder.com/sonoff_NSPanel.html):
You can use the following template or copy the one on 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 downloads the autoexec.be file from the repository and restarts Tasmota.
This will download the autoexec.be file from the repository and restart tasmota.
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.)
---
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.)
## Flash Firmware to Nextion Screen
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.
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.
Use one of the following commands in the Tasmota console (not the Berry console) to flash the latest release from this repository:
Use the one following commands in the tasmota console (not 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 process takes around 5 minutes.
After sending the command, the screen should show a progress bar. The flashing progress takes around 5 minutes.
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.
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
---
<details>
<summary>Alternatively, you can use your own web server or the one built into Home Assistant:</summary>
<summary>Alternatively you can use your own webserver or the one build into HomeAssistant:</summary>
<br>
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))
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))
**The web server must be HTTP. HTTPS is not supported due to Berry language limitations in Tasmota.**
**Webserver must be HTTP, HTTPS is not supported, due to limitations of berry lang on 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