You missed my answer
Print out the result of the transform and make sure you are getting something.
It looks preaty good
2017-03-21 22:28:04.449 [INFO ] [.smarthome.model.script.Process AC40] - Ende Auswertung
2017-03-21 22:28:04.520 [INFO ] [.smarthome.model.script.Process AC40] - 21.64179
2017-03-21 22:28:04.525 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'Process AC40': The argument 'command' must not be null or empty.
this is the last line to transfer the value to the item
TL300E02B01.sendCommand (AC40_TL300E02B01)
the line has the following error
The method or field TL300E02B01 is undefined
Do I have to change the dot in the number to an comma?
The error is saying that the Item TL300E02B01 doesnāt exist. Make sure you donāt have a typo in on that Item as well.
The dot is fine. You would probably have problems if you used the comma.
Make sure there is no leading or trailing spaces in the String returned from the transform.
May be I have a trailing space.
How can I strip the string? Is there a command like .strip ?
.trim
Here is my item-file
String AC40_Raw { http="<[AC40CacheRaw:60000:REGEX((.*))]" }
Number TL300E02B01 "Zulufttemperatur Lueftung [%.1f Ā°C]" <temperature>
followed by the rule file
rule "Process AC40"
when
Item AC40_Raw received update
then
logInfo("Process AC40", "Beginn Auswertung")
// val AC40corrected = AC40_Raw.state.toString.replace("<br>", "<br/>").replace("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30\">", "").replace("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"","").replace("\"http://www.w3.org/TR/html4/loose.dtd\">", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">")
val AC40corrected = AC40_Raw.state.toString.replace("<br>", "<br/>")
AC40corrected = AC40corrected.replace("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30\">", "")
AC40corrected = AC40corrected.replace("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"","")
AC40corrected = AC40corrected.replace("\"http://www.w3.org/TR/html4/loose.dtd\">", "")
AC40corrected = AC40corrected.replace("<h2>Liste der ausgewählten FG-Adressen:</h2>","")
logInfo("Process AC40", AC40corrected)
logInfo("Process AC40", "Ende Auswertung")
val AC40_TL300E02B01 = transform("XSLT", "AC40_TL300E02B01.xsl", AC40corrected)
logInfo("Process AC40", AC40_TL300E02B01)
// Process and post the tags and values to the appropriate Items
TL300E02B01.sendCommand (AC40_TL300E02B01)
end
the rule file is not error free
Here it is
Your are right. Indeed the http binding is working.
But donāt tell me that it was easy
I never said it was easy. Dealing with raw data from websites and other devices is hard even for experienced programmers. The fact that you are dealing with a not well-formed HTML that you wanted to use XSLT on made it even more of difficult.
It would have been easier had you taken my hint and used Regex instead.
What version of Designer are you using? Is it 0.9? If so that is your problem. There is a major problem in the 0.9 version that is causing it to no recognize Items. You should use the 0.8 version.
Thats a good question. I downloaded both, but in the running Designer I canāt see on which Version Iāam, but I supose Iāam a lucky man and startet immediately with the newest version to have less trouble, Only with my openhabian I was a little bit to conservative. (Thats also not true, I realy was one of the first users)
On Thursday I will try to get the Modbus Binding via USB-RS485 to get to run.
What do you think about that?
Thanks a lot for your patience and help.
I donāt know much about this binding. Good luck!
Hello I have to go on with this thread.
I now have the problem, that I have Setpoints and Switches I would like to change.
So I have to change my items and rule file.
I would like to keep my
String AC40_Raw { http="<[AC40CacheRaw:60000:REGEX((.*))]" }
but instead of selecting everything I would like to do the necessary changes which in the moment are done in the rule file
when
Item AC40_Raw received update
then
// logInfo("Process AC40", "Beginn Auswertung")
val AC40corrected = AC40_Raw.state.toString.replace("<br>", "<br/>")
AC40corrected = AC40corrected.replace("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30\">", "")
AC40corrected = AC40corrected.replace("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"","")
AC40corrected = AC40corrected.replace("\"http://www.w3.org/TR/html4/loose.dtd\">", "")
AC40corrected = AC40corrected.replace("<h2>Liste der ausgewählten FG-Adressen:</h2>","")
directly.
The sendcommands in my rule file
TA300A00B91.sendCommand (transform("XSLT", "AC40_TA300A00B91.xsl", AC40corrected).trim)
TL300E01B01.sendCommand (transform("XSLT", "AC40_TL300E01B01.xsl", AC40corrected).trim)
TL300E02B01.sendCommand (transform("XSLT", "AC40_TL300E02B01.xsl", AC40corrected).trim)
should be placed in the items file directly
Number TA300A00B91{ http="<[AC40_Raw:10000:XSLT(AC40_TA300A00B91.xsl)]" }
And later on I would like to define the http post
Number TA300A00B91{ http="<[AC40_Raw:10000:XSLT(AC40_TA300A00B91.xsl)] >[CHANGED:POST:http:////192.168.1.200/cgi-fga/fga/fgacmd/TA300A00B91?pw=0123456789&nv=18]" }
The final ā18ā should become replaced by the changed value.
What do I have to change to get in running?
Is it possible to get a multiple selection with a regex?
A regex can select multiple things but I donāt think OH is able to take advantage of it.
See the HTTP binding for how to configure the binding to send requesters. One thing I notice is for outgoing you should use > instead of <
Thats what I did.
The first ā<ā is the incomming value, which should be read out of the cached webpage (with all the need changes and the final xsl transformation)
The second ā>ā should send an http post on changed event to a web adress with the changed value.
My starting problem at the moment is, that in the http-config file I have defined the AC40CacheRaw Item(?)
AC40CacheRaw.url=http://ac40/cgi-fga/index.htm?fgt=**&fgm=****************
This item(?) is used as channel to define the AC40raw string Item, which then is parsed to become an AC40corrected variable which contains a transformable xml string.
Can I asign this AC40corrected variable to a string-Item which I can use then as input channel for my items?
If you are not sure you really need to review the Beginnerās Tutorial and the Introduction and Concepts chapters of the Userās Manual. Knowing what an Item, Thing, and Channel is and how they differ is vital to configuring OH.
That AC40CacheRaw line but it is absolutely not an item not is it a thing not is it a channel.
What you have created is a cached HTTP binding config (see the HTTP binding readme).
And for completeness, the HTTP binding is a 1.x binding and therefore doesnāt have Things and Channels.
Please see the bindingās readme. That is the whole point of the cached config. The binding makes one request and you can populate multiple Items from that one request.
Thank you for your replay.
I just startet a few hours ago and come to the same conclusion as you
So I started to learn a little bit regex. It as nice as XSLT.
With the following RegEx
[<].?a.href.*fga[/]TL300E02D01.*[>]
I get out of my cached webpage the following selection:
<a href="fga/TL300E02D01 " target="_blank">18 </a>
with an xslt transform I also get the value.
But at the moment Iāam not capable to do both at my item definition
Number TESTSOLLWERT "Testsollwert" {http="<[AC40CacheRaw:60000:REGEX([<].?a.href.*fga[/]TL300E02D01.*[>])]"}
So Iāam looking forward for select just the value with the regex.
At the moment Iāam reading through the net to find out how.
I think now I have the correct syntax of my regex, but it is not working. Why?
String TESTSOLLWERT "Testsollwert [%s]" (gLueftungTemp) {http="<[AC40CacheRaw:60000:REGEX(TL300E02D01.*blank.[>](.*)[<])]"}
On my Sitmap group I only get the value ānullā displayed. The Log shows
2017-09-18 08:39:39.288 [ItemStateChangedEvent ] - TESTSOLLWERT changed from NULL to null
My AC40CacheRaw looks like
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="30">
<title> Address List </title>
<style type="text/css">
body { background-color:#C0C0C0; color:#0000FF; }
</style>
</head>
<body>
<h2>Liste der ausgewählten FG-Adressen:</h2>
----------------------------------------------------------------------------------------------------
<br><pre><b>TA300A00B91 </b>Dachgeschosstemperatur Analogeingang mit Grenzwert
<br>18-09-17 08:34:56 <a href="fga/TA300A00B91 " target="_blank">22.76119 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TH300A00Z01 </b>Stromzaehler Heizung Zaehlwert mit Grenzwert
<br>18-09-17 08:34:56 <a href="fga/TH300A00Z01 " target="_blank">1556.001 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300A00A01 </b>Generalbefehl 1 stufiger Befehlspunkt
<br>18-09-17 08:34:56 <a href="fga/TL300A00A01 " target="_blank">EIN1 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300A00A02 </b>Sommerbetrieb 1 stufiger Befehlspunkt
<br>18-09-17 08:34:56 <a href="fga/TL300A00A02 " target="_blank">EIN1 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300A00Q10 </b>Aussenluftklappen AUF 1 stufiger Befehlspunkt
<br>18-09-17 08:34:56 <a href="fga/TL300A00Q10 " target="_blank">EIN1 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300A00Q11 </b>Aussenluftklappen FRG 1 stufiger Befehlspunkt
<br>18-09-17 08:34:56 <a href="fga/TL300A00Q11 " target="_blank">AUS </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300A00Q12 </b>Aussenluftklappen AUF 1 stufiger Befehlspunkt
<br>18-09-17 08:34:56 <a href="fga/TL300A00Q12 " target="_blank">AUS </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E01B01 </b>Aussenluftlufttemperatur Analogeingang mit Grenzwert
<br>18-09-17 08:34:56 <a href="fga/TL300E01B01 " target="_blank">10.44776 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E01F11 </b>Frostschutz Alarmmeldung
<br>18-09-17 08:34:56 <a href="fga/TL300E01F11 " target="_blank"> </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E01Z01 </b>Stromzaehler Vorerhitzer Zaehlwert mit Grenzwert
<br>18-09-17 08:34:56 <a href="fga/TL300E01Z01 " target="_blank">15.8 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E02A01 </b>Freigabe Heizstab 1 stufiger Befehlspunkt
<br>18-09-17 08:34:56 <a href="fga/TL300E02A01 " target="_blank">AUS </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E02B01 </b>Zulufttemperatur Analogeingang mit Grenzwert
<br>18-09-17 08:34:56 <a href="fga/TL300E02B01 " target="_blank">17.91045 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E02D01 </b>SW Zulufttemperatur Analogausgang
<br>18-09-17 08:34:56 <a href="fga/TL300E02D01 " target="_blank">18 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E02Q01 </b>Heizstab Analogausgang
<br>18-09-17 08:34:56 <a href="fga/TL300E02Q01 " target="_blank">0 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E02Z01 </b>Stromzaehler Erhitzer Zaehlwert mit Grenzwert
<br>18-09-17 08:34:56 <a href="fga/TL300E02Z01 " target="_blank">1528.202 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E51B01 </b>Raumablufttemperatur Analogeingang mit Grenzwert
<br>18-09-17 08:34:56 <a href="fga/TL300E51B01 " target="_blank">21.76616 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300G01M01 </b>Zuluftventilator 1 stufiger Befehlspunkt
<br>18-09-17 08:34:56 <a href="fga/TL300G01M01 " target="_blank">EIN1 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300G01Z01 </b>Stromzaehler Ventilator Zaehlwert mit Grenzwert
<br>18-09-17 08:34:56 <a href="fga/TL300G01Z01 " target="_blank">1294.539 </a>
<br></pre>
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300G51B01 </b>Fortlufttemperatur Analogeingang mit Grenzwert
<br>18-09-17 08:34:56 <a href="fga/TL300G51B01 " target="_blank">15.9204 </a>
<br></pre>
</body>
</html>
I 'am a little bit further.
I have problems with the configuration.
I have the following http.cfg
AC40CacheRaw.url=http://ac40/cgi-fga/index.htm?fgt=**&fgm=****************
AC40CacheRaw.updateInterval=60000
I try with the following ac40.items file definition
String AC40_Raw { http="<[AC40CacheRaw:60000:REGEX((.*))]" } // Is used for working in ac40.rule
String TestSoll { http="<[AC40CacheRaw:60000:REGEX(TL300E02B01.*blank.[>](.*)[<])]"} //Should get the value string
If openhab run without the item TestSoll there are nor errors in the log.
In VisualStudioCode all my Item are shown and I can see the actual values.
But if I add the item TestSoll
VisualStudioCode throws an error
If I close VisualStudioCode and open it again I get the following log entry
==> /var/log/openhab2/openhab.log <==
2017-09-18 11:59:48.800 [ERROR] [ersey.server.ServerRuntime$Responder] - An I/O error has occurred while writing a response message entity to the container output stream.
org.glassfish.jersey.server.internal.process.MappableException: java.lang.NullPointerException
at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:92)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:711)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:444)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:434)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:329)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76)[9:com.eclipsesource.jaxrs.publisher:5.3.1.201602281253]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[79:org.eclipse.jetty.security:9.2.19.v20160908]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.Server.handle(Server.java:499)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)[71:org.eclipse.jetty.io:9.2.19.v20160908]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[83:org.eclipse.jetty.util:9.2.19.v20160908]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[83:org.eclipse.jetty.util:9.2.19.v20160908]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: java.lang.NullPointerException
at org.eclipse.smarthome.io.rest.core.item.EnrichedItemDTOMapper.map(EnrichedItemDTOMapper.java:48)
at org.eclipse.smarthome.io.rest.core.item.EnrichedItemDTOMapper.map(EnrichedItemDTOMapper.java:41)
at org.eclipse.smarthome.io.rest.core.item.ItemResource.lambda$0(ItemResource.java:153)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)[:1.8.0_121]
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1353)[:1.8.0_121]
at java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:294)[:1.8.0_121]
at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206)[:1.8.0_121]
at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:169)[:1.8.0_121]
at java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300)[:1.8.0_121]
at java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681)[:1.8.0_121]
at org.eclipse.smarthome.io.rest.Stream2JSONInputStream.fillBuffer(Stream2JSONInputStream.java:90)[114:org.eclipse.smarthome.io.rest:0.9.0.b5]
at org.eclipse.smarthome.io.rest.Stream2JSONInputStream.read(Stream2JSONInputStream.java:66)[114:org.eclipse.smarthome.io.rest:0.9.0.b5]
at java.io.InputStream.read(InputStream.java:179)[:1.8.0_121]
at java.io.InputStream.read(InputStream.java:101)[:1.8.0_121]
at org.glassfish.jersey.message.internal.ReaderWriter.writeTo(ReaderWriter.java:115)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider.writeTo(AbstractMessageReaderWriterProvider.java:79)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.message.internal.InputStreamProvider.writeTo(InputStreamProvider.java:105)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.message.internal.InputStreamProvider.writeTo(InputStreamProvider.java:60)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:106)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:86)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
... 41 more
If both string have the same regex as the first string they both work.
If I delete the TestSoll String and restart VisualStudioCode again everything is fine.
What am I doing wrong?
Now I changed the item to
Number TestSoll "Wert [%1.f]" (gLueftungTemp) { http="<[AC40CacheRaw:60000:REGEX(TL300E02B01.*blank.[>](.*)[<])]"} //Should get the value string
I get no errors in the log no error in VisualStudioCode but an error in the sitemap
But I realy do not understand why?
I change now completly to a javascript transform.
I placed the regex in the follwoing javascriptfile
(function(i) {
var re = new RegExp('TL300E02D01.*blank.[>](.*)[<]');
var out = i.match(re)[1]
out = Number(out)
return out;
})(input)
and changed the item definition to
Number TestSoll { http="<[AC40CacheRaw:10000:JS(AC40_Value.js)]"}
Let me say: This way it is working
Why it is not working with a direct regex I still do not understand.
Iām gald you got it working. Scanning the code from my phone Iām afraid I was of limited help. I canāt explain why the regex wasnāt working. There is nothing obviously wrong with it.
Iāve no idea what the map errors are all about but since the VS error and the OH logs seem to agree that there is some sort of map error there must be something wrong syntactically.
If you cared to figure it out, you could load the files into Designer and see if it tells you something more informative. Designer has better syntax checking.