How can I retrieve data from a not well formed html webpage with the http-binding?

Hello,

I have a pretty old plc with an integrated webserver at home.

If I ask the plc to show its complete Data with values I get the following webpage as return.

<!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&auml;hlten FG-Adressen:</h2>
----------------------------------------------------------------------------------------------------
<br><pre><b>TA300A00B91       </b>Dachgeschosstemperatur              Analogeingang mit Grenzwert
<br>07-03-17  18:27:23            <a href="fga/TA300A00B91     " target="_blank">22.01493 </a>
<br></pre>                                                                                           
----------------------------------------------------------------------------------------------------
<br><pre><b>TH300A00Z01       </b>Stromzaehler Heizung                Zaehlwert mit Grenzwert
<br>07-03-17  18:27:23            <a href="fga/TH300A00Z01     " target="_blank">1556.001 </a>
<br></pre>                                                                                               
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300A00A01       </b>Generalbefehl                       1 stufiger Befehlspunkt
<br>07-03-17  18:27:23            <a href="fga/TL300A00A01     " target="_blank">EIN1  </a>
<br></pre>                                                                                                  
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300A00A02       </b>Sommerbetrieb                       1 stufiger Befehlspunkt
<br>07-03-17  18:27:23            <a href="fga/TL300A00A02     " target="_blank">AUS  </a>
<br></pre>                                                                                                   
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300A00Q10       </b>Aussenluftklappen AUF               1 stufiger Befehlspunkt
<br>07-03-17  18:27:23            <a href="fga/TL300A00Q10     " target="_blank">EIN1  </a>
<br></pre>                                                                                                  
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300A00Q11       </b>Aussenluftklappen FRG               1 stufiger Befehlspunkt
<br>07-03-17  18:27:23            <a href="fga/TL300A00Q11     " target="_blank">AUS  </a>
<br></pre>                                                                                                   
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300A00Q12       </b>Aussenluftklappen AUF               1 stufiger Befehlspunkt
<br>07-03-17  18:27:23            <a href="fga/TL300A00Q12     " target="_blank">AUS  </a>
<br></pre>                                                                                                   
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E01B01       </b>Aussenluftlufttemperatur            Analogeingang mit Grenzwert
<br>07-03-17  18:27:23            <a href="fga/TL300E01B01     " target="_blank">4.726368 </a>
<br></pre>                                                                                           
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E01F11       </b>Frostschutz                         Alarmmeldung
<br>07-03-17  18:27:23            <a href="fga/TL300E01F11     " target="_blank">  </a>
<br></pre>                                                                                                                 
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E01Z01       </b>Stromzaehler Vorerhitzer            Zaehlwert mit Grenzwert
<br>07-03-17  18:27:23            <a href="fga/TL300E01Z01     " target="_blank">15.8 </a>
<br></pre>                                                                                                   
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E02A01       </b>Freigabe Heizstab                   1 stufiger Befehlspunkt
<br>07-03-17  18:27:23            <a href="fga/TL300E02A01     " target="_blank">EIN1  </a>
<br></pre>                                                                                                  
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E02B01       </b>Zulufttemperatur                    Analogeingang mit Grenzwert
<br>07-03-17  18:27:23            <a href="fga/TL300E02B01     " target="_blank">20.14925 </a>
<br></pre>                                                                                           
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E02D01       </b>SW Zulufttemperatur                 Analogausgang
<br>07-03-17  18:27:23            <a href="fga/TL300E02D01     " target="_blank">20 </a>
<br></pre>                                                                                                               
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E02Q01       </b>Heizstab                            Analogausgang
<br>07-03-17  18:27:23            <a href="fga/TL300E02Q01     " target="_blank">26.40662 </a>
<br></pre>                                                                                                         
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E02Z01       </b>Stromzaehler Erhitzer               Zaehlwert mit Grenzwert
<br>07-03-17  18:27:23            <a href="fga/TL300E02Z01     " target="_blank">1528.202 </a>
<br></pre>                                                                                               
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300E51B01       </b>Raumablufttemperatur                Analogeingang mit Grenzwert
<br>07-03-17  18:27:23            <a href="fga/TL300E51B01     " target="_blank">16.04477 </a>
<br></pre>                                                                                           
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300G01M01       </b>Zuluftventilator                    1 stufiger Befehlspunkt
<br>07-03-17  18:27:23            <a href="fga/TL300G01M01     " target="_blank">EIN1  </a>
<br></pre>                                                                                                  
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300G01Z01       </b>Stromzaehler Ventilator             Zaehlwert mit Grenzwert
<br>07-03-17  18:27:23            <a href="fga/TL300G01Z01     " target="_blank">1294.539 </a>
<br></pre>                                                                                               
----------------------------------------------------------------------------------------------------
<br><pre><b>TL300G51B01       </b>Fortlufttemperatur                  Analogeingang mit Grenzwert
<br>07-03-17  18:27:23            <a href="fga/TL300G51B01     " target="_blank">11.06965 </a>
<br></pre>                                                                                           
</body>
</html>


