Save
Saving
  • P psysak

    You ever find a way? I have the same issue right now.

    posted in MangoES Hardware read more
  • P psysak

    Hey, quick question. Does anyone know how to configure multistate points for use with bacnet publisher? I setup a virtual point and wanted to publish it via bacnet multistate but it doesn't work, I get errors saying inconsistent-configuration.

    posted in User help read more
  • P psysak

    Works like a charm.

    posted in User help read more
  • P psysak

    Have you guys ever implemented something like fail2ban on a mango server? I think my mango got taken down by something scanning it aggressively

    posted in User help read more
  • P psysak

    Sorry @phildunlap you're right I missed details. Yes it was just a string which stores the variable name of a context object.
    So can you set on a this[serial]? I'll try it later

    posted in User help read more
  • P psysak

    So I dug around in the forum a bit and for now I think I'm going to do a pointquery for the xid and then set from there :)

    posted in User help read more
  • P psysak

    Hey @MattFox thanks for the response.

    Hmm. So what I'm doing is trying to substitute serial with a string from the api call, and that string is supposed to be the same name as the "Variable Name" of a point I created in that scripting DS. I noticed that if I hard code a value of serial so for example

    serial = 123456789;
    

    Where 123456789 is an existing data point with that Variable Name, if I print serial it is an object. So I assume the issue is that I get a string back from the API and then I'm trying to substitute that for serial and call .set() on it. This is not a reference to the data point right?

    posted in User help read more
  • P psysak

    OK laaast question :)

    I've created this in a scripting source

    function getRequest(_id, serial) {
        // This portion is the part which actually retreives the data from api
        HttpBuilder.get("https://thisisadomain/api/v2/sensors/" + _id + "/analyses/timeseries?dateRequest=dtd&units=l&resolution=h", headers, parameters).err(function(status, headers, content) {
          throw "Script failed with HTTP status: " + status;
        }).resp(function(status, headers, content) { 
           // Needs to be 200 status or you can set the accepted statuses
           // If all is well then call the parsing function and pass the JSON to it
           //print(content);
           match = RegExp(regex).exec(content);
           //print(match[1]);
           serial.set(match[1]);
        }).execute();
    }
    

    Ignoring that there is clearly other parts missing which I didn't paste here, my question revolves around the line

    serial.set();
    

    I should have known that doesn't work because serial is not a variable name, but I want to someone use serial to point to the correct variable in the data source. Basically, I am passing a serial and id number to this function which calls an api passing the id to it which in turn returns a value, I regex that value and want to set a variable with the "Variable Name" of serial. I have created these variables in the DS prior to this. How do I get that reference to the point so I can run set on it?

    posted in User help read more
  • P psysak

    Just curious if it's possible to add a token to the ds?

    posted in User help read more
  • P psysak

    @phildunlap said in Thank you to everyone for the help:

    The versatility of Mango could lead you back to it even if you find yourself in another industry, or perhaps even tinkering with home automation systems, and you'll be welcomed back should it!

    Absolute fact, I'll most likely do some stuff around the house with it. The melding of the old school controls world with modern API's, web based stuff etc is pretty impressive and powerful!

    I'll be working a lot with Haystack in my next adventure so if there's some opportunity to bring Mango into the fold I will do what I can to make that happen.

    posted in User help read more