Difference between revisions of "ESPEasy Command Reference"
Jump to navigation
Jump to search
m (Added note that the Command Reference page is transitioning to readthedocs.) |
|||
(55 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | '''Notice:''' The ESPEasy Command Reference page is transitioning to a new format. The revised page can be found here: [https://espeasy.readthedocs.io/en/latest/Reference/Command.html readthedocs] | ||
+ | <br> | ||
+ | <br> | ||
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: | 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: | ||
− | + | {| class="wikitable sortable" | |
− | + | |- | |
− | + | ! style="width: 8%|Protocol | |
− | + | ! style="width: 35%|Syntax | |
− | + | ! Extra information | |
+ | |- | ||
+ | |||
+ | | HTTP | ||
+ | | '''http://<espeasyip>/control?cmd=<span style="color: white; background:#0077dd"><command></span>''' | ||
+ | | Send commands over the HTTP protocol. | ||
+ | |- | ||
+ | |||
+ | | MQTT | ||
+ | | '''<MQTT subscribe template>/cmd''' with payload: '''<span style="color: white; background:#0077dd"><command></span>''' | ||
+ | | Send commands over the MQTT protocol. As of current status this is obeyed only for the [[ESP Easy web interface#Controllers page (version 2.0+)|first controller]] in the list. | ||
+ | |- | ||
+ | |||
+ | | Serial (TTL) | ||
+ | | '''<span style="color: white; background:#0077dd"><command></span>''' | ||
+ | | Send commands using serial (RX/TX). Just type the '''<command>''' | ||
+ | |- | ||
+ | |||
+ | | UDP | ||
+ | | '''SendTo <unit nr>, <span style="color: white; background:#0077dd"><command></span>''' | ||
+ | | Send commands from one ESP Easy unit to another. Setup UDP peer-2-peer first. | ||
+ | |- | ||
+ | |||
+ | | Rules | ||
+ | | '''<span style="color: white; background:#0077dd"><command></span>''' | ||
+ | | Internally within ESP Easy. Just enter the '''<command>''' within an event block or conditional block. | ||
+ | |- | ||
+ | |||
+ | |} | ||
− | Commands are divided into several classes: | + | '''<span style="color: white; background:#0077dd">Commands</span>''' are divided into several classes: |
− | Internal - Can be run from serial and rules engine | + | <span style="color: red>Internal</span> - Can be run from serial and rules engine |
− | Rules - Can be run from serial and rules engine | + | <span style="color: green>Rules</span> - Can be run from serial and rules engine |
− | + | <span style="color: orange>Plugin</span> - Can be run from serial, rules engine, HTTP, MQTT | |
− | Special - This can be used from any source | + | <span style="color: black>Special</span> - This can be used from any source |
If you want to use internal or rules commands using HTTP/MQTT, setup an event within the rules section and remotely launch the "event" command. | If you want to use internal or rules commands using HTTP/MQTT, setup an event within the rules section and remotely launch the "event" command. | ||
− | {| | + | {| class="wikitable sortable" |
+ | |- | ||
! Command | ! Command | ||
! Class | ! Class | ||
Line 22: | Line 54: | ||
! Syntax | ! Syntax | ||
|- | |- | ||
+ | |||
| Debug | | Debug | ||
− | | Internal | + | | style="background: red; color: white;" | Internal |
| Change Serial port debug level | | Change Serial port debug level | ||
| Debug <1-4> | | Debug <1-4> | ||
|- | |- | ||
+ | |||
| Delay | | Delay | ||
− | | Rules | + | | style="background: green; color: white;" | Rules |
| Delay rule processing | | Delay rule processing | ||
| Delay <delay in milliSeconds> | | Delay <delay in milliSeconds> | ||
|- | |- | ||
+ | |||
| Event | | Event | ||
− | | Special | + | | style="background: black; color: white;" | Special |
− | | Create an event | + | | Create an event, it's possible to send a float value along as well. |
− | | event <event> | + | | event,<eventName><BR>event,<eventName>=<eventValue> |
|- | |- | ||
+ | |||
| GPIO | | GPIO | ||
− | | Plugin | + | | style="background: orange; color: black;" | Plugin |
| Direct control of output pins | | Direct control of output pins | ||
| See:[[GPIO]] | | See:[[GPIO]] | ||
|- | |- | ||
− | + | ||
− | | | + | | Status |
− | | | + | | style="background: orange; color: black;" | Plugin |
− | + | | Get a status set by GPIO/PWM/Servo command. | |
− | + | | Status,GPIO,<pin number> | |
− | |||
− | | Plugin | ||
− | | PWM | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
+ | |||
| IP | | IP | ||
− | | Internal | + | | style="background: red; color: white;" | Internal |
| Change IP address | | Change IP address | ||
| IP <IP address> | | IP <IP address> | ||
|- | |- | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| LongPulse | | LongPulse | ||
− | | Plugin | + | | style="background: orange; color: black;" | Plugin |
| Direct pulse control of output pins | | Direct pulse control of output pins | ||
| See:[[GPIO]] | | See:[[GPIO]] | ||
|- | |- | ||
− | | | + | |
− | | Plugin | + | | LongPulse_mS |
− | | | + | | style="background: orange; color: black;" | Plugin |
− | | See:[[ | + | | Direct pulse control of output pins, same as above but using mSeconds instead of Seconds. |
+ | | See:[[GPIO]] | ||
|- | |- | ||
− | | | + | |
− | | | + | | Name |
− | | | + | | style="background: red; color: white;" | Internal |
− | | | + | | Set the name of the unit |
+ | | Name <new name> | ||
|- | |- | ||
− | + | ||
− | + | | Password | |
− | + | | style="background: red; color: white;" | Internal | |
− | + | | Set the password of the unit | |
− | + | | Password <new password> | |
− | |||
− | |||
− | | | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | | | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
+ | |||
| Pulse | | Pulse | ||
− | | Plugin | + | | style="background: orange; color: black;" | Plugin |
| Direct pulse control of output pins | | Direct pulse control of output pins | ||
| See:[[GPIO]] | | See:[[GPIO]] | ||
|- | |- | ||
+ | |||
| Publish | | Publish | ||
− | | Rules | + | | style="background: green; color: white;" | Rules |
| Send command using MQTT broker service | | Send command using MQTT broker service | ||
| Publish <topic>, <value> | | Publish <topic>, <value> | ||
|- | |- | ||
+ | |||
| PWM | | PWM | ||
− | | Plugin | + | | style="background: orange; color: black;" | Plugin |
| Direct PWM control of output pins | | Direct PWM control of output pins | ||
| See:[[GPIO]] | | See:[[GPIO]] | ||
|- | |- | ||
+ | |||
| Reboot | | Reboot | ||
− | | Internal | + | | style="background: red; color: white;" | Internal |
| Reboot the ESP | | Reboot the ESP | ||
| Reboot | | Reboot | ||
|- | |- | ||
+ | |||
| Reset | | Reset | ||
− | | Internal | + | | style="background: red; color: white;" | Internal |
− | | Reset config to factory default | + | | Reset config to factory default. Caution, all settings will be lost! |
| Reset | | Reset | ||
|- | |- | ||
+ | |||
+ | | ResetFlashWriteCounter | ||
+ | | style="background: red; color: white;" | Internal | ||
+ | | Reset flash write to zero. | ||
+ | | ResetFlashWriteCounter | ||
+ | |- | ||
+ | |||
+ | | Rules | ||
+ | | style="background: red; color: white;" | Internal | ||
+ | | Rules enabled (1) or rules disabled (0) | ||
+ | | Rules,<value> | ||
+ | |- | ||
+ | |||
+ | | Tone | ||
+ | | style="background: orange; color: black;" | Plugin | ||
+ | | Play tone via speaker or piezo | ||
+ | | See:[[Buzzer (RTTTL)]] | ||
+ | |- | ||
+ | |||
+ | | Rtttl | ||
+ | | style="background: orange; color: black;" | Plugin | ||
+ | | Play melody via speaker or piezo | ||
+ | | See:[[Buzzer (RTTTL)]] | ||
+ | |- | ||
+ | |||
| Save | | Save | ||
− | | Internal | + | | style="background: red; color: white;" | Internal |
| Save config to persistent flash memory | | Save config to persistent flash memory | ||
| Save | | Save | ||
|- | |- | ||
+ | |||
| SendTo | | SendTo | ||
− | | Rules | + | | style="background: green; color: white;" | Rules |
| Send command to other ESP (using UDP) | | Send command to other ESP (using UDP) | ||
| SendTo <unit nr>, <command> | | SendTo <unit nr>, <command> | ||
|- | |- | ||
+ | |||
| SendToHTTP | | SendToHTTP | ||
− | | Rules | + | | style="background: green; color: white;" | Rules |
− | | Send command to other network device using HTTP | + | | Send command to other network device using HTTP. Example for domain:<br>''SendToHTTP temperatur.nu,80,/rapportera.php?hash=123abc456&t=[temp2#out]'' |
− | | SendToHTTP <IP address>, <Portnumber>, <command> | + | | SendToHTTP <IP address>, <Portnumber>, <command><br>SendToHTTP <domain>, <Portnumber>, </url> |
|- | |- | ||
+ | |||
| SendToUDP | | SendToUDP | ||
− | | Rules | + | | style="background: green; color: white;" | Rules |
| Send command to other network device using UDP | | Send command to other network device using UDP | ||
| SendToUDP <IP address>, <Portnumber>, <command> | | SendToUDP <IP address>, <Portnumber>, <command> | ||
|- | |- | ||
+ | |||
| Servo | | Servo | ||
− | | Plugin | + | | style="background: orange; color: black;" | Plugin |
| Direct control of servo motors | | Direct control of servo motors | ||
| See:[[GPIO]] | | See:[[GPIO]] | ||
+ | Example for MQTT: <MQTT subscribe template>/cmd Servo 1 0 120 | ||
|- | |- | ||
+ | |||
| Settings | | Settings | ||
− | | Internal | + | | style="background: red; color: white;" | Internal |
| Show settings on serial terminal | | Show settings on serial terminal | ||
| Settings | | Settings | ||
|- | |- | ||
− | | | + | |
− | | | + | | TaskClear |
− | | | + | | style="background: red; color: white;" | Internal |
− | | | + | | Delete the given task/device |
+ | | TaskClear,<task/device nr> | ||
+ | |- | ||
+ | |||
+ | | TaskClearAll | ||
+ | | style="background: red; color: white;" | Internal | ||
+ | | Delete ALL task/device | ||
+ | | TaskClearAll | ||
+ | |- | ||
+ | |||
+ | | TaskRun | ||
+ | | style="background: red; color: white;" | Internal | ||
+ | | Run/excecute the given task/device, use to manually force an update/read of the task. | ||
+ | | TaskRun,<task/device nr> | ||
|- | |- | ||
+ | |||
| TaskValueSet | | TaskValueSet | ||
− | | Rules | + | | style="background: green; color: white;" | Rules |
| Set values on a Dummy Task device | | Set values on a Dummy Task device | ||
− | | TaskValueSet <task nr>, <value nr>, <value/formula> | + | | TaskValueSet,<task/device nr>,<value nr>,<value/formula> |
|- | |- | ||
+ | |||
| TimerSet | | TimerSet | ||
− | | Rules | + | | style="background: green; color: white;" | Rules |
| Start a timed event | | Start a timed event | ||
− | | TimerSet <timernr>, < | + | | TimerSet,<timernr>,<timeInSeconds> |
+ | |- | ||
+ | |||
+ | | Unit | ||
+ | | style="background: red; color: white;" | Internal | ||
+ | | Set the unit number | ||
+ | | Unit <unit number> | ||
|- | |- | ||
+ | |||
| WifiAPKey | | WifiAPKey | ||
− | | Internal | + | | style="background: red; color: white;" | Internal |
| Change AP WPA key | | Change AP WPA key | ||
| WifiAPKey <WPA key> | | WifiAPKey <WPA key> | ||
|- | |- | ||
+ | |||
+ | | WifiAPMode | ||
+ | | style="background: red; color: white;" | Internal | ||
+ | | Force the unit into AP mode. | ||
+ | | WifiAPMode | ||
+ | |- | ||
+ | |||
| WifiConnect | | WifiConnect | ||
− | | Internal | + | | style="background: red; color: white;" | Internal |
| Connect to configured wireless network | | Connect to configured wireless network | ||
| WifiConnect | | WifiConnect | ||
|- | |- | ||
+ | |||
| WifiDisconnect | | WifiDisconnect | ||
− | | Internal | + | | style="background: red; color: white;" | Internal |
| Disconnect from wireless network | | Disconnect from wireless network | ||
| WifiDisconnect | | WifiDisconnect | ||
|- | |- | ||
+ | |||
| WifiKey | | WifiKey | ||
− | | Internal | + | | style="background: red; color: white;" | Internal |
− | | Change WPA key | + | | Change WPA key for primary WiFi |
| WifiKey <Wifi WPA key> | | WifiKey <Wifi WPA key> | ||
|- | |- | ||
+ | |||
+ | | WifiKey2 | ||
+ | | style="background: red; color: white;" | Internal | ||
+ | | Change WPA key for secondary WiFi | ||
+ | | WifiKey2 <Wifi WPA key> | ||
+ | |- | ||
+ | |||
| WifiScan | | WifiScan | ||
− | | Internal | + | | style="background: red; color: white;" | Internal |
| Scan Wireless networks | | Scan Wireless networks | ||
| WifiScan | | WifiScan | ||
|- | |- | ||
+ | |||
| WifiSSID | | WifiSSID | ||
− | | Internal | + | | style="background: red; color: white;" | Internal |
− | | Change SSID | + | | Change SSID to connect as primary WiFi |
| WifiSSID <SSID> | | WifiSSID <SSID> | ||
+ | |- | ||
+ | |||
+ | | WifiSSID2 | ||
+ | | style="background: red; color: white;" | Internal | ||
+ | | Change SSID to connect as secondry WiFi | ||
+ | | WifiSSID2 <SSID> | ||
|} | |} | ||
+ | |||
+ | = Raw list of commands = | ||
+ | |||
+ | <div style="border-bottom:1px solid black; background: red; padding:0.4em 1em; font-size:110%; font-weight:bold; font-color: white;"><span style="color:white">WARNING</span></div> | ||
+ | |||
+ | <div style="border-bottom:1px solid red; background:#F6CECE; padding:0.4em 1em 0.4em;">Some of these commands '''below''' are not meant to be used by end users, they might do harm to your system if used wrongly. This list is meant to be a reference list for developers and power users.</div> | ||
+ | |||
+ | |||
+ | <pre style="color: #0077dd"> | ||
+ | event [_C005.ino] | ||
+ | %valname% [_C005.ino] (variable) | ||
+ | %value% [_C008.ino] (variable) | ||
+ | email [_N001_Email.ino] | ||
+ | buzzer [_N002_Buzzer.ino] | ||
+ | pinstate [_P001_Switch.ino] | ||
+ | gpio [_P001_Switch.ino] | ||
+ | pwm [_P001_Switch.ino] | ||
+ | pulse [_P001_Switch.ino] | ||
+ | longpulse [_P001_Switch.ino] | ||
+ | longpulse_ms [_P001_Switch.ino] | ||
+ | servo [_P001_Switch.ino] | ||
+ | status [_P001_Switch.ino] | ||
+ | monitor [_P001_Switch.ino] | ||
+ | inputswitchstate [_P001_Switch.ino] | ||
+ | rtttl [_P001_Switch.ino] | ||
+ | tone [_P001_Switch.ino] | ||
+ | mcpgpio [_P009_MCP.ino] | ||
+ | mcppulse [_P009_MCP.ino] | ||
+ | mcplongpulse [_P009_MCP.ino] | ||
+ | extgpio [_P011_PME.ino] | ||
+ | extpwm [_P011_PME.ino] | ||
+ | extpulse [_P011_PME.ino] | ||
+ | extlongpulse [_P011_PME.ino] | ||
+ | LCDCMD [_P012_LCD.ino] | ||
+ | Off [_P012_LCD.ino] | ||
+ | Clear [_P012_LCD.ino] | ||
+ | pcfgpio [_P019_PCF8574.ino] | ||
+ | pcfpulse [_P019_PCF8574.ino] | ||
+ | pcflongpulse [_P019_PCF8574.ino] | ||
+ | serialsend [_P020_Ser2Net.ino] | ||
+ | setlevel [_P021_Level.ino] | ||
+ | getlevel [_P021_Level.ino] | ||
+ | pcapwm [_P022_PCA9685.ino] | ||
+ | pcafrq [_P022_PCA9685.ino] | ||
+ | OLEDCMD [_P023_OLED.ino] | ||
+ | IRSEND [_P035_IRTX.ino] | ||
+ | RAW [_P035_IRTX.ino] | ||
+ | NEC [_P035_IRTX.ino] | ||
+ | JVC [_P035_IRTX.ino] | ||
+ | RC5 [_P035_IRTX.ino] | ||
+ | RC6 [_P035_IRTX.ino] | ||
+ | SAMSUNG [_P035_IRTX.ino] | ||
+ | SONY [_P035_IRTX.ino] | ||
+ | PANASONIC [_P035_IRTX.ino] | ||
+ | PIONEER [_P035_IRTX.ino] | ||
+ | OLEDFRAMEDCMD [_P036_FrameOLED.ino] | ||
+ | Low [_P036_FrameOLED.ino] | ||
+ | High [_P036_FrameOLED.ino] | ||
+ | NeoPixel [_P038_NeoPixel.ino] | ||
+ | NeoPixelAll [_P038_NeoPixel.ino] | ||
+ | NeoPixelLine [_P038_NeoPixel.ino] | ||
+ | NeoClockColor [_P041_NeoClock.ino] | ||
+ | NeoTestAll [_P041_NeoClock.ino] | ||
+ | NeoTestLoop [_P041_NeoClock.ino] | ||
+ | MotorShieldCMD [_P048_Motorshield_v2.ino] | ||
+ | DCMotor [_P048_Motorshield_v2.ino] | ||
+ | Forward [_P048_Motorshield_v2.ino] | ||
+ | Backward [_P048_Motorshield_v2.ino] | ||
+ | Release [_P048_Motorshield_v2.ino] | ||
+ | Stepper [_P048_Motorshield_v2.ino] | ||
+ | SINGLE [_P048_Motorshield_v2.ino] | ||
+ | DOUBLE [_P048_Motorshield_v2.ino] | ||
+ | INTERLEAVE [_P048_Motorshield_v2.ino] | ||
+ | MICROSTEP [_P048_Motorshield_v2.ino] | ||
+ | mhzcalibratezero [_P049_MHZ19.ino] | ||
+ | mhzreset [_P049_MHZ19.ino] | ||
+ | mhzabcenable [_P049_MHZ19.ino] | ||
+ | mhzabcdisable [_P049_MHZ19.ino] | ||
+ | mhzmeasurementrange1000 [_P049_MHZ19.ino] | ||
+ | mhzmeasurementrange2000 [_P049_MHZ19.ino] | ||
+ | mhzmeasurementrange3000 [_P049_MHZ19.ino] | ||
+ | mhzmeasurementrange5000 [_P049_MHZ19.ino] | ||
+ | senseair_setrelay [_P052_SenseAir.ino] | ||
+ | senseair_setABCperiod [_P052_SenseAir.ino] | ||
+ | dmx [_P054_DMX512.ino] | ||
+ | chime [_P055_Chiming.ino] | ||
+ | chimeplay [_P055_Chiming.ino] | ||
+ | chimesave [_P055_Chiming.ino] | ||
+ | mprint [_P057_HT16K33_LED.ino] | ||
+ | mbr [_P057_HT16K33_LED.ino] | ||
+ | mnum [_P057_HT16K33_LED.ino] | ||
+ | encwrite [_P059_Encoder.ino] | ||
+ | stop [_P065_DRF0299_MP3.ino] | ||
+ | vol [_P065_DRF0299_MP3.ino] | ||
+ | eq [_P065_DRF0299_MP3.ino] | ||
+ | tare [_P067_HX711_Load_Cell.ino] | ||
+ | 7dn [_P073_7DGT.ino] | ||
+ | 7dt [_P073_7DGT.ino] | ||
+ | 7don [_P073_7DGT.ino] | ||
+ | 7doff [_P073_7DGT.ino] | ||
+ | 7db [_P073_7DGT.ino] | ||
+ | NEXTION [_P075_Nextion.ino] | ||
+ | hlwreset [_P076_HLW8012.ino] | ||
+ | hlwcalibrate [_P076_HLW8012.ino] | ||
+ | dothis [_Pxxx_PluginTemplate.ino] | ||
+ | accessinfo [Command.ino] | ||
+ | background [Command.ino] | ||
+ | blynkget [Command.ino] | ||
+ | build [Command.ino] | ||
+ | clearaccessblock [Command.ino] | ||
+ | clearrtcram [Command.ino] | ||
+ | config [Command.ino] | ||
+ | debug [Command.ino] | ||
+ | delay [Command.ino] | ||
+ | deepsleep [Command.ino] | ||
+ | erase [Command.ino] | ||
+ | executerules [Command.ino] | ||
+ | i2cscanner [Command.ino] | ||
+ | ip [Command.ino] | ||
+ | logentry [Command.ino] | ||
+ | lowmem [Command.ino] | ||
+ | malloc [Command.ino] | ||
+ | meminfo [Command.ino] | ||
+ | notify [Command.ino] | ||
+ | nosleep [Command.ino] | ||
+ | password [Command.ino] | ||
+ | publish [Command.ino] | ||
+ | reboot [Command.ino] | ||
+ | restart [Command.ino] | ||
+ | resetflashwritecounter [Command.ino] | ||
+ | sdcard [Command.ino] | ||
+ | sdremove [Command.ino] | ||
+ | sysload [Command.ino] | ||
+ | sendto [Command.ino] | ||
+ | sendtohttp [Command.ino] | ||
+ | sendtoudp [Command.ino] | ||
+ | serialfloat [Command.ino] | ||
+ | settings [Command.ino] | ||
+ | taskclear [Command.ino] | ||
+ | taskclearall [Command.ino] | ||
+ | taskrun [Command.ino] | ||
+ | taskvalueset [Command.ino] | ||
+ | taskvaluesetandrun [Command.ino] | ||
+ | timerset [Command.ino] | ||
+ | timerpause [Command.ino] | ||
+ | timerresume [Command.ino] | ||
+ | udptest [Command.ino] | ||
+ | unit [Command.ino] | ||
+ | wdconfig [Command.ino] | ||
+ | wdread [Command.ino] | ||
+ | wifiapmode [Command.ino] | ||
+ | wificonnect [Command.ino] | ||
+ | wifidisconnect [Command.ino] | ||
+ | wifikey2 [Command.ino] | ||
+ | wifissid2 [Command.ino] | ||
+ | wifiscan [Command.ino] | ||
+ | Rules#TimerPause= [Command.ino] (event) | ||
+ | Rules#TimerResume= [Command.ino] (event) | ||
+ | System#Wake [ESPEasy.ino] (event) | ||
+ | System#Boot [ESPEasy.ino] (event) | ||
+ | System#Sleep [ESPEasy.ino] (event) | ||
+ | %pvalue% [ESPEasy.ino] (variable) | ||
+ | WiFi#ChangedAccesspoint [ESPEasyWifi.ino] (event) | ||
+ | WiFi#Disconnected [ESPEasyWifi.ino] (event) | ||
+ | WiFi#Connected [ESPEasyWifi.ino] (event) | ||
+ | Rules#Timer= [Misc.ino] (event) | ||
+ | %eventvalue% [Misc.ino] (variable) | ||
+ | %vcc% [StringConverter.ino] (variable) | ||
+ | %SP% [StringConverter.ino] (variable) | ||
+ | %ip4% [StringConverter.ino] (variable) | ||
+ | %ip% [StringConverter.ino] (variable) | ||
+ | %rssi% [StringConverter.ino] (variable) | ||
+ | %ssid% [StringConverter.ino] (variable) | ||
+ | %bssid% [StringConverter.ino] (variable) | ||
+ | %wi_ch% [StringConverter.ino] (variable) | ||
+ | %unit% [StringConverter.ino] (variable) | ||
+ | %mac% [StringConverter.ino] (variable) | ||
+ | %mac_int% [StringConverter.ino] (variable) | ||
+ | %sysload% [StringConverter.ino] (plugin name) | ||
+ | %sysheap% [StringConverter.ino] (variable) | ||
+ | %systm_hm% [StringConverter.ino] (variable) | ||
+ | %systm_hm_am% [StringConverter.ino] (variable) | ||
+ | %systime% [StringConverter.ino] (variable) | ||
+ | %systime_am% [StringConverter.ino] (variable) | ||
+ | %sysname% [StringConverter.ino] (variable) | ||
+ | %syshour% [StringConverter.ino] (variable) | ||
+ | %sysmin% [StringConverter.ino] (variable) | ||
+ | %syssec% [StringConverter.ino] (variable) | ||
+ | %syssec_d% [StringConverter.ino] (variable) | ||
+ | %sysday% [StringConverter.ino] (variable) | ||
+ | %sysmonth% [StringConverter.ino] (variable) | ||
+ | %sysyear% [StringConverter.ino] (variable) | ||
+ | %sysyears% [StringConverter.ino] (variable) | ||
+ | %sysweekday% [StringConverter.ino] (variable) | ||
+ | %sysweekday_s% [StringConverter.ino] (variable) | ||
+ | %lcltime% [StringConverter.ino] (variable) | ||
+ | %lcltime_am% [StringConverter.ino] (variable) | ||
+ | %uptime% [StringConverter.ino] (variable) | ||
+ | %unixtime% [StringConverter.ino] (variable) | ||
+ | %tskname% [StringConverter.ino] (variable) | ||
+ | %vname1% [StringConverter.ino] (plugin name) | ||
+ | %vname2% [StringConverter.ino] (variable) | ||
+ | %vname3% [StringConverter.ino] (variable) | ||
+ | %vname4% [StringConverter.ino] (variable) | ||
+ | %id% [StringConverter.ino] (variable) | ||
+ | %val1% [StringConverter.ino] (plugin name) | ||
+ | %val2% [StringConverter.ino] (variable) | ||
+ | %val3% [StringConverter.ino] (variable) | ||
+ | %val4% [StringConverter.ino] (variable) | ||
+ | %c_w_dir% [StringConverter.ino] (plugin name) | ||
+ | %c_c2f% [StringConverter.ino] (variable) | ||
+ | %c_ms2Bft% [StringConverter.ino] (variable) | ||
+ | %c_cm2imp% [StringConverter.ino] (variable) | ||
+ | %c_mm2imp% [StringConverter.ino] (variable) | ||
+ | %c_m2day% [StringConverter.ino] (variable) | ||
+ | %c_m2dh% [StringConverter.ino] (variable) | ||
+ | %c_m2dhm% [StringConverter.ino] (variable) | ||
+ | %c_s2dhms% [StringConverter.ino] (variable) | ||
+ | Clock#Time= [TimeESPeasy.ino] (event) | ||
+ | Time#Initialized [TimeESPeasy.ino] (event) | ||
+ | Time#Set [TimeESPeasy.ino] (event) | ||
+ | Login#Failed [WebServer.ino] (event) | ||
+ | </pre> |
Latest revision as of 00:03, 13 March 2020
Notice: The ESPEasy Command Reference page is transitioning to a new format. The revised page can be found here: readthedocs
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:
Protocol | Syntax | Extra information |
---|---|---|
HTTP | http://<espeasyip>/control?cmd=<command> | Send commands over the HTTP protocol. |
MQTT | <MQTT subscribe template>/cmd with payload: <command> | Send commands over the MQTT protocol. As of current status this is obeyed only for the first controller in the list. |
Serial (TTL) | <command> | Send commands using serial (RX/TX). Just type the <command> |
UDP | SendTo <unit nr>, <command> | Send commands from one ESP Easy unit to another. Setup UDP peer-2-peer first. |
Rules | <command> | Internally within ESP Easy. Just enter the <command> within an event block or conditional block. |
Commands are divided into several classes:
Internal - Can be run from serial and rules engine Rules - Can be run from serial and rules engine Plugin - Can be run from serial, rules engine, HTTP, MQTT Special - This can be used from any source
If you want to use internal or rules 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 <delay in milliSeconds> |
Event | Special | Create an event, it's possible to send a float value along as well. | event,<eventName> event,<eventName>=<eventValue> |
GPIO | Plugin | Direct control of output pins | See:GPIO |
Status | Plugin | Get a status set by GPIO/PWM/Servo command. | Status,GPIO,<pin number> |
IP | Internal | Change IP address | IP <IP address> |
LongPulse | Plugin | Direct pulse control of output pins | See:GPIO |
LongPulse_mS | Plugin | Direct pulse control of output pins, same as above but using mSeconds instead of Seconds. | See:GPIO |
Name | Internal | Set the name of the unit | Name <new name> |
Password | Internal | Set the password of the unit | Password <new password> |
Pulse | Plugin | Direct pulse control of output pins | See:GPIO |
Publish | Rules | Send command using MQTT broker service | Publish <topic>, <value> |
PWM | Plugin | Direct PWM control of output pins | See:GPIO |
Reboot | Internal | Reboot the ESP | Reboot |
Reset | Internal | Reset config to factory default. Caution, all settings will be lost! | Reset |
ResetFlashWriteCounter | Internal | Reset flash write to zero. | ResetFlashWriteCounter |
Rules | Internal | Rules enabled (1) or rules disabled (0) | Rules,<value> |
Tone | Plugin | Play tone via speaker or piezo | See:Buzzer (RTTTL) |
Rtttl | Plugin | Play melody via speaker or piezo | See:Buzzer (RTTTL) |
Save | Internal | Save config to persistent flash memory | Save |
SendTo | Rules | Send command to other ESP (using UDP) | SendTo <unit nr>, <command> |
SendToHTTP | Rules | Send command to other network device using HTTP. Example for domain: SendToHTTP temperatur.nu,80,/rapportera.php?hash=123abc456&t=[temp2#out] |
SendToHTTP <IP address>, <Portnumber>, <command> SendToHTTP <domain>, <Portnumber>, </url> |
SendToUDP | Rules | Send command to other network device using UDP | SendToUDP <IP address>, <Portnumber>, <command> |
Servo | Plugin | Direct control of servo motors | See:GPIO
Example for MQTT: <MQTT subscribe template>/cmd Servo 1 0 120 |
Settings | Internal | Show settings on serial terminal | Settings |
TaskClear | Internal | Delete the given task/device | TaskClear,<task/device nr> |
TaskClearAll | Internal | Delete ALL task/device | TaskClearAll |
TaskRun | Internal | Run/excecute the given task/device, use to manually force an update/read of the task. | TaskRun,<task/device nr> |
TaskValueSet | Rules | Set values on a Dummy Task device | TaskValueSet,<task/device nr>,<value nr>,<value/formula> |
TimerSet | Rules | Start a timed event | TimerSet,<timernr>,<timeInSeconds> |
Unit | Internal | Set the unit number | Unit <unit number> |
WifiAPKey | Internal | Change AP WPA key | WifiAPKey <WPA key> |
WifiAPMode | Internal | Force the unit into AP mode. | WifiAPMode |
WifiConnect | Internal | Connect to configured wireless network | WifiConnect |
WifiDisconnect | Internal | Disconnect from wireless network | WifiDisconnect |
WifiKey | Internal | Change WPA key for primary WiFi | WifiKey <Wifi WPA key> |
WifiKey2 | Internal | Change WPA key for secondary WiFi | WifiKey2 <Wifi WPA key> |
WifiScan | Internal | Scan Wireless networks | WifiScan |
WifiSSID | Internal | Change SSID to connect as primary WiFi | WifiSSID <SSID> |
WifiSSID2 | Internal | Change SSID to connect as secondry WiFi | WifiSSID2 <SSID> |
Raw list of commands
WARNING
Some of these commands below are not meant to be used by end users, they might do harm to your system if used wrongly. This list is meant to be a reference list for developers and power users.
event [_C005.ino] %valname% [_C005.ino] (variable) %value% [_C008.ino] (variable) email [_N001_Email.ino] buzzer [_N002_Buzzer.ino] pinstate [_P001_Switch.ino] gpio [_P001_Switch.ino] pwm [_P001_Switch.ino] pulse [_P001_Switch.ino] longpulse [_P001_Switch.ino] longpulse_ms [_P001_Switch.ino] servo [_P001_Switch.ino] status [_P001_Switch.ino] monitor [_P001_Switch.ino] inputswitchstate [_P001_Switch.ino] rtttl [_P001_Switch.ino] tone [_P001_Switch.ino] mcpgpio [_P009_MCP.ino] mcppulse [_P009_MCP.ino] mcplongpulse [_P009_MCP.ino] extgpio [_P011_PME.ino] extpwm [_P011_PME.ino] extpulse [_P011_PME.ino] extlongpulse [_P011_PME.ino] LCDCMD [_P012_LCD.ino] Off [_P012_LCD.ino] Clear [_P012_LCD.ino] pcfgpio [_P019_PCF8574.ino] pcfpulse [_P019_PCF8574.ino] pcflongpulse [_P019_PCF8574.ino] serialsend [_P020_Ser2Net.ino] setlevel [_P021_Level.ino] getlevel [_P021_Level.ino] pcapwm [_P022_PCA9685.ino] pcafrq [_P022_PCA9685.ino] OLEDCMD [_P023_OLED.ino] IRSEND [_P035_IRTX.ino] RAW [_P035_IRTX.ino] NEC [_P035_IRTX.ino] JVC [_P035_IRTX.ino] RC5 [_P035_IRTX.ino] RC6 [_P035_IRTX.ino] SAMSUNG [_P035_IRTX.ino] SONY [_P035_IRTX.ino] PANASONIC [_P035_IRTX.ino] PIONEER [_P035_IRTX.ino] OLEDFRAMEDCMD [_P036_FrameOLED.ino] Low [_P036_FrameOLED.ino] High [_P036_FrameOLED.ino] NeoPixel [_P038_NeoPixel.ino] NeoPixelAll [_P038_NeoPixel.ino] NeoPixelLine [_P038_NeoPixel.ino] NeoClockColor [_P041_NeoClock.ino] NeoTestAll [_P041_NeoClock.ino] NeoTestLoop [_P041_NeoClock.ino] MotorShieldCMD [_P048_Motorshield_v2.ino] DCMotor [_P048_Motorshield_v2.ino] Forward [_P048_Motorshield_v2.ino] Backward [_P048_Motorshield_v2.ino] Release [_P048_Motorshield_v2.ino] Stepper [_P048_Motorshield_v2.ino] SINGLE [_P048_Motorshield_v2.ino] DOUBLE [_P048_Motorshield_v2.ino] INTERLEAVE [_P048_Motorshield_v2.ino] MICROSTEP [_P048_Motorshield_v2.ino] mhzcalibratezero [_P049_MHZ19.ino] mhzreset [_P049_MHZ19.ino] mhzabcenable [_P049_MHZ19.ino] mhzabcdisable [_P049_MHZ19.ino] mhzmeasurementrange1000 [_P049_MHZ19.ino] mhzmeasurementrange2000 [_P049_MHZ19.ino] mhzmeasurementrange3000 [_P049_MHZ19.ino] mhzmeasurementrange5000 [_P049_MHZ19.ino] senseair_setrelay [_P052_SenseAir.ino] senseair_setABCperiod [_P052_SenseAir.ino] dmx [_P054_DMX512.ino] chime [_P055_Chiming.ino] chimeplay [_P055_Chiming.ino] chimesave [_P055_Chiming.ino] mprint [_P057_HT16K33_LED.ino] mbr [_P057_HT16K33_LED.ino] mnum [_P057_HT16K33_LED.ino] encwrite [_P059_Encoder.ino] stop [_P065_DRF0299_MP3.ino] vol [_P065_DRF0299_MP3.ino] eq [_P065_DRF0299_MP3.ino] tare [_P067_HX711_Load_Cell.ino] 7dn [_P073_7DGT.ino] 7dt [_P073_7DGT.ino] 7don [_P073_7DGT.ino] 7doff [_P073_7DGT.ino] 7db [_P073_7DGT.ino] NEXTION [_P075_Nextion.ino] hlwreset [_P076_HLW8012.ino] hlwcalibrate [_P076_HLW8012.ino] dothis [_Pxxx_PluginTemplate.ino] accessinfo [Command.ino] background [Command.ino] blynkget [Command.ino] build [Command.ino] clearaccessblock [Command.ino] clearrtcram [Command.ino] config [Command.ino] debug [Command.ino] delay [Command.ino] deepsleep [Command.ino] erase [Command.ino] executerules [Command.ino] i2cscanner [Command.ino] ip [Command.ino] logentry [Command.ino] lowmem [Command.ino] malloc [Command.ino] meminfo [Command.ino] notify [Command.ino] nosleep [Command.ino] password [Command.ino] publish [Command.ino] reboot [Command.ino] restart [Command.ino] resetflashwritecounter [Command.ino] sdcard [Command.ino] sdremove [Command.ino] sysload [Command.ino] sendto [Command.ino] sendtohttp [Command.ino] sendtoudp [Command.ino] serialfloat [Command.ino] settings [Command.ino] taskclear [Command.ino] taskclearall [Command.ino] taskrun [Command.ino] taskvalueset [Command.ino] taskvaluesetandrun [Command.ino] timerset [Command.ino] timerpause [Command.ino] timerresume [Command.ino] udptest [Command.ino] unit [Command.ino] wdconfig [Command.ino] wdread [Command.ino] wifiapmode [Command.ino] wificonnect [Command.ino] wifidisconnect [Command.ino] wifikey2 [Command.ino] wifissid2 [Command.ino] wifiscan [Command.ino] Rules#TimerPause= [Command.ino] (event) Rules#TimerResume= [Command.ino] (event) System#Wake [ESPEasy.ino] (event) System#Boot [ESPEasy.ino] (event) System#Sleep [ESPEasy.ino] (event) %pvalue% [ESPEasy.ino] (variable) WiFi#ChangedAccesspoint [ESPEasyWifi.ino] (event) WiFi#Disconnected [ESPEasyWifi.ino] (event) WiFi#Connected [ESPEasyWifi.ino] (event) Rules#Timer= [Misc.ino] (event) %eventvalue% [Misc.ino] (variable) %vcc% [StringConverter.ino] (variable) %SP% [StringConverter.ino] (variable) %ip4% [StringConverter.ino] (variable) %ip% [StringConverter.ino] (variable) %rssi% [StringConverter.ino] (variable) %ssid% [StringConverter.ino] (variable) %bssid% [StringConverter.ino] (variable) %wi_ch% [StringConverter.ino] (variable) %unit% [StringConverter.ino] (variable) %mac% [StringConverter.ino] (variable) %mac_int% [StringConverter.ino] (variable) %sysload% [StringConverter.ino] (plugin name) %sysheap% [StringConverter.ino] (variable) %systm_hm% [StringConverter.ino] (variable) %systm_hm_am% [StringConverter.ino] (variable) %systime% [StringConverter.ino] (variable) %systime_am% [StringConverter.ino] (variable) %sysname% [StringConverter.ino] (variable) %syshour% [StringConverter.ino] (variable) %sysmin% [StringConverter.ino] (variable) %syssec% [StringConverter.ino] (variable) %syssec_d% [StringConverter.ino] (variable) %sysday% [StringConverter.ino] (variable) %sysmonth% [StringConverter.ino] (variable) %sysyear% [StringConverter.ino] (variable) %sysyears% [StringConverter.ino] (variable) %sysweekday% [StringConverter.ino] (variable) %sysweekday_s% [StringConverter.ino] (variable) %lcltime% [StringConverter.ino] (variable) %lcltime_am% [StringConverter.ino] (variable) %uptime% [StringConverter.ino] (variable) %unixtime% [StringConverter.ino] (variable) %tskname% [StringConverter.ino] (variable) %vname1% [StringConverter.ino] (plugin name) %vname2% [StringConverter.ino] (variable) %vname3% [StringConverter.ino] (variable) %vname4% [StringConverter.ino] (variable) %id% [StringConverter.ino] (variable) %val1% [StringConverter.ino] (plugin name) %val2% [StringConverter.ino] (variable) %val3% [StringConverter.ino] (variable) %val4% [StringConverter.ino] (variable) %c_w_dir% [StringConverter.ino] (plugin name) %c_c2f% [StringConverter.ino] (variable) %c_ms2Bft% [StringConverter.ino] (variable) %c_cm2imp% [StringConverter.ino] (variable) %c_mm2imp% [StringConverter.ino] (variable) %c_m2day% [StringConverter.ino] (variable) %c_m2dh% [StringConverter.ino] (variable) %c_m2dhm% [StringConverter.ino] (variable) %c_s2dhms% [StringConverter.ino] (variable) Clock#Time= [TimeESPeasy.ino] (event) Time#Initialized [TimeESPeasy.ino] (event) Time#Set [TimeESPeasy.ino] (event) Login#Failed [WebServer.ino] (event)