Command Reference

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.

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 ESP Easy peer-2-peer controller 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 can be used from any source

Command a specific task for multiple instances of a plugin

When multiple tasks are assigned to run the same plugin, one may want to address a specific task to run the command.

In order to do so, prefix the command with the intended task name. Either by using [<TaskName>]. or [<TaskNumber>]. (square brackets are optional) to address a specific instance.

N.B. This requires the plugin names to be unique (if the TaskName variant is used).

Examples:

[Display1].oledframedcmd,3,'Hello World'

[Display2].oledframedcmd,4,'From the other side'

This will display ‘Hello World’ on the 3rd line of the display with name ‘Display1’, and ‘From the other side’ on line 4 of the display named ‘Display2’.

[AC1].irsendac,{<some_json_to_control_AC>}

[AC2].irsendac,{<some_json_to_control_AC>}

This allows to control multiple IR controlled AC’s from one ESP.

Internal Commands

Commands handled by ESPEasy core. These are not part of a plugin.

TODO : Check commands M..Z and check for all commands whether the “class” is still valid.

Command

Class

Purpose / Syntax

AsyncEvent

Special

Schedule an event, it’s possible to send a float value along as well.

This is the same as a regular event, but it will not be executed immediately. Instead it will be added to an event queue.

Use this to keep rules execution times as short as possible.

N.B. New values sent by a task will also be of this type.

See event syntax below…

AccessInfo

Internal

Show allowed IP range for the web interface.

AccessInfo

Example output: Allowed IP range : 192.168.10.0 - 192.168.10.255

Background

Internal

Process background tasks.

Background

Build

Internal

Get or set build information. This will not be stored, so only valid until reboot.

Build

Build,12345

Example output: Build:20104

ClearAccessBlock

Internal

Clear allowed IP range for the web interface for the current session. See also AccessInfo.

ClearAccessBlock

ClearRTCram

Internal

Clear all (cached) data from the RTC memory. This data is persistent as long as the node is powered and thus survives a reboot or crash.

ClearRTCram

Config

Internal

Remote config of a task. TODO: Describe command syntax.

Config

ControllerDisable

Internal

Disable a controller. This will not save the settings, but if the settings get saved anyway the controller will remain disabled at reboot.

ControllerDisable,<controller nr>

ControllerEnable

Internal

Enable a controller. (Only possible when a protocol is assigned to the controller index) This will not save the settings, but if the settings get saved anyway the controller will remain enabled at reboot.

ControllerEnable,<controller nr>

DateTime

Internal

Get or set the date and time (optional).

Usage: Datetime[,YYYY-MM-DD[,hh:mm:ss]]

Examples:

  • Datetime,2020-02-29,00:23:00

  • Datetime,2020-02-29 - set node time ‘2020-02-29 00:00:00’

  • Datetime - get current node time

Time source will be set to Manual_set until the time will be updated via another source. (e.g. GPS or NTP)

Debug

Internal

Change Serial port debug level

Debug,<1-4>

DeepSleep

Internal

Switch the node to deep sleep. Max sleep time depends on library version and differs from roughly 71 minutes (4294 sec.) to 3h46 for ESP8266, and up to 8 years (281474976 sec.) on ESP32 (theoretically). If you specify a Min sleep time of 0, you’ll have to wake the device yourself by pulling RST to GND. If you specify a negative sleep time value, the maximum will be applied.

DeepSleep,<sleep time in seconds>

Delay

Rules

Delay rule processing. Warning: Do not use this as it may cause all kinds of issues.

Delay,<delay in milliSeconds>

DNS

Internal

Get or set DNS configuration.

DNS

DNS,8.8.8.8

Example output: DNS:192.168.88.1(DHCP)

DST

Internal

Get or set Daylight Saving Time.

DST

DST,0 to disable, DST,1 to enable

Example output: DST:true

EraseSDKwifi

Internal

Erase WiFi settings that may have been stored in the SDK wifi settings area.

EraseSDKwifi

Event

Special

Create an event, it’s possible to send a float value along as well.

See event syntax below…

ExecuteRules

Internal

Execute the rules in a specific file on the file system.

ExecuteRules,<filename>

Gateway

Internal

Get or set the gateway configuration

Gateway

Gateway,192.168.1.1

Example output: Gateway:192.168.10.254(DHCP)

I2Cscanner

Internal

Run I2C scanner to find connected I2C chips. Output will be sent to the serial port.

I2Cscanner

Example output:

4500043 : Info  : Command: i2cscanner
I2C  : Found 0x3c
I2C  : Found 0x40
I2C  : Found 0x5a

IP

Internal

Get or set IP address

IP

IP,<IP address>

Example output: IP:192.168.10.86(DHCP)

Let

Internal

Set the value of n (1..16).

Let,<n>,<value>

Load

Internal

Load (reload) the stored settings.

Load

LogEntry

Internal

Add string to log

LogEntry,<string>[,<level>]

<level> is optional and can be any of these (numeric) values:

  • 1 = ERROR

  • 2 = INFO (default)

  • 3 = DEBUG

  • 4 = DEBUG_DEV

When a <level> is provided, it will be present in the log output if the ‘Tolerant last parameter’ Advanced setting is enabled.

LogPortStatus

Internal

Display status information about all ports

LogPortStatus

LoopTimerSet

LoopTimerSet_ms

Rules

Start a sequence of timed events

  • LoopTimerSet,<timernr>,<timeInSeconds>

  • LoopTimerSet_ms,<timernr>,<time in msec>

  • LoopTimerSet,<timernr>,<timeInSeconds>,<nr of loops>

  • LoopTimerSet_ms,<timernr>,<time in msec>,<nr of loops>

  • LoopTimerSet,<timernr>,0 (disables the timer)

The 3rd value is optional and can be used to set a fixed number of loops.

When possible, try using the LoopTimerSet funxtion (or its msec equivalent) to get a consistent schedule interval. A loop timer is basing its next scheduled time on the previous scheduled time and not the moment when it is actually executed.

On a typical setup, calling TimerSet from the rules every time a timer has expired, may cause a delay of at least 20 msec. The actual jitter introduced here depends on the load of the node and the length of the rules.

Please note, the execution time in the rules may differ, but as long as a loop timer is used, the scheduled time to run is always a fixed interval from when it was set. (even when a timer interval was missed)

The Rules#Timer event generated by a timer has 2 event values. (since build 2020/08/12):

  • %eventvalue1% has the timer number (1 … max timer ID)

  • %eventvalue2% has the loop count for loop timers (since build 2020/08/12)

See also TimerSet.

N.B. the timernr is shared between TimerSet and LoopTimerSet

meminfo

Internal

Will send summary of struct sizes to the serial port.

meminfo

Example output:

4306250 : Info  : Command: meminfo
SecurityStruct         | 593
SettingsStruct         | 1228
ExtraTaskSettingsStruct| 472
DeviceStruct           | 12

meminfoDetail

Internal

Will enable extra detailed information on the internal structure of the settings file. This is displayed graphically in the system info page. This state is not stored, so only active until reboot.

A detailed summary is also sent to the serial port.

meminfoDetail

Name

Internal

Set the name of the unit

Name,<new name>

Password

Internal

Set the password of the unit

Password,<new password>

Publish

Rules

Send command using MQTT broker service

Publish,<topic>,<value>

Reboot

Internal

Reboot the ESP

Reboot

Reset

Internal

Reset config to factory default. Caution, all settings will be lost!

Reset

Reset Flash Write Counter

Internal

Reset flash write to zero.

ResetFlashWriteCounter

Rules

Internal

Rules enabled (1) or rules disabled (0)

Rules,<1/0>

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

