Avatar for Guptilious

Guptilious

Member since May 2024 • Last active Sep 2024
  • 5 conversations
  • 11 comments

Most recent activity

  • in Bangle.js
    Avatar for Guptilious

    Thanks for the suggestions. Personally wasn't able to locate the blind using the NRF Connect but I guess that also would have limited me to only controlling 1 blind vs all the old ones also. I was thinking I may have to do something to pick up the signals from the remote control and then set up some sort of device to send the same to the blinds based on a watch command going to it. Certaining annoying and more tricky than I was expecting.

    I realised on the back of the remote it lists a remote frequency of 433.92 MHz that it states to use (similar remote examples - https://www.aliexpress.us/item/3256806033231133.html?gatewayAdapt=glo2usa4itemAdapt#nav-specification https://smart-rollos.de/en/product/handsender-bf-315-fuer-24v-rolloantrieb/). But I'm guessing that doesn't matter and it's all about picking up the signals being sent by the button presses?

    Based on the above I guess I'm working with an RF remote (from googling around) and by switching devices, you're just sending different codes which in term targets different devices. I was thinking to pull this off using the puckJS - mostly so I don't require a board to be wired up and powered all the time. It would also be discreet and allow me to bluetooth to it using my bangleJS watch, when I enter a room. But I'm not sure if the puckJS could also pull something like this off (I've seen from your videos it might have been able to do this if it was IR).

    (Speaking as someone who has never done any board or signal work, so my comments are coming from a place of complete ignorance).

    edited

  • in Bangle.js
    Avatar for Guptilious

    The home I'm in currently has smart blinds installed.

    The upstairs blinds come with a remote that allows you to roll the blind up/down, pause and switch between blind numbers or 'all'. There are also multiple remotes and there isn't 1 that works on all of them.

    The downstairs blinds are slightly newer and have the same remote but also have a mobile app (tuiss) that allows you to schedule when you'd like the blinds to go up and down, as well as see battery levels etc. The app requires me to switch on my phones bluetooth, but I'd imagine the remotes send their own signal (got no experience here so guessing).

    As the upstairs blinds don't allow the use of this app, I want to find a way to define and send these signals myself.

    I was hoping to create a watch app, that allows me to send a signal to the blinds (regardless of which one), to raise and lower them - as well as set a schedule for them to open and close, even when the watch isn't around. Creating the watch app is fine but I'm not sure about the signal sending part or how to do this 'neatly'.

    I'm assuming I will need some other component boards or something to be involved (as I'd image the older blinds don't have some bluetooth detector like the newer blinds do) but I've got no real idea where to start with something like this. So hoping some smarter people here might be able to offer some beginner guidance on where to start or videos to check out that will get me going. Ideally I'd be aiming for any other components to be discrete but I'll work with what's doable.

    Also attached some photos of the blind motor things and the remote, if that is of any help. Blue blind is the newer model

    Thanks in advance for any guidance people may be able to give.

  • in Bangle.js
    Avatar for Guptilious

    thanks for the suggestions! Will have a look through each and figure out which to use, so I can finish this off :)

  • in Bangle.js
    Avatar for Guptilious

    I'm nearly finished with an app I've been working on, that allows my bangle JS to work as a TV remote control. I was thinking of learning how to create a mobile app (so the https requests from the watch can go directly to the TV via the app) however for now, I have a node webserver on an rpi and send the https request to that - which then sends commands to the TV.

    In order to do this the bangle JS currently has my webservers IP and my login/password for the https server, included as variables inside the code. I obviously can't publish it with my variables but I'm unsure what the best approach here is, if we want to 'generalise' the code, so anyone can then assign their own variables.

    I was thinking to comment in the project that you need to write a file to your watch that the code could then reference but wasn't sure if that's the easiest thing to do, to make things generalised for users.

    Can someone confirm what the best/easiest approach would be for users to be able to assign their values? Alternatively I could draw some terrible keyboard screen so people can spend 10 minutes typing things in on the watch, but something tells me people won't appreciate that :)

  • in Bangle.js
    Avatar for Guptilious

    @Gordon ah that makes more sense. Still getting my head around the promises and returns. Clearly wasn't thinking about the http request as it's own function that can be returned in the same line.

    Thanks for the help :)

  • in Bangle.js
    Avatar for Guptilious

    I'm currently working on getting my bangle js to send a post request to a webserver and then after a period of time, submit a get request to the webserver, to the retreive the result the first post would cause.

    I've tried running a test script to confirm the watch is picking up the get data but I can't get it to display the output onto the screen.

    Below is the test script I'm running which I believe should work. Also I've added the getabridge debud logs which (as I understand them) confirm I am at least getting the data from the 'get' request.

    Is there an issue with my code approach to getting the output to return correctly, or is there something else I may have missed in the documentation that I need to be doing?

    Apologies if it's something to do with the Promie resolution. Still trying to get my head around async functions.

    const credentials = btoa(`${username}:${password}`);
    
    function getPost() {
      return new Promise((resolve, reject) => {
        Bangle.http(
          serverUrl,
          {
            method: 'GET',
            headers: {
            'Authorization': `Basic ${credentials}`
          }
        }, (err, response) => {
          if (err) {
            console.error("Error received:", err);
            reject(err);
          } else {
            console.log("Response received:", response);
            resolve(response);
          }
        });
      });
    }
    
    function swipeHandler(LR, UD) {
      if (LR === -1) {
    
        getPost().then(response => {
          g.clearRect(0, 0, g.getWidth(), g.getHeight()); 
          g.setFont('Vector', 20);
          g.drawString(response, 10, 40); 
    
        }).catch(error => {
          console.error("Error handling swipe:", error);
          g.clearRect(0, 0, g.getWidth(), g.getHeight()); 
          g.setFont('Vector', 20);
          g.drawString("fail", 10, 40); 
        });
    
      }
    }
    
    Bangle.on('swipe', swipeHandler);
    

    {"t":"http","url":"https://url.co.uk","id":"18650623373","method":"GET","headers":{"Authorization":"Basic
    "}}

    ================================================ SENDING ^PGB({"t":"http","id":"18650623373","resp":"data received"})

    ================================================

Actions