How can I retrieve the data from that webpage?

The TopFloorLevelTemperature (Dachgeschosstemperatur) with the value of 22.01493 can be found in that line

<br><pre><b>TA300A00B91       </b>Dachgeschosstemperatur              Analogeingang mit Grenzwert
<br>07-03-17  18:27:23            <a href="fga/TA300A00B91     " target="_blank">22.01493 </a>
<br></pre>

I am using OH2

Is it better trying to retrieve the data with a xsl transformation or is it easier to get the value by a regex?

How can I step forward to develop either the xsl file or the regex step by step.? I need some kind of debugging. Any ideas what I can use best therefore?

Hi,

Since HTML is more or less a strict formatted XML with special and defined Tags, XSLT should bei a good starting Point for your goal.

See the Wiki for further explanation.


It refers to a XSLT tutorial from w3schools.

They have an online editor where you can try out transformations.
This could be a debugging solution for you.

I have used their js live editor in the past for testing stuff and it worked really well.

I am no expert in grabbing html Pages with OH, so it is definetely possible that there is already existing a better out of the Box solution.

Hello,

thank you for your answer. I tried the online transformation editor. Which is a brilliant tool.

But I am not capable to read in my not well formed webpage.

The problem seems to be that the webpage has a lot of open tags.

For example

is not closing and I get an error. If I close it by adding “/” I come to the next error

Here you can see the

<br>

Tags are never closed.

Is there a way to read into a xslt Processor a mal formed xml and does oh2 support this?

Hello to all,

I worked a little bit further on my problem.

If I change my webpage to the following structure

<!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&auml;hlten FG-Adressen:</h2>
----------------------------------------------------------------------------------------------------
<br /><pre><b>TA300A00B91       </b>Dachgeschosstemperatur              Analogeingang mit Grenzwert
<br />08-03-17  08:45:58            <a href="fga/TA300A00B91     " target="_blank">21.39304 </a>
<br /></pre>                                                                                           
----------------------------------------------------------------------------------------------------
<br /><pre><b>TL300E01B01       </b>Aussenluftlufttemperatur            Analogeingang mit Grenzwert
<br />08-03-17  08:45:58            <a href="fga/TL300E01B01     " target="_blank">-1.243778 </a>
<br /></pre>                                                                                          
----------------------------------------------------------------------------------------------------
<br /><pre><b>TL300E02B01       </b>Zulufttemperatur                    Analogeingang mit Grenzwert
<br />08-03-17  08:45:58            <a href="fga/TL300E02B01     " target="_blank">20.02488 </a>
<br /></pre>                                                                                           
----------------------------------------------------------------------------------------------------
<br /><pre><b>TL300E51B01       </b>Raumablufttemperatur                Analogeingang mit Grenzwert
<br />08-03-17  08:45:58            <a href="fga/TL300E51B01     " target="_blank">14.42786 </a>
<br /></pre>                                                                                           
----------------------------------------------------------------------------------------------------
<br /><pre><b>TL300G51B01       </b>Fortlufttemperatur                  Analogeingang mit Grenzwert
<br />08-03-17  08:45:58            <a href="fga/TL300G51B01     " target="_blank">7.338314 </a>
<br /></pre>                                                                                           
</body>
</html>

I can readin this into the xslt processor. I just replaced all

<br> with  <br /> 

and I closed the Meta tag with “/” as well to

<META HTTP-EQUIV="Refresh" CONTENT="30" />

I wrote the follwing xsl

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output indent="yes" method="xml" encoding="UTF-8" omit-xml-declaration="yes" />

  <xsl:template match="/">
    <xsl:for-each select="html/body/pre">
      <xsl:value-of select="b"/>
      <xsl:value-of select="a"/>
    </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>

And I get the the tagnames with values as result

TA300A00B91 21.39304 TL300E01B01 -1.243778 TL300E02B01 20.02488 TL300E51B01 14.42786 TL300G51B01 7.338314 

