• N
    Nurr

    Hello!

    We are using "evt.context.pointEventDetector.xid " to get the xid of an event. Also, we want to use default message (which is shown on event view.). Is that possible to get event default message like xid? If possible, can you please share the format?

    0_1583393524007_5f085b4d-5b7c-44b7-9ee3-1e6418b51698-image.png

    //to get event xid :   
    var parameter = evt.context.pointEventDetector.xid;
    
    //Thanks a lot

    posted in How-To read more
  • N
    Nurr

    Hi Everyone!

    We would like to add point properties such as point tags to event table as a column. Is there any way to do that?

    0_1583412474036_156adc71-35ed-4a2e-a9ef-b1d493e21a96-image.png

    Cheers,

    posted in How-To read more
  • N
    Nurr

    Dear All,

    We are using the function below in set point event handler, and having problem viewing the unit of "°C". Other units such as %, C or A seems very well.

    The message in event list is "Datasource1 - Point1 has exceeded 50 °C", but when we use in script it seems like "Datasource1 - Point1 has exceeded 50 ?"
    How we can fix this?

    var message = evt.messageString;
    

    Thanks in advance!!

    posted in Scripting general Discussion read more
  • N
    Nurr

    Hello,

    I will collect data via API for our project. I would like to get the readValue of each device but I couldn't find the way to get it. Because I am very new at javascript and API environment.

    The Data API format is shown below. In order to get data, I have tried 2 different methods:

    Method 1:
    I have added HTTP retriever datasource and added a point. Then I get an error.

    Is there any suggestion, what is the best way/datasource to get this data?
    How do we enter authorization info (basic, bearer etc.) to http datasources?

    HTTP retriever url: http://10.35.173.145:84/api/Lin
    Point Value RegEx: .readValue":(\d+).(?=."deviceName":"PDU-24A-42F11".).
    Error: Invalid response from "http://10.35.173.145:84/api/Lin": 401

    //url: http://10.35.173.145:84/api/Lin
    // Bearer Auth code: eyJhbGciOiJIUzI1NiIsInR5
    {
        "lastUpdate": "2020-06-10T10:52:39.8352606+03:00",
        "result": [
            {
                "deviceId": 27,
                "deviceName": "PDU-24A-42F11",
                "room": "DC_KAR",
                "row": "M_KAR",
                "location": "SOL",
                "tagId": 20987,
                "tagName": "Voltage",
                "unit": "V",
                "readDate": "2020-06-10T10:51:45",
                "readValue": 228.87
            },
            {
                "deviceId": 33,
                "deviceName": "PDU-23B-7F1",
                "room": "DC_KAR",
                "row": "M_KAR",
                "location": "SOL",
                "tagId": 21155,
                "tagName": "Voltage",
                "unit": "V",
                "readDate": "2020-06-10T10:52:23",
                "readValue": 228.97
            },
            {
                "deviceId": 34,
                "deviceName": "PDU-23B-29F11",
                "room": "DC_KAR",
                "row": "M_KAR",
                "location": "SOL",
                "tagId": 21183,
                "tagName": "Voltage",
                "unit": "V",
                "readDate": "2020-06-10T10:51:31",
                "readValue": 228.97
            },
            {
                "deviceId": 35,
                "deviceName": "PDU-23B-25F11",
                "room": "DC_KAR",
                "row": "M_KAR",
                "location": "SOL",
                "tagId": 21211,
                "tagName": "Voltage",
                "unit": "V",
                "readDate": "2020-06-10T10:51:00",
                "readValue": 228.87
            },
            {
                "deviceId": 42,
                "deviceName": "PDU-23B-33F11",
                "room": "DC_KAR",
                "row": "M_KAR",
                "location": "SOL",
                "tagId": 21327,
                "tagName": "Voltage",
                "unit": "V",
                "readDate": "2020-06-10T10:51:34",
                "readValue": 228.97
            },
            {
                "deviceId": 30,
                "deviceName": "PDU-23B-38F11",
                "room": "DC_KAR",
                "row": "M_KAR",
                "location": "SOL",
                "tagId": 21071,
                "tagName": "Voltage",
                "unit": "V",
                "readDate": "2020-06-10T10:52:30",
                "readValue": 228.89999
            }
    }
    

    Method 2:
    I have added a global script shown below. When I print the content, I see the data. But I cannot get the read value of device. How can I get it?

    function linye(message) {
      
         HttpBuilder.request({
        	path: "http://10.35.173.145:84/api/Lin",
        	method: "GET",
        	headers: {
        	    ContentType : "application/json",
                Authorization : "Bearer eyJhbGciOiJIUzI1NiIsInR5",
        	},
    
        	err: function(status, headers, content) { //errorCallback for linguistic completion
        		throw "Request got bad response: " + status+content;
        	},
        	resp: function(status, headers, content) { //responseCallback
        	    
        		return true; //will print in wrapping print()
        	},
        	excp: function(exception) { //exceptionCallback
        		throw exception.getMessage();
        	}
        })
    }
    

    Thanks in advance!

    posted in How-To read more
  • N
    Nurr

    Hello!

    I am trying to use /events/data-point-summaries API function which is shown in swagger. I could not get a response.
    The code used is shown below.

    How should I use /events/data-point-summaries API to get a successful response?

    Thanks!

    
    var eventsum = HttpBuilder.request({
        path: "http://localhost:8080/rest/v2/events/data-point-summaries",
        method: "POST",
        headers: {
            "Host": "10.167.35.76:8080",
          "Accept": "application/json, text/plain",
            "Content-Type": "application/json;charset=UTF-8",
            "Authorization":
                "Bearer+"token,
        },
        parameters:{
            "xids":[
              "DP_a638a144-5b1d-45c7-bcb1-b89097cbb08a",
              "DP_a7e64a32-8229-4909-95e3-a992208382c4"
            ]},
        err: function (status, headers, content) {
            throw "Request got bad response: " + status;
        },
        resp: function (status, headers, content) {
            return JSON.parse(content);
        },
    });
    

    posted in How-To read more
  • N
    Nurr

    Hello All!

    We faced with error 1 while configuration import.

    Steps we have done is shown below.

    1. Open Configuration import/export page
    2. Select Event Handlers
    3. Click Export
    4. Click Import, without any change
    5. Then, Error 1 is seen on the screen.

    When we check the event handler, which gives an error, in the event handlers import JSON file, we see that some detectorsXID and dataPointXID is null shown like below.

    For Situation 1 , we have defined an event detector to the point "DP_74d73b67-41d1-49c1-a0fc-1b29d6921bb3" and selected the event handler for this event detector. After that, we directly deleted the event detector. Although we deleted the event detector, the point is seen as below in the event handler JSON export.

    For Situation2, we deleted point which has an event detector that we selected an event handler. Although we deleted point, the point is seen as below in the event handler JSON export.

    We solved the problem by deleting objects with null properties. How we can prevent from this problem, not to have the problem again?

    //Situation 1
            {
              "sourceType": "DATA_POINT",
              "dataPointXID": "DP_74d73b67-41d1-49c1-a0fc-1b29d6921bb3",
              "detectorXID": null
            },
    //Situation 2
            {
              "sourceType": "DATA_POINT",
              "dataPointXID": null,
              "detectorXID": null
            },
    

    Error 1:
    Event handler 'EH_086295d6-da94-4714-b350-3104832ca77e': saved
    Event handler 'EH_20bb44aa-cc63-417d-9781-92934af4b6ff': saved
    Event handler 'EH_d290da12-b346-4d0f-99fc-9dbfa160ab7a': Event type must have a 'detectorXID'
    Event handler 'EH_8ca1bc17-18b9-4ec1-a92e-0f94c9f35a7b': Event type must have a 'detectorXID'
    Event handler 'EH_33742af8-5d69-435f-8d2d-1493e91aa2dd': Event type must have a 'dataPointXID'
    Event handler 'EH_f0ff4774-bc57-4612-b3e5-b6fdaf151fa9': Event type must have a 'detectorXID'
    Event handler 'EH_1fb091b1-ea9a-4092-8172-799f677676e0': Event type must have a 'detectorXID'
    Event handler 'EH_a89c16f2-336a-438e-a8dd-58ca2fefd86d': Event type must have a 'dataPointXID'

    Thanks a lot!

    posted in Mango feedback read more
  • N
    Nurr

    Hi All,

    We need to create an HTTP JSON endpoint for JSON data which will be posted by another system. The example data is shown below and we will get "isAlarm" value for each alarm of each device.
    For this purpose, we are planning to use HTTP JSON Receiver data source. Can we use this data source to create an endpoint? What is your suggestion?

    We could not found proper documentation for Http JSON Receiver Datasource and datapoint. Can you please show us how to create Http JSON Receiver Datasource and datapoint?

    Data Example:
    {
    "lastUpdate": "2020-08-05T13:53:22.2211582+03:00",
    "devices": [
    {
    "deviceId": 1306,
    "deviceName": "GBZ_SOL4_4.17_K",
    "room": "SOL-4",
    "row": "4.Sıra",
    "rack": "17.Kabinet",
    "isEnabled": true,
    "isDisconnected": false,
    "deviceModel": "ExagatePDU",
    "tags": [
    {
    "tagId": 20987,
    "tagName": "Voltage",
    "unit": "V",
    "readDate": "2020-08-05T18:32:04",
    "readValue": 229.07001,
    "isCritical": false,
    "isAlarm": false
    },
    {
    "tagId": 20356,
    "tagName": "Current",
    "unit": "A",
    "readDate": "2020-08-05T18:33:24",
    "readValue": 0.42,
    "isCritical": false,
    "isAlarm": false
    },
    {
    "tagId": 21342,
    "tagName": "P",
    "unit": "kW",
    "readDate": "2020-08-05T18:33:35",
    "readValue": 0.174,
    "isCritical": false,
    "isAlarm": false
    }
    ]
    }
    ]
    }

    Thanks in advance,

    posted in User help read more
  • N
    Nurr

    Dear All,

    We can download CSV export of events from the "Events" page. We would like to see just some of the columns in the export. Is that possible to edit the format of events CSV export?

    Thanks in advance,

    posted in User help read more
  • N
    Nurr

    Dear All,

    What processes should be working while Mango is running?

    Thanks!

    posted in Mango Automation Installation read more
  • N
    Nurr

    Dear All,

    We would like to run Mango with https instead of http. We have tried steps on the Mango Documentation ( https://docs-v3.mango-os.com/installation-configuration/#ssl-properties ) and restart Mango then get an error as below.

    What should we do to run Mango with https?

    WARN  2020-09-16T09:19:45,659 (com.serotonin.m2m2.Lifecycle.webServerInitialize:975) - ALPN is enabled in env.properties but couldn't be loaded: No Server ALPNProcessors!
    java.lang.IllegalStateException: No Server ALPNProcessors!
            at org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory.<init>(ALPNServerConnectionFactory.java:52) ~[jetty-alpn-server-9.4.23.v20191118.jar:9.4.23.v20191118]
            at com.serotonin.m2m2.Lifecycle.webServerInitialize(Lifecycle.java:973) ~[ma-priv-3.7.7.jar:?]
            at com.serotonin.m2m2.Lifecycle.initialize(Lifecycle.java:221) ~[ma-priv-3.7.7.jar:?]
            at com.serotonin.m2m2.Main.main(Main.java:159) ~[ma-priv-3.7.7.jar:?]
            Suppressed: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/alpn/java/server/JDK9ServerALPNProcessor has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
                    at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_252]
                    at java.lang.ClassLoader.defineClass(ClassLoader.java:756) ~[?:1.8.0_252]
                    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[?:1.8.0_252]
                    at java.net.URLClassLoader.defineClass(URLClassLoader.java:468) ~[?:1.8.0_252]
                    at java.net.URLClassLoader.access$100(URLClassLoader.java:74) ~[?:1.8.0_252]
                    at java.net.URLClassLoader$1.run(URLClassLoader.java:369) ~[?:1.8.0_252]
                    at java.net.URLClassLoader$1.run(URLClassLoader.java:363) ~[?:1.8.0_252]
                    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_252]
                    at java.net.URLClassLoader.findClass(URLClassLoader.java:362) ~[?:1.8.0_252]
                    at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_252]
                    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) ~[?:1.8.0_252]
                    at java.lang.ClassLoader.loadClass(ClassLoader.java:405) ~[?:1.8.0_252]
                    at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_252]
                    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_252]
                    at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_252]
                    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370) ~[?:1.8.0_252]
                    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) ~[?:1.8.0_252]
                    at java.util.ServiceLoader$1.next(ServiceLoader.java:480) ~[?:1.8.0_252]
                    at org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory.<init>(ALPNServerConnectionFactory.java:59) ~[jetty-alpn-server-9.4.23.v20191118.jar:9.4.23.v20191118]
                    at com.serotonin.m2m2.Lifecycle.webServerInitialize(Lifecycle.java:973) ~[ma-priv-3.7.7.jar:?]
                    at com.serotonin.m2m2.Lifecycle.initialize(Lifecycle.java:221) ~[ma-priv-3.7.7.jar:?]
                    at com.serotonin.m2m2.Main.main(Main.java:159) ~[ma-priv-3.7.7.jar:?]
            Suppressed: java.lang.IllegalStateException: org.eclipse.jetty.alpn.ALPN must be on JVM boot classpath
                    at org.eclipse.jetty.alpn.openjdk8.server.OpenJDK8ServerALPNProcessor.init(OpenJDK8ServerALPNProcessor.java:44) ~[jetty-alpn-openjdk8-server-9.4.23.v20191118.jar:9.4.23.v20191118]
                    at org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory.<init>(ALPNServerConnectionFactory.java:72) ~[jetty-alpn-server-9.4.23.v20191118.jar:9.4.23.v20191118]
                    at com.serotonin.m2m2.Lifecycle.webServerInitialize(Lifecycle.java:973) ~[ma-priv-3.7.7.jar:?]
                    at com.serotonin.m2m2.Lifecycle.initialize(Lifecycle.java:221) ~[ma-priv-3.7.7.jar:?]
                    at com.serotonin.m2m2.Main.main(Main.java:159) ~[ma-priv-3.7.7.jar:?]
    ERROR 2020-09-16T09:19:45,902 (com.serotonin.m2m2.Main.main:162) - Error during initialization
    java.lang.IllegalStateException: no valid keystore
            at org.eclipse.jetty.util.security.CertificateUtils.getKeyStore(CertificateUtils.java:50) ~[jetty-util-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.util.ssl.SslContextFactory.loadKeyStore(SslContextFactory.java:1188) ~[jetty-util-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.util.ssl.SslContextFactory.load(SslContextFactory.java:323) ~[jetty-util-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.util.ssl.SslContextFactory.doStart(SslContextFactory.java:245) ~[jetty-util-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[jetty-util-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) ~[jetty-util-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117) ~[jetty-util-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.server.SslConnectionFactory.doStart(SslConnectionFactory.java:92) ~[jetty-server-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[jetty-util-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) ~[jetty-util-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117) ~[jetty-util-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:320) ~[jetty-server-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:81) ~[jetty-server-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:231) ~[jetty-server-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[jetty-util-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.server.Server.doStart(Server.java:385) ~[jetty-server-9.4.23.v20191118.jar:9.4.23.v20191118]
            at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[jetty-util-9.4.23.v20191118.jar:9.4.23.v20191118]
            at com.serotonin.m2m2.Lifecycle.webServerInitialize(Lifecycle.java:1042) ~[ma-priv-3.7.7.jar:?]
            at com.serotonin.m2m2.Lifecycle.initialize(Lifecycle.java:221) ~[ma-priv-3.7.7.jar:?]
            at com.serotonin.m2m2.Main.main(Main.java:159) ~[ma-priv-3.7.7.jar:?]
    INFO  2020-09-16T09:19:45,902 (com.serotonin.m2m2.Lifecycle.terminate:400) - Mango Lifecycle terminating...
    ERROR 2020-09-16T09:19:45,922 (com.serotonin.m2m2.Lifecycle.terminate:478) - com.serotonin.provider.InputStreamEPollProvider
    com.serotonin.provider.ProviderNotFoundException: com.serotonin.provider.InputStreamEPollProvider
            at com.serotonin.provider.Providers.get(Providers.java:30) ~[mango-3.7.7.jar:?]
            at com.serotonin.provider.Providers.get(Providers.java:20) ~[mango-3.7.7.jar:?]
            at com.serotonin.m2m2.Lifecycle.terminate(Lifecycle.java:473) ~[ma-priv-3.7.7.jar:?]
            at com.serotonin.m2m2.Main.main(Main.java:163) ~[ma-priv-3.7.7.jar:?]
    ERROR 2020-09-16T09:19:45,922 (com.serotonin.m2m2.Lifecycle.terminate:486) - com.serotonin.provider.ProcessEPollProvider
    com.serotonin.provider.ProviderNotFoundException: com.serotonin.provider.ProcessEPollProvider
            at com.serotonin.provider.Providers.get(Providers.java:30) ~[mango-3.7.7.jar:?]
            at com.serotonin.provider.Providers.get(Providers.java:20) ~[mango-3.7.7.jar:?]
            at com.serotonin.m2m2.Lifecycle.terminate(Lifecycle.java:481) ~[ma-priv-3.7.7.jar:?]
            at com.serotonin.m2m2.Main.main(Main.java:163) ~[ma-priv-3.7.7.jar:?]
    

    Thanks in advance!

    posted in Mango Automation Installation read more