Page 1 of 1
Add variable in html ESP32
Posted: Mon Dec 20, 2021 5:27 pm
by MJU20
Fast question: how do I get a variable into a HTML file in Flowcode?
I did that ones in FC, in a wired module but can't find the file anymore.
Any directions to an example?
I want to add a temperature into a HTML-file..
Thanks.
Re: Add variable in html ESP32
Posted: Mon Dec 20, 2021 7:08 pm
by stefan.erni
Hi MJU20
You can use the %1.....%10 to set in the HTML Code
Maybe this two sample help
regards
Stefan
viewtopic.php?f=9&t=739
viewtopic.php?f=4&t=761
Code: Select all
<html>
<body>
<h1>Flowcode App Developer Webserver</h1>
LED is %0
<br />
<form action="/page2.htm">
<input type="checkbox" id="0" name="0" value="ON" %1 >
<label for="0"> LED Control</label><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
Re: Add variable in html ESP32
Posted: Mon Dec 20, 2021 10:18 pm
by MJU20
YES!! That was what I was looking for!
Thank you stefan.erni.
Too bad I can't read the example files.
I don't have the app develop tools..
Do I need to name the variable in FC %0?
Re: Add variable in html ESP32
Posted: Tue Dec 21, 2021 9:37 am
by Steve-Matrix
Attached is one of those projects saved as a .fcfx file. It might not work in this form, but at least you should be able to load it and see what is happening.
The WebServer component allows you to change the values of the %1 (etc) substitution variables using the macro "SetOutValue".
Re: Add variable in html ESP32
Posted: Tue Dec 21, 2021 5:27 pm
by MJU20
Thank you Steve,
I will examine it.
The "Indicator" can be replaced by a common LED I guess.