Here I can go on finding out how to get the values into oh2 items.

But my biggest problem still is:

How can I read in the webpage and modify it by adding all these “/” ???

1 Like

That is a problem. XSLT won’t work unless the XML is well formed. I’d use Regex.

Move the transform to a Rule.

rule "Process PLC"
when
    Item PLC_Raw receives update
then
    val corrected = PLX_Raw.state.toString.replace("<br>", "<br/>")
    val tagsAndVals = transform("XSLT", "plc.xslt", corrected)

    // Process and post the tags and values to the appropriate Items

end

Hello Rich,

thank you for your tip

Is the PLC_Raw the cached http File? Or where do I get it from?

I was thinking about the following way for an solution with the http Binding.

Normaly the website is cached in the following way

http.cfg

plcCacheRaw.url=http://plc.local/raw
plcCacheRaw.updateInterval=60000

I would change to an indirect call. I would call an python script, which calls the webpage and does the replacements

plcCache.url=file://…/python correct.py ‘http://plc.local/raw…’
plcCache.updateInterval=60000

Afterwards I could use the xsl statements to get the values into the item. There would be no need for rules then.

Would this way work?

When yes, what would be the correct syntax for that indirect call?

You didn’t provide any of your Items so I made one up. This is the Item that is bound to the HTTP binding but without any transformation.

Then the Item definition would look like:

PLC_Raw { http="plcCacheRaw:60000:REGEX((.*))" } // I don't know if you can totally skip the transformation so I use this noop REGEX transform

This is crazy overcomplicated. There is no need for a Python script. Besides, the HTTP binding cannot process file URLs, only HTTP URLs.

With one change to your Item and two lines of code added to a Rule you were going to have to write anyway to process the result of your XSLT transform you have solved your problem.

Hello again,

thank for your answer.

This is an important information

I was not sure about that. Now I am.

I could not provide an item, because I tried to learn a little bit xsl. Where I had to solve the nasty problem with the “/”.
After that I would have started with the items definitions

Your way to start just with an item (holding the raw webpage) seems to be indeed a lot easier.
This way makes the http binding in my eyes obsolet.

I’ll give your way it a try.

No. It is the HTTP binding that actually gets the HTML from the web server. The Item is bound to the HTTP binding. Without the HTTP binding you will get no data to process.

Hello,

I did now the following (as I thought that I understood it), but with no success.

  1. Create http.cfg in service folder
AC40CacheRaw.url=http://ac40/cgi-fga/index.htm?fgt=**&fgm=****************
AC40CacheRaw.updateInterval=60000
  1. Create Item File AC40.item in item folder
AC40_Raw { http="AC40CacheRaw:60000:REGEX((.*))" }


Number TL300E02B01  "Zulufttemperatur Lueftung [%.1f °C]"   <temperature>
  1. Create rules File AC40.rules in rules folder
rule "Process AC40"
when
    Item AC40_Raw receives update
then
    val AC40corrected = AC40_Raw.state.toString.replace("<br>", "<br/>").state.toString.replace("<META HTTP-EQUIV="Refresh" CONTENT="30">", "")
    val AC40_TL300E02B01 = transform("XSLT", "AC40_TL300E02B01.xsl", AC40corrected)
    

    // Process and post the tags and values to the appropriate Items
 
    TL300E02B01.sendCommand (AC40_TL300E02B01 as DecimalType)

end

4 Create xsl-file AC40_TL300E02B01.xsl in rules folder

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output indent="yes" method="xml" encoding="UTF-8" omit-xml-declaration="yes" />

  <xsl:template match="/">
    <xsl:for-each select="html/body/pre">
      <xsl:if test="starts-with(b ,'TL300E02B01')">
          <xsl:value-of select="a"/>
      </xsl:if>
    </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>

Nothing happens :disappointed:

In which folder do I have to put the xsl File?

Or is my variable AC40corrected not correct? (to replace actions in one line!)

Or what ever else is wrong?

Should be String AC40_Raw { http="AC40CacheRaw:60000:REGEX((.*))" }

That was my mistake above. I left out the Item type.

You only call .state once. .state is a method on the Item. Once you call toString you are dealing with a String and there is no .state method. There is also no need to call toString again. Its already a Sring. Finally, you are dealing with just a String, so unless when you open this HTML in notepad is uses < instead of < you should use <. Finally, you need to escape double quotes within the String. Should be:

val AC40corrected = AC40_Raw.state.toString.replace("<br>", "<br/>").replace("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30\">", "")

