Event Handler Setting Meta Point Failing
-
Update:
I tried 'multistate' instead of numeric, got this error:
Here are the event handler settings:
-
The second image you provided, of the /internal/queueStats.shtm page, makes me certain it is the first issue I referred to. If you update to 3.4 I would expect that issue to go away. If you restart I would expect it to be temporarily relieved.
-
Sounds good -- we will wait for 3.4 to be officially released and then upgrade and report back.
Thank you again for all of your help!
-
Hi @phildunlap ,
Still no luck. We upgraded to 3.4 today and now we're getting this error when trying to create an event handler to set a point:
For reference, here is the event handler we are trying to create:
-
Post the error in its entirety from your Mango/logs/ma.log file.
-
@phildunlap said in Event Handler Setting Meta Point Failing:
Post the error in its entirety from your Mango/logs/ma.log file.
ERROR 2018-05-02T09:55:50,957 (com.serotonin.m2m2.web.dwr.util.ExceptionDetectionFilter.doFilter:38) - DWR invocation exception org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO eventHandlersMapping (eventHandlerId, eventTypeName, eventTypeRef1, eventTypeRef2) values (?, ?, ?, ?) ON DUPLICATE KEY IGNORE]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE' at line 1 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231) ~[spring-jdbc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) ~[spring-jdbc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:655) ~[spring-jdbc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:876) ~[spring-jdbc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:937) ~[spring-jdbc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at com.serotonin.db.spring.ExtendedJdbcTemplate.update(ExtendedJdbcTemplate.java:83) ~[mango-3.4.0.jar:?] at com.serotonin.m2m2.db.dao.EventHandlerDao.addEventHandlerMappingIfMissing(EventHandlerDao.java:241) ~[mango-3.4.0.jar:?] at com.serotonin.m2m2.db.dao.EventHandlerDao.saveRelationalData(EventHandlerDao.java:210) ~[mango-3.4.0.jar:?] at com.serotonin.m2m2.db.dao.EventHandlerDao.saveRelationalData(EventHandlerDao.java:37) ~[mango-3.4.0.jar:?] at com.serotonin.m2m2.db.dao.AbstractBasicDao.lambda$saveFull$0(AbstractBasicDao.java:552) ~[mango-3.4.0.jar:?] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) ~[spring-tx-4.3.16.RELEASE.jar:4.3.16.RELEASE] at com.serotonin.m2m2.db.dao.AbstractBasicDao.saveFull(AbstractBasicDao.java:548) ~[mango-3.4.0.jar:?] at com.serotonin.m2m2.db.dao.AbstractBasicDao.saveFull(AbstractBasicDao.java:539) ~[mango-3.4.0.jar:?] at com.serotonin.m2m2.web.dwr.EventHandlersDwr.save(EventHandlersDwr.java:333) ~[mango-3.4.0.jar:?] at com.serotonin.m2m2.web.dwr.EventHandlersDwr.saveSetPointEventHandler(EventHandlersDwr.java:272) ~[mango-3.4.0.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_162] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_162] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_162] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_162] at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34) ~[dwr-2.0.11.jar:?] at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428) ~[dwr-2.0.11.jar:?] at com.serotonin.m2m2.web.dwr.util.TranslationsFilter.doFilter(TranslationsFilter.java:37) ~[mango-3.4.0.jar:?] at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428) ~[dwr-2.0.11.jar:?] at com.serotonin.m2m2.web.dwr.util.ExceptionDetectionFilter.doFilter(ExceptionDetectionFilter.java:26) [mango-3.4.0.jar:?] at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428) [dwr-2.0.11.jar:?] at com.serotonin.m2m2.web.dwr.util.DwrPermissionFilter.doFilter(DwrPermissionFilter.java:46) [mango-3.4.0.jar:?] at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428) [dwr-2.0.11.jar:?] at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431) [dwr-2.0.11.jar:?] at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283) [dwr-2.0.11.jar:?] at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52) [dwr-2.0.11.jar:?] at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101) [dwr-2.0.11.jar:?] at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146) [dwr-2.0.11.jar:?] at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [javax.servlet-api-3.1.0.jar:3.1.0] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar:3.1.0] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) [jetty-servlet-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1772) [jetty-servlet-9.3.23.v20180228.jar:9.3.23.v20180228] at org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:110) [spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at com.serotonin.m2m2.web.filter.MangoShallowEtagHeaderFilter.doFilterInternal(MangoShallowEtagHeaderFilter.java:90) [mango-3.4.0.jar:?] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.23.v20180228.jar:9.3.23.v20180228] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at com.serotonin.m2m2.web.mvc.spring.security.PermissionExceptionFilter.doFilter(PermissionExceptionFilter.java:32) [mango-3.4.0.jar:?] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:155) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177) [spring-security-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347) [spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263) [spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1751) [jetty-servlet-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582) [jetty-servlet-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [jetty-security-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [jetty-server-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [jetty-server-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [jetty-servlet-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [jetty-server-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213) [jetty-server-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:493) [jetty-server-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [jetty-server-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.server.Server.handle(Server.java:539) [jetty-server-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) [jetty-server-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [jetty-server-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [jetty-io-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [jetty-io-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [jetty-io-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [jetty-util-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [jetty-util-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [jetty-util-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [jetty-util-9.3.23.v20180228.jar:9.3.23.v20180228] at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [jetty-util-9.3.23.v20180228.jar:9.3.23.v20180228] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162] Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_162] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_162] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_162] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_162] at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) ~[mysql-connector-java-5.1.26.jar:?] at com.mysql.jdbc.Util.getInstance(Util.java:386) ~[mysql-connector-java-5.1.26.jar:?] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054) ~[mysql-connector-java-5.1.26.jar:?] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190) ~[mysql-connector-java-5.1.26.jar:?] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4122) ~[mysql-connector-java-5.1.26.jar:?] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2570) ~[mysql-connector-java-5.1.26.jar:?] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731) ~[mysql-connector-java-5.1.26.jar:?] at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2818) ~[mysql-connector-java-5.1.26.jar:?] at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2157) ~[mysql-connector-java-5.1.26.jar:?] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2460) ~[mysql-connector-java-5.1.26.jar:?] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2377) ~[mysql-connector-java-5.1.26.jar:?] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2361) ~[mysql-connector-java-5.1.26.jar:?] at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) ~[commons-dbcp-1.4.jar:1.4] at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) ~[commons-dbcp-1.4.jar:1.4] at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:883) ~[spring-jdbc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:876) ~[spring-jdbc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:639) ~[spring-jdbc-4.3.16.RELEASE.jar:4.3.16.RELEASE] ... 99 more
-
Whoa, that's not good. I have committed a fix and we'll be releasing core 3.4.1 to address this. Thanks for bringing it to our attention.
-
@phildunlap said in Event Handler Setting Meta Point Failing:
Whoa, that's not good. I have committed a fix and we'll be releasing core 3.4.1 to address this. Thanks for bringing it to our attention.
Glad to hear it was discovered early :)
Any workarounds until 3.4.1?
-
We'll be releasing 3.4.1 today.
-
@phildunlap
Thanks!Thanks for the quick fix as well.
-
3.4.1 is released.
-
Thanks @phildunlap
Upgrade went smooth and what we were trying to do kind of worked, but still not working as expected.
I am now able to create an event handler to set a point to a static value if an event is triggered -- and that works just fine. However, the point we are setting almost instantly goes back to 0, despite the event still being active.
Screenshots:
Event Detector:
Proof that the event is still active:
Event Handler:
History of the point we are trying to set, note it goes active, and then 8 seconds later inactive for some reason (even though we never came close to hiting the reset limit of <60)
-
We can see in the annotation that it wasn't the inactive event doing it. So, what could trigger that meta point to recompute itself? Is 0 the value it would get if it executed?
-
@phildunlap said in Event Handler Setting Meta Point Failing:
We can see in the annotation that it wasn't the inactive event doing it. So, what could trigger that meta point to recompute itself? Is 0 the value it would get if it executed?
Hi,
Sorry -- unsure what you mean by if "...it was executed"
Nothing else changes that point except the event handler.
Here's a screeenshot of the metapoint details:
-
While I have contemplated making meta points that don't have execution conditions (would be useful to hit 'refresh point value' on, as that can also trigger the meta script), I haven't yet. So, either your meta point has a point in its context that has 'update context' checked and that triggers the meta points execution, or you have the update event set to something other than context update and it's executing at some specified rate or cron.
-
Ah, screenshots. You probably want to change that script body to
return UNCHANGED;
or use a virtual point instead. Currently I would expect it gets a value of 0 (casting a null return value to a numeric) every time that context point updates. -
Putting
return UNCHANGED
worked!Just a follow up questions so we don't have to bug you as much in the future:
Can you provide us some guidance on where to find documentation on virtual points?
How does a virtual point differ from an meta data point?
Thanks again for all of your hard work in helping us get this working.
-
Certainly! Sorry you were inconvenienced by the queuing issue!
Alas the documentation is scattered around the forum primarily, although the context help (blue ? next to the data source name on the edit page) is useful. Virtual points are perhaps the simplest of points. You can disable polling on the data source, and then they're just points to set values into. The data source can also poll to make the points do simple things like increment, generate random values, alternate, or whatever is sensible to the data type.
Meta points are event-driven timer-driven script bodies that are an iceberg of features with limitless use cases somewhat described here: https://github.com/infiniteautomation/ma-core-public/blob/main/Core/web/WEB-INF/dox/mangoJavaScript.htm
I have posted a great many examples of meta points and scripts around the forum.