【Domoticz】【ESP】通过Domoticz控制esp的http命令格式——ESPEasy System Variables

原文在这里

使用Domoticz平台时,控制ESPEasy节点的IO口,可使用http命令控制,这里贴官网的详细介绍以便查询,日后再整理。


ESP Easy offers a set of commands to control hardware devices and provide some basic local control using rules. There are several ways to launch commands on ESP Easy:

  • Using HTTP: syntax http:///control?cmd=
  • Using MQTT: send the to topic /cmd
  • Using Serial port: just type the
  • Using UDP between ESP units: SendTo , (Setup UDP peer-2-peer first!)
  • Using the Rule engine: just enter the within an event block or conditional block.

Commands are divided into several classes: Internal, Rules engine, plugins. The internal commands can only be used from Serial or Rules engine. If you want to use internal commands using HTTP/MQTT, setup an event within the rules section and remotely launch the "event" command.

Command Class Purpose Syntax
Debug Internal Change Serial port debug level Debug <1-4>
Delay Rules Delay rule processing Delay
Event Rules Create an event event
GPIO Plugin Direct control of output pins See:GPIO
IP Internal Change IP address IP
LCD Plugin Write text messages to LCD screen See:LCDDisplay
LCDCMD Plugin Control LCD screen See:LCDDisplay
LongPulse Plugin Direct pulse control of output pins See:GPIO
MCPGPIO Plugin Control MCP23017 output pins See:MCP23017
MCPPulse Plugin Pulse control on MCP23017 output pins See:MCP23017
MCPLongPulse Plugin Long pulse control on MCP23017 output pins See:MCP23017
OLED Plugin Write text messages to OLED screen See:OLEDDisplay
OLEDCMD Plugin Control OLED screen See:OLEDDisplay
PCAPWM Plugin Control PCA9685 pwm pins See:PCA9685
PCFGPIO Plugin Control PCF8574 output pins See:PCF8574
PCFPulse Plugin Pulse control on PCF8574 output pins See:PCF8574
PCFLongPulse Plugin Long pulse control on PCF8574 output pins See:PCF8574
Pulse Plugin Direct pulse control of output pins See:GPIO
Publish Rules Send command using MQTT broker service Publish ,
PWM Plugin Direct PWM control of output pins See:GPIO
Reboot Internal Reboot the ESP Reboot
Reset Internal Reset config to factory default Reset
Save Internal Save config to persistent flash memory Save
SendTo Rules Send command to other ESP (using UDP) SendTo ,
SendToHTTP Rules Send command to other network device using HTTP SendToHTTP , ,
SendToUDP Rules Send command to other network device using UDP SendToUDP , ,
Servo Plugin Direct control of servo motors See:GPIO
Settings Internal Show settings on serial terminal Settings
Status Plugin Show status on previously controlled pins Status ,
TimerSet Rules Start a timed event TimerSet ,
WifiAPKey Internal Change AP WPA key WifiAPKey
WifiConnect Internal Connect to configured wireless network WifiConnect
WifiDisconnect Internal Disconnect from wireless network WifiDisconnect
WifiKey Internal Change WPA key WifiKey
WifiScan Internal Scan Wireless networks WifiScan
WifiSSID Internal Change SSID WifiSSID
ESPEasy 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
%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:///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)


你可能感兴趣的:(开源硬件Arduino等等)