Skip to content

Commit b648f7f

Browse files
Updated docs according to upcomming v2.0 BETA (#42)
* Updated docs according to upcomming v2.0 BETA * Fixed syntax of labels and also added more colors to Label-component * Fixed more syntax errors * Escaped < and > tags * Added missed tags from previous commit * Added missing MQTT topic * Added instructions on how to reorder entities/scenes * added information about how to manually upload and choose between the 4 different tft files. * Updated flashing tool page to say beta 2.0. Changed picture in manual with one with more installed panels. * Added support page with buy me a coffee and payed affiliate links. --------- Co-authored-by: cablesandcoffee <erikbergstroom@gmail.com>
1 parent 76bfad5 commit b648f7f

22 files changed

Lines changed: 371 additions & 188 deletions

docs/advanced/architecture.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,25 @@
22
title: Architecture
33
sidebar_position: 7
44
---
5+
56
import Centered from '@site/src/components/Centered';
7+
import Label from '@site/src/components/Label';
68

79
# Architecture
810

911
## Software components
12+
1013
There are 3 software components written for the NSPanel Manager project:
1114

12-
* **Web interface**: The web interface that you interact with is built on top of the Django framework. This software gives
13-
the user an interface to interact and configure the project with. This software also manages the database with settings.
14-
* **MQTT Manager**: There is a second software running in the background on the NSPanel Manager container that
15-
hosts the web interface. This component is named "MQTTManager". The MQTTManager handles all things with
16-
MQTT. It loads the config from the web interface via the API and then processes all commands from panels, state
15+
- **Web interface**: The web interface that you interact with is built on top of the Django framework. This software gives
16+
the user an interface to interact with and configure the NSPanel Manager software. This software also manages the database with settings.
17+
- **MQTT Manager**: There is a second software running in the background on the NSPanel Manager container that
18+
hosts the web interface. The MQTTManager handles all things with
19+
MQTT. It loads the config from the database uppon startup and changes to configuration then processes all commands from panels, state
1720
updates from Home Assistant and OpenHAB and so on. It’s basically the glue that makes the panel’s actions affect
1821
Home Assistant and OpenHAB. The MQTTManager is also the software that send state updates from Home Assistant
1922
and OpenHAB to the panels when changes occur.
20-
* **The NSPanel firmware**: The firmware written for the NSPanel has been specifically designed to be as response
23+
- **The NSPanel firmware**: The firmware written for the NSPanel has been specifically designed to be as responsive
2124
and easy to use as possible. The firmware handles all communication with the TFT (Nextion) display and with
2225
MQTTManager via MQTT.
2326

@@ -47,12 +50,13 @@ arrows above.
4750
### Home Assistant and/or OpenHAB to/from NSPanel Manager container
4851

4952
There is two types of traffic flowing between these nodes:
50-
* **Websocket**: A websocket connection is setup in order for the NSPanel Manager container to receive entity updates
53+
54+
- **Websocket**: A websocket connection is setup in order for the NSPanel Manager container to receive entity updates
5155
from Home Assistant and/or OpenHAB but also to sent entity commands (E.. turn light X on to 20%). A websocket
5256
is used to speed up the communication and also to not have to poll the home automation software for information.
53-
* **HTTP GET API**: The usual HTTP GET API is also used. This is used when adding entities to a room, as an
54-
example. When pressing the "Add new light" button, the NSPanel Manager container will make an HTTP GET request
55-
to gather all available entities and then send them back to the client (browser) so that the user may choose what
57+
- **HTTP GET API**: The usual HTTP GET API is also used. This is used when adding entities to a room, as an
58+
example. When pressing the "Add new entity" button, the NSPanel Manager container will make an HTTP GET request
59+
to gather all available entities and then send them back to the client (browser) so that the user may choose what
5660
entity to add to the room.
5761

5862
### NSPanel Manager container to/from MQTT
@@ -66,20 +70,26 @@ Home Assistant and OpenHAB can leverage the MQTT integration through "Home Assis
6670
OpenHAB can also use) to auto-discover NSPanels and automatically register entities for panel temperature reading, panel
6771
relays, screen state and so on.
6872

69-
### NSPanel Manager container to/from NSPanels
73+
### NSPanel Manager container to/from NSPanels <Label value="stable"/>
7074

