Skip to content

output module

doomke edited this page Jul 11, 2023 · 8 revisions

Description

Manages the state and operation of an output pin and reports changes to the server. Can be used to drive relays or MOSFETs, output power can be adjusted via PWM. Output is automatically turned off if connection is lost.

Settings

setting type range description
pin integer > 0 number of the pin to apply the output voltage to ADD NOTE: not all available
pwm boolean if false the output will be binary (relay), if true the output power can be adjusted using an 8 bit unsigned integer (0 to 255)
channel integer ≥ 0 PWM channel[1] of the ESP32 to use
frequency integer > 0 frequency (in Hz)[2] to use for the PWM
infoLED String controlId of a LED, module will instruct LED to indicate if changes were made by a user[3]
  1. PWM channel 0 and 1 must not be used if a camera module is present, otherwhise the camera will not function properly.
  2. Might not work with all frequencies and is highly dependend on a fast switching output (hardware). Make sure your output can follow the specified frequency.
  3. Defaults to an empty String, in which case no attempts to operate the LED will be made.

Command Keys

key type range description
pwm integer (0, 255) adjust power level to the specified value[4]
switch boolean switch output on if true and off if false[4]
pulse integer (0, 65535) turn on output for the specified time (in ms) -- turns off automatically after the time expired
identify integer > 0 highlight the hardware by its LED[5] for the specified time (in ms)
  1. if the output is specified for pwm, switch still takes effect: if a non-zero pwm is set but the output is switched off, still no voltage is applied to the output. Likewise, if the output is switched on and a pwm of 0 is set, no live voltage will be applied to the output.
  2. infoLED must be assigned, otherwise no LED will light up

Status

"controlId":"heater",
"status":
{
    "isOn":true,
    "pwm":255
}
  • isOn – boolean, true if the output is currently turned on. pwm still applies, if available.
  • pwm – uint8, optional, only present for modules that do have PWM. Current power level of the module, only applied if isOn is true.

Events

  • busy – occurs when pulse command is issued and the module is waiting for the specified time to pass
  • ready – occurs when a pulse command has been completed

General

Guides

Principle of Operation

Modules

Software Hardware
camera camera
infoLED infoLED
input input
macro macro
output output
servo servo
socket socket
stepper stepper
WiFi wifi

Clone this wiki locally