(Bangle2) I need help with updating / getting my data without a phone (step count, sleep data, sync time) #7893
-
|
I have EspruinoHub running on a Pi4, I can see my watch, but the only advertised data is battery and rssi. I don't really use the watch anywhere near its potential because I just don't want to use gadgetbridge. I don't like it, can't explain why I just don't like the way it works. I would rather the watch sync its data to the Pi. I also notice a decent time drift over a week or so, so I've just had to manually connect it to the app loader when I notice, but that's annoying. I'm self-taught with JS, I've been writing it for 20 years, but I feel like a newborn baby when I look at the code on this watch. It's probably me, I'm old and it took me a while to get used to server-side javascript, I'm sure embedded JS just has its own learning curve. Is there a way to set up my Pi with EspruinoHub to try to connect to the watch every, say, 30 minutes. Sync the time, get the latest sleep/step data, then disconnect? Alternatively, would this be more easily accomplished on the watch itself, like advertising the step count? Seems like that'd be hard with sleep data, the BLE range is just about where I sleep, so connection is intermittent. I feel like advertising isn't the right option for syncing sleep data. I also have Node-RED on the Pi, and plenty of ways of getting data to Home Assistant, so to keep it simple I'd like to start with just trying to connect and read the data from the Pi, I just don't know how to do that with this watch. Update: I've spent the last few hours simply trying to connect to the watch, using EspruinoHub and gatttool. It seems like the watch is just refusing to connect that way, but it will connect perfectly happily to the IDE or the app loader. I had my phone connected and I guess I must have paired it at some point in the past, but I don't get why it can connect to the IDE no problem. Below is the start of my config.json, with the mac of my watch: But on the status page it shows up like this: However, the mqtt messages are "/ble/advertise/Bangle" |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Check https://www.espruino.com/Interfacing and search for bluepy_uart.py |
Beta Was this translation helpful? Give feedback.
-
|
If you're trying to get your data into Home Assistant I'd strongly recommend using BTHome: https://www.espruino.com/BTHome It's like someone took EspruinoHub and built it right into Home Assistant - you just have to format the data that the Bangle outputs in the correct way, and there are already some Bangle.js apps which handle this which you could extend with extra data: https://banglejs.com/apps/?q=bthome Personally, I'd say that's the best bet for sending sleep data for instance. If the Bluetooth range isn't there, I'd spend $5 on an ESP32 board and run esphome on it (https://esphome.io/) - it's a very easy install that can be done from the browser, and it extends the Bluetooth range of Home Assistant so is good for loads of things. ... but for actually sending stuff to the Bangle, as @nxdefiant says I'd look at https://www.espruino.com/Interfacing and maybe have some script on the Pi that runs at some point when you know the Bangle is in range, and updates what you need to update. Bangle.js stores health data every 10 minutes, so you could in theory just read that to sync it every day even without the BTHome stuff. I'd love to add an Espruino plugin to Home Assistant to allow two-way comms, but unfortunately it's quite a steep learning curve :( |
Beta Was this translation helpful? Give feedback.
If you're trying to get your data into Home Assistant I'd strongly recommend using BTHome: https://www.espruino.com/BTHome
It's like someone took EspruinoHub and built it right into Home Assistant - you just have to format the data that the Bangle outputs in the correct way, and there are already some Bangle.js apps which handle this which you could extend with extra data: https://banglejs.com/apps/?q=bthome
Personally, I'd say that's the best bet for sending sleep data for instance. If the Bluetooth range isn't there, I'd spend $5 on an ESP32 board and run esphome on it (https://esphome.io/) - it's a very easy install that can be done from the browser, and it extends the Bluetooth range …