AC40_TL300E02B01 is a String. You can’t just cast a String to a DecimalType. Assuming that this String is parsable (i.e. uses . for decimal instead of , and has no leading or trailing white space) you can just pass it as is to sendCommand.

This belongs in the transform folder.

I highly highly recommend using Designer. Most if not all of these errors would have been highlighted in red for you immediately as you type.

Hello,

I’am using the designer, but nearly every line shows errors, so I don’t care a lot about this (I’am used to windows :slight_smile: and not every error is really important)

I changed the rule file and I still have errors

the first error

the second error tells me

And the last error

is the only one which tell me that the cast from string to string is a little bit stupid so I left the cast and I get the messeage

But the field TL300E02B01 is defined as Number within the item-File.

what do I have to do to convert the string (“21.14428”) into a number?
I think it should convert by itself, as in the item definition the number format is specified as “%.1f”

My really big problem is at the moment that I have no idea how to debug.

In the karaf nothing is happening. The Temperatur is shown as “–”

I’am nearby, but still far away. (I’am also a little bit tired, so I’am going to bed now)

Every error you list is fatal. Your rule will not work with any one of these errors, let alone all of them. The only errors you can ignore are calls to add-on actions, Channel triggers, and references to Items defined in PaperUI. All other errors are real and must be corrected.

Indicates a problem on that line. Upon review I see you use “receives” instead of “received”.

The second error is telling you that you do not have an AC40_Raw Item. And as I pointed out above, there needs to be a String in front of that Item in the .Items file.

The third one which is actually two errors is probably caused by the second error. Once oh encountered that malformed Item definition for AC40_Raw, it stopped paying the file so your second item dues not exist either.

You don’t have to. Just pass the String to sendCommand and it will convert it to a number for you.

These are two completely different things. I don’t have the time to fully explain but suffice it to say you cannot convert a String to a Number or any other type using as.

Step one is making sure the are no errors down in Designer or confirming Designer is not showing real errors.

Then add logging to your rule to see where it fails.

That part of the Item definition is only about how to display it in a UI, and does not affect how the Item is stored or updated.

Hello,

I think the http binding does not work at all. But I’am not sure, because I can not solve my errors.

I have now:

// http-cfg File  in services folder

AC40CacheRaw.url=http://ac40/cgi-fga/index.htm?fgt=**&fgm=****************

AC40CacheRaw.updateInterval=10000

my items file looks like (are you sure, that the REGEX can be used instead of XSLT ?)
Both lines do not work!
The items-file is error free.

Group  AC40         "AC40"

//String AC40_Raw     (AC40) { http="AC40CacheRaw:10000:REGEX((.*))" } 
String AC40_Raw     (AC40) { http="<[AC40CacheRaw:10000:REGEX((.*))]" } 


Number TL300E02B01  "Zulufttemperatur Lueftung [%.1f °C]"   <temperature> (Temperature)

and my rule

rule "Process_AC40"
when
    Item AC40_Raw received update
then
	logInfo("Process_AC40","received update")
//    val AC40corrected = AC40_Raw.state.toString.replace("<br>", "<br/>").replace("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30\">", "")
//    val AC40_TL300E02B01 = transform("XSLT", "AC40_TL300E02B01.xsl", AC40corrected)
    var AC40corrected = AC40_Raw.state.toString.replace("<br>", "<br/>").replace("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30\">", "")
    var AC40_TL300E02B01 = transform("XSLT", "AC40_TL300E02B01.xsl", AC40corrected)

 // Process and post the tags and values to the appropriate Items
 
    TL300E02B01.sendCommand (AC40_TL300E02B01)

end

the logInfo never comes.(even if I comment all the rest of the lines)

I still have the error on “AC40_Raw” where I get

“The method or field AC40_Raw is undefined”

I changed from val to var but there is no difference.

I supose the problem is in the line

 Item AC40_Raw received update

There is something missing, but what?

Now I thougt a good idea may be a reboot.

Karaf is telling me now:

