sensor will not trigger with http result

Hello,

ive made a command which sends parameters(from rules) to my thermostat, it will send back a json string, ive attached a sensor to it to read it.

it has worked before but now my sensors.log says that there is no polling interval given (which is also not needed) any known issued or is it because of an designer update?

error logfile:

ERROR 2016-08-04 09:32:45,060 : There was an implementation error in the event listener associated with sensor ‘3M50_Online_check’. The listener implementation may not have started correctly : Could not set sensor because no polling interval was given

java.lang.RuntimeException: Could not set sensor because no polling interval was given

at org.openremote.controller.protocol.http.HttpGetCommand.setSensor(HttpGetCommand.java:174)

at org.openremote.controller.model.sensor.Sensor.start(Sensor.java:387)

at org.openremote.controller.deployer.Version20ModelBuilder.buildSensorModel(Version20ModelBuilder.java:673)

at org.openremote.controller.deployer.Version20ModelBuilder.build(Version20ModelBuilder.java:557)

at org.openremote.controller.deployer.AbstractModelBuilder.buildModel(AbstractModelBuilder.java:154)

at org.openremote.controller.service.Deployer.startup(Deployer.java:872)

at org.openremote.controller.service.Deployer.startController(Deployer.java:350)

at org.openremote.controller.spring.SpringContext.initializeController(SpringContext.java:109)

at org.openremote.controller.service.ServiceContext.init(ServiceContext.java:427)

at org.openremote.controller.bootstrap.Startup.loadServiceContext(Startup.java:88)

at org.openremote.controller.bootstrap.servlet.ServletStartup.initializeServiceContext(ServletStartup.java:195)

at org.openremote.controller.bootstrap.servlet.ServletStartup.contextInitialized(ServletStartup.java:109)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)

at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)

at org.apache.catalina.core.StandardService.start(StandardService.java:516)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

at org.apache.catalina.startup.Catalina.start(Catalina.java:578)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

ive always used the staging designer https://composer.openremote.org/staging/Modeler.jsp

username: robke

naamloos.png

Hi,

it is strange that it used to work at all, as the command which you call from rule with param is a different instance that the command linked to sensor. What you did was actually non documented feature. What I do to get such bidirectional communication is to use 2 commands, one for calling from the rule, where I can pass param, and another one to read the response. For the first command, when I want to call some HTTP service I use shell execution protocol where I call curl with output redirection to a file. Then I read this file with HTTP protocol and pooling http://localhost:8688/controller/your_file_name.json

This was the way I’ve implemented Smappee devices http://www.openremote.org/display/docs/OpenRemote+2.0+How+To+-+Smappee

Kind regards,

Michal

Yes that did the trick, a shell command with parameters from rules, the shell command will create a json files like:
curl -H “Content-Type: application/x-www-form-urlencoded” -X POST -d “$1 $2” http://api.scinan.com/v1.0/devices/list > /openremote/webapps/controller/scripts/saswell_read_data.json

and an http command with a polling interval which parses the json

tnx