NSPanel Documentation โ—† Icon overview GitHub Deutsch

Test environment

Ready-made test data for every panel model: states for every channel role of the adapter, and for each model a panel configuration with all card types, fully filled pages and a fully filled screensaver. A change can be checked on five formats within minutes, without creating a single state by hand โ€” and for a hardware test a configuration is right there.

This is meant for everyone working on the adapter or trying to reproduce a bug. Nothing here is needed for day-to-day use.

Contents:

1. What it is for

The test environment exists to make layout problems visible before someone runs into them in daily use. Every page is filled to its last slot, the values are deliberately awkward (long names, wide numbers, units), and the same configuration runs on all five formats. What still fits on the EU panel overflows on the US portrait panel.

A number of bugs were found exactly this way โ€” cut-off values, colliding names, a screensaver drawn in the wrong orientation. The comparison is on the picture page under Before and after.

2. Create the test states

Instance settings โ†’ tab Developer โ†’ button Create test states.

The tab is only visible in expert mode. It is toggled in the admin itself (icon at the bottom left of the sidebar), not in the instance settings, and the setting applies to the current browser session. See the page Developer for details.

Developer tab with the button and the message

The adapter creates the objects below 0_userdata.0.NSPanelTest and alias.0.NSPanelTest and sets initial values. With the currently shipped data that is 550 objects (folders, values and aliases together); the number grows whenever the test data is extended.

The message below the button gives three numbers: created, already existing, failed.

Requirement Why
The instance must be running The button sends a message to the instance; if it is stopped, the admin refuses with "Instance โ€ฆ is not alive".
0_userdata.0 and alias.0 must exist Objects are only created from NSPanelTest downwards. Without the branch above, every object counts as failed.

Existing objects and values are left untouched. The adapter checks each object individually and skips it if it is already there โ€” initial values are only written for newly created objects. So the button may be pressed as often as you like; the second time it reports "0 created". There is a flip side: time values are not refreshed this way (see Limits).

If something fails, the run does not stop โ€” every single object is written to the log with a warning, and the third number of the message shows how many there were.

3. Import the panel configuration

The ready-made configurations are in the repository under testumgebung/panels/. There is one file per model:

Model Resolution File
EU 480 ร— 320 landscape nspanel-eu.json
US landscape 480 ร— 320 landscape nspanel-us-l.json
US portrait 320 ร— 480 portrait nspanel-us-p.json
Smartphone landscape 640 ร— 320 landscape nspanel-web-l.json
Smartphone portrait 320 ร— 640 portrait nspanel-web-p.json

The way there: tab NSPanel settings โ†’ on the panel tile Import panel configuration โ†’ pick the file โ†’ Import in the overview โ†’ then save the instance settings.

Overview before the import

In an empty panel everything fits without conflict: 24 rows โ€” 23 pages and the screensaver.

Result of the import

Two things take effect at different moments. The panel settings (states cmd.*) are written immediately on import, everything else only when the instance settings are saved. No manual restart is needed โ€” saving restarts the adapter along the way.

Everything else about the dialog โ€” part selection, import mode, name conflicts, safety prompts โ€” is on the page Transfer a panel configuration.

The files contain no secrets. They were exported without credentials (secretsIncluded: false); the alarm and unlock pages carry no PIN of their own, so the instance's global password applies, and the guest Wi-Fi is configured as an open network.

Several models in the same instance are no problem: page names carry a per-model prefix (eu_, usl_, usp_, webl_, webp_), so there are no name clashes.

Without hardware: a web panel

The quickest route needs no device at all: tab NSPanel settings โ†’ Add web panel โ†’ choose the model โ†’ save the instance settings โ†’ then import as described above. The button only appears when web panels are enabled in the instance settings.

It opens in the browser at http://<ioBroker>:8090/<topic> โ€” port 8090 is the default; with HTTPS enabled it is https, and with a PIN set a login page comes first. The details are on the page Web panel.

By the way, all five shipped files were exported from web panels โ€” including the EU and US ones. For a real device you import the very same file; the origin recorded in the export says nothing about where it may go.

4. What the panel shows

23 pages, reachable in this order. The right arrow walks through all of them and returns from the last one to the home page. The numbers are the filled slots per model โ€” every page is filled up to the capacity of the model.