SendToHTTP,<IP address>,<Portnumber>,<command>

SendToHTTP,<domain>,<Portnumber>,</url>

SendToUDP

Rules

Send command to other network device using UDP (non-ESP Easy units)

SendToUDP,<IP address>,<Portnumber>,<command>

Settings

Internal

Show settings on serial terminal

Settings

Subnet

Internal

Get or set the network subnet setting

Subnet

Example output: Subnet:255.255.255.0(DHCP)

Subnet,255.255.255.0

Subscribe

Rules

Subscribes to a specific topic using MQTT broker service

Subscribe,<topic>

TaskClear

Internal

Delete the given task/device

TaskClear,<task nr/task name>

TaskClearAll

Internal

Delete ALL task/device

TaskClearAll

TaskDisable

Internal

Disable a task. This will not save the settings, but if the settings get saved anyway the task will remain disabled at reboot.

TaskDisable,<task nr/task name>

TaskEnable

Internal

Enable a task. (only possible when a plugin is assigned to the task) This will not save the settings, but if the settings get saved anyway the task will remain enabled at reboot.

TaskEnable,<task nr/task name>

TaskRun

Internal

Run/excecute the given task/device, use to manually force an update/read of the task.

TaskRun,<task nr/task name>

TaskValueSet

Rules

Set values on a Dummy Task (device).

TaskValueSet,<task nr/task name>,<value nr/value name>,<value/formula>

TaskValueSetAndRun

Rules

Set values on a Dummy Task (device) and run/execute the task/device, to manually force an update/read of the task.

TaskValueSetAndRun,<task nr/task name>,<value nr/value name>,<value/formula>

TimerPause

Rules

Pause a timer

TimerPause,<timer number>

TimerResume

Rules

Resume a paused timer

TimerResume,<timer number>

TimerSet

TimerSet_ms

Rules

Start a timed event

  • TimerSet,<timernr>,<timeInSeconds>

  • TimerSet_ms,<timernr>,<time in msec>

  • TimerSet,<timernr>,0 (disables the timer)

See also LoopTimerSet

N.B. the timernr is shared between TimerSet and LoopTimerSet

TimeZone

Internal

Get or set the TimeZone

TimeZone

Example output: TimeZone:60

TimeZone,<minutes from UTC>

UdpPort

Internal

Set the udp port

UdpPort,<port>

UdpTest

Internal

Send a test message to an udp port, for <count> number of times

UdpTest,<port>,<count>

Unit

Internal

Set the unit number

Unit,<unit number>

UseNTP

Internal

Get or set the status of NTP (Network Time Protocol)

UseNTP

Example output: UseNTP:true

UseNTP,<0/1>

WdConfig

Internal

Configure external Watchdog device

WdConfig,<address>,<command>,<data>

WdRead

Internal

Read from external Watchdog device

WdRead,<address>,<pointer/register>

WifiAPKey

Internal

Change AP WPA key

WifiAPKey,<WPA key>

WifiAllowAP

Internal

Uncheck the setting to prevent starting AP when unable to connect to a network.

WifiAllowAP

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>

WifiSTAMode

Internal

Force the unit into STA mode.

WifiSTAMode

Event command

The event command is a special command used to trigger an event. This event can then be acted upon from the rules. You can send 0..4 event values along with the event.

An event will be executed immediately if its origin demands a state update. For events which do not need to be executed immediately, we have the AsyncEvent, which is added to an event queue. This queue is processed 10 times per second, one event at a time.

Try to use AsyncEvents where possible, to keep rules processing times low.

Event / Info

Event,SingleEvent

The event (triggered by any of the launch ways) will make the unit publish a message.

Rules example

on SingleEvent do
  Publish,%sysname%/Info,A single event has been triggered!
endon

Event,SingleValue=123

The event value 123 is intercepted and published.

Rules example

on SingleValue do
  Publish,%sysname%/Info,An event has been sent (%eventvalue%)!
endon

Event,Multi=1,2,3,99

The event value 99 (4) is intercepted and the rule TaskValueSet... is triggered, value of task 12 value 1 is then 1 + 2 = 3 or 1 - 2 = -1.

Rules example

on Multi do
  if %eventvalue4%=99
    TaskValueSet,12,1,[%eventvalue1%+%eventvalue2%]
  else
    TaskValueSet,12,1,[%eventvalue3%-%eventvalue2%]
  endif
endon

GPIO Commands

Internal GPIO

Internal GPIO handling NORMAL

Supported hardware: Relay, Servo motor

Command (GPIO/Value)

Extra information

GPIO,<GPIO>,<state>

GPIO: 0 … 16

State:

2 (HIGH-Z, input)

1 (HIGH, output)

0 (LOW, output)

Basic on/off.. We can control a pin with simple http URL commands. To change the pin to high or low steady output. Setting GPIO to 2 means that it will be able to detect low level relays (with high impedance, Z).

GPIOtoggle,<GPIO>

GPIO: 0 … 16

Toggle on/off.. Toggle the current (output) state of the given GPIO pin. When executed, it changes the pin mode to output.

LongPulse,<GPIO>,<state>,<duration>

GPIO: 0 … 16

State: 1/0

Duration: 1 … 999 S

To send a *long* pulse to a certain pin.. A long pulse is basically the same as the plain pulse. Duration is defined in seconds, which makes it more suitable for longer duration. This command is not blocking, but will send 2 events to start and stop the pulse. This may have some variation depending on the system load of the module. Variation is typically up-to 10 msec, but may be up-to a second, depending on active plugins and controllers performing blocking operations.

LongPulse_mS,<GPIO>,<state>,<duration>

GPIO: 0 … 16

State: 1/0

Duration: 10 … 15000 msec

To send a *long* pulse to a certain pin. A LongPulse_mS is the same as the regular LongPulse. The only difference is the time base in milliseconds rather than in seconds.

Pulse,<GPIO>,<state>,<duration>

GPIO: 0 … 16

State: 1/0

Duration: 0 … 1000 msec

To send a *short* pulse to a certain pin. Example to send an active high (1) pulse on GPIO 14 for 500 mSeconds. Pulse duration is in milliseconds. State is 1 or 0. N.B. this is a blocking call, meaning no other actions will be performed during the pulse.

PWM,<GPIO>,<duty>

PWM,<GPIO>,<duty>,<duration>

PWM,<GPIO>,<duty>,<duration>,<frequency>

GPIO: 0 … 15

Duty: 0 … 1023

Duration: 100 … 15000 msec (optional)

Frequency: 100 … 40000 Hz (optional)

To set a certain PWM level. If you have set a certain GPIO to a PWM level and want to use it as a regular HIGH/LOW pin you need to reset by setting the PWM level to 0.

Duration (in msec) parameter will create a fading. Value of 0 will not set a duration.

Frequency (in Hz) will be set to 1000 Hz when not given. Frequencies above 30 kHz are not stable and will likely crash the ESP.

Servo,<servo ID>,<GPIO>,<position>

GPIO: 0 … 15

Servo: 1/2

Position: -180 … 180 (see warning below)

To control a servo motor. Builds before 2020/11/22 only supported a maximum of 2 servos. Later builds allow more and no longer need the servo ID as a new ID is generated based on the GPIO pin used. To remain compatible with existing rules, the number of parameters has not changed.

Warning

Most servos are not able to turn full 360°! Normally the servos are able to go from -90° to 90°, some rare servos do allow for -135° to 135°.

A position value of 9000 will stop the PWM signal. This can be useful to save energy on servos which do not need power to remain at the same position.

Monitor,G,<GPIO>

GPIO: 0 … 16

To monitor a GPIO state. By the use of the command you will receive events when the GPIO state of that pin is changed from 1 to 0 and from 0 to 1.

