Skip to content

Commit c212e0c

Browse files
authoredMar 25, 2025··
HASPmota auto-start
1 parent dac52a3 commit c212e0c

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed
 

‎docs/HASPmota.md

+12-18
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@
22

33
!!! tip "This feature is included in tasmota32-lvgl.bin"
44

5+
!!! Starting from v14.5.0.2, HASPmota automatically starts if a file `pages.jsonl` is present
6+
57
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.
68

79
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+
919
## Gallery of widgets
1020

1121
[![HASPmota label](_media/lvgl/HASPmota_1_instructions.png){width="160"}](#label)
@@ -35,7 +45,7 @@ This feature is heavily inspired from @fvanroie's [openHASP project](https://git
3545
[![HASPmota tabview](_media/lvgl/HASPmota_25_tabview.png){width="160"}](#tabview)
3646

3747

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)
3949

4050
## Minimal requirements
4151

@@ -136,22 +146,6 @@ The code trigger a read of sensors every 2 seconds and publish the JSON result t
136146
tasmota.add_cron('*/2 * * * * *', def () var s = tasmota.read_sensors() if (s) tasmota.publish_rule(s) end end, 'hm_every_5_s')
137147
```
138148

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-
155149
## HASPmota reference
156150

157151
### Integration to Berry

0 commit comments

Comments
 (0)
Please sign in to comment.