7175
The configuration of lights, scenes and so on does not reside on each panel. The panel only has locally the bare minimum
7276
configuration for setup. When the panel starts and has connected to WiFi it will do a HTTP GET request to the NSPanel
73-
Manager container in order to receive all configuration of entities, screen brightness and really, all settings
77+
Manager container in order to receive all configuration of entities, screen brightness and really, all settings
7478
available in the NSPanel Manager web interface.
7579

80+
### NSPanel Manager container to/from NSPanels <Label value="beta"/>
81+
82+
The configuration of lights, scenes and so on does not reside on each panel. The panel only has locally the bare minimum
83+
configuration for setup. When the panel starts and has connected to MQTT it will get the data needed to operate via MQTT messages
84+
sent via the MQTTManager software component.
85+
7686
### MQTT to/from NSPanels
7787

7888
Each NSPanel send states (E.g. temperature) and commands (E.g. turning on a light) over MQTT for the NSPanel Manager
79-
container to pickup.
89+
container to pickup.
8090

8191
The panel also receives commands, E.g. turn on relay 1, turn on screen and so on.
8292

8393
:::info
8494
The complete list of MQTT topics is documented [here](./mqtt-topics).
85-
:::
95+
:::

docs/advanced/mqtt-topics.md

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
title: MQTT Topics
33
sidebar_position: 10
44
---
5+
56
import Centered from '@site/src/components/Centered';
7+
import Label from '@site/src/components/Label';
68

7-
# MQTT Topics
9+
# MQTT Topics <Label value="stable"/>
810

911
Below table is a description of all MQTT topics that might be of use by a user. Replace `<panel_name>` with the friendly
1012
name of your NSPanel:
1113

1214
| Topic | Payload | Description |
13-
|-----------------------------------------------|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
15+
| --------------------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1416
| nspanel/\<panel_name\>/screen_cmd | 1 or 0 | Send a 1 or 0 to turn on/off the display. |
1517
| nspanel/\<panel_name\>/screen_state | 1 or 0 | Current state of the screen. |
1618
| nspanel/\<panel_name\>/brightness | 1 to 100 | Control the brightness of the screen. |
@@ -25,14 +27,51 @@ name of your NSPanel:
2527

2628
There are more topics that are used internally, these are:
2729

30+
| Topic | Payload | Description |
31+
| ----------------------------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------- |
32+
| nspanel/entities/\<type\>/\<id\>/state\_\<attribute\> | The value of the attribute | An update of entity state value sent out by MQTTManager. Example:nspanel/entities/light/42/state_kelvin |
33+
| nspanel/status/time | Time as a string | Current time sent by MQTTManager. |
34+
| nspanel/status/weather | JSON | A JSON representation of the current weather and weather forecast. |
35+
| nspanel/\<panel_name\>/status_report | JSON | JSON payload with current state of the panel. |
36+
| nspanel/\<panel_name\>/status | JSON | JSON payload with current online/offline state of the panel. |
37+
| nspanel/\<panel_name\>/command | JSON | JSON payload with a command for the panel to execute. |
38+
| nspanel/mqttmanager/command | JSON | JSON payload from panel with a command for MQTTManager to perform. |
39+
40+
# MQTT Topics <Label value="beta"/>
41+
42+
Below table is a description of all MQTT topics that might be of use by a user. Replace `<mac>` with the MAC-address of your NSPanel:
43+
44+
| Topic | Payload | Description |
45+
| -------------------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
46+
| nspanel/\<mac\>/screen_cmd | 1 or 0 | Send a 1 or 0 to turn on/off the display. |
47+
| nspanel/\<mac\>/screen_state | 1 or 0 | Current state of the screen. |
48+
| nspanel/\<mac\>/brightness_cmd | 1 to 100 | Control the brightness of the screen. |
49+
| nspanel/\<mac\>/brightness_state | 1 to 100 | Current state of the brightness of the screen. |
50+
| nspanel/\<mac\>/brightness_screensaver_cmd | 0 to 100 | Control the brightness of the screensaver. |
51+
| nspanel/\<mac\>/brightness_screensaver_state | 0 to 100 | State of the brightness of the screensaver. |
52+
| nspanel/\<mac\>/relay1_cmd | 1 or 0 | Send a 1 or 0 to turn on/off relay 1. |
53+
| nspanel/\<mac\>/relay1_state | 1 or 0 | The current state of relay 1. |
54+
| nspanel/\<mac\>/relay2_cmd | 1 or 0 | Send a 1 or 0 to turn on/off relay 2. |
55+
| nspanel/\<mac\>/relay2_state | 1 or 0 | The current state of relay 2. |
56+
| nspanel/\<mac\>/temperature | Current temperature | The current temperature reading. |
57+
| nspanel/\<mac\>/screensaver_mode_cmd | screensaver mode | Select what screensaver to display <br/> Choose from the following: <br/>- with_background<br/>-without_background<br/>-datetime_with_background<br/>-datetime_without_background<br/>or no_screensaver |
58+
| nspanel/\<mac\>/screensaver_mode_state | screensaver mode | The currently selected screensaver mode |
59+
| nspanel/\<mac\>/log | Log message | The panel will send live logs on this topic. |
2860

