Web UI

Michael Ingraham 2019-09-17 09:33:28 -04:00
parent 8a6800eab8
commit 9aaf60c4b4
1 changed files with 26 additions and 24 deletions

@ -100,35 +100,37 @@ Executed on restart. p vars are saved automatically after this call
>`>W`
The lines in this section are displayed in the web UI main page. Requires compiling with `#define USE_SCRIPT_WEB_DISPLAY`.
you may put any html code here. vars may be substituted by the usual %var%
html lines are put into the sensor section of the main page or if preceeded with a `@` on top of the page.
USER IO elements are put on top of the page
>additionally a WEB user interface may be generated: toggle button, check box, slider or text input.
> - **Button** bu(`<vn>` `<txt1>` `<txt2>`)
vn = name of variable to hold button state
txt1 = text of ON state of button
txt2 = text of OFF state of button
> - **Checkbox** ck(`<vn>` `<txt>`)
vn = name of variable to hold checkbox state
txt = label text
> - **Slider** sl(`<min>` `<max>` `<vn>` `<ltxt>` `<mtxt>` `<rtxt>`)
min = slider minimum value
max = slider maximum value
vn = name of variable to hold slider value
ltxt = label left of slider
mtxt = label middle of slider
rtxt = label right of slider
> - **Textinput** ck(`<vn>` `<txt>`)
vn = name of string variable to hold text state
txt = label text
>
> You may put any html code here.
>- Variables may be substituted using %var%
>- HTML statements are displayed in the sensor section of the main page
>- HTML statements preceded with a `@` are displayed at the top of the page
>- USER IO elements are displayed at the top of the page
>
>A web user interface may be generated containing any of the following elements: toggle button, check box, slider, or text input.
>- **Button:** `bu(<vn> <txt1> <txt2>)`
`<vn>` = name of variable to hold button state
`<txt1>` = text of ON state of button
`<txt2>` = text of OFF state of button
>- **Checkbox:** `ck(<vn> <txt>)`
`<vn>` = name of variable to hold checkbox state
`<txt>` = label text
>- **Slider:** `sl(<min> <max> <vn> <ltxt> <mtxt> <rtxt>)`
`<min>` = slider minimum value
`<max>` = slider maximum value
`<vn>` = name of variable to hold slider value
`<ltxt>` = label left of slider
`<mtxt>` = label middle of slider
`<rtxt>` = label right of slider
>- **Text Input:** `tx(<vn> <txt>)`
`<vn>` = name of string variable to hold text state
`<txt>` = label text
>`>J`
The lines in this section are published via MQTT in a JSON payload on [TelePeriod](Commands#teleperiod). Requires compiling with `#define USE_SCRIPT_JSON_EXPORT `.
>`>M`
[Smart Meter Interface](smart-meter-interface).
[Smart Meter Interface](smart-meter-interface)
If a variable does not exist, `???` is displayed for commands