• 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
  • P
    psysak

    Hey guys, just wanted to let you know that I will be moving on from my current role and as such I wanted to thank you for all the help you've provided me over the last couple years. You've taken the time to answer all my questions even when many of them were probably way too basic and I appreciate that greatly. Mango has a pretty high learning curve to make it do some of the things I needed it to but the support you provided me makes up for that in spades. You may see a colleague of mine in here at some point in the future or you may hear from the company about some engineering services but I can't know for sure.

    I'm not leaving the industry so it's possible I may be back but for now thank you and good luck in the future.

    By the way, when is 3.6 due out?

    posted in User help read more
  • P
    psysak

    Just curious, if I use an alpha point to store something akin to csv data can an excel report do anything with that and is it possible to somehow do any math on the data in there?

    For example lets say I store something like

    1,2,3,4 - timestamp:xxx
    4,3,2,1 - timestamp:other_xxx

    Can any math be done on the individual "columns"?

    posted in User help read more