UnMonitor,G,<GPIO>

GPIO: 0 … 16

To cancel the monitor of a GPIO state. By the use of the command you will stop receiving events when the GPIO state of that pin is changed from 1 to 0 and from 0 to 1.

Status,G,<GPIO>

GPIO: 0 … 16

Returns the status of a pin. By the use of the command you will receive the status of the relevant pin.

External MCPGPIO

Command (MCPGPIO/Value)

Extra information

MCPGPIO,<MCPGPIO>,<state>

MCPGPIO: 0 … 255

State:

2 (HIGH-Z, input)

1 (HIGH, output)

0 (LOW, output)

-1 (OFFLINE, disconnected)

Basic on/off.. We can control a pin with simple http URL commands. To change the pin to high or low steady output. Setting PCFGPIO to 2 means that it will be able to detect low level relays (with high impedance, Z).

MCPGPIOtoggle,<MCPGPIO>

MCPGPIO: 0 … 255

Toggle on/off.. Toggle the current (output) state of the given MCPGPIO pin. When executed, it changes the pin mode to output.

MCPLongPulse,<MCPGPIO>,<state>,<duration>

MCPGPIO: 0 … 255

State: 1/0

Duration: 1 … 999 S

To send a *long* pulse to a certain pin.. A long pulse is basically the same as the plain pulse. Duration is defined in seconds, which makes it more suitable for longer duration. This command is not blocking, but will send 2 events to start and stop the pulse. This may have some variation depending on the system load of the module. Variation is typically up-to 10 msec, but may be up-to a second, depending on active plugins and controllers performing blocking operations.

MCPLongPulse_mS,<MCPGPIO>,<state>,<duration>

MCPGPIO: 0 … 255

State: 1/0

Duration: 10 … 15000 msec

To send a *long* pulse to a certain pin. A LongPulse_mS is the same as the regular LongPulse. The only difference is the time base in milliseconds rather than in seconds.

MCPPulse,<MCPGPIO>,<state>,<duration>

MCPGPIO: 0 … 255

State: 1/0

Duration: 0 … 1000 msec

To send a *short* pulse to a certain pin. Example to send an active high (1) pulse on MCPGPIO 14 for 500 mSeconds. Pulse duration is in milliseconds. State is 1 or 0. N.B. this is a blocking call, meaning no other actions will be performed during the pulse.

Status,MCP,<MCPGPIO>

MCPGPIO: 0 … 255

Returns the status of a pin. By the use of the command you will receive the status of the relevant pin.

Monitor,MCP,<MCPGPIO>

MCPGPIO: 0 … 255

To monitor a MCPGPIO state. By the use of the command you will receive events when the state of that pin is changed from 1 to 0 and from 0 to 1.

UnMonitor,MCP,<MCPGPIO>

MCPGPIO: 0 … 255

To cancel the monitor of a MCPGPIO state. By the use of the command you will stop receiving events when the state of that pin is changed from 1 to 0 and from 0 to 1.

MonitorRange,MCP,<MCPGPIO>

MCPGPIO: 0 … 255

To monitor a MCPGPIO state. By the use of the command you will receive events when the state of that pin is changed from 1 to 0 and from 0 to 1.

UnMonitorRange,MCP,<MCPGPIO>

MCPGPIO: 0 … 255

To cancel the monitor of a MCPGPIO state. By the use of the command you will stop receiving events when the state of that pin is changed from 1 to 0 and from 0 to 1.

MCPGPIOrange,<MCPGPIO start pin>,<MCPGPIO end pin>,<value> [,optional bitmask]

MCPGPIO start pin: 0 … 255

MCPGPIO end pin: 0 … 255

value: 0 or 1

bitmask:
- if not present assume to operate in all pins
- if present is used as a mask (1=update, 0=do not update)
- pins are numbered from right to left (i.e. 87654321)
- if number of bit lower than number of pins, then padded with 0
- if number of bit higher than number of pins, then it’s truncated
Change the status of a pin for a given range applying the given mask

examples:
- mcpgpioRange,1,8,1 -> set pins 1 to 8 to 1
- mcpgpioRange,3,12,1 -> set pins 3 to 12 to 1
- mcpgpioRange,5,17,0 -> set pins 5 to 17 to 0

- mcpgpioRange,3,12,1,525 or mcpgpioRange,3,12,1,0b0100001101
mask = ‘0100001101’
write pattern after mask = ‘x1xxxx11x1’ where x indicates that the pin will not be changed
(only pin 1,3,4,9 will be changed)

- mcpgpioRange,3,12,1,973 or mcpgpioRange,3,12,1,0b1111001101
mask = 973 = ‘1111001101’
write pattern after mask = ‘1111xx11x1’ where x indicates that the pin will not be changed

MCPGPIOpattern,<MCPGPIO start pin>,<MCPGPIO end pin>,<write pattern> [,optional bitmask]

MCPGPIO start pin: 0 … 255

MCPGPIO end pin: 0 … 255

write pattern: it’s a write pattern. Write 0 or 1.
- Example: use decimal number 15 (in binary is 00001111) to set to 1 pin 1,2,3 and 4 and to set to 0 pins 5,6,7,8
- if number of bit lower than number of pins, then padded with 0;
- if number of bit higher than number of pins, then it’s truncated.

bitmask:
- if not present assume to operate in all pins
- if present is used as a mask (1=update, 0=do not update)
- if number of bit lower than number of pins, then padded with 0
- if number of bit higher than number of pins, then it’s truncated
Change the status of a pin for a given range applying the given mask

examples:
- mcpgpioPattern,1,8,13
write pattern = ‘1101’ that will be padded as: ‘0000001101’
mask not present, assume mask = ‘1111111111’

- mcpgpioPattern,3,12,13
write pattern = ‘1101’ that will be padded as: ‘0000001101’
mask not present, assume mask = ‘1111111111’

- mcpgpioPattern,3,12,525
write pattern = 525 = ‘100001101’
mask not present, assume mask = ‘1111111111’

- mcpgpioPattern, 3, 12, 525, 973
write pattern = 525 = ‘100001101’
mask = 973 = ‘1111001101’
write pattern after mask = ‘1000xx11x1’ where x indicates that the pin will not be changed

MCPmode,<MCPGPIO>,<mode>

MCPGPIO: 0 … 255

mode:
0 = OUTPUT
1 = INPUT PULLUP
2 = INPUT

To change the mode of an MCPGPIO pin.

example: mcpMode,1,0 (set pin 1 as output)

MCPmodeRange,<MCPGPIO start pin>,<MCPGPIO end pin>, <mode>

MCPGPIO start pin: 0 … 255

MCPGPIO end pin: 0 … 255

mode:
0 = OUTPUT
1 = INPUT PULLUP
2 = INPUT

To change the mode of an MCPGPIO range of pin.

example: mcpModeRange,1,8,0 (set pin 1 to 8 as output)

External PCFGPIO

Command (PCFGPIO/Value)

Extra information

PCFGPIO,<PCFGPIO>,<state>

PCFGPIO: 0 … 255

State:

2 (HIGH-Z, input)

1 (HIGH, output)

0 (LOW, output)

-1 (OFFLINE, disconnected)

Basic on/off.. We can control a pin with simple http URL commands. To change the pin to high or low steady output. Setting PCFGPIO to 2 means that it will be able to detect low level relays (with high impedance, Z).

PCFGPIOtoggle,<PCFGPIO>

PCFGPIO: 0 … 255

Toggle on/off.. Toggle the current (output) state of the given PCFGPIO pin. When executed, it changes the pin mode to output.

