|
2 | 2 |
|
3 | 3 | !!! tip "This feature is included in tasmota32-lvgl.bin"
|
4 | 4 |
|
| 5 | +!!! Starting from v14.5.0.2, HASPmota automatically starts if a file `pages.jsonl` is present |
| 6 | + |
5 | 7 | Tasmota happily supports the openHASP compatible format, known as HASPmota. This format allows you to describe rich graphics interfaces using simple JSON templates. The HASPmota support in Tasmota leverages the power of [LVGL](https://tasmota.github.io/docs/LVGL/) and the [Berry language](https://tasmota.github.io/docs/Berry/), but you don't need to code or learn the LVGL API to use it.
|
6 | 8 |
|
7 | 9 | This feature is heavily inspired from @fvanroie's [openHASP project](https://github.com/HASwitchPlate/openHASP).
|
8 |
| - |
| 10 | + |
| 11 | +## Running HASPmota |
| 12 | + |
| 13 | +HASPmota, like OpenHASP, relies of describing the elements to be displayed in a simple JSONL file. [JSONL (JSON Lines)](https://jsonlines.org/) is a file format where each line is a valid JSON value. The default file name is `pages.jsonl`. |
| 14 | + |
| 15 | +When a file `pages.jsonl` is present in the file system, HASPmota is automatically started without any additional code needed (since v14.5.0.2, previously you needed to start HASPmota in `autoexec.be`). |
| 16 | + |
| 17 | +HASPmota auto-start is triggered after `autoexec.be` is executed, so you have the opportunity to start HASPmota yourself, or initialize any sensor or components `autoexec.be` time. You can also use a different name than `pages.jsonl` and start HASPmota at any time of your convenience. |
| 18 | + |
9 | 19 | ## Gallery of widgets
|
10 | 20 |
|
11 | 21 | [{width="160"}](#label)
|
@@ -35,7 +45,7 @@ This feature is heavily inspired from @fvanroie's [openHASP project](https://git
|
35 | 45 | [{width="160"}](#tabview)
|
36 | 46 |
|
37 | 47 |
|
38 |
| -The `jsonl` file used to display the widgets can be found [here](_media/lvgl/haspmota_demo.jsonl) |
| 48 | +The `jsonl` file used to display the widgets can be found [widget demo JSONL file](_media/lvgl/haspmota_demo.jsonl) |
39 | 49 |
|
40 | 50 | ## Minimal requirements
|
41 | 51 |
|
@@ -136,22 +146,6 @@ The code trigger a read of sensors every 2 seconds and publish the JSON result t
|
136 | 146 | tasmota.add_cron('*/2 * * * * *', def () var s = tasmota.read_sensors() if (s) tasmota.publish_rule(s) end end, 'hm_every_5_s')
|
137 | 147 | ```
|
138 | 148 |
|
139 |
| -## Running HASPmota |
140 |
| - |
141 |
| -`HASPmota` code is included in `tasmota32-lvgl` firmwares. |
142 |
| - |
143 |
| -Running `HASPmota` with your own template is as simple as: |
144 |
| - |
145 |
| -- create a template in `pages.jsonl` and store it in the Tasmota file system |
146 |
| -- create an `autoexec.be` file containing the following: |
147 |
| - |
148 |
| -``` berry |
149 |
| -# simple `autoexec.be` to run HASPmota using the default `pages.jsonl` |
150 |
| -import haspmota |
151 |
| -haspmota.start() |
152 |
| -``` |
153 |
| - |
154 |
| - |
155 | 149 | ## HASPmota reference
|
156 | 150 |
|
157 | 151 | ### Integration to Berry
|
|
0 commit comments