# Page Card eu us-l us-p web-l web-p
1 Light (home page) cardGrid 6 6 6 8 10
2 House cardGrid2 8 8 9 10 15
3 Readings cardGrid3 4 4 4 6 8
4 Blinds & gates cardEntities 4 4 5 4 8
5 Sensors cardEntities 4 4 5 4 8
6 Controls cardEntities 4 4 5 4 8
7 All roles cardEntities 28 28 28 28 28
8 Departures cardSchedule 6 6 6 6 11
9 Living room cardThermo โ€“ โ€“ โ€“ โ€“ โ€“
10 Air conditioning cardThermo โ€“ โ€“ โ€“ โ€“ โ€“
11 Heating circuits cardThermo2 9 9 9 9 9
12 (Media, no title) cardMedia 5 5 5 6 8
13 Power flow cardPower โ€“ โ€“ โ€“ โ€“ โ€“
14 Power 24 h cardChart โ€“ โ€“ โ€“ โ€“ โ€“
15 Outside temperature cardLChart โ€“ โ€“ โ€“ โ€“ โ€“
16 Energy today cardPChart โ€“ โ€“ โ€“ โ€“ โ€“
17 Alarm system cardAlarm โ€“ โ€“ โ€“ โ€“ โ€“
18 Open door cardAlarm (unlock) โ€“ โ€“ โ€“ โ€“ โ€“
19 Guest Wi-Fi cardQR โ€“ โ€“ โ€“ โ€“ โ€“
20 Instructions cardQR โ€“ โ€“ โ€“ โ€“ โ€“
21 Waste collection cardTrash โ€“ โ€“ โ€“ โ€“ โ€“
22 Light (page link) pageLink โ€“ โ€“ โ€“ โ€“ โ€“
23 Details cardEntities 4 4 5 4 8

"โ€“" means the card has no freely assignable slots; its content lives in the card itself.

A few peculiarities that stand out while clicking through, all of them intentional:

All pages on all five models as pictures: Test environment โ€“ pictures โ†’ Pages per model.

5. Screensaver

One entry per model, start mode advanced. Every area is filled up to the capacity of the model โ€” for the largest mode in each case, so that no slot stays empty after switching modes either.

Area eu us-l us-p web-l web-p
left 3 3 3 3 4
bottom 6 6 6 8 8
indicators 7 7 8 11 12
favourite 1 1 1 1 1
alternate row 1 1 1 1 1
MR icons 2 2 2 2 2
notifications 2 2 2 2 2

The indicators are mixed on purpose: display only, tap switches or opens a page, long press with its own action, or both together.

Switching the mode โ€” set the state <instance>.panels.<panel ID>.cmd.screenSaver.layout:

Value Mode
0 standard
1 alternate
2 advanced
3 easyview
4 tiles

The change takes effect immediately. The plain names are also available as selectable values on the state itself.

After an adapter restart the mode from the admin applies again โ€” here advanced. That holds for screensavers created in the admin, and therefore for the test environment. If the screensaver comes from a configuration script, the mode you set survives the restart. To change it permanently, edit the entry "Test โ€ฆ" in the Screensaver tab.

The two notifications appear when 0_userdata.0.NSPanelTest.Hinweis.Waschmaschine_fertig is true or 0_userdata.0.NSPanelTest.Hinweis.Fenster_offen is greater than 0. The first can be dismissed, the second cannot โ€” it only disappears once the value is back to 0.

All five modes on all five models as pictures: Test environment โ€“ pictures โ†’ Screensaver modes.

6. System page "navigation error"

When a navigation points to a page that does not exist, the panel shows a system page: title Nav error, plus the missing target, the page the jump came from, and the hint to check the configuration. The back arrow returns to the original page.

This cannot be reproduced with the five panel files from testumgebung/panels/. Their navigation is complete. The screenshots come from the older, script-configured test setup (testumgebung/Global_Script.ts), where one page deliberately points at an empty target. To see the page, add a navigation target that does not exist to any page by hand.

The page in both system languages and on all five models: Test environment โ€“ pictures โ†’ System page "navigation error".

7. Limits

Topic What to keep in mind
Media page It needs a real player. The files point to squeezeboxrpc.0.Players.Familienzimmer โ€” the only reference to a foreign adapter in the whole configuration. After the import, enter your own player in the admin (alexa2, sonos, spotify-premium, mpd, squeezeboxrpc) or hide the page.
Two roles without a page media is on no page โ€” an element of that role needs an alias to a real player. sensor.alarm.flood is not implemented as a page element in the adapter; as a screensaver indicator the water sensor only shows up on the two smartphone formats, because only those have enough indicator slots.
Time values go stale Departures and waste collection dates are set relative to the current time when they are created. Because the button never overwrites anything, they stay as they are. To refresh them, delete the affected states and press the button again.
Initial values only The states do not move on their own. To see a curve in a chart, you have to write values yourself.

8. Structure and your own additions

Where the states come from, how to add your own, how the five panel files are produced and what the unit test guarantees is described on the page Test environment โ€“ structure.


Source of this page: doc/en/Testumgebung.md ยท Project on GitHub

  Back to top