Announcing openHAB for Garmin

Ok, will check.

As for the problem concerning the two Switch lines, I apologize Robert for not describing my problem precisely enough - it concerned an item of the Group type (which you couldn’t have guessed). That is my item:

Group:Switch:OR(ON, OFF)	    LedG 		"LED[(%d)]" 	            <color>

This item is used on the standard sitemap in the form:

Switch item=LedG label="LED" mappings=[OFF="WYLACZ WSZEDZIE"] icon="color"

I use this sitemap in an android app, it works and looks like this:
[screenshot to be attached]
Screenshot_20250609_103604_openHAB

This means I have the option to Switch OFF the entire group, but at the same time I can see in parentheses how many members of the group are ON.

In the case of your Garmin app, this only works (allows to Switch OFF group while displaying the number of members are ON) when I use the line:

Switch item=LedG label="LED Group [(%d)]"

but on the watch it displays the value of members ON in double brackets: square brackets and parentheses, not like in Android only in parentheses.
[screenshot to be attached - today evening]

%s if I remember correctly is for string type items and %d is for number type items - so its not the case here.

I wanted to point out that this is not some big critical problem and if it is time-consuming then it is definitely better to put it aside and develop the project with other functionalities :slight_smile:
EDIT:
We have to postpone the issue of the Switch item of the Group type which shows how many members are ON. Unfortunately, I am not able to reproduce the situation again. I could swear I saw “LED Group [(3)] switch” in the watch, but currently there are no brackets with a number :exploding_head:

Reinstalling the Florian file helped - remote control from the watch returned.

OK, yes — the absence of a formatted state in square brackets is what I would have expected.
If you do see it again, please let me know — there might be a bug in the app at work here.

I think you’ve raised a valid use case, and I’d like to support it in the app — I’ll work on adding that.

:+1: Glad to hear it, I’ll add this to the troubleshooting section of the user manual.

1 Like

Hi Robert. Running v0.3.3 on a Garmin Edge 540, I think I have it configured correctly, running a very simple sitemap, but when I access the app, I seem to get the following error:
2025-06-10-15-57-50

Are you using toggle switches (ON/OFF)?

