-
-
Hi. I was thinking it would be nice if the Bangle could advertise it's battery level (so Home Assistant can remind to charge it, for example).
Does anything like this exist? Is a widget the right way to do it? Something like this works for me.
(() => { function advertiseBattery() { NRF.setAdvertising([ {0x180F : [E.getBattery()]}, ]); } setInterval(advertiseBattery, 60 * 1000); advertiseBattery(); // add your widget WIDGETS["ble_battery_service"]={ area:"tl", // tl (top left), tr (top right), bl (bottom left), br (bottom right) width: 0, // how wide is the widget? You can change this and call Bangle.drawWidgets() to re-layout draw: function() {} // called to draw the widget }; })()
I'll open a PR if this is sensible. Thanks.
-
Thanks! It looks like the code is basically the same as your previous tutorial then. https://www.espruino.com/BLE+Lightbulbs
I haven't got the Hue bulbs either, but I'm just trying to work out which one I should get next. I was thinking I might try Bluetooth just so I don't have yet another Wifi device on the network.
A Bangle JS app is a good idea, but I would probably want to use EspruinoHub to control the bulb via MQTT from Home Assistant.Those Awox bulbs that you used in your tutorial don't really seem to be available in the UK.
It looks like the Bluetooth bulbs that are currently available are:- Philips Hue
- Veho (TP-Link) Kasa
- Philips Hue
-
-
-
-
-
This issue is related: https://github.com/espruino/EspruinoHub/issues/16
-
-
-
Hi @Gordon.
What's up with the whole "Web Bluetooth only works over HTTPS" thing? Obviously that totally sux for development, as people have to develop straight on Github.
I was thinking that there must be a way to develop locally, so I was planning on making a Docker image with a web server that creates a self-signed certificate, to see if that works.
I initially tried it over plain HTTP though and I was surprised that I could connect to my Bangle.Is that expected? What would you expect to not work?
Where does it say that Web Bluetooth only works over HTTPS? From my small amount of duckduckgoing, I can only find that you said it once in a workshop that you did... :SI think if people were able to just clone the repo and run it locally it would make things way simpler.
Thanks.
-
-
Hi. I've got an idea to improve one of the current apps, but I'm not really sure what process is.
Do I just open a PR?
Do I open an issue first?
Do I need to discuss with the original developer or, once their app is added, do they not have any more say than anyone else?Is it ultimatly down to @Gordon if my changes are approved?
Thanks.
-
-
-
-
-
-
Hi. I want to publish an MQTT message with the
retain
flag, but from looking at the docs and code, it seems like it isn't supported. Is that correct?I was going to open an issue in the repository, but I couldn't find where the source code for https://www.espruino.com/modules/MQTT.js is.
Thanks.
-
-
Yeah. The module defines a
class
. Is that the problem? I thought support for classes was added a couple of versions ago?Ahh. "Module minification" was switched to "Esprima". I've changed it to "No minification" and it works now.
It would have been nice if the error message included a bit more information. eg Saying that it was line 2 of the module file. Is that possible?
Thanks.
-
-
The error occurs when I click the button to send to Espruino in the IDE. I get a red popup message over the left-hand pane.
I'm using the Chrome extension in this instance, if it makes a difference.
@Gordon I don't think I'm using any fancy new features, but I'll check that.
This was added as boot code: https://github.com/espruino/BangleApps/pull/542