Skip to content

🔥Kotlin Multiplatform Desktop/Android/iOS Energy Tracker app

License

Notifications You must be signed in to change notification settings

ryanw-mobile/OctoMeter

Repository files navigation

OctoMeter: Empowering Smart Electricity Usage
Pull request GitHub Repo stars Gradle Build Codacy Coverage Badge Codacy Grade Badge Renovate enabled

Production-grade Kotlin Multiplatform App targeting Desktop, Android, iOS


cover image


Made in the UK, For the UK.

Complementary article: Releasing my First True Kotlin Multiplatform App

cover image

It works for me

This is a dashboard-type app that runs on desktop (desktop-first), Android, and iOS. It implements an adaptive layout that works on mobile, tablet, and dynamic desktop window sizes. The app honours light and dark modes on all available platforms.

The main purposes of this app are:

  • Compile smart meter electricity usage; estimate and project electricity usage and cost.
  • Track the Agile Octopus tariff unit rates for the coming 24 hours, with countdown and automatic refresh.
  • Browse available Octopus Energy tariffs.

This is a fully functional app that I developed for myself. I use it every day and my energy expenses have reduced by more than 50%. For this reason, the app was intentionally built to reach production-level quality as much as possible.

Note

Octopus Energy customers: You are invited to collaborate, if this app is not working correctly for your account. Report an issue to start a conversation.

  • While it should technically work for some other Octopus Energy customers, I do not have enough sample data to cover all use cases.
  • For non-Octopus Energy customers, or non-UK residents, the demo mode will display random meter readings and default tariff rates to illustrate the app’s functionality.

cover image


If you like this app, consider giving me a star, following me on Medium, or on LinkedIn.



Switch to Octopus!

  • Learn more about the Agile Octopus smart tariff, or other available Octopus tariffs shown in this App.
  • Switch to Octopus Energy using this link, both of us will get £50 (or £100 for business).



Running the app

The project dependencies are maintained by Renovate. By default, the app builds on the latest Xcode and Android Studio.

All downloadables are provided under the Release Section.

  • MacOS Desktop App: We provide a DMG installer.
  • Windows Desktop App: We provide both EXE and MSI installers.
  • Android: We provide signed APK and App Bundle.
  • iOS: Join as a tester at Test Flight.
  • To build and run the Desktop app yourself, execute ./gradlew run

Testflight QR Code




To-do lists

Planned enhancements are logged as issues.

Note

I am actively seeking my next full-time Senior Android Developer role. Due to budget constraints, major feature development may be delayed. If you know of any suitable opportunities in the UK, I would greatly appreciate your referral.

RestAPI and GraphQL

Octopus Energy and Kraken prefer GraphQL over REST API. Accordingly, the second phase of this project has migrated several REST APIs to GraphQL. Unfortunately, not every REST API currently has an equivalent GraphQL counterpart; therefore, this app has a mixed use of both for demonstration purposes

Features Implementation
Account and meters 🕸️ GraphQL
Products Search (by postcode) 🕸️ GraphQL
Tariff details 🕸️ GraphQL
Half-hourly tariff rates 😴 RestAPI (Needs access to tariffs not subscribed)
Consumptions 😴 RestAPI (Needs server to honour query end date)

Version 1.4.0 is the last version it contains pure Ktor-RestAPI.



Data Security and Privacy

This app can run under the demo mode without requiring any credentials.

To pull real smart meter data from your Octopus Energy account, you need to generate an API key for your account at https://octopus.energy/dashboard/new/accounts/personal-details/api-access. This app never asks for your Octopus customer account password, and you can always generate a new API key to invalidate the old keys.

This app does not have write access to any of your customer data kept at Octopus Energy's systems.



Some technical details

  • /composeApp is for Kotlin code shared across the Compose Multiplatform application. It contains several subfolders:

    • commonMain is for code that’s common for all targets.
    • androidMain is the traditional Android project root.
    • desktopMain is for the desktop (JVM) app.
    • iosMain is for the Kotlin code to be exposed to the iOS app.
  • /iosApp contains the iOS application. Open OctoMeter.xcworkspace to build the App.

Dependencies

Plugins



Licenses

This project is licensed under the Mozilla Public License Version 2.0 (MPL-2.0) with a non-commercial clause. See the LICENSE file for details.

Icon licenses

Every tiny piece matters. This App contains the icons contributed by:

MIT License:

Apache 2.0 License:

CC BY 4.0 License:

ISC License: