@nino-kurtalj New link is here: https://docs-v4.radixiot.com/script-examples
Best posts made by tungthanh500
-
Device disconnect and data logging
Hi all,
I'm building a Mango website to monitor some power meter via Ethenet. Below is my data point logging setting.
Today, my server disconnect or the meter disconnect, the server keeps logging last data value (see photo below)
From 3PM to 9PM, the server is disconnected so I expect the value should be 0.Is there are any setting so I can make sure the logging value is 0 if server/power meter disconnected, therefore I or anyone can realize the abnormal and check the server/meter?
Thank you.
Latest posts made by tungthanh500
-
Change a data point with condition
Hello guys, I have a system and I want to control a data point with condition.
I have following data point, polled through modbus TCP every 15 seconds:- Grid THDi L1, L2 and L3
- Compensation Ratio
- THDi setpoint (I set as 10)
I want to make a Meta Data Point with following code:
maxTHDI = Math.max(thdi_l1.value, thdi_l2.value, thdi_l3.value); if (maxTHDI < (setpoint.value - 1)) { comp_ratio.set(comp_ratio.value - 0.01); } else if (maxTHDI > setpoint.value) { if (comp_ratio >0.95) { comp_ratio.set(1)} else { comp_ratio.set (comp_ratio.value + 0.05); } } RuntimeManager.sleep(15000);
My intention is:
- If the value of maxTHDi is lower than 9, then i lower the value of comp_ratio by 0.01.
- if the value of maxTHDi is above 10 then if comp_ratio > 0.95 then comp_ratio = 1 and if comp_ratio is lower 0.95, i will increase comp_ratio by 0.05.
I want to make this meta point run every 15 second, together with the polling of Modbus data point. However, every time I enable this meta point this kind of error appear in the logs and repeat lots of times:
INFO 2024-07-19T19:32:26,312 (com.serotonin.m2m2.rt.RuntimeManagerImpl.startDataSource:346) - Data source (name=Setpoint Controller, id=13, type=MetaDataSourceRT) took 12ms to start WARN 2024-07-19T19:34:54,511 (com.infiniteautomation.mango.rest.latest.websocket.pointValue.PointValueWebSocketHandler$PointValueWebSocketListener.pointUpdated:253) - Error sending websocket message com.infiniteautomation.mango.rest.latest.websocket.WebSocketClosedException: Websocket closed at com.infiniteautomation.mango.rest.latest.websocket.MangoWebSocketHandler.sendStringMessageAsync(MangoWebSocketHandler.java:121) ~[?:?] at com.infiniteautomation.mango.rest.latest.websocket.MangoWebSocketHandler.sendMessage(MangoWebSocketHandler.java:96) ~[?:?] at com.infiniteautomation.mango.rest.latest.websocket.pointValue.PointValueWebSocketHandler.sendMessage(PointValueWebSocketHandler.java:154) ~[?:?] at com.infiniteautomation.mango.rest.latest.websocket.pointValue.PointValueWebSocketHandler$PointValueWebSocketListener.sendNotification(PointValueWebSocketHandler.java:200) ~[?:?] at com.infiniteautomation.mango.rest.latest.websocket.pointValue.PointValueWebSocketHandler$PointValueWebSocketListener.pointUpdated(PointValueWebSocketHandler.java:250) ~[?:?] at com.serotonin.m2m2.rt.DataPointEventNotifyWorkItem.execute(DataPointEventNotifyWorkItem.java:64) ~[mango-5.1.4.jar:?] at com.serotonin.m2m2.rt.maint.BackgroundProcessingImpl$RejectableWorkItemRunnable.run(BackgroundProcessingImpl.java:531) ~[mango-5.1.4.jar:?] at com.serotonin.timer.Task.runTask(Task.java:176) ~[mango-5.1.4.jar:?] at com.serotonin.timer.TaskWrapper.run(TaskWrapper.java:22) ~[mango-5.1.4.jar:?] at com.serotonin.timer.OrderedThreadPoolExecutor$OrderedTaskCollection.run(OrderedThreadPoolExecutor.java:268) ~[mango-5.1.4.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:840) [?:?] WARN 2024-07-19T19:34:54,511 (com.infiniteautomation.mango.rest.latest.websocket.pointValue.PointValueWebSocketHandler$PointValueWebSocketListener.pointUpdated:253) - Error sending websocket message com.infiniteautomation.mango.rest.latest.websocket.WebSocketClosedException: Websocket closed at com.infiniteautomation.mango.rest.latest.websocket.MangoWebSocketHandler.sendStringMessageAsync(MangoWebSocketHandler.java:121) ~[?:?] at com.infiniteautomation.mango.rest.latest.websocket.MangoWebSocketHandler.sendMessage(MangoWebSocketHandler.java:96) ~[?:?] at com.infiniteautomation.mango.rest.latest.websocket.pointValue.PointValueWebSocketHandler.sendMessage(PointValueWebSocketHandler.java:154) ~[?:?] at com.infiniteautomation.mango.rest.latest.websocket.pointValue.PointValueWebSocketHandler$PointValueWebSocketListener.sendNotification(PointValueWebSocketHandler.java:200) ~[?:?] at com.infiniteautomation.mango.rest.latest.websocket.pointValue.PointValueWebSocketHandler$PointValueWebSocketListener.pointUpdated(PointValueWebSocketHandler.java:250) ~[?:?] at com.serotonin.m2m2.rt.DataPointEventNotifyWorkItem.execute(DataPointEventNotifyWorkItem.java:64) ~[mango-5.1.4.jar:?] at com.serotonin.m2m2.rt.maint.BackgroundProcessingImpl$RejectableWorkItemRunnable.run(BackgroundProcessingImpl.java:531) ~[mango-5.1.4.jar:?] at com.serotonin.timer.Task.runTask(Task.java:176) ~[mango-5.1.4.jar:?] at com.serotonin.timer.TaskWrapper.run(TaskWrapper.java:22) ~[mango-5.1.4.jar:?] at com.serotonin.timer.OrderedThreadPoolExecutor$OrderedTaskCollection.run(OrderedThreadPoolExecutor.java:268) ~[mango-5.1.4.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:840) [?:?]
Please suggest me some workaround.
Thank you -
RE: Pi Portfolio creating
Update: I can do it. The most important content of the instruction is: "The data will be classified by Site, Device Type, and Device IDs which are the main tags that need to be configured in the data points to allow this module to show accurate data."
This should be highlighted, in bold because it is in the introduction and non-English speaker like me always miss it!
-
Pi Portfolio creating
Hello, I'm trying to configure my system to use new Po Portfolio and to be honest it is not easy to follow the instruction.
I finished setting up the Device types but I am facing difficulty to connect the Device in Site configuration.
When I add a new Device in Devices Tab, how to make a connection between a Device name in Data Source with below configuration (Export ID, Device ID, Name)?
Please check these screenshots: https://imgur.com/a/RlZIJDr
1st is where I need to Add device to a site
2nd is my Data Source
3rd is my Device Name -
RE: Docker and Mango v5.0.2
@MattFox If I am not wrong, in Mango 5, you must access the web with 8443 (or SSL route) and there is no workaround. I'm using an Mango instance on Windows to try stuff and no way out :"<
-
RE: Syntax for Read Permission = true in query
@Benoit You can post your devices structure here, we can give you some advise or suggestion.
About learning about script, you can see examples in people's posts -
RE: Syntax for Read Permission = true in query
@Benoit Totally agree with Matt. You should use tags more for easy filtering. It may takes some time but you can optimise your code
-
RE: Announcing the New Mango 5 Pre-Release: Download Now and Explore Exciting Features!
Congrat on new Version in few hours.
I found this "bug" (not sure if it is).
Below is my measurement of energy at my flat (latest 5.0.1). You can see that I clicked at 3 Jun, the values and timestamp appears on 4 Jun. This also happens on Mango 4.
-
RE: Announcing the New Mango 5 Pre-Release: Download Now and Explore Exciting Features!
@mumcs01 is there any place where we can give our feedback?
-
RE: Help with ideas for how to guide
@CraigWeb Do you mind making a tutorial regarding to SSL certify on Windows for Mango 5 (or Mango 4)? I know the system should be installed on Linux based for better configuration but Windows is preferred in my place and it is not easy for us to write an instruction on how to use everything on Ubuntu
-
RE: MySQL database restore
Hi @CraigWeb , actually I was trying to install a new Mango 5 instance. Everything is totally new. These are what I did:
1/ Install MySQL 8.0, create a database (scheme) named mango
2/ Install Mango 5 and paste a mango.properties file with MySQL info as above mentioned in mango_data folder.
3/ Start mango service and change admin password.
4/ Create a data source with some data point.
5/ Backup with Backup feature in System Setting -> SQL backup
6/ Delete data source and restore with System Setting -> SQL backup.
7/ See that orange warning pop up, but the deleted data source and data point is back, but I'm not sure if it normal or not.