Skip to content

Supported Outputs

Built-In Outputs (System)~

On/Off: MQTT Publish~

  • Manufacturer: Mycodo
  • Interfaces: IP
  • Output Types: On/Off
  • Libraries: paho-mqtt
  • Dependencies: paho-mqtt
  • Additional URL: Link

Publish "on" or "off" (or any other strings of your choosing) to an MQTT server.

OptionTypeDescription
Channel Options
HostnameText - Default Value: localhostThe hostname of the MQTT server
PortInteger - Default Value: 1883The port of the MQTT server
TopicText - Default Value: paho/test/singleThe topic to publish with
Keep AliveInteger - Default Value: 60The keepalive timeout value for the client. Set to 0 to disable.
Client IDText - Default Value: client_6GggcConUnique client ID for connecting to the MQTT server
On PayloadText - Default Value: onThe payload to send when turned on
Off PayloadText - Default Value: offThe payload to send when turned off
Startup StateSelectSet the state when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Force CommandBooleanAlways send the command if instructed, regardless of the current state
Current (Amps)DecimalThe current draw of the device being controlled
Use LoginBooleanSend login credentials
UsernameText - Default Value: userUsername for connecting to the server
PasswordTextPassword for connecting to the server. Leave blank to disable.
Use WebsocketsBooleanUse websockets to connect to the server.

PWM: MQTT Publish~

  • Manufacturer: Mycodo
  • Output Types: PWM
  • Libraries: paho-mqtt
  • Dependencies: paho-mqtt
  • Additional URL: Link

Publish a PWM value to an MQTT server.

OptionTypeDescription
Channel Options
HostnameText - Default Value: localhostThe hostname of the MQTT server
PortInteger - Default Value: 1883The port of the MQTT server
TopicText - Default Value: paho/test/singleThe topic to publish with
Keep AliveInteger - Default Value: 60The keepalive timeout value for the client. Set to 0 to disable.
Client IDText - Default Value: client_tO6tBFpxUnique client ID for connecting to the MQTT server
Use LoginBooleanSend login credentials
UsernameText - Default Value: userUsername for connecting to the server
PasswordTextPassword for connecting to the server.
Use WebsocketsBooleanUse websockets to connect to the server.
Startup StateSelectSet the state when Mycodo starts
Startup ValueDecimalThe value when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Shutdown ValueDecimalThe value when Mycodo shuts down
Invert SignalBooleanInvert the PWM signal
Invert Stored SignalBooleanInvert the value that is saved to the measurement database
Current (Amps)DecimalThe current draw of the device being controlled
Commands
Set the Duty Cycle.
Duty CycleDecimalThe duty cycle to set
Set Duty CycleButton

Value: MQTT Publish~

  • Manufacturer: Mycodo
  • Output Types: Value
  • Libraries: paho-mqtt
  • Dependencies: paho-mqtt
  • Additional URL: Link

Publish a value to an MQTT server.

OptionTypeDescription
Channel Options
HostnameText - Default Value: localhostThe hostname of the MQTT server
PortInteger - Default Value: 1883The port of the MQTT server
TopicText - Default Value: paho/test/singleThe topic to publish with
Keep AliveInteger - Default Value: 60The keepalive timeout value for the client. Set to 0 to disable.
Client IDText - Default Value: client_4ccOuIPcUnique client ID for connecting to the MQTT server
Off ValueIntegerThe value to send when an Off command is given
Use LoginBooleanSend login credentials
UsernameText - Default Value: userUsername for connecting to the server
PasswordTextPassword for connecting to the server.
Use WebsocketsBooleanUse websockets to connect to the server.

Built-In Outputs (Devices)~

Digital Potentiometer: DS3502~