PCFLongPulse,<PCFGPIO>,<state>,<duration>

PCFGPIO: 0 … 255

State: 1/0

Duration: 1 … 999 S

To send a *long* pulse to a certain pin.. A long pulse is basically the same as the plain pulse. Duration is defined in seconds, which makes it more suitable for longer duration. This command is not blocking, but will send 2 events to start and stop the pulse. This may have some variation depending on the system load of the module. Variation is typically up-to 10 msec, but may be up-to a second, depending on active plugins and controllers performing blocking operations.

PCFLongPulse_mS,<PCFGPIO>,<state>,<duration>

PCFGPIO: 0 … 255

State: 1/0

Duration: 10 … 15000 msec

To send a *long* pulse to a certain pin. A LongPulse_mS is the same as the regular LongPulse. The only difference is the time base in milliseconds rather than in seconds.

PCFPulse,<PCFGPIO>,<state>,<duration>

PCFGPIO: 0 … 255

State: 1/0

Duration: 0 … 1000 msec

To send a *short* pulse to a certain pin. Example to send an active high (1) pulse on PCFGPIO 14 for 500 mSeconds. Pulse duration is in milliseconds. State is 1 or 0. N.B. this is a blocking call, meaning no other actions will be performed during the pulse.

Status,PCF,<PCFGPIO>

PCFGPIO: 0 … 255

Returns the status of a pin. By the use of the command you will receive the status of the relevant pin.

Monitor,PCF,<PCFGPIO>

PCFGPIO: 0 … 255

To monitor a PCFGPIO state. By the use of the command you will receive events when the state of that pin is changed from 1 to 0 and from 0 to 1.

UnMonitor,PCF,<PCFGPIO>

PCFGPIO: 0 … 255

To cancel the monitor of a PCFGPIO state. By the use of the command you will stop receiving events when the state of that pin is changed from 1 to 0 and from 0 to 1.

MonitorRange,PCF,<PCFGPIO>

PCFGPIO: 0 … 255

To monitor a PCFGPIO state. By the use of the command you will receive events when the state of that pin is changed from 1 to 0 and from 0 to 1.

UnMonitorRange,PCF,<PCFGPIO>

PCFGPIO: 0 … 255

To cancel the monitor of a PCFGPIO state. By the use of the command you will stop receiving events when the state of that pin is changed from 1 to 0 and from 0 to 1.

PCFGPIOrange,<PCFGPIO start pin>,<PCFGPIO end pin>,<value> [,optional bitmask]

PCFGPIO start pin: 0 … 255

PCFGPIO end pin: 0 … 255

value: 0 or 1

bitmask:
- if not present assume to operate in all pins
- if present is used as a mask (1=update, 0=do not update)
- pins are numbered from right to left (i.e. 87654321)
- if number of bit lower than number of pins, then padded with 0
- if number of bit higher than number of pins, then it’s truncated
Change the status of a pin for a given range applying the given mask

examples:
- pcfgpioRange,1,8,1 -> set pins 1 to 8 to 1
- pcfgpioRange,3,12,1 -> set pins 3 to 12 to 1
- pcfgpioRange,5,17,0 -> set pins 5 to 17 to 0

- pcfgpioRange,3,12,1,525 or pcfgpioRange,3,12,1,0b0100001101
mask = ‘0100001101’
write pattern after mask = ‘x1xxxx11x1’ where x indicates that the pin will not be changed
(only pin 1,3,4,9 will be changed)

- pcfgpioRange,3,12,1,973 or pcfgpioRange,3,12,1,0b1111001101
mask = 973 = ‘1111001101’
write pattern after mask = ‘1111xx11x1’ where x indicates that the pin will not be changed

PCFGPIOpattern,<PCFGPIO start pin>,<PCFGPIO end pin>,<write pattern> [,optional bitmask]

PCFGPIO start pin: 0 … 255

PCFGPIO end pin: 0 … 255

write pattern: it’s a write pattern. Write 0 or 1.
- Example: use decimal number 15 (in binary is 00001111) to set to 1 pin 1,2,3 and 4 and to set to 0 pins 5,6,7,8
- if number of bit lower than number of pins, then padded with 0;
- if number of bit higher than number of pins, then it’s truncated.

bitmask:
- if not present assume to operate in all pins
- if present is used as a mask (1=update, 0=do not update)
- if number of bit lower than number of pins, then padded with 0
- if number of bit higher than number of pins, then it’s truncated
Change the status of a pin for a given range applying the given mask

examples:
- pcfgpioPattern,1,8,13
write pattern = ‘1101’ that will be padded as: ‘0000001101’
mask not present, assume mask = ‘1111111111’

- pcfgpioPattern,3,12,13
write pattern = ‘1101’ that will be padded as: ‘0000001101’
mask not present, assume mask = ‘1111111111’

- pcfgpioPattern,3,12,525
write pattern = 525 = ‘100001101’
mask not present, assume mask = ‘1111111111’

- pcfgpioPattern, 3, 12, 525, 973
write pattern = 525 = ‘100001101’
mask = 973 = ‘1111001101’
write pattern after mask = ‘1000xx11x1’ where x indicates that the pin will not be changed

PCFmode,<PCFGPIO>,<mode>

PCFGPIO: 0 … 255

mode:
0 = OUTPUT
1 = INPUT PULLUP
2 = INPUT

To change the mode of an PCFGPIO pin.

example: pcfMode,1,0 (set pin 1 as output)

PCFmodeRange,<PCFGPIO start pin>,<PCFGPIO end pin>, <mode>

PCFGPIO start pin: 0 … 255

PCFGPIO end pin: 0 … 255

mode:
0 = OUTPUT
1 = INPUT PULLUP
2 = INPUT

To change the mode of an PCFGPIO range of pin.

example: pcfModeRange,1,8,0 (set pin 1 to 8 as output)

Ringtone Internal GPIO

Internal GPIO handling NORMAL

Supported hardware: Buzzer (RTTTL), Piezo element, Speaker (Ringtones etc.)

Command (GPIO/Value)

Extra information

tone,<gpio>,<tone>,<duration>

GPIO: 12 … 16

Tone: 20 … 13000 Hz

Duration: 100 … 15000 msec

You should try to use GPIO 12…16 since these generally aren’t used. The recommended tone range is 20 Hz … 13 kHz. Up-to 40 kHz should be possible to generate, but will be inaudible for humans. Frequencies above 30 kHz are not stable and will likely crash the ESP.

Duration is set in ms.

N.B. tones with a duration less than 50 msec will be blocking. Longer duration will use the scheduler, which may cause some fluctuations in the duration.

rtttl,<gpio>,<value>

GPIO: 12 … 16

Value: d=<duration>,o=<octave>,b=<tempo>,<notes…>

You should try to use GPIO 12…16 since these generally aren’t used by ESP internal functions. N.B. Playing a tune is blocking for as long as the tune is playing.

Value can be defined like <name_of_melody:duration,octave,beat,notes….>

For example: rtttl,14,test:d=8,o=5,b=180,c6,b,c6,p,g,g-

More RTTTL Ringtone Downloads

Plugin based commands

Besides the internal commands there’s also plugin specific commands.

These can only be handled when the specific plugin is included in the ESPEasy build (and the plugin is assigned to an enabled task)

P003 Generic - Pulse counter

Command (GPIO/Value)

Extra information

ResetPulseCounter

legacy method:

ResetPulseCounter,<taskNumber>

Reset the counters (pulse counter and total counter) of P003 Pulse Counter.

When using multiple instances of Pulse Counter tasks, use a prefix to address the right one. E.g. 2.ResetPulseCounter, [GasZaehler].ResetPulseCounter or GasZaehler.ResetPulseCounter to address task number 2 or the task with the name GasZaehler. When task is neither identified as prefix nor as parameter, the first active Pulse Counter task will be affected.

