Skip to content

[Feature Request] Home assistant integration #14

Open

Description

@frostworx

Hello,

thanks a lot for this great project! I just connected it with my Colmi R12, and it instantly delivered data.
The gui looks really nice and well organized.
If it is not too much requested it would be great if the app would provide some Home Assistant integration or connection.

I've seen you closed an Android Health Support feature request, which would have been one option, but IMHO a standalone integration (or using mqtt) would be even better, because you could collect data from multiple devices simultaneously (or I did not understand Health Connect completely :)).

Activity

  1. foureight84 commented on Jul 7, 2026

    @foureight84
    Owner

    Hey there :D Thanks for using our app.

    What are you looking for in regards to Home Assistant Integration? e.g. Do you want your health stats synced to a home assistant PulseLoop extension so that you could monitor things like your sleep pattern vs Bed room temperature?

    I just want to get some of your specific use case(s) so that we can add it to the list of suggestions and weigh with other requests as well. There are only two of us working on this at the moment and since Android closely follows iOS we would need to have feature parity with iOS/adoption on that platform as well.

    Also, the closed Android Health does not mean it's not on the roadmap. I acknowledged that it would be on the roadmap and would occur in tandem with Apple Health Kit integration when that occurs on Apple.

  2. frostworx commented on Jul 7, 2026

    @frostworx
    Author

    Hello,
    thanks four your quick reply!
    I simply love adding all my data combined in home assistant, so I'd appreciate if every sensor the ring/your app ships would be also available in home assistant. You can already use Gadgetbridge for that, which also does support the colmi rings. But Gagetbridge "only" covers Health Connect (which can be enabled as "pass-through" sensor from the home assistant companion app), so you'd always have just one data per sensor type (i.e. pulserate or steps) no matter how many devices you have. With an exclusive home assistant integration you could easily see the values your specific device generated and compare it with other devices you have.

    Thank you very much for even considering it!

  3. aheider commented on Nov 5, 2026

    @aheider

    You can use health connect and then pull the data into eg Sparkyfitness https://github.com/CodeWithCJ/SparkyFitness

  4. frostworx commented on Nov 5, 2026

    @frostworx
    Author

    thanks for trying to help, @aheider!
    although I do not really like a workaround here (tbh I haven't used the ring for some time now), you remind me, that sparkyfitness is still in my backlog to check :)
    In fact it is even already installed (maybe this winter)

  5. foureight84 commented on Nov 13, 2026

    @foureight84
    Owner

    Hey @frostworx, picking this back up! 👋

    You mentioned MQTT in your first post, and that's the direction we're leaning. Before we build anything, would something like this work for you?

    • An optional MQTT exporter in Settings. You point it at your broker (host, port, username/password, TLS), and PulseLoop publishes your ring's data whenever it syncs.
    • Home Assistant MQTT discovery, so the sensors just show up in HA as a device on their own. No YAML needed.
    • A separate topic and device per ring/phone, so if you've got several people or rings, each one shows up as its own device in HA with its own heart rate, steps and so on. That should cover the multi-device thing Health Connect merges together.
    • Probably heart rate, SpO₂, HRV, stress, temperature, steps/calories/distance, last night's sleep (total plus stages), and ring battery. Each would only appear if your ring actually measures it.

    A couple of quick questions:

    1. Does MQTT plus HA discovery sound good to you, or were you hoping for an actual HA custom integration?
    2. Which sensors would you actually use? Anything missing from that list?
    3. Is "publish after each sync" (roughly every 30 min in the background, more often while the app is open) frequent enough, or would you want live heart rate too?

    No pressure at all, especially if the ring's been in a drawer lately 🙂 Just want to make sure we build the version that's actually useful. Thanks!

  6. frostworx commented on Nov 13, 2026

    @frostworx
    Author

    Hello @foureight84!
    Thank you very much for looking into it!

    Your planning already sounds very feature complete and covers everything I'd love to see.

    Maybe it is a good idea to let the user choose the sync rate.
    Depending on what people are doing with the data in HA, it might be crucial do have live data (i.e. for workout on a "stupid" crosstrainer or similar). But a 30 minutes sync sounds like a very good default for me, which I personally probably would not even change.

    Thanks a lot!

  7. foureight84 commented on Nov 15, 2026

    @foureight84
    Owner

    Hey @frostworx — we've implemented standalone MQTT export with per-device topics, configurable background sync intervals, ~5 s live workout / spot-measurement streaming, and automatic MQTT discovery, and cut an RC build for you to try out!

    Test Build & Links


    Quick Setup (Settings → MQTT)

    1. Open Settings → MQTT and turn on Enable MQTT export.
    2. Enter your Broker Host, Port (1883 plain TCP for local/private hosts, or enable Use TLS (MQTTS) on 8883), and optional Username / Password (stored in EncryptedSharedPreferences).
    3. Keep or customize:
      • Base Topic: pulseloop
      • Discovery Prefix: homeassistant (any MQTT auto-discovery consumer / HA discovery compatible)
      • Device Name Override: (optional, replaces the ring's default slug <name>_<last4>)
      • Background Ring Sync: 15 min, 30 min (default), 1 hr, or 2 hr
      • Live workout streaming: On by default (~5 s coalesced updates during active workouts and live spot measurements, plus an immediate snapshot when a workout ends)
      • Sensors: Toggle individual sensors on or off (only sensors supported by your paired ring are offered/exported)
    4. Tap Test Connection to verify the broker handshake, then Publish Now to push your current ring snapshot immediately (use Clear Retained Topics if you ever want to wipe previously retained topics).

    Note: Demo/seeded rows (demo / mock) are excluded — only real measurements, sleep, daily activity, and workouts from a paired ring are exported.


    Topic Structure to Watch & Validate

    Every message is published with QoS 1 and retain = true.

    • Consolidated JSON State Topic

      <base_topic>/<device_slug>/state
      

      Example: pulseloop/colmi_r11_e1f2/state
      <device_slug> is <sanitized_name>_<last4> (or <sanitized_device_name_override>), keeping multiple rings / devices cleanly separated.

    • MQTT Auto-Discovery Config Topics

      <discovery_prefix>/<component>/<unique_prefix>/<sensor_key>/config
      
      • <component>: binary_sensor for workout_active, sensor for everything else
      • <unique_prefix>: pulseloop_<mac_or_id_hex> (for example pulseloop_aabbccdde1f2)
        Example: homeassistant/sensor/pulseloop_aabbccdde1f2/heart_rate/config

    Quick CLI check against your broker:

    mosquitto_sub -h <your-broker> -t 'pulseloop/#' -t 'homeassistant/+/pulseloop_+/+/config' -v

    Exported Sensors & Selection Rules

    Sensors are capability-gated to your paired ring and can be toggled individually in Settings → MQTT:

    Vitals

    Sensor Key Component JSON Field Unit Device / State Class Selection Requirement
    battery sensor battery % battery / measurement BATTERY capability
    heart_rate sensor heart_rate bpm — / measurement HEART_RATE or MANUAL_HEART_RATE (uses live HR during workout streaming)
    resting_heart_rate sensor resting_heart_rate bpm — / measurement HEART_RATE or MANUAL_HEART_RATE and computed resting baseline present
    spo2 sensor spo2 % — / measurement SPO2, SPO2_HISTORY, or MANUAL_SPO2
    hrv sensor hrv ms — / measurement HRV or MANUAL_HRV
    stress sensor stress — — / measurement STRESS or MANUAL_STRESS and real hardware STRESS rows present
    temperature sensor temperature °C temperature / measurement TEMPERATURE or MANUAL_TEMPERATURE
    blood_pressure_systolic sensor blood_pressure_systolic mmHg — / measurement BLOOD_PRESSURE or MANUAL_BLOOD_PRESSURE
    blood_pressure_diastolic sensor blood_pressure_diastolic mmHg — / measurement BLOOD_PRESSURE or MANUAL_BLOOD_PRESSURE
    blood_sugar sensor blood_sugar mg/dL blood_glucose_concentration / measurement BLOOD_SUGAR
    respiratory_rate sensor respiratory_rate breaths/min — / measurement Real RESPIRATORY_RATE measurement rows present
    vo2_max sensor vo2_max mL/kg/min — / measurement VO2MAX

    Daily Activity & Sleep

    Sensor Key Component JSON Field Unit Device / State Class Selection Requirement
    steps sensor steps steps — / total_increasing STEPS capability
    calories sensor calories kcal — / total_increasing STEPS capability
    distance sensor distance m distance / total_increasing STEPS capability
    active_minutes sensor active_minutes min duration / total_increasing STEPS capability
    sleep_duration sensor sleep_duration min duration / measurement SLEEP capability
    sleep_score sensor sleep_score — — / measurement SLEEP capability
    sleep_deep sensor sleep_deep min duration / measurement SLEEP capability
    sleep_light sensor sleep_light min duration / measurement SLEEP capability
    sleep_rem sensor sleep_rem min duration / measurement SLEEP and REM_SLEEP capabilities
    sleep_awake sensor sleep_awake min duration / measurement SLEEP capability

    Live Workout & Diagnostics

    Sensor Key Component JSON Field Unit Device / State Class / Category Selection Requirement
    workout_active binary_sensor workout_active ON/OFF running HEART_RATE capability or active/recorded workout (payload_on: "ON", payload_off: "OFF")
    workout_type sensor workout_type — — Same as workout_active (omitted from state JSON when inactive)
    workout_duration sensor workout_duration s duration / measurement Same as workout_active (omitted from state JSON when inactive)
    last_sync sensor last_sync ISO-8601 UTC timestamp / diagnostic Always included

    Example Payloads

    Discovery Config (homeassistant/sensor/pulseloop_aabbccdde1f2/heart_rate/config):

    {
      "name": "Heart Rate",
      "unique_id": "pulseloop_aabbccdde1f2_heart_rate",
      "object_id": "colmi_r11_e1f2_heart_rate",
      "state_topic": "pulseloop/colmi_r11_e1f2/state",
      "value_template": "{{ value_json.get('heart_rate') }}",
      "unit_of_measurement": "bpm",
      "state_class": "measurement",
      "icon": "mdi:heart-pulse",
      "device": {
        "identifiers": ["pulseloop_aabbccdde1f2"],
        "name": "Colmi R11",
        "manufacturer": "Colmi",
        "model": "Colmi R11",
        "sw_version": "1.00.38",
        "connections": [["mac", "aa:bb:cc:dd:e1:f2"]]
      }
    }

    Consolidated State (pulseloop/colmi_r11_e1f2/state):

    {
      "battery": 84,
      "heart_rate": 72,
      "resting_heart_rate": 58,
      "spo2": 98,
      "hrv": 46.5,
      "stress": 31,
      "temperature": 36.4,
      "steps": 6840,
      "calories": 428.0,
      "distance": 4925,
      "active_minutes": 34,
      "sleep_duration": 450,
      "sleep_score": 70,
      "sleep_deep": 115,
      "sleep_light": 245,
      "sleep_rem": 90,
      "sleep_awake": 25,
      "workout_active": false,
      "last_sync": "2026-11-15T08:06:12Z"
    }

    (Null metrics and inactive workout fields are omitted from the JSON object rather than emitted as null.)

    Let us know how it behaves with your Colmi R12 and your broker setup, and whether any topics, discovery attributes, or sync timings need tweaking!

  8. frostworx commented on Nov 15, 2026

    @frostworx
    Author

    Wow, you are fast!
    I can confirm that the mqtt integration works ootb without any problems using local lan with port 1883.
    The sensors are all present in home assistant (multiple currently without known state, because I did not move, others already have data).

    Thank you very much for the implementation, this is really nice!

    I hope it is not too much requested but I had one more feature request (can't tell if this is hard to implement):
    It would be great if the mqtt integration would also accept wss, so the data could also be shipped to HA while not at home.
    as an example owntracks accepts mqtt through port 443 using websockets and tls (wss) to my reverse proxy domain just fine
    (the documentation here https://testmqtt.com/learn/mqtt-over-websockets for sure gives a better explanation :))

  9. foureight84 commented on Nov 16, 2026

    @foureight84
    Owner

    Hey @frostworx — glad to hear LAN MQTT worked right out of the box!

    We've added MQTT over WebSockets (ws:// / wss://) support (RFC 6455 with Sec-WebSocket-Protocol: mqtt) to feat/14-mqtt (PR #147) and cut a new RC build for you to test:

    Reverse Proxy / wss:// Setup (Settings → MQTT)

    1. Under Broker Connection → Transport, select WebSocket (WS / WSS).
    2. Turn on Use TLS (MQTTS / WSS) — Port will automatically default to 443 (or enter any custom port).
    3. Set Broker Host to your reverse-proxy domain (e.g. mqtt.yourdomain.tld).
    4. Set WebSocket Path to match your reverse proxy / broker listener (defaults to /mqtt, e.g. /ws or /mqtt).
    5. Tap Test Connection to verify the TLS + HTTP Upgrade + MQTT handshake.

    Let us know if wss:// works cleanly through your reverse proxy!

  10. frostworx commented on Nov 16, 2026

    @frostworx
    Author

    I'm ill, so only gave it a very quick try, but I can confirm wss works fine! thanks a lot for the fast implementation!

  11. foureight84 commented on Nov 17, 2026

    @foureight84
    Owner

    No worries. Feel better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions