Custom component for Home Assistant to interact the Carelink platform by Medtronic with integrated Nightscout uploader. The api is mostly the works of @ondrej1024 who made the Python port from another JAVA api.
- Medtronic Guardian Connect CGM (to be confirmed)
- Medtronic MiniMed 770G pump (to be confirmed)
- Medtronic MiniMed 780G pump
HACS is a community store for Home Assistant. You can install HACS and then install Carelink Integration from the HACS store.
Then you can install the integration
Copy the custom_components/carelink to your custom_components folder. Reboot Home Assistant and configure the 'Carelink' integration via the integrations page or press the blue button below.
The needed information for the authentification process can either be provided as a shared seed file (/config/carelink_logindata.json), or entered during the initial setup of the integration.
The Home Assistant Carelink Integration needs the initial login data stored in /config/carelink_logindata.json (shared seed). There are three ways to create this file:
The easiest way to get your logindata.json is using the Carelink Token Generator add-on directly in Home Assistant. No technical knowledge required.
-
Add this repository to your Home Assistant add-on store:
https://github.com/yo-han/Home-Assistant-Carelink -
Install the "Carelink Token Generator" add-on
-
Configure your region (EU or US) and start the add-on
-
Click "Open Web UI" and follow the login process
-
The token file will be saved automatically to
/config/carelink_logindata.json- you can then add the Carelink integration with empty fields
For more details, see the Add-on README.
If you can't use the Home Assistant add-on, you can use our Docker-based token tool. This requires Docker to be installed on your computer.
-
Navigate to the token-tool folder and set up your credentials:
cd token-tool cp .env.example .env # Edit .env with your Carelink username and password
-
Run the tool:
docker compose up --build
-
Open
http://localhost:6080/vnc.html?autoconnect=truein your browser -
Wait a few seconds for your credentials to be auto-filled, then solve the CAPTCHA
-
Download your token file from
http://localhost:8000/logindata.jsonor find it in./token-tool/output/ -
Copy it to your Home Assistant config directory as
/config/carelink_logindata.json
For more details and troubleshooting, see the Token Tool README.
Alternatively, you can run the login script directly on a PC with a screen. The login script from @ondrej1024's Carelink Python API, written by @palmarci (Pal Marci), was slightly modified and can be found here "carelink_carepartner_api_login.py".
Simply run:
python carelink_carepartner_api_login.py
You might need to install the following Python packages to satisfy the script's dependencies:
- requests (pip install requests)
- OpenSSL (pip install pyOpenSSL)
- seleniumwire (pip install selenium-wire)
- curlify (pip install curlify)
- blinker vertion 1.7.0 (pip install blinker==1.7.0) (Issue documented here: seleniumbase/SeleniumBase#2782)
For Windows environment the following packages need to be installed too:
setuptools (pip install setuptools)
packaging (pip install packaging)
The script opens a Firefox web browser (so make sure Firefox is installed on your machine) with the Carelink login page. You have to provide your Carelink patients or follower credentials (recommended) and solve the reCapcha. On successful completion of the login, the data file will be created with the following structure:
Either the content of the logindata.json file can be taken over into the setup of the HA Carelink integration, or the entire file can be placed at /config/carelink_logindata.json (shared seed).
All parameters during setup are optional and a provided shared seed file will have a higher priority and overwrite the manual configuration.
If the file was placed at /config/carelink_logindata.json before the integration setup was started in Home Assistant, all parameters during the setup can stay empty.
The integration will copy the shared seed into an entry-specific file at /config/carelink_logindata_<entry_id>.json.
If you regenerate tokens, the integration will update the entry-specific file when the shared seed is newer.
Legacy installs that still use custom_components/carelink/logindata.json will be handled as a fallback.
With those information, the Home Assistant Carelink Integration will be able to automatically refresh the login data when it expires.
It should be able to do so within one week of the last refresh.
The scan interval of the integration can be configured during the integration setup. User can configure anything between 30 and 300 seconds. Default is 60 seconds.
To use the Nightscout uploader, it is mandatory to provide the Nightscout URL and the Nightscout API secret.
The Nightscout uploader can upload all SG data and add Treatments with the amount of carbs and insulin.
In order to be able to show the active insulin reported by the pump, the remaining reservoir amount parameter of the nightscout pump plugin has been reused.

- DeviceStatus
- Glucose entries
- Basal
- Bolus
- AutoBolus
- Alarms
- Alerts
- Messages
The logger integration lets you define the level of logging activities in Home Assistant. Turning on debug mode will show more information about unsupported devices in your logbook.
logger:
default: critical
logs:
custom_components.carelink: debug- CareLink MFA is not supported
- Notification messages are in English
- CareLink follower account (with MFA NOT ENABLED)
- Guardian Connect CGM outside US: patient or care partner account
- Guardian Connect CGM inside US: not tested yet! (possibly a care partner account)
- 7xxG pump outside US: care partner account (same as for Medtronic CareLink Connect app)
- 7xxG pump inside US: care partner account (same as for Medtronic CareLink Connect app)