The command will also trigger a call to PLUGIN_READ as if it processes a normal successful read.

SetPulseCounterTotal,value

legacy method:

SetPulseCounterTotal,value,<taskNumber>

Set the value of the total count of P003 Pulse Counter.

When using multiple instances of Pulse Counter tasks, use a prefix to address the right one. E.g. 2.SetPulseCounter,1000, [GasZaehler].SetPulseCounter,1000 or GasZaehler.SetPulseCounter,1000 to address task number 2 or the task with the name GasZaehler. When task is neither identified as prefix nor as parameter, the first active Pulse Counter task will be affected.

A call to set the counter total will also trigger a call to PLUGIN_READ as if it processes a normal successful read.

N.B. The set value is the internal value, so any present formula will be processed after this value is set.

LogPulseStatistic,<subcommand>

Optional subcommands:

  • r reset error and overdue counters.

  • i temporary increases the log level for regular statisticel log entries from Debug to Info

Initiate a single log entry with statistical information of current PULSE counter parameters (only if PULSE mode type is being used. Cf. special chapter about Statistical logging in P003 plugin documentation).

The <subcommand> is executed AFTER writing to logfile, so you see the result of the reset in consecutive loggings.

The i subcommand allows you to increase the log level to Info and still see the Pulse Counter’s statistical logings without other not needed Debug messages. This setting is valid until next reset.

When using multiple instances of Pulse Counter tasks, use a prefix to address the right one. E.g. 2.LogPulseStatistic,i, [GasZaehler].LogPulseStatistic,i or GasZaehler.LogPulseStatistic,i to address task number 2 or the task with the name GasZaehler. When the task-prefix is omitted, the first active Pulse Counter task will be affected.

N.B. Note that this single log entry is done, when Log Level is set to Info. Only the regular statistical logging is done by default on level Debug, but can be temporary increased to Info with the above i command.

P012 Display - LCD2004

Command

Extra information

lcdcmd,<value>

Value:

  • on will turn the display ON.

  • off will turn the display OFF.

  • clear will clear any information from the display.

Using these commands, either from rules, via http or mqtt, the state of the display can be controlled.

lcd,<row>,<col>,<text>

The <row> parameter corresponds with the same lines as the plugin configuration has.

The <col> parameter sets the column the text will be displayed.

The <text> parameter must be a single command parameter. Meaning, it must be wrapped in quotes when using a space or comma as text.

If double quote characters are needed, wrap the parameter in single quotes or back quotes.

All template notations can be used, like system variables, or reference to a task value.

P036 Display - OLED SSD1306/SH1106 Framed

Command

Extra information

oledframedcmd,display,<value>

Value:

  • on will turn the display ON.

  • off will turn the display OFF.

  • low will dim the display to low.

  • med will dim the display to medium.

  • high will set the brightness to maximum.

OLED displays will age quite fast, so it is not adviced to run them continously at max brightness.

Some displays do not accept all brightness levels and some also make a quite high pitch coil whine noise when running on some brightness levels. So different levels of brightness can also be of help on those displays.

The display controller itself does support more brightness levels, but these are chosen to give noticable change in brightness levels and also to help in choosing the best values for the 2 brightness control registers. As there are 2 brightness control registers, there is some overlap in their range, but some combinations may lead to issues like coil whining noise or sometimes not even working displays as not all of these displays are wired to support both controls to be used.

oledframedcmd,<line>,<text>

The <line> parameter corresponds with the same lines as the plugin configuration has.

The <text> parameter must be a single command parameter. Meaning, it must be wrapped in quotes when using a space or comma as text.

If double quote characters are needed, wrap the parameter in single quotes or back quotes.

The updated line text is not stored in the settings itself, but kept in memory. After a reboot the stored plugin settings will be used.

All template notations can be used, like system variables, or reference to a task value.

After receiving text this way, the frame where the text is placed is shown, if the setting for ‘Wake display on receiving text’ is checked.

oledframedcmd,frame[,<framenr>]

This command is to display a specific frame (aka page), or the next frame. When reaching the last frame, a ‘next’ (0) will display the first frame.

The <framenr> parameter corresponds to the desired frame (1..<number of frames>) to display. The number of frames is determined by dividing the lines in use (at least one line in that frame with some data), by the number of Lines per Frame. So practically, the range is 1..3 when all lines are used and 4 Lines per Frame is set, or 1..12 if Line per frames is set to 1. The number of frames is updated if a frame would initially be empty, and an external source places text on a line of that frame (see above).

When omitting <framenr>, or providing 0, the next frame is displayed.

When the display is off, because a ‘Display Timeout’ is set and the timer has expired or it is turned off by the off command (see above), then it is turned on, and, when set, the timer is started again.

P048 Motor - Adafruit Motorshield v2

Command

Examples

MotorShieldCMD,DCMotor,<Motornumber>,<Action>,<Speed>

Motornumber:

1 Motor M1

2 Motor M2

3 Motor M3

4 Motor M4

Action:

Forward Turn on DC Motor, Direction Forward

Backward Turn on DC Motor, Direction Backward

Release Stop applying voltage to the motor, causing the motor to run freely.

Speed: a value from 0-255

Turn on DC Motor, Direction: Forward. Speed: 99

http://<ESP IP address>/control?cmd=MotorShieldCMD,DCMotor,0,Forward,99

Stopping the DC Motor:

http://<ESP IP address>/control?cmd=MotorShieldCMD,DCMotor,0,Release

MotorShieldCMD,Stepper,<Motornumber>,<Action>,<Steps>,<stepsize>

Motornumber:

1 Stepper M1 & M2

2 Motor M3 & M4

Action:

Forward Turn on DC Motor, Direction Forward

Backward Turn on DC Motor, Direction Backward

Release Stop applying voltage to the motor, causing the motor to run freely.

Steps: a value from 0-255

Stepsize:

SINGLE Perform a single (full) step

DOUBLE Perform 2 (full) steps

INTERLEAVE Perform half step

MICROSTEP Perform quarter step

Turn on DC Motor, Direction: Forward. Steps: 99

http://<ESP IP address>/control?cmd=MotorShieldCMD,Stepper,0,Forward,99,

Stopping the DC Motor:

http://<ESP IP address>/control?cmd=MotorShieldCMD,Stepper,0,Release

P052 Gases - CO2 Senseair

Command (GPIO/Value)

Extra information

senseair_setrelay,<value>

Value:

1 will set the relay to ON.

0 will set the relay to OFF.

-1 will remove control over relay.

Used in tSense (K70) to set the relay to either 1 or 0. Observe that using this command will take over the control of the relay from the tSense. If you want to give the control back you use the -1 value.

P053 Dust - PMSx003 / PMSx003ST

Command

Extra information

pmsx003,wake

Either pulls the PWR_SET pin high, or writes wake command to the sensor.

pmsx003,sleep

Either pulls the PWR_SET pin low, or writes sleep command to the sensor.

pmsx003,reset

If reset pin is set, the pin will be pulled down for 250 msec to reset the sensor.

P065 Notify - DFPlayer-Mini MP3

Command

Extra information

play,<number>

Example:

play,12 to play the 12th track available on the SD card.

Starts playing the nth file on the SD-card. Acceptable numbers 0..2999.

stop

Stops playing the current file immediately.

vol,<volume>

Example:

vol,15

Change the playback volume to the set level. Acceptable values 1..30. When 0 (or no argument) is provided, the max. volume will be set!

Volume is also stored in the settings, but not saved untile either a save command is used, or the settings of the device is saved from the web interface.

