FreeStyle Libre 2

Yes, It was 7.2 at that time but it was not updated after that at all. Do you think, I have to create these flows again?

Maybe you messed up something in the flow, delete the flow (keep helpers, they look ok) and try import flow again.

So Uh, did it work?

I tried again with new flow today but still the same.
image
this one is correct, right?

Sorry, can’t see why it wouldn’t work, the only explanation that sounds reasonable is, that I’m on a newer api version and you’re still on the old, can you try the original flow as posted above?
This one:

[{"id":"1d53e8e8cb49d6ee","type":"tab","label":"Libre","disabled":false,"info":"","env":[]},{"id":"3f93eda1ef013b57","type":"http request","z":"1d53e8e8cb49d6ee","name":"Libre Link Auth API Call","method":"POST","ret":"obj","paytoqs":"ignore","url":"https://api-au.libreview.io/llu/auth/login","tls":"5f0b28b1aaa052cb","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Pragma","valueType":"other","valueValue":"no-cache"},{"keyType":"other","keyValue":"Version","valueType":"other","valueValue":"4.7.0"},{"keyType":"other","keyValue":"product","valueType":"other","valueValue":"llu.ios"},{"keyType":"other","keyValue":"Cache-Control","valueType":"other","valueValue":"no-cache"},{"keyType":"other","keyValue":"Accept-Language","valueType":"other","valueValue":"en-AU,en;q=0.9"},{"keyType":"other","keyValue":"Content-Type","valueType":"other","valueValue":"application/json"}],"x":690,"y":40,"wires":[["6e74824d3048d6c2"]]},{"id":"d682318c.36823","type":"debug","z":"1d53e8e8cb49d6ee","name":"Connection Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":570,"y":200,"wires":[]},{"id":"ef169e174831491a","type":"http request","z":"1d53e8e8cb49d6ee","name":"Libre Link Connections API Call","method":"GET","ret":"obj","paytoqs":"query","url":"https://api-au.libreview.io/llu/connections","tls":"5f0b28b1aaa052cb","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Pragma","valueType":"other","valueValue":"no-cache"},{"keyType":"other","keyValue":"Version","valueType":"other","valueValue":"4.7.0"},{"keyType":"other","keyValue":"product","valueType":"other","valueValue":"llu.ios"},{"keyType":"other","keyValue":"Cache-Control","valueType":"other","valueValue":"no-cache"},{"keyType":"other","keyValue":"Accept-Language","valueType":"other","valueValue":"en-AU,en;q=0.9"},{"keyType":"other","keyValue":"Content-Type","valueType":"other","valueValue":"application/json"},{"keyType":"other","keyValue":"Authorization","valueType":"msg","valueValue":"token"}],"x":210,"y":200,"wires":[["d682318c.36823","4af54317f78a2c03","0641052c53bdd52a","3c263e5bfcb22e4a"]]},{"id":"6e74824d3048d6c2","type":"function","z":"1d53e8e8cb49d6ee","name":"Convert Token to Bearer token","func":"\n// Assuming you have a variable named 'token'\nvar token = msg.payload.data.authTicket.token; // Replace 'msg.payload.token' with the actual path to your token variable\n\n// Prepend 'Bearer ' to the token\nvar bearerToken = 'Bearer ' + token;\n\n// Update the message payload with the new bearer token\nmsg.token = bearerToken;\n\n// Return the modified message object\nreturn msg;\n\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":120,"wires":[["ef169e174831491a"]]},{"id":"b84131edd60d5143","type":"api-call-service","z":"1d53e8e8cb49d6ee","name":"Update Name BGL","server":"f5d6c7d4.360698","version":5,"debugenabled":false,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.Name_bgl"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":810,"y":260,"wires":[[]]},{"id":"4af54317f78a2c03","type":"function","z":"1d53e8e8cb49d6ee","name":"Convert BGL Payload","func":"// Check if msg.payload.data[0] and msg.payload.data[0].glucoseMeasurement exist\nif (\n    msg.payload &&\n    msg.payload.data &&\n    msg.payload.data[0] &&\n    msg.payload.data[0].glucoseMeasurement\n) {\n    // Access the Value property\n    var bgl = msg.payload.data[0].glucoseMeasurement.Value;\n\n    // Assign the value to msg.bgl\n//    msg.payload.bgl = bgl;\n//    msg.payload = '';\n    msg.payload.data.shift();\n    msg.payload.data.value = bgl;\n} else {\n    // Handle the case where the necessary properties are not present\n    console.error(\n        \"Missing properties in msg.payload.data. Unable to set msg.bgl.\"\n    );\n}\n\nreturn msg;\n\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":260,"wires":[["b84131edd60d5143"]]},{"id":"0df0514713297b08","type":"inject","z":"1d53e8e8cb49d6ee","name":"Start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":90,"y":120,"wires":[["0730b4d04dd91244"]]},{"id":"95e0a95020a138f1","type":"cron","z":"1d53e8e8cb49d6ee","name":"Start Every 5 Mins","crontab":"*/5 * * * *","x":130,"y":40,"wires":[["0730b4d04dd91244"]]},{"id":"381d6fd4e0855b9b","type":"api-call-service","z":"1d53e8e8cb49d6ee","name":"Update Name BGL Trend Arrow","server":"f5d6c7d4.360698","version":5,"debugenabled":false,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.Name_bgl_trend_arrow"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":850,"y":320,"wires":[[]]},{"id":"0641052c53bdd52a","type":"function","z":"1d53e8e8cb49d6ee","name":"Convert BGL Payload","func":"// Check if msg.payload.data[0] and msg.payload.data[0].glucoseMeasurement exist\nif (\n    msg.payload &&\n    msg.payload.data &&\n    msg.payload.data[0] &&\n    msg.payload.data[0].glucoseMeasurement\n) {\n    // Access the Value property\n    var trendarrow = msg.payload.data[0].glucoseMeasurement.TrendArrow;\n    msg.payload.data.shift();\n    msg.payload.data.value = trendarrow;\n} else {\n    // Handle the case where the necessary properties are not present\n    console.error(\n        \"Missing properties in msg.payload.data. Unable to set msg.payload.\"\n    );\n}\n\nreturn msg;\n\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":320,"wires":[["381d6fd4e0855b9b"]]},{"id":"e1a1c0781889539f","type":"api-call-service","z":"1d53e8e8cb49d6ee","name":"Update Name Sensor Serial Number","server":"f5d6c7d4.360698","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.Name_libre_sensor_serial_number"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":860,"y":380,"wires":[[]]},{"id":"3c263e5bfcb22e4a","type":"function","z":"1d53e8e8cb49d6ee","name":"Convert Sensor Serial Number","func":"// Check if msg.payload.data[0] and msg.payload.data[0].glucoseMeasurement exist\nif (\n    msg.payload &&\n    msg.payload.data &&\n    msg.payload.data[0] &&\n    msg.payload.data[0].glucoseMeasurement\n) {\n    // Access the Value property\n    var sensorsn = msg.payload.data[0].sensor.sn;\n    msg.payload.data.shift();\n    msg.payload.data.value = sensorsn;\n} else {\n    // Handle the case where the necessary properties are not present\n    console.error(\n        \"Missing properties in msg.payload.data. Unable to set msg.payload.\"\n    );\n}\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":380,"wires":[["e1a1c0781889539f"]]},{"id":"0730b4d04dd91244","type":"function","z":"1d53e8e8cb49d6ee","name":"Get Libre Link Credentials","func":"var libreuser = global.get('libre_link_user');\nvar librepass = global.get('libre_link_pass');\n// Create or modify the JSON body\nvar jsonBody = {\n    email: libreuser,\n    password: librepass\n};\n\n// Set the modified JSON as the output\nmsg.payload = jsonBody;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":40,"wires":[["3f93eda1ef013b57"]]},{"id":"5f0b28b1aaa052cb","type":"tls-config","name":"TLS","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false,"alpnprotocol":""},{"id":"f5d6c7d4.360698","type":"server","name":"Home Assistant HA1","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

The warning raised in the debug means that the payload comming back from the API is different than the one I get.

Still the same.
image

Sorry, unable to help without access to your HA. I’d need to look at the payloads
 maybe someone else will have some idea.

Perhaps the original author of the flow.

This one works: GitHub - gillesvs/librelink: Librelink integration for Home Assistant

1 Like

Thanks Stu1!!! I didn’t know it existed! :slight_smile:

ok I was just thinking about integrating this for my fiancé, thank you so much for posting this as this will make this easy to use!

Possibilities to set up for a diabetic who wears an Apple Watch.

  • Display current BGL on an Apple Watch using the BGL sensor reading data via a HA Apple Watch complication (Apple restrict this to 15 min updates),
  • Persistently ‘nudge’ during daylight hours using HA notifications (trigger a HA automation every 10 mins, condition of after sunrise before sunset) when the sensor patch loses signal (time since last reading),
  • Persistently ‘nudge’ during daylight hours using HA notifications (trigger a HA automation every 15mins) when BGL readings are Hi or Lo.
1 Like

Just noticed this thread. Some feedback. I have had this running for more than a year. Make sure you check the age of the sensor_local_time & last_protocol_timestamp. I had scenarios where my dashboards wernt updating. This was caused by the sensor auto update to the phone not working properly. The sensor is not great in noisy environments. I have my dashboard warning for stale data if the update is more than a few mins old. Just a good safety precaution!.