2017-03-13 01:55:11.559 [SEVERE] [org.apache.karaf.main.Main] - Could not launch framework
java.lang.OutOfMemoryError: Java heap space
        at org.eclipse.osgi.container.ModuleDatabase$Persistence.readStringArray(ModuleDatabase.java:1381)
        at org.eclipse.osgi.container.ModuleDatabase$Persistence.readMap(ModuleDatabase.java:1341)
        at org.eclipse.osgi.container.ModuleDatabase$Persistence.readGenericInfo(ModuleDatabase.java:1280)
        at org.eclipse.osgi.container.ModuleDatabase$Persistence.readModule(ModuleDatabase.java:1107)
        at org.eclipse.osgi.container.ModuleDatabase$Persistence.load(ModuleDatabase.java:1015)
        at org.eclipse.osgi.container.ModuleDatabase.load(ModuleDatabase.java:879)
        at org.eclipse.osgi.storage.Storage.<init>(Storage.java:145)
        at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
        at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:75)
        at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31)
        at org.eclipse.osgi.launch.EquinoxFactory.newFramework(EquinoxFactory.java:24)
        at org.apache.karaf.main.Main.launch(Main.java:250)
        at org.apache.karaf.main.Main.main(Main.java:175)

2017-03-13 01:55:19.799 [SEVERE] [org.apache.karaf.main.Main] - Could not launch framework
java.lang.OutOfMemoryError: Java heap space
        at org.eclipse.osgi.container.ModuleDatabase$Persistence.readStringArray(ModuleDatabase.java:1381)
        at org.eclipse.osgi.container.ModuleDatabase$Persistence.readMap(ModuleDatabase.java:1341)
        at org.eclipse.osgi.container.ModuleDatabase$Persistence.readGenericInfo(ModuleDatabase.java:1280)
        at org.eclipse.osgi.container.ModuleDatabase$Persistence.readModule(ModuleDatabase.java:1107)
        at org.eclipse.osgi.container.ModuleDatabase$Persistence.load(ModuleDatabase.java:1015)
        at org.eclipse.osgi.container.ModuleDatabase.load(ModuleDatabase.java:879)
        at org.eclipse.osgi.storage.Storage.<init>(Storage.java:145)
        at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
        at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:75)
        at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31)
        at org.eclipse.osgi.launch.EquinoxFactory.newFramework(EquinoxFactory.java:24)
        at org.apache.karaf.main.Main.launch(Main.java:250)
        at org.apache.karaf.main.Main.main(Main.java:175)

Is there a way to get it run again? I only was playing with the http binding. I didn’t expect rebooting problems.

I’am running the version

login as: pi
pi@hab's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Mar 13 01:53:59 2017 from xxxxxxxxxxxx

