Prerequisites
To complete this guide, you’ll need:- Valid OAuth 2.0 credentials (
client_idandclient_secret) - Registered redirect URIs for your application
Overview
In this guide, we’ll walk through integrating a Home Energy Management System (HEMS) with our API. By the end, your HEMS will be able to access real-time pricing data and optimize energy consumption accordingly.Implement OAuth 2.0 Flow (Optional)
If you’re building a third-party application that requires user consent, you’ll need to implement the Authorization Code flow. This involves:
- Redirecting users to our authorization endpoint
- Handling the callback with the authorization code
- Exchanging the code for access tokens
Store the refresh token securely - you’ll need it to maintain long-term access to the user’s data.
Select Subscription
Use the List Subscriptions endpoint to retrieve the customer’s subscriptions:
Most customers will only have one subscription. Store the subscription ID for subsequent API calls.
Fetch Price Information
Once authorized, your HEMS can retrieve real-time and forecasted electricity prices using the Price Time Series endpoint:
Implement Price-Based Optimization
With access to real-time and forecasted prices, your HEMS can optimize energy consumption by shifting energy-intensive operations to lower-price periods. This helps reduce energy costs for your customers while maintaining comfort and functionality.
The optimization strategy will depend on your specific HEMS capabilities and customer preferences.
Final Thoughts
Congratulations! You’ve learned how to integrate a HEMS with our API for price-based energy optimization. Your system can now make intelligent decisions based on real-time electricity prices.Need help? Have suggestions? We’d love to hear from you! Contact us at
[email protected] to share your feedback or
get assistance with your integration.