Sleep as Android's Bangle.js wearable integration with Bangle.js 2..? #7217
Replies: 1 comment
-
Posted at 2023-03-22 by Graphity I didn't know about this and my banglejs 2 also doesn't connect. I'm happy to test and support the integration. Posted at 2023-03-22 by digitalcircuit I'm glad to know it's not just me :) My guess is the Sleep as Android app is sending JS code to the Bangle.js 2 watch via the Bangle.js Gadgetbridge app, and expecting some sort of reply (perhaps via Android Intents?) that it doesn't receive. I'll try to look into the Gadgetbridge debugging advice soon. You might be able to find something with it, too? Posted at 2023-03-22 by digitalcircuit UPDATE: fetching Gadgetbridge debug logs, I see… nothing from Sleep as Android in Gadgetbridge's logs. I have my custom code snippet from Tasker successfully shown and parsed, though. Perhaps there's something between Bangle.js Gadgetbridge and Sleep as Android that needs fixed? I do frequently see the following, but I suspect it's unrelated:
Looking at
This matches up with the Sleep as Android Wearable integration API documentation: I git-clone'd the Gadgetbridge source code and searched recursively for Posted at 2023-03-23 by gfric IGNORE THIS (can't delete) Posted at 2023-03-24 by Graphity I use Gadgetbridge in German. For me, when I tap the gear at my BangleJS, there is no "allow 3rd party apps to change settings" or its translation. But I activated (translated by me): "Text as bitmap", "Allow internet access" and "Allow intents" Posted at 2023-07-20 by digitalcircuit Someone has stepped up to work on Sleep as Android support in Gadgetbridge! https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3188 It looks like they are focusing on the Mi Band (based on the PR branch name), but this could potentially be used as the foundation for Bangle.js 2 support, too. Posted at 2023-11-22 by lunctis-viribus I have the same issue. It would be awesome if the Bangle.js2 can integrate with Sleep as Android. Posted at 2024-04-17 by @thyttan Gadgetbridge Sleep As Android integration imminent (Probably. For nightlies at least): https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3687#issuecomment-1765530 Bangle.js sleep sync is in talks also: espruino/BangleApps#3275 Posted at 2024-05-17 by AnotherStranger Hey, I just got hands-on experience and tried implementing the Sleep as Android integration for Banglejs. It was relatively straightforward, but I still need to figure out how to enable or disable my Bangle app from Gadgetbridge. My current solution is:
Posted at 2024-06-23 by digitalcircuit In case anyone missed this, Sleep as Android support will be available soon, courtesy of AnotherStranger (thank you!)…
Posted at 2024-07-06 by user158095 @AnotherStranger Thank you for your efforts and time investment in securing this functionality! I've looked into the implementation and while I get a gist of the changes, I can't figure out how to get the integrations to play nice. As far as I understand, I should get things going through the following setup:
There are new exposed settings in Gadgetbridge that relate to Sleep as Android. Posted at 2024-07-07 by AnotherStranger Hey @user158095, So let me guide you through the setup.
Now for the setup:
Note: For me, "Do Not Disturb" does block the measurements from appearing. Posted at 2024-07-07 by user158095 Alright, I wasn't too far off! :) So, at this point I have an almost completely working setup following this procedure:
Its just something like 2% left for this to be a smash hit! :) I don't really understand why Sleep as Android is behaving differently during a sleep track cycle, compared to sensor testing. It's certainly frustrating, though, but I'll keep pushing some buttons over here and see if I can come up with something. Posted at 2024-07-07 by AnotherStranger By default Sleep as Android Requests Actigraph data every 120 seconds. So it usually takes a few minutes before the first entries are visible in the actigraph. Did you try this? Posted at 2024-07-07 by user158095 I reset Sleep as Android to factory defaults and it looks much better now. It seems to be working fine with DnD enabled as well. Will keep testing it out. Very appreciated, this implementation! Posted at 2024-07-09 by digitalcircuit Setting the "DIY" smartwatch option was the only thing I missed; I mistakenly assumed the "Bangle.js" choice would've worked. No need to disable automatic nighttime DND, no need to reset Sleep as Android to defaults (thankfully due to over 2 years of sleep data gathered via phone). Heart rate monitoring works, too. For my first night, the actigraph data does look.. different than just having my phone next to my pillow (notably, a lot less deep sleep time), but I'll need to try this for longer to get a feel for which might be more accurate. Thanks again! Posted at 2024-07-09 by KTibow This is interesting stuff, for me this is the first time I'll be able to believe a sleep chart. I'm curious as to how HRM will be implemented. I looked at the code and it looks like any HRM data sent from the Health app will be forwarded to Sleep as Android, but after tracking for 20 minutes with the interval set to Always, the HRM graph doesn't show up while the actigraph does. Does anyone else have HRM working? Posted at 2024-07-09 by digitalcircuit Just to check, did you enable "Heart rate monitoring" in the Wearables section of Sleep as Android, too? I think that's the only extra step I took beyond what was mentioned before. I don't know why that's off by default; I almost overlooked it. It does look like it took maybe 20-50 minutes before the first reading in Sleep as Android; maybe there's a delay. Posted at 2024-07-09 by KTibow Yeah, all the switches from on the Bangle to in Gadgetbridge to in Sleep are enabled. I guess I'll see if it's different when I run the full tracking. Posted at 2024-07-13 by digitalcircuit Overall, this is awesome! The Alarm ETA widget on Bangle.js is a nice way to see how much time I have left to sleep if I wake up early, too. However, after some more nights to test, the Bangle.js actigraph data feels like it's less meaningful vs. my phone next to my pillow. So far, Sleep as Android has not detected deep sleep, always triggering the smart wake up alarm at the earliest start time. My phone next to my pillow (2024-7-2): Wearing Bangle.js 2 (2024-7-9): I wonder if there's a difference in how Bangle.js 2 reports accelerometer data..? At a glance, the Posted at 2024-07-28 by AnotherStranger Hey there, Posted at 2024-11-18 by girardcarillo Thanks a lot for this explanation, very useful. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2023-03-03 by digitalcircuit
Has anyone used the Sleep as Android app with their Bangle.js 2 (not v1)?
In Sleep as Android's
Settings
→Sleep tracking
→Wearables
→Use wearable
section, there's an option forBangle.js
. If you don't have the Bangle.js Gadgetbridge installed, it'll direct you to the Play Store to get it. Otherwise, when testing, it waits to connect to my Bangle.js 2… and does nothing. I have all the Gadgetbridge and Bangle programming/intents/etc features enabled, and I've confirmed that I can send JavaScript code via Tasker (to auto-toggle Quiet mode).I'm guessing Sleep as Android's integration was written for the Bangle.js v1 since it doesn't mention heart-rate monitoring, and the v2 hardware/firmware may be different enough to break it.
I did reach out to Sleep as Android's support, and apparently it's a third party integration:
I'd be happy to try debugging this, but I figured I'd get an idea of what others know first.
Aside, I know Bangle.js 2 has a self-contained sleep phase alarm/tracking app. However, I have over 2 years of sleep data in Sleep as Android and I've integrated it into my routine (controls bedroom lights/music, activates different modes on my phone, etc). Installing the sleep phase alarm app didn't seem to make this work, either.
Beta Was this translation helpful? Give feedback.
All reactions