####################################################################
########################## HAB #################### 5.15.160729 ####
####################################################################
##          Ip = 192.168.1.xxx
##     Release = Raspbian GNU/Linux 8 (jessie)
##      Kernel = Linux 4.4.0-1-rpi2
##    Platform = Raspberry Pi 2 Model B Rev 1.1
##      Uptime = 0 day(s). 0:5:58
##   CPU Usage = 27.02 % average CPU usage over 4 core(s)
##    CPU Load = 1m: 1.04, 5m: 0.83, 15m: 0.39
##      Memory = Free: 0.79 GB (84%), Used: 0.15 GB (16%), Total: 0.94 GB
##        Swap = Free: 0.00 GB (0%), Used: 0.00 GB (100%), Total: 0.00 GB
##        Root = Free: 26.09 GB (93%), Used: 1.69 GB (7%), Total: 29.29 GB
##     Updates = 68 apt-get updates available.
##    Sessions = 2 sessions
##   Processes = 112 running processes of 7666 maximum processes
####################################################################

              Welcome to            __  _____    ____  _
            ____  ____  ___  ____  / / / /   |  / __ )(_)___ _____
           / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  / / __ `/ __ \
          / /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ / / /_/ / / / /
          \____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/_/\__,_/_/ /_/
              /_/
                                         openHAB 2.0 Build #547

[01:59:30] pi@HAB:~$

I now I have to update. As I have a very old version of openhabian it is better to do a complette reinstall.

Is it possible to get it run again?

Doubtful as I and hundreds of others are successfully using it.

Which means that AC40_Raw is never receiving updates.

Which is the root cause of the problem. This rule will never run as long as you see this error. The error says as far as OH is concerned AC40_Raw doesn’t exist. This points to some sort of syntax error in the .items file preventing OH from loading and parsing that file.

That is a REALLY old version of OH. There have been hundreds of bugs corrected and improvements made since build 547. This might even be before the first Beta release.

Save your /etc/openhab2 folder and upgrade. Without your being at least at the Release version (which is around build 790 I think) we will not be able to help much. There have been too many bugs fixed and changes made to begin to help.

Do not focus on getting this version running and focus on getting the release or 2.10 snapshot installed. I would start with a fresh openHABian given the problems you are seeing.

I’am back with a running system :relaxed:

I reentered everything.

But the binding is still not running.

Do I have to add the binding in the addon.cfg File? Or is the file http.cfg enough information for the OH2 system to know what to do?

In my rules File I still have an error:

rule "Process AC40"
when
    Item AC40_Raw received update
then
    val AC40corrected = AC40_Raw.state.toString.replace("<br>", "<br/>").state.toString.replace("<META HTTP-EQUIV='Refresh' CONTENT='30>'", "")
    val AC40_TL300E02B01 = transform("XSLT", "AC40_TL300E02B01.xsl", AC40corrected)
    

    // Process and post the tags and values to the appropriate Items
 
    TL300E02B01.sendCommand (AC40_TL300E02B01)

end

I get the error:

The method or field AC40_Raw is undefined

What am I doing wrong?

Here comes the screenshot

Another question I’am concerning about is the second “toString.replace”

“<META HTTP-EQUIV=‘Refresh’ CONTENT=‘30>’”

There are two String in there which are surroundet by “” I changed that to apostrophes. Is that right?

The second error is the same as the first one. Only the variable name is changed.

Here is the item definition

String AC40_Raw { http="AC40CacheRaw:60000:REGEX((.*))" }


Number TL300E02B01  "Zulufttemperatur Lueftung [%.1f °C]"   <temperature>

You must install the binding by either installing it through PaperUI or adding it to addons.cfg.

If you don’t have the binding installed that could theoretically cause the AC40_Raw Item to not be successfully created which would account for the error.

Now it looks better here the karaf log

==> /var/log/openhab2/openhab.log <==
2017-03-21 17:39:58.116 [ERROR] [el.item.internal.GenericItemProvider] - Binding configuration of type 'http' of item 'AC40_Raw' could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: bindingConfig 'AC40CacheRaw:60000:REGEX((.*))' doesn't contain a valid binding configuration
        at org.openhab.core.binding.internal.BindingConfigReaderDelegate.processBindingConfiguration(BindingConfigReaderDelegate.java:50)
        at org.eclipse.smarthome.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:312)
        at org.eclipse.smarthome.model.item.internal.GenericItemProvider.dispatchBindingsPerType(GenericItemProvider.java:268)
        at org.eclipse.smarthome.model.item.internal.GenericItemProvider.addBindingConfigReader(GenericItemProvider.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_112]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_112]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_112]
        at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_112]
        at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:224)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:617)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:501)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.inject.BindMethod.invoke(BindMethod.java:655)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1722)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:1699)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:371)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:320)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:291)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127)[32:org.apache.felix.scr:2.0.6]
        at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:482)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:998)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.openhab.core.binding.internal.BindingConfigReaderFactory.registerDelegateService(BindingConfigReaderFactory.java:69)
        at org.openhab.core.binding.internal.BindingConfigReaderFactory.addBindingConfigReader(BindingConfigReaderFactory.java:52)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_112]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_112]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_112]
        at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_112]
        at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:224)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:617)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:501)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.inject.BindMethod.invoke(BindMethod.java:655)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1722)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:1699)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:371)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:320)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:291)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127)[32:org.apache.felix.scr:2.0.6]
        at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:886)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:873)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:940)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:740)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:674)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:429)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:657)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:341)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:403)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.Activator.access$200(Activator.java:54)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:278)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.utils.extender.AbstractExtender.addingBundle(AbstractExtender.java:192)[32:org.apache.felix.scr:2.0.6]
        at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:469)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:415)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)[org.osgi.core-6.0.0.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:902)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.Module.publishEvent(Module.java:466)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.Module.start(Module.java:457)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer.applyDelta(ModuleContainer.java:717)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer.resolveAndApply(ModuleContainer.java:491)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:437)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:427)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.resolveBundles(ModuleContainer.java:1267)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.resolveBundles(FeaturesServiceImpl.java:1366)[8:org.apache.karaf.features.core:4.0.8]
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:847)[8:org.apache.karaf.features.core:4.0.8]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1176)[8:org.apache.karaf.features.core:4.0.8]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1074)[8:org.apache.karaf.features.core:4.0.8]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_112]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_112]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_112]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_112]
2017-03-21 17:39:58.278 [INFO ] [b.core.service.AbstractActiveService] - HTTP Refresh Service has been started

No we are stepping forward. Without the crash I would not have noticed that addon.cfg. But after the reinstall I had some problems wiht that.

I installed the binding now via paperui.