Garmin Connect Custom Integration
In this article we will explain how you can connect your Garmin Watch in Home Assistant, to track and visualize data such as heart rate, steps, floors ascended/descended, calories, sleep cycle, stress and much more! Moreover, we will show you how you can control your integrated Home Assistant entities from your Garmin watch, such as lights, bulbs, switches using a custom Garmin widget.
Installation and Setup
Garmin Connect for Home Assistant is a custom integration developed by cyberjunky.
The easiest way to install it is via HACS:
- Open HACS and click Integrations
- Click the three dots in the top right corner, and open Custom repositories
- Add https://github.com/cyberjunky/home-assistant-garmin_connect
- In HACS, click + Explore and download repositories and search for Garmin
- Download the repo by clicking Download this repository with HACS
- Restart Home Assistant
- Navigate to the Integrations page, Configuration > Devices & Services
Tip: You can add a sidebar shortcut directly to you integrations page! Guide
- Click + Add Integration, search for Garmin and click
- In the pop-up, login with your Garmin Connect account
The Garmin Connect custom integration exposes a plethora of sensors in you Home Assistant instance. Not all of the available sensors will be useful to you, it depends of the model you have, what apps you have connected and the tracking services you use.
By default, the following sensors are enabled:
- Total Steps
- Daily Step Goal
- Total KiloCalories
- Active KiloCalories
- BMR KiloCalories
- Burned KiloCalories
- Total Distance Mtr
- Active Time
- Sedentary Time
- Sleeping Time
- Awake Duration
- Sleep Duration
- Floors Ascended
- Floors Descended
- Floors Ascended Goal
- Min Heart Rate
- Max Heart Rate
- Resting Heart Rate
- Avg Stress Level
- Max Stress Level
- Rest Stress Duration
- Activity Stress Duration
- Uncat. Stress Duration
- Total Stress Duration
- Low Stress Duration
- Medium Stress
- High Stress Duration
- Body Battery Charged
- Body Battery Drained
- Body Battery Highest
- Body Battery Lowest
- Body Battery Most
- Average SPO2
- Lowest SPO2
- Latest SPO2
There are much more available sensors which you can enable from the Integrations page. Which ones will be of importance to you, depends entirely of what you want to achieve, the device you have and your connected services. The incoming data will be out of sync once setup, because your sports watch syncs periodically to your phone, and thus to Home Assistant. Garmin Connect has very low rate limit, max. once ~ 5 minutes.
Visualizing Garmin Data
Now that we have all that Garmin data pouring in Home Assistant, we can visualize some of the sensors in our Home Assistant dashboard. For example, maybe you want to glance an overview of your steps, floors, average heart rate in you wall mounted panel. If your significant other also has a Garmin device, you can compare activity about your day.
For our example, we will use a combination of the basic Entities & Glance cards nested in a Vertical stack card.
type: vertical-stack cards: - type: entities entities: - entity: sensor.total_steps - entity: sensor.daily_step_goal title: Activity Overview show_state: true - type: glance entities: - entity: sensor.resting_heart_rate - entity: sensor.min_heart_rate - entity: sensor.max_heart_rate show_state: true state_color: false - type: entities entities: - entity: sensor.floors_ascended - entity: sensor.floors_ascended_goal show_state: trueCode language: YAML (yaml)
HassControl Garmin Widget
The Garmin Connect custom integration allows you visualize and automate data gathered from your daily activities. To be able to control you HA instance from your watch, we need to add a custom widget to the watch and connect it to your Home Assistant. HassControl is a widget developed by karlenek, and it is capable of basic entity control via your Garmin device.
Installation and Setup
To install the HassControl widget, open the Garmin Connect IQ app on your phone:
- Click the search tab and type in HassControl
- Click on the widget and install it
- Open the widget setting
- Under Host, enter your Home Assistant URL
Note: Only a secure HTTPS connection is allowed, this limitation is imposed by Garmin.
- (Optional): If you want to use a long-lived access token instead of logging in, you can paste it here
- Under scenes, enter any scene you want controllable through the widget
Scene setup is explained in detail bellow.
- Under group, enter group name to import entities to the widget
Group setup is explained in detail bellow.
- To login to you HA instance, open the widget on your smart watch and trigger any scene/entity
- You will see a login request pop-up on your smartphone. Enter your credentials and login in to you HA server
- If you see a “No entities configured” screen press and hold the widget, click Settings and Refresh Entities.
- Done, now you can control your lights and switches
Entities Setup and Configuration
Because Garmin Watches are primarily designed for endurance, outdoor activities and GPS tracking accuracy, they feature a so-called Chroma display instead of a LED/OLED display. These displays favor battery life over color accuracy and vividness, and for our particular use case, this brings in some limitations. They have a small delay which can be noticed when navigating through the interface and toggling entities and aren’t as vivid as OLED displays.
The HassControl widget can control the following entities:
|binary_sensor||Only displays basic boolean state, device class is not supported.|
|input_boolean||Toggling of its state is supported.|
|light||Can be turned on/off, color, brightness, etc. are not supported.|
|lock||Both locking and unlocking are supported.|
|cover||Both closing and opening the cover is supported.|
|switch||Can be turned on/off|
|automation||Can be turned on/off|
Since scenes names are not easily configurable in Home Assistant, you can use the scene field in the settings of widget to setup aliases for your scenes. For example:
If you have a scene named scene.children_bedtime, you input children_bedtime=Children Bedtime, or for scene.movie_time, you would input movie_time=Movie Time. This will allow the scene names to be nicely displayed on your watch.
The easiest way to manipulate which entities are shown on your watch, is to create a Home Assistant group containing wanted entities. For example:
#Add this to your configuration.yaml groups: garmin_lights: name: Lights entities: - light.sonoff_kitchen_led - light.sonoff_element_lights - light.bar_lights - light.sonoff_living_room - light.sonoff_wall_1 - light.sonoff_wall_2 - light.sonoff_wall_3Code language: YAML (yaml)
Remember to reload your groups in Home Assistant when making changes before you add them to the widget. When you have created you entities group, simply open the settings of the HassControl widget in the Connect IQ app, and add your group name in the group field of the widget. To reload your entities on the watch itself, open widget setting (for watches with touch display, press and hold the widget, and click Setting > Refresh entities. Repeat the procedure anytime you make changes to your HA groups.
Note: The default start view is filtered to scenes and will not show light, switches etc., the start view can be changed in the widget settings in your Garmin device.
After connecting you Garmin Watch to your Home Assistant server, you can view and manipulate Garmin data in HA itself. You can setup automations and reminders, gather data for long term retention and analysis and display all in a beautiful HA dashboard. With the HassControl widget, you can open you garage door when pulling into the driveway, right from your watch!