An app that connects your Garmin wearable to your openHAB smart home system, giving you convenient access to essential devices and real-time information.
The user manual is available in the openHAB documentation at https://next.openhab.org/docs/apps/garmin/.
This README covers the following topics:
- Introduction
- Project Structure
- Build Instructions
- Helpful Tips and Notes
- Copyright Notice
- Attributions
This app is built using the Garmin Connect IQ SDK and is based on openHAB sitemaps.
It includes two application types:
- Glance: A lightweight, quick-access entry point.
- Widget: The main, full-screen interface for interacting with the sitemap.
The Widget:
- Displays a hierarchical structure representing a single sitemap, using the SDK's
CustomMenu
andCustomMenuItem
. - Requests sitemap updates at a configurable interval.
- Updates the menu whenever a new response is received.
- Caches the latest sitemap response in persistent storage.
- Renders sitemap Widgets using specific
CustomMenuItem
implementations, which may also send commands to items.
The Glance:
- Displays the sitemap label.
- If sufficient memory is available, it also requests the sitemap at the same interval as the Widget and caches it in storage, allowing the Widget to start with a fresh state.
Further reading:
The project is organised into the following directories:
The root directory contains essential project files.
Key files:
README.md
: This filemanifest.xml
: Defines the app's structure, supported devices, and required permissions (e.g., storage, background tasks)monkey.jungle
: The build script that determines available features per device. It includes extensive documentation in the file itself.
Further reading:
- Connect IQ SDK Core Topics - Manifest and Permissions
- Connect IQ SDK Core Topics - Build Configuration
Contains VS Code customizations.
Contains the user manual, published at https://next.openhab.org/docs/apps/garmin/.
This folder contains compiled binary releases of the app, intended for upload to the Garmin Connect IQ Store.
In the Connect IQ SDK, resources define:
-
Properties: Parameters stored outside the app and not visible to the user. These are currently not used by the app; instead, more flexible Constants are used. See Folder
source-constants
for details. -
Settings: User-facing configurations
-
Drawables: Image assets used by the app
-
Strings: Text values like app name and version
Folder breakdown:
/resources/base
: Contains resources shared across all device types./resources/base/drawables.xml
: Defines image assets used in the app (referenced asDrawable
elements)./resources/base/settings.xml
: Specifies the app’s configuration settings, including default values, types, and user-facing descriptions./resources/base/string.xml
: Contains static string values such as the app name and version number.
/resources/edge
: Contains resources specific to Garmin Edge devices. SomeDrawable
elements are overridden here to account for different sizing requirements./resources/launcher-icons
: Contains one subdirectory per launcher icon size. Each subdirectory includes a resource definition for that specific size. The correct icon is selected via the resource path in themonkey.jungle
build file, depending on the target device./resources/svg
: Contains the original SVG files used to generateDrawable
resources.
Further reading:
The app is written in Monkey C, Garmin's programming language, using the Connect IQ SDK API for UI, settings, persistent storage, and HTTP requests to openHAB.
For more details, continue reading the folder’s README.
This folder defines device-specific configuration using code-based Constants, which replace Garmin SDK Properties due to their limitations. Unlike Properties, Constants are embedded in the code, update automatically with new app versions, and benefit from compiler validation.
For more details, continue reading the folder’s README.
Follow the steps below to build, run, and test the app using the Connect IQ SDK and Garmin simulator.
-
Install:
- Visual Studio Code
- Git
- Connect IQ SDK (see Connect IQ SDK Installation for troubleshooting)
- Monkey C extension for VS Code
-
Open VS Code and clone the
openhab-garmin
repository -
Open any file in the
/source
folder -
Press F5 to start the simulator and select a target device
-
Go to
File
→Edit Persistent Storage
→Edit Application.Properties
and configure as needed- To allow HTTP URLs, uncheck
Settings > Use Device HTTPS Requirements
- To allow HTTP URLs, uncheck
- Press
CTRL+SHIFT+P
→Monkey C: Build Current Project
Follow these steps to prepare and export your app for upload to the Garmin Connect IQ Store:
-
Remove Debug Statements
Ensure all debug logging or print statements are commented out or removed. See Removing Debug Statements for guidance.
-
Update the Version Number
Edit the file
resources/base/strings.xml
and set the correct version number for this release. -
Set the Correct App ID
Open
manifest.xml
and set the appropriate app ID:- Use the stable app ID for production releases.
- Use the beta app ID for test releases.
🛠 You’ll need to switch to XML mode in your editor to change this value manually.
-
Export the Project
Use the command palette:
CTRL + SHIFT + P
→Monkey C: Export Project
This will generate the.iq
file used for uploading.
To support a new device:
- If the device isn't available in your current SDK, launch the SDK Manager and download/activate the latest version.
- In
manifest.xml
, check the new device in the supported device list. - Configure device-specific features in the
monkey.jungle
build file (see Root Folder/
). - Test in the simulator (see above)
- Export the project (
CTRL+SHIFT+P
→Monkey C: Export Project
) and upload the.iq
file to the Connect IQ Store
Further reading:
A collection of useful information for working on this project.
While debug statements are only printed in debug builds, they still occupy code space in release builds. Therefore, when building a release, all debug statements should be commented out.
To find all active debug statements in VS Code, press CTRL+SHIFT+H
to open the global search and replace panel. Enable regular expressions by clicking the .*
icon next to the search field, and use the following pattern to locate all active debug statements:
(?<!\/\/ )Logger\.debug\(
To deactivate the debug statements, replace them with:
// Logger.debug(
This will comment them out without affecting any lines that are already commented.
Copyright (c) 2025 Contributors to the openHAB project
The contents of this repository are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0
SPDX-License-Identifier: EPL-2.0
The interface icons, except for the openHAB logo, are licensed under CC BY 3.0 by Adrien Coquet from Noun Project.