Skip to content

Plugin button control

Martin Pihrt edited this page Oct 13, 2026 · 1 revision

Button Control

Controls OSPy functions through eight MCP23017 I2C buttons and indicator LEDs.

At a glance

Item Value
Version 1.0.0
Category Hardware, displays and outputs
Author Martin Pihrt
License GPL-3.0
OSPy 3.0.211 or newer
Python 3.8 or newer
Permissions i2c, system
Hardware platforms: raspberry_pi, beaglebone, linux; interfaces: i2c
Dependencies None
Python/OS packages smbus / python3-smbus (required)
Interfaces No provider or mobile API declared
Source Open the plug-in directory

What it is for

Controls OSPy functions through eight MCP23017 I2C buttons and indicator LEDs.

How it works and how to configure it

Tested in Python 3+

This plugin uses a circuit board with MCP23017 controller connected to the OSPy Sprinkler board via the I2C interface. This plug-in includes eight buttons with optional functions and signalisating via eicht LEDs. Visit Martin Pihrt's blog for more information. I2C address for MCP23017: 0x20 to 0x27.

The plug-in includes an OSPy plugin.json manifest, registers its polling worker with the shared plug-in runtime, uses the common stop signal, and implements health(). Diagnostics reports enablement, worker state, configured I2C address, latest successful controller read, and the latest communication error. I2C bus handles are closed after each operation.

Plugin setup

  • Check Use Button: If checked use button plugin is enabled.

  • Address for MCP23017 controller: Selector for I2C address in range 0x20 to 0x27.

  • First stop: First stop everything running and then start the program. If we want to start a new program and add it to the running ones, we will leave this option off.

  • Select: Run-now program 1 Run-now program 2 Run-now program 3 Run-now program 4 Run-now program 5 Run-now program 6 Run-now program 7 Run-now program 8 Restart system (OS system) Shutdown system (OS system) Stop stations Enable scheduler Disable Scheduler

  • Status: Status window from the plugin.

In-app help and settings notes

The following notes are generated from the help page shipped with this plug-in. Field names are also explained directly in the OSPy settings page.

This plugin uses a circuit board with MCP23017 controller connected to the OSPy Sprinkler board via the interface

This plug-in includes eight buttons with optional functions and signalisating via eicht LEDs

Visit for more information

The PCB board for 8 buttons (board by pihrt.com)

Address for MCP23017 controller

Selector for address in range 0x20 to 0x27.

The address is set via inputs A0-A2 on the MCP23017 controller.

Chip address

A2

A1

A0

Address

000

GND

0x20

001

VCC

0x21

010

0x22

011

0x23

100

0x24

101

0x25

110

0x26

111

0x27

For find your address use System Information plugin.

Note: the buttons must not have the same address as the LCD display. You must change either the address of the display or the buttons address.

First stop

First stop everything running and then start the program. If we want to start a new program and add it to the running ones, we will leave this option off.

Related links and diagrams

schematics

top

bot

top2

left

Support

Check OSPy → Diagnostics first and remove passwords, tokens, private addresses and other secrets before sharing logs. Report reproducible plug-in problems in the OSPy-plugins issue tracker.

Back to the plug-in catalog

Clone this wiki locally