Developer Resources

Build powerful applications for the Octopus Home Pro platform.

Build Apps for the Octopus Home Pro

Our comprehensive SDK gives you access to energy data, smart home functionality, and more.

The Octopus Home Pro is an open platform designed to empower developers to create innovative energy applications. Whether you want to build personal automation tools or distribute your app to other users, our SDK App provides everything you need to get started.

Get Started in Minutes

  • Install the Octopus Home Pro SDK App from the App Store on your device (search for "Developer SDK")
  • Follow the initial setup instructions in the SDK App Store description
  • Connect to your device using VS Code with the Remote-SSH extension (detailed instructions below)

SDK Overview

The Octopus Home Pro SDK provides a comprehensive set of tools and APIs to interact with the device's capabilities. Here's what you can access:

Energy Data

Access real-time and historical electricity and gas consumption data. Monitor usage patterns, set up alerts, and analyze trends.

  • Live meter readings
  • Historical consumption
  • Cost calculations
  • Usage events and alerts

Zigbee Integration

Communicate with Zigbee devices throughout your home. Control smart switches, read sensors, and build automations.

  • Device discovery
  • State monitoring
  • Command execution
  • Device grouping

System Integration

Integrate with popular smart home platforms and other systems. Connect to Home Assistant, GivEnergy batteries, and more.

  • Home Assistant API
  • GivEnergy battery systems
  • MQTT messaging
  • Webhooks for external services

Hardware Extensions

Access the Pi HAT connector to extend functionality with hardware add-ons. Build custom sensing, display, and control applications.

  • GPIO access
  • I2C/SPI communication
  • Serial interfaces
  • Hardware event hooks

Getting Started

Setting up your SDK development environment is straightforward.

1. SDK Installation

The SDK is now available as an App you can download directly to your Octopus Home Pro device. Simply check the App Store on your device and search for "Developer SDK" to install it.

For detailed installation and setup instructions, refer to the SDK App description in the App Store. The description contains all necessary steps to get started.

2. SDK Status Indicators

The status of the Home Pro SDK container is presented visually using 3 of the 4 LEDs that are found on top of the front matrix display of the device:

SDK docker image being downloaded

SDK Downloading Status

Orange LED flashing

SDK container not available after download

SDK Not Found Status

Red LED solid

SDK container exists but cannot start

SDK Error Status

Red LED flashing

SDK container is ready

SDK Ready Status

Green LED flashing

3. Connect with Visual Studio Code

To connect to the code base with VS Code, follow these steps:

  1. Click on the Extensions tab on the left panel.
    Visual Studio Code Extensions

    Search for and install the 'remote-ssh' extension.

  2. Choose View -> Command Palette -> Remote-SSH: Connect to Host

    Select '+ Add New SSH Host' and add:

    ssh -p 8023 -o HostKeyAlgorithms=+ssh-rsa root@<HPRO-IP>

    where <HPRO-IP> should be replaced with the IP address of your Home Pro.

    Connect to SSH Host
  3. The first time an SSH connection is made to the Home Pro it will take a couple of minutes as the VSCode SSH Server is downloaded to the Home Pro container for subsequent use.

    When prompted, use the password 'cad_dev'. It is recommended to change this password after your first login.

    VS Code Connected
Note: The SDK docker image is hosted at Docker Hub. You can develop new apps and submit a pull request to update the image for the community if you wish.

API Reference

The Octopus Home Pro SDK provides several modules for interacting with different aspects of the system. For detailed API documentation with complete and accurate code examples, please visit our API Reference section.

Available APIs

  • Energy API
    Access electricity and gas meter data
  • Zigbee API
    Control smart home devices
  • Screen API
    Control the built-in display
  • Hardware API
    Access GPIO, I2C, SPI interfaces
  • Storage API
    Persistent data storage
  • Notifications API
    Send alerts and messages

SDK Directory Structure

When you connect to your Home Pro's SDK container, you'll find the following API directories:


startup.sh
Octave_PWM/
Octave_I2C/
Octave_GPIO/
Octave_SPI/
Octave_Energy/
Octave_Screen/
                    

Each directory contains documentation, examples, and the necessary libraries for that specific API.

Code Examples

For accurate and up-to-date code examples, please refer to the API Reference documentation. The examples there are regularly validated against the latest SDK version to ensure compatibility.

Example Apps

Here are some example apps to help you get started with development:

Energy Usage Monitor

A simple app that monitors energy usage and sends notifications when it exceeds thresholds.

View Code

Smart Lighting Controller

Control Zigbee lights based on energy usage and time of day.

View Code

Energy Dashboard

A web-based dashboard showing energy usage statistics and trends.

View Code

Battery Optimizer

Optimize GivEnergy battery charging/discharging based on energy prices and usage patterns.

View Code

Publishing Your App

Once you've developed your app, you can share it with other Octopus Home Pro users through the App Store.

Prepare Your App for Publication

  1. Ensure your app's metadata in app.json is complete and accurate
  2. Create quality icons and screenshots for your app
  3. Write clear documentation for users
  4. Test thoroughly on real hardware

// app.json example
{
  "id": "com.example.energy-monitor",
  "name": "Energy Monitor",
  "version": "1.0.0",
  "description": "Monitors energy usage and sends notifications",
  "author": {
    "name": "Jane Developer",
    "email": "jane@example.com"
  },
  "category": "Utilities",
  "tags": ["energy", "monitoring", "notifications"],
  "permissions": [
    "energy:read",
    "notifications:write"
  ],
  "icons": {
    "small": "assets/icon-48.png",
    "medium": "assets/icon-96.png",
    "large": "assets/icon-192.png"
  },
  "homepage": "https://example.com/energy-monitor",
  "repository": "https://github.com/example/energy-monitor"
}
                            

Submit to the App Store

Use the CLI tool to package and submit your app:


# Package your app
home-pro-cli package

# This creates a .hpapp file that can be submitted
# You'll find it in the dist/ directory

# Submit to the App Store
home-pro-cli publish
                            

After submission, your app will go through a review process to ensure it meets our quality and security standards. Once approved, it will be available in the Octopus App Store for all users to download.

You can also distribute your app privately by sharing the .hpapp file directly with users, who can install it using the "Install from file" option in the App Store.

Join Our Developer Community

Connect with other developers, share knowledge, and get support for your app development.