Using Continuous Glucose Monitor (CGM) Data

I have just included the Nightscout integration into HA, great!

Can somebody share how to change from mg/dL to mmol/L? Would love to use this integration but I am not used to the mg/dL numbers.

Thanks!

divide by 18.

But if you are using the dexcom integration you can set the units in the integrations UI. Go configuration/integrations, click ā€œConfigureā€ on the dexcom integration and voila!

Canā€™t you do this in NightScout?

Not in the nightscout integration.

Sorry in for nightscout use a template to divide by 18.

My nightscout is in mmol/L, but will use a template to adjust the value. Thanks!

When you say your Nightscout is in mmol/L do you mean that the Nightscout web page shows mmol/L? Even if that is so, the Nightscout api always delivers in mg/dL.

Yes, my nightscout web page shows mmol/L. I have created a new sensor to calculate by mmol/L. I have not been able to also transfer the attribute that gives the direction. Any tips how to?

under sensor: in your configuration.yaml file

 - platform: rest
   name: Trend
   resource: https://xxx.herokuapp.com/api/v1/entries/current.json
   value_template: '{{ value_json[0].direction }}'

Finding icons for all the directions is not particularly easy.

Mmm, i am still learning yaml, but this doesnā€™t seem to be workingā€¦

I am sorry my own cutting and pasting let me down. I have corrected my last post, hopefully that should work!

Thanks Nickrout, working new! Yes the icons, that is going to be another learning for me. Any hits are of course appreciated :wink:

Could you share your flow?

Iā€™ve got my node red done great with Alexa announcing highs and lowsā€¦ but I donā€™t need her doing this every 5 minutes!

Iā€™ve just run out of ideas for noding a delay and re-check.

Does this tomato app work? I am trying to add my libre 2 to the app but it keeps asking me to download the patched librelink app which I have but just canā€™t get it working.

I donā€™t use libre any more. I have a tandem pump that links to dexcom so I switched to dexcom. I canā€™t remember the tomato details, but it worked at the time.

Iā€™ve also got Nightscout in Ha but finding it very restricted in what we can do with it, I came over to Ha due to Google removing API to allow us voice prompts on what Nightscout and AAPS inputs to then be telling me more details on how many days the sensor has been on me and carbs on board and insulin on board.

Iā€™m like this somehow back in Ha and on display when it is triggered.
I also like lights to change colors to warn us when Low or High but on my attempts with Scenes in it but again I stopped doing it due to it needing constant attention due to something to do with snapshots also does not survive a restart of Home Assistant, so this needs a fix too for me to be able to use it in piece!

Basically, it does what you want but if you need to turn off the Ha system in my case a Ikool core it will need to be done. I have not figured out how to re get it started yet! :slight_smile:

But if we can find ways so it can survive these restarts that setup is great.

Iā€™m not fully sure how you have got nightscout into Ha as I think I got my in with a simple Url card.

But if we can all help on these things in this community will be great! I think we are on a vote too to have a Healthā€™ category in the forum but I also feel we need a Type 1 Tag or group too as there are so many varying ways we have to deal with and a lot of categories to deal with!

But we have to start somewhere :slight_smile:

I will share this too what Nickrout wants too!

It Might of already been posted but Iā€™m just sharing!

This is a little of my setup so far and want it to get better in HA now! :slight_smile:
I also love xdrip to be in here too.
But Nightscout is getting Xdrips readings anyway

Nightscout in HA with Auto detection

I do not have it like that not I reduced the size of it due to a new Dashboard.

It can be a bit laggy getting reading on at times not sure why but I think its down to using the URL in HA
Also, the lock on it keeps requesting your secret to get into the setting which I have been told is a bug within Nightscout.

1 Like

Iā€™m setup with Heroku and do it in there, not sure on your setup.

@Thediabeticway getting your nightscout web page into HA doesnā€™t give you sensors. If you want to analyze your data and display it in your own graphs and get it announced you need sensors.

My nightscout is integrated via rest, like this

rest: 
  - resource: https://SECRET-upload-0-guest.t1pal.com/api/v1/entries/current.json
    scan_interval: 150
    sensor:
      - name: Blood Sugar
        value_template: '{{ (value_json[0].sgv/18)|round(1)}}'
        unit_of_measurement: mmol/L
        icon: mdi:diabetes
      - name: "Blood Sugar Delta"
        value_template: '{{ (value_json[0].delta/18)|round(2)}}'
        unit_of_measurement: mmol/L
      - name: Blood Sugar Trend
        value_template: '{{ value_json[0].direction}}'
       

Notes: the nightscout api returns mg/dL, divide by 18 to get mmol/L

The api address will be the address you use in nightscout in your browser

Update interval 2.5 mins (150s) - dexcom reads every 5 minutes. Seems to be often enough for me.

Thanks Nick for this! way.

what do you mean by Sensors? Dexcom Sensors? or another sensor type :slight_smile:

Or are you meaning this one I already have in HA!
Nightscout Intergration

I mean a sensor on home assistant terms. See Sensor - Home Assistant

The code I posted provides the sensors in home assistant ā€œsensor.blood_sugarā€, ā€œsensor.blood_sugar_deltaā€ and ā€œsensor.blood_sugar_trendā€

Once you have these sensors you can further process them, graph them, create a notification for high and low blood sugar, etc.

1 Like