The DS3502 can generate a 0 - 10k Ohm resistance with 7-bit precision. This equates to 128 possible steps. A value, in Ohms, is passed to this output controller and the step value is calculated and passed to the device. Select whether to round up or down to the nearest step.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
Round StepSelect(Options: [Up | Down] (Default in bold)Round direction to the nearest step value

Digital-to-Analog Converter: MCP4728~

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
VREF (volts)Decimal - Default Value: 4.096Set the VREF voltage
Channel Options
NameTextA name to distinguish this from others
VREFSelect(Options: [Internal | VDD] (Default in bold)Select the channel VREF
GainSelect(Options: [1X | 2X] (Default in bold)Select the channel Gain
Start StateSelect(Options: [Previously-Saved State | Specified Value] (Default in bold)Select the channel start state
Start Value (volts)DecimalIf Specified Value is selected, set the start state value
Shutdown StateSelect(Options: [Previously-Saved Value | Specified Value] (Default in bold)Select the channel shutdown state
Shutdown Value (volts)DecimalIf Specified Value is selected, set the shutdown state value

Motor: Stepper Motor, Bipolar (Generic) (Pi <= 4)~

This is a generic module for bipolar stepper motor drivers such as the DRV8825, A4988, and others. The value passed to the output is the number of steps. A positive value turns clockwise and a negative value turns counter-clockwise.

OptionTypeDescription
Channel Options
If the Direction or Enable pins are not used, make sure you pull the appropriate pins on your driver high or low to set the proper direction and enable the stepper motor to be energized. Note: For Enable Mode, always having the motor energized will use more energy and produce more heat.
Step PinIntegerThe Step pin of the controller (BCM numbering)
Full Step DelayDecimal - Default Value: 0.005The Full Step Delay of the controller
Direction PinIntegerThe Direction pin of the controller (BCM numbering). Set to None to disable.
Enable PinIntegerThe Enable pin of the controller (BCM numbering). Set to None to disable.
Enable ModeSelect(Options: [Only When Turning | Always] (Default in bold)Choose when to pull the enable pin high to energize the motor.
Enable at ShutdownSelect(Options: [Enable | Disable] (Default in bold)Choose whether the enable pin in pulled high (Enable) or low (Disable) when Mycodo shuts down.
If using a Step Resolution other than Full, and all three Mode Pins are set, they will be set high (1) or how (0) according to the values in parentheses to the right of the selected Step Resolution, e.g. (Mode Pin 1, Mode Pin 2, Mode Pin 3).
Step ResolutionSelect(Options: [Full (modes 0, 0, 0) | Half (modes 1, 0, 0) | 1/4 (modes 0, 1, 0) | 1/8 (modes 1, 1, 0) | 1/16 (modes 0, 0, 1) | 1/32 (modes 1, 0, 1)] (Default in bold)The Step Resolution of the controller
Mode Pin 1IntegerThe Mode Pin 1 of the controller (BCM numbering). Set to None to disable.
Mode Pin 2IntegerThe Mode Pin 2 of the controller (BCM numbering). Set to None to disable.
Mode Pin 3IntegerThe Mode Pin 3 of the controller (BCM numbering). Set to None to disable.

Motor: ULN2003 Stepper Motor, Unipolar (Pi <= 4)~

  • Manufacturer: STMicroelectronics
  • Interfaces: GPIO
  • Output Types: Value
  • Libraries: RPi.GPIO, rpimotorlib
  • Dependencies: RPi.GPIO, rpimotorlib
  • Manufacturer URL: Link
  • Datasheet URLs: Link 1, Link 2

This is a module for the ULN2003 driver.

OptionTypeDescription
Channel Options
Notes about connecting the ULN2003...
Pin IN1Integer - Default Value: 18The pin (BCM numbering) connected to IN1 of the ULN2003
Pin IN2Integer - Default Value: 23The pin (BCM numbering) connected to IN2 of the ULN2003
Pin IN3Integer - Default Value: 24The pin (BCM numbering) connected to IN3 of the ULN2003
Pin IN4Integer - Default Value: 25The pin (BCM numbering) connected to IN4 of the ULN2003
Step DelayDecimal - Default Value: 0.001The Step Delay of the controller
Notes about step resolution...
Step ResolutionSelect(Options: [Full | Half | Wave] (Default in bold)The Step Resolution of the controller

On/Off: Grove Multichannel Relay (4- or 8-Channel board)~

  • Manufacturer: Grove
  • Interfaces: I2C
  • Output Types: On/Off
  • Libraries: smbus2
  • Dependencies: smbus2
  • Manufacturer URL: Link
  • Datasheet URL: Link
  • Product URL: Link

Controls the 4 or 8 channel Grove multichannel relay board.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
Channel Options
NameTextA name to distinguish this from others
Startup StateSelectSet the state of the relay when Mycodo starts
Shutdown StateSelectSet the state of the relay when Mycodo shuts down
On StateSelect(Options: [HIGH | LOW] (Default in bold)The state of the GPIO that corresponds to an On state
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Kasa HS300 6-Outlet WiFi Power Strip (old library, deprecated)~

  • Manufacturer: TP-Link
  • Interfaces: IP
  • Output Types: On/Off
  • Dependencies: python-kasa
  • Manufacturer URL: Link

This output controls the 6 outlets of the Kasa HS300 Smart WiFi Power Strip. This module uses an outdated python library and is deprecated. Do not use it. You will break the current Kasa modules if you do not delete this deprecated Output.

OptionTypeDescription
HostText - Default Value: 192.168.0.50Host or IP address
Status Update (Seconds)Integer - Default Value: 60The period between checking if connected and output states.
Channel Options
NameText - Default Value: Outlet NameA name to distinguish this from others
Startup StateSelectSet the state when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Force CommandBooleanAlways send the command if instructed, regardless of the current state
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Kasa HS300 6-Outlet WiFi Power Strip~

This output controls the 6 outlets of the Kasa HS300 Smart WiFi Power Strip. This is a variant that uses the latest python-kasa library. Note: if you see errors in the daemon log about the server starting, try changing the Asyncio RPC Port to another port.

OptionTypeDescription
HostText - Default Value: 0.0.0.0Host or IP address
Status Update (Seconds)Integer - Default Value: 300The period between checking if connected and output states. 0 disables.
Asyncio RPC PortInteger - Default Value: 18308The port to start the asyncio RPC server. Must be unique from other Kasa Outputs.
Channel Options
NameText - Default Value: Outlet NameA name to distinguish this from others
Startup StateSelectSet the state when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Force CommandBooleanAlways send the command if instructed, regardless of the current state
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Kasa KP303 3-Outlet WiFi Power Strip (old library, deprecated)~

  • Manufacturer: TP-Link
  • Interfaces: IP
  • Output Types: On/Off
  • Dependencies: python-kasa
  • Manufacturer URL: Link

This output controls the 3 outlets of the Kasa KP303 Smart WiFi Power Strip. This module uses an outdated python library and is deprecated. Do not use it. You will break the current Kasa modules if you do not delete this deprecated Output.

OptionTypeDescription
HostText - Default Value: 192.168.0.50Host or IP address
Status Update (Seconds)Integer - Default Value: 60The period between checking if connected and output states.
Channel Options
NameText - Default Value: Outlet NameA name to distinguish this from others
Startup StateSelectSet the state when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Force CommandBooleanAlways send the command if instructed, regardless of the current state
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Kasa KP303 3-Outlet WiFi Power Strip~

This output controls the 3 outlets of the Kasa KP303 Smart WiFi Power Strip. This is a variant that uses the latest python-kasa library. Note: if you see errors in the daemon log about the server starting, try changing the Asyncio RPC Port to another port.

OptionTypeDescription
HostText - Default Value: 0.0.0.0Host or IP address
Status Update (Seconds)Integer - Default Value: 300The period between checking if connected and output states. 0 disables.
Asyncio RPC PortInteger - Default Value: 18575The port to start the asyncio RPC server. Must be unique from other Kasa Outputs.
Channel Options
NameText - Default Value: Outlet NameA name to distinguish this from others
Startup StateSelectSet the state when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Force CommandBooleanAlways send the command if instructed, regardless of the current state
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Kasa WiFi Power Plug~

This output controls Kasa WiFi Power Plugs, including the KP105, KP115, KP125, KP401, HS100, HS103, HS105, HS107, and HS110. Note: if you see errors in the daemon log about the server starting, try changing the Asyncio RPC Port to another port.

OptionTypeDescription
HostText - Default Value: 0.0.0.0Host or IP address
Status Update (Seconds)Integer - Default Value: 300The period between checking if connected and output states. 0 disables.
Asyncio RPC PortInteger - Default Value: 18331The port to start the asyncio RPC server. Must be unique from other Kasa Outputs.
Channel Options
Startup StateSelectSet the state when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Force CommandBooleanAlways send the command if instructed, regardless of the current state
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Kasa WiFi RGB Light Bulb~

This output controls the the Kasa WiFi Light Bulbs, including the KL125, KL130, and KL135. Note: if you see errors in the daemon log about the server starting, try changing the Asyncio RPC Port to another port.

OptionTypeDescription
HostText - Default Value: 0.0.0.0Host or IP address
Status Update (Seconds)Integer - Default Value: 300The period between checking if connected and output states. 0 disables.
Asyncio RPC PortInteger - Default Value: 18299The port to start the asyncio RPC server. Must be unique from other Kasa Outputs.
Channel Options
Startup StateSelectSet the state when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Force CommandBooleanAlways send the command if instructed, regardless of the current state
Current (Amps)DecimalThe current draw of the device being controlled
Commands
Transition (Milliseconds)Integer - Default Value: 0The hsv transition period
Brightness (Percent)IntegerThe brightness to set, in percent (0 - 100)
SetButton
Transition (Milliseconds)Integer - Default Value: 0The hsv transition period
Hue (Degree)IntegerThe hue to set, in degrees (0 - 360)
SetButton
Transition (Milliseconds)Integer - Default Value: 0The hsv transition period
Saturation (Percent)IntegerThe saturation to set, in percent (0 - 100)
SetButton
Transition (Milliseconds)Integer - Default Value: 0The hsv transition period
Color Temperature (Kelvin)IntegerThe color temperature to set, in degrees Kelvin
SetButton
Transition (Milliseconds)Integer - Default Value: 0The hsv transition period
HSVText - Default Value: 220, 20, 45The hue, saturation, brightness to set, e.g. "200, 20, 50"
SetButton
Transition (Milliseconds)Integer - Default Value: 1000The transition period
OnButton
Transition (Milliseconds)Integer - Default Value: 1000The transition period
OffButton

On/Off: MCP23017 16-Channel I/O Expander~

Controls the 16 channels of the MCP23017.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
Channel Options
NameTextA name to distinguish this from others
Startup StateSelectSet the state of the GPIO when Mycodo starts
Shutdown StateSelectSet the state of the GPIO when Mycodo shuts down
On StateSelect(Options: [HIGH | LOW] (Default in bold)The state of the GPIO that corresponds to an On state
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Neopixel (WS2812) RGB Strip with Raspberry Pi~

Control the LEDs of a neopixel light strip. USE WITH CAUTION: This library uses the Hardware-PWM0 bus. Only GPIO pins 12 or 18 will work. If you use one of these pins for a NeoPixel strip, you can not use the other for Hardware-PWM control of another output or there will be conflicts that can cause the Mycodo Daemon to crash and the Pi to become unresponsive. If you need to control another PWM output like a servo, fan, or dimmable grow lights, you will need to use the Software-PWM by setting the Output PWM: Raspberry Pi GPIO and set the "Library" field to "Any Pin, <=40kHz". If you select the "Hardware Pin, <=30MHz" option, it will cause conflicts. This output is best used with Actions to control individual LED color and brightness.

OptionTypeDescription
Data PinInteger - Default Value: 18Enter the GPIO Pin connected to your device data wire (BCM numbering).
Number of LEDsInteger - Default Value: 1How many LEDs in the string?
On ModeSelect(Options: [Single Color | Rainbow] (Default in bold)The color mode when turned on
Single ColorText - Default Value: 30, 30, 30The Color when turning on in Single Color Mode, RGB format (red, green, blue), 0 - 255 each.
Rainbow Speed (Seconds)Decimal - Default Value: 0.01The speed to change colors in Rainbow Mode
Rainbow BrightnessInteger - Default Value: 20The maximum brightness of LEDs in Rainbow Mode (1 - 255)
Rainbow ModeSelect(Options: [All LEDs change at once | One LED Changes at a time] (Default in bold)How the rainbow is displayed
Channel Options
Startup StateSelectSet the state when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Force CommandBooleanAlways send the command if instructed, regardless of the current state
Commands
LED PositionIntegerWhich LED in the strip to change
RGB ColorText - Default Value: 10, 0, 0The color (e.g 10, 0, 0)
SetButton

On/Off: PCF8574 8-Channel I/O Expander~

  • Manufacturer: Texas Instruments
  • Interfaces: I2C
  • Output Types: On/Off
  • Libraries: smbus2
  • Dependencies: smbus2
  • Manufacturer URL: Link
  • Datasheet URL: Link
  • Product URL: Link

Controls the 8 channels of the PCF8574.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
Channel Options
NameTextA name to distinguish this from others
Startup StateSelectSet the state of the GPIO when Mycodo starts
Shutdown StateSelectSet the state of the GPIO when Mycodo shuts down
On StateSelect(Options: [HIGH | LOW] (Default in bold)The state of the GPIO that corresponds to an On state
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: PCF8575 16-Channel I/O Expander~

  • Manufacturer: Texas Instruments
  • Interfaces: I2C
  • Output Types: On/Off
  • Libraries: smbus2
  • Dependencies: smbus2
  • Manufacturer URL: Link
  • Datasheet URL: Link
  • Product URL: Link

Controls the 16 channels of the PCF8575.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
Channel Options
NameTextA name to distinguish this from others
Startup StateSelectSet the state of the GPIO when Mycodo starts
Shutdown StateSelectSet the state of the GPIO when Mycodo shuts down
On StateSelect(Options: [HIGH | LOW] (Default in bold)The state of the GPIO that corresponds to an On state
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Python Code~

  • Interfaces: Python
  • Output Types: On/Off
  • Dependencies: pylint

Python 3 code will be executed when this output is turned on or off.

OptionTypeDescription
Analyze Python Code with PylintBoolean - Default Value: TrueAnalyze your Python code with pylint when saving
Channel Options
On CommandPython code to execute when the output is instructed to turn on
Off CommandPython code to execute when the output is instructed to turn off
Startup StateSelectSet the state when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Force CommandBooleanAlways send the command if instructed, regardless of the current state
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Raspberry Pi GPIO (Pi 5)~

  • Interfaces: GPIO
  • Output Types: On/Off
  • Libraries: pinctrl

The specified GPIO pin will be set HIGH (3.3 volts) or LOW (0 volts) when turned on or off, depending on the On State option.

OptionTypeDescription
Channel Options
Pin: GPIO (BCM)IntegerThe pin to control the state of
Startup StateSelectSet the state when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
On StateSelect(Options: [HIGH | LOW] (Default in bold)The state of the GPIO that corresponds to an On state
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Raspberry Pi GPIO (Pi <= 4)~

  • Interfaces: GPIO
  • Output Types: On/Off
  • Libraries: RPi.GPIO
  • Dependencies: RPi.GPIO

The specified GPIO pin will be set HIGH (3.3 volts) or LOW (0 volts) when turned on or off, depending on the On State option.

OptionTypeDescription
Channel Options
Pin: GPIO (BCM)IntegerThe pin to control the state of
Startup StateSelectSet the state when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
On StateSelect(Options: [HIGH | LOW] (Default in bold)The state of the GPIO that corresponds to an On state
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Sequent Microsystems 8-Relay HAT for Raspberry Pi~

  • Manufacturer: Sequent Microsystems
  • Interfaces: I2C
  • Output Types: On/Off
  • Libraries: smbus2
  • Dependencies: smbus2
  • Manufacturer URL: Link
  • Datasheet URL: Link
  • Product URL: Link

Controls the 8 relays of the 8-relay HAT made by Sequent Microsystems. 8 of these boards can be used simultaneously, allowing 64 relays to be controlled.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
Board Stack NumberSelectSelect the board stack number when multiple boards are used
Channel Options
NameTextA name to distinguish this from others
Startup StateSelectSet the state of the GPIO when Mycodo starts
Shutdown StateSelectSet the state of the GPIO when Mycodo shuts down
On StateSelect(Options: [HIGH | LOW] (Default in bold)The state of the GPIO that corresponds to an On state
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Shell Script~

  • Output Types: On/Off
  • Libraries: subprocess.Popen

Commands will be executed in the Linux shell by the specified user when this output is turned on or off.

OptionTypeDescription
Channel Options
On CommandText - Default Value: /home/pi/script_on_off.sh onCommand to execute when the output is instructed to turn on
Off CommandText - Default Value: /home/pi/script_on_off.sh offCommand to execute when the output is instructed to turn off
UserText - Default Value: mycodoThe user to execute the command
Startup StateSelectSet the state when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Force CommandBooleanAlways send the command if instructed, regardless of the current state
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Sparkfun Relay Board (4 Relays)~

  • Manufacturer: Sparkfun
  • Interfaces: I2C
  • Output Types: On/Off
  • Libraries: sparkfun-qwiic-relay
  • Dependencies: sparkfun-qwiic-relay
  • Manufacturer URL: Link
  • Product URLs: Link 1, Link 2

Controls the 4 relays of the relay module.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
Channel Options
NameTextA name to distinguish this from others
Startup StateSelectSet the state of the GPIO when Mycodo starts
Shutdown StateSelectSet the state of the GPIO when Mycodo shuts down
On StateSelect(Options: [HIGH | LOW] (Default in bold)The state of the GPIO that corresponds to an On state
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: Wireless 315/433 MHz (Pi <= 4)~

  • Interfaces: GPIO
  • Output Types: On/Off
  • Libraries: rpi-rf
  • Dependencies: RPi.GPIO, rpi_rf

This output uses a 315 or 433 MHz transmitter to turn wireless power outlets on or off. Run /opt/Mycodo/mycodo/devices/wireless_rpi_rf.py with a receiver to discover the codes produced from your remote.

OptionTypeDescription
Channel Options
Pin: GPIO (BCM)IntegerThe pin to control the state of
On CommandText - Default Value: 22559Command to execute when the output is instructed to turn on
Off CommandText - Default Value: 22558Command to execute when the output is instructed to turn off
ProtocolSelect(Options: [1 | 2 | 3 | 4 | 5] (Default in bold)
Pulse LengthInteger - Default Value: 189
Startup StateSelectSet the state when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Force CommandBooleanAlways send the command, regardless of the current state
Current (Amps)DecimalThe current draw of the device being controlled

On/Off: XL9535 16-Channel I/O Expander~

  • Manufacturer: Texas Instruments
  • Interfaces: I2C
  • Output Types: On/Off
  • Libraries: smbus2
  • Dependencies: smbus2
  • Manufacturer URL: Link
  • Datasheet URL: Link
  • Product URL: Link

Controls the 16 channels of the XL9535.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
Channel Options
NameTextA name to distinguish this from others
Startup StateSelectSet the state of the GPIO when Mycodo starts
Shutdown StateSelectSet the state of the GPIO when Mycodo shuts down
On StateSelect(Options: [HIGH | LOW] (Default in bold)The state of the GPIO that corresponds to an On state
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup
Current (Amps)DecimalThe current draw of the device being controlled

PWM: PCA9685 16-Channel LED Controller~

  • Manufacturer: NXP Semiconductors
  • Interfaces: I2C
  • Output Types: PWM
  • Libraries: adafruit-pca9685
  • Dependencies: adafruit-pca9685
  • Manufacturer URL: Link
  • Datasheet URL: Link
  • Product URL: Link

The PCA9685 can output a PWM signal to 16 channels at a frequency between 40 and 1600 Hz.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
Frequency (Hertz)Integer - Default Value: 1600The Herts to output the PWM signal (40 - 1600)
Channel Options
NameTextA name to distinguish this from others
Startup StateSelectSet the state when Mycodo starts
Startup ValueDecimalThe value when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Shutdown ValueDecimalThe value when Mycodo shuts down
Invert SignalBooleanInvert the PWM signal
Invert Stored SignalBooleanInvert the value that is saved to the measurement database
Current (Amps)DecimalThe current draw of the device being controlled

PWM: Python 3 Code~

  • Interfaces: Python
  • Output Types: PWM
  • Dependencies: pylint

Python 3 code will be executed when this output is turned on or off. The "duty_cycle" object is a float value that represents the duty cycle that has been set.

OptionTypeDescription
Analyze Python Code with PylintBoolean - Default Value: TrueAnalyze your Python code with pylint when saving
Channel Options
Python 3 CodePython code to execute to set the PWM duty cycle (%)
UserText - Default Value: mycodoThe user to execute the command
Startup StateSelectSet the state when Mycodo starts
Startup ValueDecimalThe value when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Shutdown ValueDecimalThe value when Mycodo shuts down
Invert SignalBooleanInvert the PWM signal
Invert Stored SignalBooleanInvert the value that is saved to the measurement database
Force CommandBooleanAlways send the command if instructed, regardless of the current state
Current (Amps)DecimalThe current draw of the device being controlled
Commands
Set the Duty Cycle.
Duty CycleDecimalThe duty cycle to set
Set Duty CycleButton

PWM: Raspberry Pi GPIO (Pi <= 4)~

  • Interfaces: GPIO
  • Output Types: PWM
  • Libraries: pigpio
  • Dependencies: pigpio, pigpio

See the PWM section of the manual for PWM information and determining which pins may be used for each library option.

OptionTypeDescription
Channel Options
Pin: GPIO (BCM)IntegerThe pin to control the state of
Startup StateSelectSet the state when Mycodo starts
Startup ValueDecimalThe value when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Shutdown ValueDecimalThe value when Mycodo shuts down
LibrarySelect(Options: [Any Pin, <= 40 kHz | Hardware Pin, <= 30 MHz] (Default in bold)Which method to produce the PWM signal (hardware pins can produce higher frequencies)
Frequency (Hertz)Integer - Default Value: 22000The Herts to output the PWM signal (0 - 70,000)
Invert SignalBooleanInvert the PWM signal
Invert Stored SignalBooleanInvert the value that is saved to the measurement database
Current (Amps)DecimalThe current draw of the device being controlled
Commands
Set the Duty Cycle.
Duty CycleDecimalThe duty cycle to set
Set Duty CycleButton

PWM: Shell Script~

  • Interfaces: Shell
  • Output Types: PWM
  • Libraries: subprocess.Popen

Commands will be executed in the Linux shell by the specified user when the duty cycle is set for this output. The string "((duty_cycle))" in the command will be replaced with the duty cycle being set prior to execution.

OptionTypeDescription
Channel Options
Bash CommandText - Default Value: /home/pi/script_pwm.sh ((duty_cycle))Command to execute to set the PWM duty cycle (%)
UserText - Default Value: mycodoThe user to execute the command
Startup StateSelectSet the state when Mycodo starts
Startup ValueDecimalThe value when Mycodo starts
Shutdown StateSelectSet the state when Mycodo shuts down
Shutdown ValueDecimalThe value when Mycodo shuts down
Invert SignalBooleanInvert the PWM signal
Invert Stored SignalBooleanInvert the value that is saved to the measurement database
Force CommandBooleanAlways send the command if instructed, regardless of the current state
Current (Amps)DecimalThe current draw of the device being controlled

Peristaltic Pump: Atlas Scientific~

  • Manufacturer: Atlas Scientific
  • Interfaces: I2C, UART, FTDI
  • Output Types: Volume, On/Off
  • Dependencies: pylibftdi
  • Manufacturer URL: Link
  • Datasheet URL: Link
  • Product URL: Link

Atlas Scientific peristaltic pumps can be set to dispense at their maximum rate or a rate can be specified. Their minimum flow rate is 0.5 ml/min and their maximum is 105 ml/min.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
FTDI DeviceTextThe FTDI device connected to the input/output/etc.
UART DeviceTextThe UART device location (e.g. /dev/ttyUSB1)
Channel Options
Flow Rate MethodSelect(Options: [Fastest Flow Rate | Specify Flow Rate] (Default in bold)The flow rate to use when pumping a volume
Desired Flow Rate (ml/min)Decimal - Default Value: 10.0Desired flow rate in ml/minute when Specify Flow Rate set
Current (Amps)DecimalThe current draw of the device being controlled
Commands
Calibration: a calibration can be performed to increase the accuracy of the pump. It's a good idea to clear the calibration before calibrating. First, remove all air from the line by pumping the fluid you would like to calibrate to through the pump hose. Next, press Dispense Amount and the pump will be instructed to dispense 10 ml (unless you changed the default value). Measure how much fluid was actually dispensed, enter this value in the Actual Volume Dispensed (ml) field, and press Calibrate to Dispensed Amount. Now any further pump volumes dispensed should be accurate.
Clear CalibrationButton
Volume to Dispense (ml)Decimal - Default Value: 10.0The volume (ml) that is instructed to be dispensed
Dispense AmountButton
Actual Volume Dispensed (ml)Decimal - Default Value: 10.0The actual volume (ml) that was dispensed
Calibrate to Dispensed AmountButton
The I2C address can be changed. Enter a new address in the 0xYY format (e.g. 0x22, 0x50), then press Set I2C Address. Remember to deactivate and change the I2C address option after setting the new address.
New I2C AddressText - Default Value: 0x67The new I2C to set the device to
Set I2C AddressButton

Peristaltic Pump: Grove I2C Motor Driver (Board v1.3)~

  • Manufacturer: Grove
  • Interfaces: I2C
  • Output Types: Volume, On/Off
  • Libraries: smbus2
  • Dependencies: smbus2
  • Manufacturer URL: Link

Controls the Grove I2C Motor Driver Board (v1.3). Both motors will turn at the same time. This output can also dispense volumes of fluid if the motors are attached to peristaltic pumps.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
Channel Options
NameTextA name to distinguish this from others
Motor Speed (0 - 100)Integer - Default Value: 100The motor output that determines the speed
Flow Rate MethodSelect(Options: [Fastest Flow Rate | Specify Flow Rate] (Default in bold)The flow rate to use when pumping a volume
Desired Flow Rate (ml/min)Decimal - Default Value: 10.0Desired flow rate in ml/minute when Specify Flow Rate set
Fastest Rate (ml/min)Decimal - Default Value: 100.0The fastest rate that the pump can dispense (ml/min)

Peristaltic Pump: Grove I2C Motor Driver (TB6612FNG, Board v1.0)~

  • Manufacturer: Grove
  • Interfaces: I2C
  • Output Types: Volume, On/Off
  • Libraries: smbus2
  • Dependencies: smbus2
  • Manufacturer URL: Link

Controls the Grove I2C Motor Driver Board (v1.3). Both motors will turn at the same time. This output can also dispense volumes of fluid if the motors are attached to peristaltic pumps.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
Channel Options
NameTextA name to distinguish this from others
Motor Speed (0 - 255)Integer - Default Value: 255The motor output that determines the speed
Flow Rate MethodSelect(Options: [Fastest Flow Rate | Specify Flow Rate] (Default in bold)The flow rate to use when pumping a volume
Desired Flow Rate (ml/min)Decimal - Default Value: 10.0Desired flow rate in ml/minute when Specify Flow Rate set
Fastest Rate (ml/min)Decimal - Default Value: 100.0The fastest rate that the pump can dispense (ml/min)
Minimum On (Seconds)Decimal - Default Value: 1.0The minimum duration the pump turns on for every 60 second period (only used for Specify Flow Rate mode).
Commands
New I2C AddressText - Default Value: 0x14The new I2C to set the sensor to
Set I2C AddressButton

Peristaltic Pump: L298N DC Motor Controller (Pi <= 4)~

  • Manufacturer: STMicroelectronics
  • Interfaces: GPIO
  • Output Types: Volume, On/Off
  • Libraries: RPi.GPIO
  • Dependencies: RPi.GPIO
  • Additional URL: Link

The L298N can control 2 DC motors, both speed and direction. If these motors control peristaltic pumps, set the Flow Rate and the output can can be instructed to dispense volumes accurately in addition to being turned on for durations.

OptionTypeDescription
Channel Options
NameTextA name to distinguish this from others
Input Pin 1IntegerThe Input Pin 1 of the controller (BCM numbering)
Input Pin 2IntegerThe Input Pin 2 of the controller (BCM numbering)
Use Enable PinBoolean - Default Value: TrueEnable the use of the Enable Pin
Enable PinIntegerThe Enable pin of the controller (BCM numbering)
Enable Pin Duty CycleInteger - Default Value: 50The duty cycle to apply to the Enable Pin (percent, 1 - 100)
DirectionSelect(Options: [Forward | Backward] (Default in bold)The direction to turn the motor
Volume Rate (ml/min)Decimal - Default Value: 150.0If a pump, the measured flow rate (ml/min) at the set Duty Cycle

Peristaltic Pump: MCP23017 16-Channel I/O Expander~

Controls the 16 channels of the MCP23017 with a relay and peristaltic pump connected to each channel.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
Channel Options
NameTextA name to distinguish this from others
On StateSelect(Options: [HIGH | LOW] (Default in bold)The state of the output channel that corresponds to the pump being on
Fastest Rate (ml/min)Decimal - Default Value: 150.0The fastest rate that the pump can dispense (ml/min)
Minimum On (Seconds)Decimal - Default Value: 1.0The minimum duration the pump should be turned on for every 60 second period
Flow Rate MethodSelect(Options: [Fastest Flow Rate | Specify Flow Rate] (Default in bold)The flow rate to use when pumping a volume
Desired Flow Rate (ml/min)Decimal - Default Value: 10.0Desired flow rate in ml/minute when Specify Flow Rate set
Current (Amps)DecimalThe current draw of the device being controlled

Peristaltic Pump: PCF8574 8-Channel I/O Expander~

  • Manufacturer: Texas Instruments
  • Interfaces: I2C
  • Output Types: Volume, On/Off
  • Libraries: smbus2
  • Dependencies: smbus2
  • Manufacturer URL: Link
  • Datasheet URL: Link
  • Product URL: Link

Controls the 8 channels of the PCF8574 with a relay and peristaltic pump connected to each channel.

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
Channel Options
On StateSelect(Options: [HIGH | LOW] (Default in bold)The state of the output channel that corresponds to the pump being on
Fastest Rate (ml/min)Decimal - Default Value: 150.0The fastest rate that the pump can dispense (ml/min)
Minimum On (Seconds)Decimal - Default Value: 1.0The minimum duration the pump should be turned on for every 60 second period
Flow Rate MethodSelect(Options: [Fastest Flow Rate | Specify Flow Rate] (Default in bold)The flow rate to use when pumping a volume
Desired Flow Rate (ml/min)Decimal - Default Value: 10.0Desired flow rate in ml/minute when Specify Flow Rate set
Current (Amps)DecimalThe current draw of the device being controlled

Peristaltic Pump: Raspberry Pi GPIO (Pi <= 4)~

  • Interfaces: GPIO
  • Output Types: Volume, On/Off
  • Libraries: RPi.GPIO
  • Dependencies: RPi.GPIO

This output turns a GPIO pin HIGH and LOW to control power to a generic peristaltic pump. The peristaltic pump can then be turned on for a duration or, after determining the pump's maximum flow rate, instructed to dispense a specific volume at the maximum rate or at a specified rate.

OptionTypeDescription
Channel Options
Pin: GPIO (BCM)IntegerThe pin to control the state of
On StateSelect(Options: [HIGH | LOW] (Default in bold)The state of the GPIO that corresponds to an On state
Fastest Rate (ml/min)Decimal - Default Value: 150.0The fastest rate that the pump can dispense (ml/min)
Minimum On (Seconds)Decimal - Default Value: 1.0The minimum duration the pump should be turned on for every 60 second period
Flow Rate MethodSelect(Options: [Fastest Flow Rate | Specify Flow Rate] (Default in bold)The flow rate to use when pumping a volume
Desired Flow Rate (ml/min)Decimal - Default Value: 10.0Desired flow rate in ml/minute when Specify Flow Rate set
Current (Amps)DecimalThe current draw of the device being controlled

Remote Mycodo Output: On/Off~

  • Interfaces: API
  • Output Types: On/Off
  • Libraries: requests
  • Dependencies: requests

This Output allows remote control of another Mycodo On/Off Output over a network using the API.

OptionTypeDescription
Remote Mycodo HostTextThe host or IP address of the remote Mycodo
Remote Mycodo API KeyTextThe API key of the remote Mycodo
State Query Period (Seconds)Integer - Default Value: 120How often to query the state of the output
Channel Options
Remote Mycodo OutputThe Remote Mycodo Output to control
Startup StateSelect(Options: [Do Nothing | Off | On] (Default in bold)Set the state when Mycodo starts
Shutdown StateSelect(Options: [Do Nothing | Off | On] (Default in bold)Set the state when Mycodo shuts down
Force CommandBooleanAlways send the command if instructed, regardless of the current state
Trigger Functions at StartupBooleanWhether to trigger functions when the output switches at startup

Remote Mycodo Output: PWM~

  • Interfaces: API
  • Output Types: PWM
  • Libraries: requests
  • Dependencies: requests

This Output allows remote control of another Mycodo PWM Output over a network using the API.

OptionTypeDescription
Remote Mycodo HostTextThe host or IP address of the remote Mycodo
Remote Mycodo API KeyTextThe API key of the remote Mycodo
State Query Period (Seconds)Integer - Default Value: 120How often to query the state of the output
Channel Options
Remote Mycodo OutputThe Remote Mycodo Output to control
Startup StateSelectSet the state when Mycodo starts
Start Duty CycleDecimalThe duty cycle to set at startup, if enabled
Shutdown StateSelectSet the state when Mycodo shuts down
Shutdown Duty CycleDecimalThe duty cycle to set at shutdown, if enabled
Invert SignalBooleanInvert the PWM signal
Invert Stored SignalBooleanInvert the value that is saved to the measurement database
Commands
Set the Duty Cycle.
Duty CycleDecimalThe duty cycle to set
Set Duty CycleButton

Spacer~

A spacer to organize Outputs.

OptionTypeDescription
ColorText - Default Value: #000000The color of the name text

Value: GP8XXX (8413, 8403) 2-Channel DAC: 0-10 VDC~

Output 0 to 10 VDC signal. GP8403: 12bit DAC Dual Channel I2C to 0-5V/0-10V | GP8413: 15bit DAC Dual Channel I2C to 0-10V

OptionTypeDescription
I2C AddressTextThe address of the I2C device.
I2C BusIntegerThe Bus the I2C device is connected.
DeviceSelect(Options: [GP8403 12-bit | GP8413 15-bit] (Default in bold)Select your GP8XXX device
Channel Options
Start StateSelect(Options: [Previously-Saved State | Specified Value] (Default in bold)Select the channel start state
Start Value (volts)DecimalIf Specified Value is selected, set the start state value
Shutdown StateSelect(Options: [Previously-Saved Value | Specified Value] (Default in bold)Select the channel shutdown state
Shutdown Value (volts)DecimalIf Specified Value is selected, set the shutdown state value
Off Value (volts)DecimalIf Specified Value to apply when turned off