@ryanlo In addition to what @MattFox is saying you should also see an Event / Alarm in the UI to correspond to the event being detected. The handler should be linked to that event and as Matt said, if you setup logging correctly you will also see it in the logs.
Posts made by terrypacker
-
RE: Delay SMS notification from Event Handler
-
RE: Delay SMS notification from Event Handler
@ryanlo the other thing you could do, if you think its the SMS relay then add another reliable email address to the handler so it send the message to multiple addresses. If the SMS address is delayed but the other one (gmail or something) gets it almost immediately you will know its the relay and not Mango.
-
RE: Move Data Points to new Data Source
@tomatopi there is going to be 2 major parts to your solution:
A. Setting up the HTTP Retriever data source and points into a single request that gets the data into the desired points.
B. Retaining the history on the existing points so that new history is appended to it.
I'll focus on B here:
- You could try modifying the points via the JSON import/export to move them onto a single data source.
- The general idea here is that if it is possible to reconfigure the points you would need to ensure that the
seriesId
in the database doesn't change. So use the XIDs to move the points and not create new ones.
- You could create an entirely new set of points and migrate existing data into them.
- There are NoSQL tools in Mango for migrating data which you would need to explore.
- You could create an entirely new set of points and then before you start them for the first time changing the series ID for them to point to the existing data.
- This would be done after you setup the new points by a Filestore Javascript.
All of this information hinges on the fact that you are on at least Mango 4. It can probably be done in Mango 3 but we didn't have the
seriesId
concept so the solution would be different. In Mango 3 the time series data is directly linked to the data point'sid
column in the database. In Mango 4 we added a column calledseriesId
to thedataPoints
table to allows us to move the time series data between points if we needed to.The caveat here is that you can only move data between points that have the same data type. For example Numeric time series can only be assigned to other Numeric points, not a Binary point.
-
RE: Disabling Event Handlers - User
@hayden_AUS we added permissions like this in Mango 4+, but there are only 2 levels for Event Handlers. View and Edit. If you wanted a user to be able to disable the event handler they would need to have the edit permission for that handler. Which would allow them to change any setting on it.
In Mango 3 Event Handlers are a superadmin thing only.
What @MattFox is suggesting is a common pattern that we use also, put your alarming logic inside Meta points and then set a basic event detector (State Detector) on the Meta point which can raise the event and handle it.
-
RE: Docker and Mango v5.0.2
@tungthanh500 there are ways around this. In Mango 5 the default is to have HTTPS enabled on first start. This also enables HSTS which redirects from the HTTP port to HTTPS. You can change these settings by injecting mango properties into the container or modifying the mango.properties file you are loading.
Take a look at these properties:
# Note: Enabling SSL/TLS also turns on HSTS by default, see the ssl.hsts.enabled setting below ssl.on=true ssl.port=8443 ... # Configure HSTS (HTTP Strict Transport Security) # Enabled by default when ssl.on=true # Sets the Strict-Transport-Security header, web browsers will always connect using HTTPS when they # see this header and they will cache the result for max-age seconds ssl.hsts.enabled=true ssl.hsts.maxAge=31536000 ssl.hsts.includeSubDomains=false
And how to inject them into the container as env variables: https://docs-v5.radixiot.com/configure-mango-properties
Just note that if you change the HSTS settings you will need to clear your browser cache since it will have cached the entry to always use HTTPS already.
-
Rate of Change Detector - Looking for real world use cases.
We are looking for examples of how our Rate of Change event detector is being used. We have a list of features and changes for upcoming releases of Mango so I am investigating the use of this detector because it is on our list.
Please let us know the configuration you are using and why please.
Thanks!
-
RE: BACnet publisher issues on RD121C unit
@Ruan-0 I think you might be confused. A Mango BACnet publisher makes Mango into a BACnet device that can be read. If you want to write to a BACnet device you probably want to be using a BACnet data source and then setting the data point value in Mango which will then write the value to the remote device.
-
RE: apiv3
@Jdiaz-co that endpoint only accepts a single point value (as you have discovered). Referring back to my first post I think you are looking for this new v3 endpoint:
POST rest/v3/point-value-modification/import
using a JSON model as the body. (See swagger UI for this)I don't think this is exposed in the UI so you will need to use Swagger. However the POST body will need to look like this:
[ { "xid": "MY_POINT_1_XID", "value": 1.0, "timestamp": "ISO Formatted Date String", "annotation": "can be null or any string" }, { .... ]
The idea being that you supply the
xid
for the point you want to set the value for. -
RE: apiv3
@Jdiaz-co I just checked and there is still and endpoint available via PUT. If you configure a data point to be 'settable' in the Mango UI and then open Chrome Dev tools while on the Data Point Details page you can set the value and see the PUT request. I can't upload images to the forum due to some problem. But here is the general output from the developer tools view:
Request URL: https://localhost:8443/rest/latest/point-values/DP_0f3b0e5d-b9ca-4f2f-916b-f2ddcadbba8a?unitConversion=true Request Method: PUT Status Code: 201 Payload: { "value":50, "dataType":"NUMERIC", "annotation":"Set from web by user: admin" }
-
RE: apiv3
@Jdiaz-co I'm a little confused by your phrasing. Maybe use some URLs as examples. But are you asking if there exists a REST v3 endpoint to PUT multiple point's values or if one exists for v1?
There are POST methods for v3. I can't say for v1 as I don't have the code checked out.
POST
rest/v3/point-values
using a JSON model as the body (this is not recommended and deprecated)POST
rest/v3/point-value-modification/import
using a JSON model as the body. (See swagger UI for this) -
RE: Making a module for alternative url path other than UI
So if you are writing your own module you could then reconfigure all the default URLs too so on login you get pointed to your pages, that is done with a DefaultPagesDefinition
-
RE: Making a module for alternative url path other than UI
Sorry, I posted something else here so I should probably try to answer your question out of curtesy. I tried to ask some developers about this but didn't get any answers. My guess is that yes it can be done but you would need to add some backend code to hook into the Spring Web context and serve up your resources. You basically would need to map your URL to a controller that serves the resources.
This is how the UI module does it:
-
RE: Feature Request: run the main loop of start() method of TcpSlave/UdpSlave in another thread
@gbccccc first you need to define what "new slave is started successfully means".
If just binding to the port and waiting for connections is enough then you can assume that if you call the method and a
ModbusInitException
is thrown then it is not running. Otherwise it is bound to the port and waiting for connections.If you want to know that something is connected you could extend the TcpSlave class like this:
public class MonitoredTcpSlave extends TcpSlave { public MonitoredTcpSlave(int port, boolean encapsulated) { super(port, encapsulated); } public boolean hasConnection() { return !listConnections.isEmpty(); } }
As a last resort you could create your own TcpSlave by extending
com.serotonin.modbus4j.ModbusSlaveSet.ModbusSlaveSet
-
RE: Cannot build with maven for custom module
@MattFox the problem isn't specifically with our repo. The way maven works is that it checks all the repositories you have listed in the module's POM or its parent POMs in some order.
That plugin isn't owned by us and thus isn't hosted in our maven repository. What your goal should be is to figure out why your build isn't finding it on the public maven repositories such as this one:
https://mvnrepository.com/artifact/org.codehaus.mojo/build-helper-maven-plugin/1.9.1
or this one:
https://central.sonatype.com/artifact/org.codehaus.mojo/build-helper-maven-plugin/1.9.1
I'm pretty sure the problem is that your computer can't reach Maven central because of a proxy or some other problem. I would start by looking there, perhaps delete your
~/.m2
directory and rebuild. Let me know if that solves it or you have a different problem.
-
RE: Bacnet Alarms
@Krish1998 it would help if you would be very specific as to what you are try to do and supply some code examples. However you might be able to use a
DeviceEventListener
And an example use here:
https://github.com/MangoAutomation/BACnet4J-samples/blob/master/src/test/java/com/infiniteautomation/bacnet4j/npdu/ip/BacnetIpListenerDiscoveryExample.java -
RE: point set timestamp
@Sean It looks to me like the point you are setting has a 5 minute logging period. So I would check the logging settings for your point. If it is set to Interval logging it won't log every value you send in to it. Since you are querying the values from the database it will only return values that are logged:
1684906212836 -> Wednesday, May 24, 2023 5:30:12.836 AM GMT 1684906512836 -> Wednesday, May 24, 2023 5:35:12.836 AM GMT 1684906812836 -> Wednesday, May 24, 2023 5:40:12.836 AM GMT 1684907112836 -> Wednesday, May 24, 2023 5:45:12.836 AM GMT
If you want access to cached values (i.e. values not yet in the database but being used for interval logging) you would want to do this:
var from = 1684906200000; var to = 1684907500000; var useCache = true; point.pointValuesBetween(from, to, useCache);
-
RE: point set timestamp
@Sean it looks like you are testing this by 'validating' the script. During validation the value is not actually set into the database but instead just printed to the result to show that if the script was really run it would have been set. So that is why when you try to get the values in the next part of the script it returns the real values from the database and your values that were set are not present. This can be kind of confusing but is done so that you can test the script and not have to worry about modifying the values in the system.
Hope that helps.
-
RE: Modbus Sniffing Support
@Turbo, interesting idea which I've not seen a request for.
This won't work with the Modbus data sources as they won't process messages unless they have sent a request.
The "Discovery" feature of those data sources also works on a request/response approach but can create data points based on the response.
It might be possible to do this with a custom module and some pieces of Modbus4J, however it handles messages in a "Waiting Room" so you would need to bypass the transport layer of the library.
You could try to use the serial data source but parsing out the messages might be tricky.
-
RE: Java problem may crash my instance
I have seen situations where our monitoring library can't handle the hardware it is running on. You can disable this using the mango property:
# enables getting operating system, process, and hardware information via the OSHI native library internal.monitor.enableOperatingSystemInfo=true