29-
| Topic | Payload | Description |
30-
|------------------------------------------------------|----------------------------|---------------------------------------------------------------------------------------------------------|
31-
| nspanel/entities/\<type\>/\<id\>/state_\<attribute\> | The value of the attribute | An update of entity state value sent out by MQTTManager. Example:nspanel/entities/light/42/state_kelvin |
32-
| nspanel/status/time | Time as a string | Current time sent by MQTTManager. |
33-
| nspanel/status/weather | JSON | A JSON representation of the current weather and weather forecast. |
34-
| nspanel/\<panel_name\>/status_report | JSON | JSON payload with current state of the panel. |
35-
| nspanel/\<panel_name\>/status | JSON | JSON payload with current online/offline state of the panel. |
36-
| nspanel/\<panel_name\>/command | JSON | JSON payload with a command for the panel to execute. |
37-
| nspanel/mqttmanager/command | JSON | JSON payload from panel with a command for MQTTManager to perform. |
61+
Below are more topics that are used internally. Replace `<manager_address>` with the IP address of the manager container.
3862

63+
| Topic | Payload | Description |
64+
| --------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------- |
65+
| nspanel/mqttmanager\_\<manager_address\>/status/time | Time as a string | Current time sent by MQTTManager. |
66+
| nspanel/mqttmanager\_\<manager_address\>/status/date | Date as a string | Current date sent by MQTTManager. |
67+
| nspanel/mqttmanager\_\<manager_address\>/status/weather | Protobuf | A protobuf representation of the current weather and weather forecast. |
68+
| nspanel/\<mac\>/status_report | Protobuf | Protobuf payload with current state of the panel. |
69+
| nspanel/\<mac\>/status | JSON | JSON payload with current online/offline state of the panel. |
70+
| nspanel/\<mac\>/command | JSON | JSON payload with a command for the panel to execute. |
71+
| nspanel/mqttmanager\_\<manager_address\>/command | Protobuf | Protobuf payload from panel with a command for MQTTManager to perform. |
72+
| nspanel/mqttmanager\_\<manager_address\>/room/\<room_id\>/state | Protobuf | Protobuf payload from the manager that represents the "Home page" state to display on the NSPanel for the given room. |
73+
| nspanel/mqttmanager\_\<manager_address\>/all_rooms_state | Protobuf | Protobuf payload from the manager that represents the "Home page" state to display on the NSPanel when in "All rooms" mode. |
74+
| nspanel/mqttmanager\_\<manager_address\>/all_rooms_state | Protobuf | Protobuf payload from the manager that represents the "Home page" state to display on the NSPanel when in "All rooms" mode. |
75+
| nspanel/mqttmanager\_\<manager_address\>/entity_pages/\<page_id\>/state | Protobuf | Protobuf payload from the manager that represents the "Entities"/"Scenes" state to display on the NSPanel when. |
76+
| nspanel/mqttmanager\_\<manager_address\>/relay_groups/\<group_id\>/state | 1 or 0 | Current state of the relay group binding 1 for "ON" and 0 for "OFF". |
77+
| nspanel/mqttmanager\_\<manager_address\>/entities/lights/\<light_id\>/state | Protobuf | Current state of the light. |

0 commit comments

Comments
 (0)