Unfortunately, a recent update introduced a bug that causes the toggle switch to crash on Edge devices and some older watches (issue #153). I’ve already fixed the issue, and the fix will be included in the next release, which should be available in the coming days.

In the meantime, you can work around the problem by adding a mappings definition to the Switch element in your sitemap:

Switch item=YourItem label="Your Label" mappings=[ON="ON", OFF="OFF"]

This will display a text-based ON/OFF state instead of the toggle switch. Tapping the menu item will still toggle between the two states.

I’ve gone ahead and uploaded version 0.3.4.

View the full changelog

Highlights of this release:

Fix for Edge devices and older watches

This release resolves the crash that occurred on Edge devices and certain older watch models.
@g_g_rich — please let me know if the fix works for you.


Display of rendered state next to toggle switches

If a display pattern is defined for a Switch item—either in the item metadata or the sitemap—the resulting string will now be shown next to the toggle switch.

Example:

Group item=TEST_GROUP label="Group [(%d)]"

This would render as follows (see second menu item):
Screenshot - 12_06_2025 , 19_52_10

@stonke, let me know if this works for your use case.


Icon support

Icons can now be displayed next to items, either defined directly in the sitemap or via item metadata.

If an icon is defined in metadata but you don’t want it to appear, you can suppress it by setting the icon parameter to an empty string ("") in the sitemap.

The icons are built into the app, and while the current set is limited, more can be added on request. You can find the full list of supported icons in the Icons section.

Wherever openHAB supports dynamic state-based icons (e.g., for lights, rollershutters, or garage doors), the app supports them too.

Example screenshots:

Screenshot - 12_06_2025 , 20_02_17

Screenshot - 12_06_2025 , 20_02_46

As always, feel free to reach out if you have feedback or requests—especially if you’d like to see specific icons added!

1 Like

Yes, that fixed it.
Looking forward to the latest version to populate.
Thanks Robert!

That’s great to hear! I just checked, and v0.3.4 has now been approved and is available for download.

1 Like

Yes, running v0.3.4 and can confirm toggle switch items are now working fine on the edge.

1 Like

It works Robert, Thank You :slight_smile:

1 Like

Hi everyone,

I’ve just uploaded v0.4.0 Release Candidate 1 to the Beta app.

If you have the chance to test it with your sitemap, it would be a great help.

This release includes significant internal changes that I’d like to validate more broadly before making them available in the main release.

Why this version is important

Recent additions like support for groups and icons revealed some underlying issues:

  • Stack overflow: Garmin CIQ apps have a limited stack size. With as few as three levels of sitemap hierarchy, the previous recursive processing could cause a crash.
  • Watchdog timeout: Garmin enforces a limit on uninterrupted code execution time. In complex sitemaps with icons, this limit could be exceeded during startup, also resulting in a crash.

What has changed

Both issues have been addressed:

  • Sitemap processing is now performed iteratively instead of recursively, avoiding stack exhaustion.
  • Menu initialization at startup is now broken into smaller asynchronous tasks, similar to how updates are already handled, preventing watchdog timeouts.

Additional improvements

  • The Group element now supports all item types, not just those explicitly mapped to a widget.
  • Support for the newly released Venu X1 has been added.

Thanks in advance for testing and for your continued feedback.

wow ! Thanks for the amazing developement! I am trying 0.3.4 on my garmin vivoactive 5s. I only can use it by https://home.myopenhab.org not with my internal IP in my WLAN. (Android phone, https://192.168.1.52:8443, the http with Port 8181 also does not work. Where do I have to check the certificates?

How is it possible to change light switches or anything else?
Thanks,
Klaus

Unfortunately, on Android, Garmin only supports HTTPS connections with a trusted (i.e., not self-signed) SSL certificate. The easiest way to achieve this is by using myopenHAB.org, which provides a valid certificate out of the box.

I’m not an expert on setting this up manually in openHAB, but this page might help:
openHAB Security Documentation

A common option for obtaining a free, valid certificate is Let’s Encrypt, though keep in mind that these certificates need to be renewed every 90 days.

Interestingly, on iOS, Garmin does support plain HTTP connections.

If you’re using openHAB 4.3.x, the best option is to install the backport of the native JSON-based REST API. This allows external apps to send commands to openHAB items.

Alternatively, you can use a custom webhook set up through the webhook binding.

You can find instructions for both options here: user manual/sending commands.

Starting with openHAB 5, the JSON-based REST API will be included by default, so command support from the app will work out of the box.

v0.4.0 has been released to the stable channel. For details on the changes, see the quoted post. If you experience any issues with the update, please don’t hesitate to reach out.

2 Likes

I’m using your evcc app on my Garmin since a long time and glad I discovered this one!

Just started to play with it, and looks great!

I’ve a small question: When I used sitemaps in the past, I created 2 items for my dimmers, so I hade a simple one of turing these light completed off are back on

        Slider item=NHC_Bureau
        Switch item=NHC_Bureau

image

But in the Garmin app I get the error: Switch 'Bureau' invalid state '61'

When I remove the Switch item, everything is ok.

Add a mapping does work, but than I need to set a fixed value for my dimmer mappings=[0="OFF", 100="ON"]

Yes, I’m afraid the app currently only supports toggle switches where the item state is explicitly ON or OFF.

I’ve created a ticket to track this: Support Switch elements for Dimmer items · Issue #168 · openhab/openhab-garmin · GitHub

If I understand correctly, the item has a numeric state (0–100), but still accepts ON/OFF commands? And when switched OFF and then back ON, it returns to its previous dimmer level?

Yes that’s completly correct (Niko Home Control).

It’s not a big issue off course. Most of the time I will use the finction on my watch to turn it off I guess.

I’ve just uploaded Version 0.4.1, which includes the following enhancements:

  • Switch elements linked to Dimmer items are now correctly displayed as toggle switches (when no mappings are defined). For state display, a value of 0 is treated as OFF, and any value from 1 to 100 as ON.
  • The door and poweroutlet icons are now supported, including state-dependent rendering.

@wars @florian-h05 – let me know if these updates work for you. :slightly_smiling_face:

1 Like

This is exactly how it should work! Tested and is working as expected.

1 Like

The new icons work like a charm, thanks!
garagedoor might also be nice.

The garagedoor is already included and fully supports state-based display. :grinning_face:

Here is the list of supported icons.

1 Like