ESPEasy System Variables

From Let's Control It
Jump to: navigation, search

ESP Easy system variables:

Generic: These can be used in templates for HTTP, MQTT, OLED and LCD displays and within rules:

%sysname%	- Name as configured through the webgui
%systime%	- Current time if NTP is enabled (HH:MM:SS, HH:MM prior to v2.0)
%uptime%	- Uptime in minutes
%ip%		- Current IP address
%vcc% 		- VCC value, this needs a custom compiled firmware! (#define FEATURE_ADC_VCC true)

Rules engine specific:

%eventvalue%	- substitutes the event value (everything that comes after the '=' sign)

Sample rules section:

on remoteTimerControl do
  timerSet 1,%eventvalue%
endon

Now send this command to the ESP:

http://<your esp ip>/control?cmd=event,remoteTimerControl=5

and it will set rules timer nr 1 to 5 seconds. Using this technique you can parse a value from an event to the rule engine. (note that 'timerSet' is a rule command and cannot be run directly from a remote command)