Difference between revisions of "ESPEasy System Variables"

From Let's Control It
Jump to navigation Jump to search
m
Line 17: Line 17:
 
  %vcc% - VCC value, this needs a custom compiled firmware! (#define FEATURE_ADC_VCC true)
 
  %vcc% - VCC value, this needs a custom compiled firmware! (#define FEATURE_ADC_VCC true)
  
Rules engine specific:
+
More uses of these system variables can be seen in the [[Tutorial_Rules|rules section]] and [[EasyFormula|formula section]].
%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)
 

Revision as of 07:56, 24 October 2017

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)
%syshour%	- HH
%sysmin%	- MM
%syssec%	- SS
%sysday%	- DD
%sysmonth%	- XX
%sysyear%	- 4 digits - 2017
%sysyears%	- 2 digits - 17
%uptime%	- Uptime in minutes
%ip%		- Current IP address
%vcc% 		- VCC value, this needs a custom compiled firmware! (#define FEATURE_ADC_VCC true)

More uses of these system variables can be seen in the rules section and formula section.