eq,<type>

Example:

eq,4

Select the equalizer configuration. Acceptable values 0..5.

0 = Normal

1 = Pop

2 = Rock

3 = Classic

4 = Jazz

5 = Base

mode,<mode>

Example:

mode,3

Select the playback mode. Acceptable values 0..3.

0 = Repeat

1 = Folder repeat

2 = Single repeat

3 = Random

NB: To have actual repeat playing a track, the repeat command should also be enabled.

NB2: This command does not work on all players, it may start a play,<mode> with repeat enabled instead. That seems hardware related.

repeat,<0|1>

Example:

repeat,1

To set repeat mode. Default is off, acceptable values 0 or 1.

0 = Off

1 = On

P073 Display - 7-segment display

Command

Extra information

7dn,<number>

Example:

7dn,[BME280#Humidity] to display the humidity measured by a BME280 sensor.

Displays a numeric value on the display, with 1 decimal position if space allows.

7dt,<temperature>

Example:

7dt,[BME280#Temperature]

To display the temperature measured by a BME280 sensor. By default includes a ° symbol, unless option ‘Hide ° for Temperatures’ is enabled.

7ddt,<temperature1>,<temperature2>

Example:

7ddt,[BME280#Temperature],[DS18b20#Temperature]

To display two temperatures measured by a BME280 sensor and a DS18b20 sensor. Only applicable for the MAX7219 - 8 digit display, as the other devices don’t have enough digits to show 2 temperatures.

7dst,<hh>,<mm>,<ss>

Example:

7dst,%syshour%+6,%sysmin%,%syssec%

To display the time for a different time zone.

Can also be used to f.e. set the next appointment time externally.

7dsd,<dd>,<mm>,<yy>

To display a date.

7dtext,<text>

Examples:

7dtext,OUT [BLK#Temperature#d2.1]^

7dtext,HU. [BLK#Humidity#d2.1]^o Will result in ‘HU. 57.2°o’ being displayed (MAX7219 display and Siekoo with uppercase ‘CHNORUX’ font)

To display a text on the display. Any variable can be used. Unsupported characters (like accented letters) will show as a space (empty digit).

With the Scroll Text option disabled, the first n characters the display can show are displayed, if the Scroll Text option is enabled, longer texts will scroll from right to left across the display, at the set speed.

7dfont,<font>

Select a different font, either by name: Default or 7dgt for the original font (0), Siekoo for standard Siekoo font (1), Siekoo_Upper for the Siekoo font with uppercase ‘CHNORUX’ characters (2), and dSEG7 for the dSEG7 font (3). Numbers can also be used, 0, 1, 2, or 3 as noted. Fontnames are not case-sensitive.

7dbin,<byte>,...

Example:

7dbin,0x40,0x20,0x10,0x08,0x04,0x02,0x01,0x80

To display any bit pattern on the display.

The example shows each digit with a different segment on, including the dot/colon, and assuming either a MAX7219 - 8 digit, or Scroll Text enabled.

See explanation on how the bits map to segments, below.

7don

Turn the display on.

7doff

Turn the display off.

7db,<0..15>

Set the brightness to the provided level.

7output,<0..5>

Change the Display Output setting, available options:

  • 0 - Manual

  • 1 - Clock 24h - Blink

  • 2 - Clock 24h - No Blink

  • 3 - Clock 12h - Blink

  • 4 - Clock 12h - No Blink

  • 5 - Date

P075 Display - Nextion

Command Syntax

Extra information

Task Name,'page.objname.txt="string"'
Task Name,'page.objname.val=number'
The Task Name is the user assigned Name for the Nextion Task. Avoid spaces, special characters and reserved words. The default name is NEXTION.
page.objname.txt is the field format for sending text strings to the Nextion display.
page.objname.val is the field format for sending integer values to the Nextion display.
The page. argument may be omitted if the Nextion object’s attribute is set as global.

Parameters

HTTP Examples

In these examples the assigned Task name is NEXTION.

NEXTION,’page0.j1.txt=”Hello World”’

NEXTION,’page3.t0.val=777’

NEXTION,’page8.t_ram.txt=”System Time [%systime%]”’

Send Hello World to a text field on the display.

http://<ESP IP address>/control?cmd='NEXTION,page0.j1.txt="Hello World"'

Send integer value -123 to a numeric field on the display:

http://<ESP IP address>/control?cmd='NEXTION,page3.t0.val=-123'

Send a Switch plugin value to a numeric field on the display:

http://<ESP IP address>/control?cmd='NEXTION,page3.t0.val=[DoorSwitch#State]'

P076 Energy (AC) - HLW8012/BL0937

Command (GPIO/Value)

Extra information

hlwcalibrate,<CalibVolt>,<CalibCurr>,<CalibAcPwr>

Examples:

hlwcalibrate,229 to set the current reported voltage to 229V AC

hlwcalibrate,0,0.1 To set the calibration to report 100 mA as actual current.

Will set the used calibration factors to some known current value. For example, if the device using this sensor is plugged into mains power, it may report 200 Volt AC, while it actually is 229V. So the value given to this command should then be 229, since that’s what is supposed to be read.

The last two parameters are optional, but their position determines what unit it represents. If the setting for current has to be updated, at least 2 parameters must be given of which the first must then be set to 0.

hlwreset

Will reset the calibration values used in the sensor’s library.

P079 Motor - Wemos / Lolin Motorshield

Command Syntax

Extra information

WemosMotorShieldCMD,<Motornumber>,<Action>,<Speed>
LolinMotorShieldCMD,<Motornumber>,<Action>,<Speed>
The WemosMotorShieldCMD and LolinMotorShieldCMD command keywords are interchangeable.
The LolinMotorShieldCMD command keyword is available on mega-20200929 and later releases.
All commands are case insensitive.

Parameters

HTTP Examples

Motornumber:

0 Motor A

1 Motor B

Action:

Forward Turn on DC Motor, Direction Forward

Backward Turn on DC Motor, Direction Backward

Stop Turn off DC Motor, no Brake

Brake Turn off DC Motor, apply Brake (short commutator)

Standby Turn off DC Motor and set MotorShield to low power mode

Speed:

0-100 (Motor PWM Duty, 0% to 100%)

Brake and Standby actions are available on mega-20200929 and later releases.

Turn on DC Motor-A, Direction: Forward, Speed: 99

http://<ESP IP address>/control?cmd=WemosMotorShieldCMD,0,Forward,99

Stopping DC Motor-A:

http://<ESP IP address>/control?cmd=WemosMotorShieldCMD,0,Stop


Local Command Testing:

Motor tests can be performed using the Command entry box found on ESPEasy device’s Tools page. For example:

WemosMotorShieldCMD,0,Forward,99

P082 Position - GPS

Command

Extra information

gps,sleep

Send u-blox specific command to put the GPS in backup mode. This turns off all parts of the GPS, except for the last known satellite trajectories.

Use this to get a faster fix, compared to turning off the power to the GPS.

In order to send a command to the GPS, the GPS RX pin must be connected.

gps,wake

Send just any character to the GPS to wake it from backup mode (see gps,sleep)

This is u-blox specific.

In order to send a command to the GPS, the GPS RX pin must be connected.

P088 Energy (Heat) - HeatpumpIR

Command

Extra information

heatpumpir,<model>,<powerstate>,<mode>,<fan>,<temperature>,<swingV>,<swingH>

model:

panasonic_ckp Panasonic CPK series

panasonic_dke Panasonic DKE series

panasonic_jke Panasonic JKE series

panasonic_nke Panasonic NKE series

panasonic_lke Panasonic LKE series

carrier_nqv Carrier/Toshiba

carrier_mca Carrier/Toshiba

midea Midea

fujitsu_awyz Fujitsu AWYZ

mitsubishi_fd Mitsubishi FD

mitsubishi_fe Mitsubishi FE

mitsubishi_msy Mitsubishi MSY

mitsubishi_msc Mitsubishi MSC

mitsubishi_fa Mitsubishi FA

samsung_aqv Samsung AQV

samsung_fjm Samsung FJM

sharp Sharp

daikin Daikin

daikin_arc417 Daikin ARC417

mitsubishi_heavy_zj Mitsubishi Heavy Electric ZJ

mitsubishi_heavy_zm Mitsubishi Heavy Electric ZM

mitsubishi_heavy_fdtc Mitsubishi Heavy FDTC

mitsubishi_sez Mitsubishi SEZ

hyundai Hyundai

hisense_aud Hisense

gree Gree (generic)

greeyan Gree YAN

greeyaa Gree YAN

fuego Fuego

toshiba Toshiba

toshiba_daiseikai Toshiba Daiseikai

ivt IVT

hitachi Hitachi

ballu Ballu

AUX AUX

powerstate:

0 Power off

1 Power on

mode:

1 Automatic

2 Heat

3 Cool

4 Dry

5 Fan only

6 Maintenance heating (10 or 8 degrees Celsius)

fan: a value from 0 to 5, 0 is auto speed

temperature: temperature in degrees Celsius, 16-30

swingV: vertical swing position (not supported on most models)

swingH: horizontal swing position (not supported on most models)

Examples: Panasonic CKP on, automatic mode, automatic fan speed, 22 degrees C, automatic horizontal & vertical swing

http://<ESP IP address>/control?cmd=heatpumpir,panasonic_ckp,1,1,0,22,0,0

For more examples, read the comments in the source code of P088_HeatpumpIR.ino

P091 Switch input - Serial MCU controlled switch

Command

Extra information

/control?cmd=relay,<relaynr>,<state>

Examples:

  • /control?cmd=relay,0,1 Switch on first relay

  • /control?cmd=relay,0,0 Switch off first relay

  • /control?cmd=relay,1,1 Switch on second relay

  • /control?cmd=relay,1,0 Switch off second relay

/control?cmd=relaypulse,<relaynr>,<state>,<duration>

Examples:

  • /control?cmd=relaypulse,0,1,500 Set first relay to ON for 500ms, then stay OFF

  • /control?cmd=relaypulse,0,0,1000 Set first relay to OFF for 1s, then stay ON

/control?cmd=ydim,<value>

Examples:

  • /control?cmd=ydim,255 Set dimmer to MAX value

  • /control?cmd=ydim,25 Set dimmer to ~10%

P093 Energy (Heat) - Mitsubishi Heat Pump

Command

Extra information

MitsubishiHP,temperature,<value>

Value must be between 16 and 31.

MitsubishiHP,power,<value>

Value = ON or OFF

MitsubishiHP,mode,<value>

Value = HEAT, COOL, FAN, DRY or AUTO

MitsubishiHP,fan,<value>

Value = 1, 2, 3, 4, AUTO or QUIET

MitsubishiHP,vane,<value>

Value = 1, 2, 3, 4, 5, SWING or AUTO

MitsubishiHP,widevane,<value>

Value = <<, <, |, >, >>, <> or SWING

P094 CUL Reader

Command

Extra information

culreader_write

Examples:

  • culreader_write,brt Switch CULfw into Wireless M-Bus receive mode ‘T’

P095 Display - TFT 2.4 inches ILI9341

Command

Extra information

TFTCMD,<tftcmd_subcommand>

Control the screen (on, off, clear,..)

Examples:

  • tftcmd,on Switch display on.

  • tftcmd,off Switch display off.

  • tftcmd,clear Clear whole display.

  • tftcmd,clear,green Clear whole display with green color.

  • tftcmd,inv,1 Invert the dispaly (value:0 normal display, 1 inverted display)

  • tftcmd,rot,2 Rotate display (value from 0 to 3 inclusive)

TFT,<tft_subcommand>,....

Draw line, rect, circle, triangle and text

Subcommands:

  • tft,txt,<text> Write simple text (use last position, color and size)

  • tft,txp,<X>,<Y> Set text position (move the cursor)

  • tft,txc,<foreColor>,<backgroundColor> Set text color (background is transparent if not provided

  • tft,txs,<SIZE> Set text size

  • tft,txtfull,<row>,<col>,<size=1>,<foreColor=white>,<backColor=black>,<text> Write text with all options

  • tft,l,<x1>,<y1>,<2>,<y2>,<color> Draw a simple line

  • tft,lh,<y>,<width>,<color> Draw an horizontal line (width = Line width in pixels (positive = right of first point, negative = point of first corner).

  • tft,lv,<x>,<height>,<color> Draw a vertical line (height= Line height in pixels (positive = below first point, negative = above first point).

  • tft,r,<x>,<y>,<width>,<height>,<color> Draw a rectangle

  • tft,rf,<x>,<y>,<width>,<height>,<bordercolor>,<innercolor> Draw a filled rectangle

  • tft,c,<x>,<y>,<radius>,<color> Draw a circle

  • tft,cf,<x>,<y>,<radius>,<bordercolor>,<innercolor> Draw a filled circle

  • tft,t,<x1>,<y1>,<x2>,<y2>,<x3>,<y3>,<color> Draw a triangle

  • tft,tf,<x1>,<y1>,<x2>,<y2>,<x3>,<y3>,<bordercolor>,<innercolor> Draw a filled triangle

  • tft,rr,<x>,<y>,<width>,<height>,<corner_radius>,<color> Draw a round rectangle

  • tft,rrf,<x>,<y>,<width>,<height>,<corner_radius>,<bordercolor>,<innercolor> Draw a filled round rectangle

  • tft,px,<x>,<y>,<color> Print a single pixel

  • tft,font,<fontname> Switch to font - SEVENSEG24, SEVENSEG18, FREESANS, DEFAULT

Examples:

Write Text :

tft,txtfull,0,0,HelloWorld

Write Text another place:

tft,txtfull,100,40,HelloWorld

Write bigger Text :

tft,txtfull,0,0,3,HelloWorld

Write RED Text :

tft,txtfull,0,0,3,HelloWorld

Write RED Text (size is 1):

tft,txtfull,0,0,1,RED,HelloWorld

Write RED Text on YELLOW background (size is 1):

tft,txtfull,0,0,1,RED,YELLOW,HelloWorld

Select font :

  • tft,font,SEVENSEG24

  • tft,txtfull,0,0,1,RED,17.0

P099 Touch - XPT2046 touchscreen on TFT display

Command

Extra information

touch,rot,<rotation>

Set the rotation to 0, 90, 180 or 270 degrees. The rotation angle should match with the display it is mounted on.

Values:

0       180 degrees

1       270 degrees

2       0 degrees (Normal)

3       90 degrees

(NB: I only have 1 display with a touchscreen mounted, and it is possible that mine is mounted 180 degrees rotated. It may be needed later to add a setting for this, we’ll see.)

Examples:

touch,rot,1 Rotate the device to 270 degrees.

touch,flip,<0|1>

Flip the rotation setting by 0 (default, value 0) or 180 degrees (numeric value > 0)

Examples:

touch,flip,1 Flip the touchscreen rotation by 180 degrees.

touch,enable,<objectname>

Enable a disabled touchobject by name.

Examples:

touch,enable,sun Enable all touchobjects with the name ‘sun’.

touch,disable,<objectname>

Disable an enabled touchobject by name.

Examples:

touch,disable,sun Disable all touchobjects with the name ‘sun’.

P101 Communication - Wake On LAN

Command Syntax

Extra information

Example 1: WAKEONLAN,<Optional MAC>,<Optional IP>,<Optional Port>
Example 2: Task Name,<Optional MAC>,<Optional IP>,<Optional Port>
When only one WOL task is assigned the WAKEONLAN and Task Name command keywords are interchangeable.
If multiple WOL tasks are assigned the user provided Task Name should be used as the command keyword.

Optional parameters will override the values entered in the WOL task’s configuration page. See examples below.

Optional Parameters

HTTP Examples

MAC Address:

aa:bb:cc:dd:ee:ff

IP Address:

255.255.255.255

Port Number:

0-65535

Turn on family room Media Server (WOL task name MediaPlayer) using task’s default settings.

http://<ESP IP address>/control?cmd=MediaPlayer

Turn on basement gaming PC using specific MAC address:

http://<ESP IP address>/control?cmd=WAKEONLAN,74:27:EA:60:40:E5

Turn on basement gaming PC using specific IP Address:

http://<ESP IP address>/control?cmd=WAKEONLAN,74:27:EA:60:40:E5,192.168.1.25

Turn on basement gaming PC using specific UDP port:

http://<ESP IP address>/control?cmd=WAKEONLAN,74:27:EA:60:40:E5,192.168.1.25,11

P104 Display - MAX7219 dot matrix

Command

Extra information

DotMatrix,clear[,All|<zone>]

Clears a zone by number or the entire display. All <zone> arguments are the zone numbers as shown on the Device settings page.

Without a <zone> or All specified, the All action is executed.

DotMatrix,update[,All|<zone>]

Update a zone, or all zones, with any updated content. Can be used instead of the Repeat (sec) option of a zone.

Without a <zone> or All specified, the All action is executed.

DotMatrix,size,<zone>,<size>

Set the size of the zone to <size> modules. Will cause a reconfiguration of all zones.

DotMatrix,[set]txt,<zone>,"<text content>"

Set the text displayed in the zone if it is of Content type Text.

txt will only replace the current content.

settxt will also store it in the device settings if it is not longer than the allowed input length (100 characters), but not save the settings.

DotMatrix,content,<zone>,<contenttype>

Set the Content type for the specified zone, where <contenttype> is a numeric value from 0..7.

  1. Text

  2. Text (reverse)

  3. Clock

  4. Clock sec

  5. Date

  6. Date yy

  7. Date/time

  8. Bar graph

Will cause a reconfiguration of all zones.

DotMatrix,alignment,<zone>,<alignmenttype>

Change the alignment of the zone, 0 = Left, 1 = Center, 2 = Right.

DotMatrix,anim.in,<zone>,<animationnr>

Change the Animation In setting for the zone. The <animationnr> value can be obtained from the dropdown in the Device settings page. The None (0) setting is not accepted here.

DotMatrix,anim.out,<zone>,<animationnr>

Change the Animation Out setting for the zone. The <animationnr> value can be obtained from the dropdown in the Device settings page.

DotMatrix,speed,<zone>,<speed_ms>

Set the Speed factor for the indicated zone. Valid values 0..65535.

DotMatrix,pause,<zone>,<pause_ms>

Set the Pause delay in milliseconds for the indicated zone. Valid values 0..65535.

DotMatrix,font,<zone>,<font_id>

Set the Font for the zone using a font ID.

Valid font ID’s:

  1. Default

  2. Numeric, double height

  3. Full, double height

  4. Vertical

  5. Extended ASCII

  6. Arabic

  7. Greek

  8. Katakana

NB: Not all fonts are available in all builds, selecting an unsupported font will fail the command.

Will cause a reconfiguration of all zones.

DotMatrix,layout,<zone>,<layouttype>

Set the Layout for the indicated zone.

  1. Standard

  2. Double, upper

  3. Double, lower

Will cause a reconfiguration of all zones.

DotMatrix,inverted,<zone>,<invertedstate>

Set the Inverted state for the indicated zone.

  1. Normal, light content on dark background

  2. Inverted, dark content on light background

Will cause a reconfiguration of all zones.

DotMatrix,specialeffect,<zone>,<specialeffect_id>

Set the Special effect for the indicated zone.

  1. None

  2. Flip up/down

  3. Flip left/right

  4. Flip u/d & l/r

Will cause a reconfiguration of all zones.

DotMatrix,offset,<zone>,<modulecount>

Set the Offset for the indicated zone. Valid values 0..254.

Will cause a reconfiguration of all zones.

DotMatrix,brightness,<zone>,<brightness>

Set the Brightness level for the indicated zone. Valid values 0 (minimum)..15 (maximum brightness).

DotMatrix,repeat,<zone>,<repeat_sec>

Set the Repeat (sec) in seconds for the indicated zone. Valid values -1 (disabled)..86400 seconds (1 day).

DotMatrix,[set]bar,<zone>,'<graph_string>[|...]'

Set a zone with a Content type of Bar graph with 1 to 8 graph strings, to be displayed as bar graphs.

bar will display the Bar graph(s).

setbar will display the Bar graph(s), and also store the provided graph string(s) in the device settings if it is not longer than the allowed input length (100 characters), but not save the settings.

The graph string used for displaying 1 or more bar graphs is formatted like this: (square backets denoting optional arguments)

<value>[,<max value>[,<min value>[,<direction[,<bartype>]]]]][|...]

<value> The value to display. This is the only required argument. The usual [Taskname#Taskvar], %function% etc. syntax can be used here. It should result in a numeric value.

<max value> The maximum expected value, defaults to 100 (treated as if it was a percentage). Can be negative if desired, but the min value should always be lower than the max value, but the values will be swapped if min value is larger than max value.

<min value> The minimum expected value, defaults to 0. Negative value can be used, as well as > 0, the full bar graph will be scaled between the max and min values to fit in the zone.

The <value>, <max value> and <min value> can be provided with decimal values (of type double).

<direction> The default direction is 0, meaning from right to left (low value is on the right side, high value is on the left side), the ‘natural’ direction for the hardware, and can be changed to 1 for left to right display.

<bartype> This can be 0, 1 or 2:

  1. Max. available bar width will be used, determined by dividing 8 by the number of graph strings provided.

  2. Single pixel bar width, resulting in a line-graph instead of a bar graph.

  3. Alternating pixelated bar graph. Will only be applied if the bar width is at least 2 pxels, or else a line graph like bartype 1 will be displayed.

Most of these arguments are optional, but if a value is to be skipped, the default should be put in, f.e. [BME#Temperature],40,0,0,2 to display a temperature on a 0 to 40 scale with bartype 2 from right to left.

Multiple graph strings can be used, these must be separated by a pipe symbol |, f.e. [Living#Temperature],40,-20,0,1|[Refrigerator#Temperature],40,-20,0,1|[Freezer#Temperature],40,-20,0,1 for displaying 3 line-graphs showing the temperatures of the livingroom, refrigerator and freezer on a -20 to 40 degrees centigrade scale from right to left. The ‘zero-point’ is around 1/3rd from the right of the zone.

If the width of the bar graph is over 2, and the zero-point is visible on the display (max value > 0 and min value < 0), then the zero-point is marked on each bar by turning the outer pixels off, like this:

|    *********           |
|    **********          | (a positive value)
|    **********          |
|    *********           |
|              ****      |
|             *****      | (a negative value)
|             *****      |
|              ****      |
              ^
              +-- Zero-point

P115 Energy - MAX1704x

Command Syntax

Extra information

max1704xclearalert
Clear the alert state. An alert event will only be sent when the alert state is set. Clearing it allows for new events to be set.