-
Notifications
You must be signed in to change notification settings - Fork 1
output module
doomke edited this page Jul 11, 2023
·
8 revisions
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.
| 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] |
- ↑PWM channel 0 and 1 must not be used if a camera module is present, otherwhise the camera will not function properly.
- ↑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.
- ↑Defaults to an empty String, in which case no attempts to operate the LED will be made.
| 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) |
-
↑if the output is specified for
pwm,switchstill 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. -
↑
infoLEDmust be assigned, otherwise no LED will light up
"controlId":"heater",
"status":
{
"isOn":true,
"pwm":255
}-
isOn$-$ boolean, true if the output is currently turned on.pwmstill applies, if available. -
pwm$-$ uint8, optional, only present for modules that do have PWM. Current power level of the module, only applied ifisOnis true.
-
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