OSPy
OSPy is a free Raspberry Pi based Python 3 program for controlling irrigation systems (sprinkler, drip, IoT, etc). This is my fork from Rimco/OSPy and Dan-in-CA/SIP with My modifications.
Mobile App Google store
Paired phones and immediate push notifications are managed in Options → Mobile applications. Push delivery is disabled by default; the editable relay field is prefilled with the official OSPy relay URL. OSPy sends signed, installation-scoped events asynchronously to the HTTPS relay, which delivers them through Firebase Cloud Messaging. Firebase credentials and FCM device tokens are never stored in OSPy. See the Mobile API v1 push notification reference.
Normal mobile communication is direct: the Android application connects to the saved local or remote OSPy HTTPS address and uses installation-scoped Mobile API v1 access and refresh tokens to read state and perform permitted actions. Immediate push is a separate background path: OSPy signs an asynchronous request to the configured relay, which validates it and delivers through Firebase Cloud Messaging even while the application is closed. Relay failure cannot block irrigation scheduling or outputs. Both flows are shown in Diagnostics → How OSPy works.
The common OSPy footer contains a direct link to the official Android application in Google Play.
Refresh-token rotation includes a single short recovery retry for a mobile process terminated between receiving and durably saving its replacement token, such as during a Google Play application update. This preserves saved connections without weakening explicit logout or administrator device revocation.
The Android application keeps a persistent device identity for every saved installation. Signing in again to the same installation replaces that device's token session and reuses its OSPy record instead of creating a duplicate. An application reinstall or a genuinely new phone creates a new identity. In OSPy administration, an active device must first be revoked; revoked records can then be permanently deleted individually or together.
The native Android controls also use Mobile API v1 for user water-level adjustment, program-group assignment and one-time postponement of a group's next scheduled runs. Refresh-token rotation keeps concurrent foreground and notification requests connected without weakening explicit logout, renewed pairing or administrator device revocation.
The built-in administrator retains the original OSPy two-factor settings. Additional accounts are managed on the responsive Options → Users page and can independently enable TOTP or e-mail verification from Account security after signing in. Existing additional accounts remain compatible and start with 2FA disabled; administrators can reset a lost user pairing without seeing its secret or backup codes.
If the administrator password is unknown or access to the configured two-factor method has been lost, run the local recovery script from the OSPy directory on the Raspberry Pi or another trusted local shell:
sudo service ospy stop
sudo python3 back_door.py
sudo service ospy startStop the service first so its settings database is not being written while recovery runs. The script requires typing RESET for confirmation and then generates a new one-time recovery password for the admin account. It disables passwordless access and two-factor authentication, removes the TOTP secret and backup codes, revokes remembered browser logins, and invalidates active web sessions after OSPy starts again. Irrigation programs, settings, plug-ins, and logs are not deleted. Open the login page, use the displayed recovery password, change it immediately, and configure two-factor authentication again if required. Use sudo python3 back_door.py --yes only in a trusted automated local recovery procedure. See Clean installation for more information.
The standalone relay_test.py script can verify the relay board and GPIO wiring before OSPy is started, or help diagnose a board fault. It switches all eight shift-register relay outputs and the additional main relay output on and off together every 1.5 seconds.
Warning: Disconnect pumps, valves, contactors, and any other equipment that must not start unexpectedly. The test energizes every relay. Do not run it while the OSPy service is controlling the same GPIO pins.
From the OSPy directory run:
sudo service ospy stop
sudo python3 relay_test.pyWatch or listen for every relay switching. Stop the test with Ctrl+C; the script disables the outputs and cleans up GPIO in its finally block. OSPy can then be started normally:
sudo service ospy start

Sensors by Pihrt.com
Sensors by Shelly.com
The OSPy system is currently available in multiple languages. For available languages and step by step, how to use is typed in MD file Any user who joins the "OSPy" project is welcome! Translation of strings into other languages is not demanding (using the Poedit)
- Czech help page
- English help page
- German help page
- Polish help page
- Russian help page
- Serbian help page
- Slovak help page
OSPy can be controlled and monitored using HTTP GET commands. With the addition of available plugins OSPy can communicate with other systems via MQTT. OSPy can also issue Linux shell commands when a station is turned on or off. This is useful for controlling wireless remote devices and for I²C relay hats and boards. The Blinker package that is shipped with OSPy sends messages to other Python modules such as plugins to report changes in status. See the signaling examples file in OSPy's plugins folder for examples. Homeassistant integration via MQTT plugin.
OSPy allows to read data from wireless sensors (ESP32, ESP8266...) Docs Shelly sensors and periphery Sensors by Shelly.com
This controller allows you to select a program stored in the OSPy on the LCD display and start it with the button. The controller is connected to the home Wi-Fi network. We do not even need a mobile phone or a computer to quickly select programs. We will use this miniature controller. Docs
OpenSprinkler Py (OSPy) Interval Program Creative Commons Attribution-ShareAlike 3.0 license
Full credit goes to Dan for his generous contributions in porting the microcontroller firmware to Python.
- The program makes use of web.py (http://webpy.org) for the web interface.
- The program makes use of cmarkgfm (https://github.com/theacodes/cmarkgfm) to render the help pages written in GitHub flavored markdown (Python 3+).
- The program makes use of OpenStreetMap (https://www.openstreetmap.org) to convert locations into coordinates.
- Interactive weather location maps use Leaflet 1.9.4 (https://leafletjs.com), distributed locally under the BSD 2-Clause license, with map tiles and attribution from OpenStreetMap.
- The program makes use of Stormglass API (https://stormglass.io/) for weather information.
- The program makes use Blinker (https://pythonhosted.org/blinker/) package that is shipped with OSPy sends messages to other Python modules such as plugins to report changes in status.
- The program makes use Arduino (https://arduino.cc) ESP32, Atmega328 and more HW boards pro OSPy aditional sensors, water tank monitor.

