I changed the time value to :6000: but the result is still the same
That every 6 seconds do 60000
Did you install the http binding version 1.x?
No. Now I did install it and also changed to 60000ms, but still no result. The only difference is that now the dash is gone.
Try that:
This will check if we get any data at all
String Info "Info [%s]" {http="<[http://campulverde.info/liveStreams.xml:60000:default]"}
thx but it makes no difference
I now have:
String Info "Info [%s]" { http="<[http://campulverde.info/liveStreams.xml:60000:XPATH(/liveStreams/stream/label/text())]" }
I have tried with t full regex and It got the data
I have checked the XPATH in https://www.freeformatter.com/xpath-tester.html#ad-output
and your XPATH is correct
I don’t know why it doesn’t work
@gsmatei and @vzorglub The xpath does not work as it does not address the namespace.
https://docs.openhab.org/addons/transformations/xpath/readme.html
thx @vzorglub!!!
Starting from the example in your link:
String Temperature_xml “Temperature [JSONPATH([name()=‘PTZStatus’]/[name()=‘AbsoluteHigh’]/[name()=‘azimuth’]/):%s °C]” {…}
i’ve tried with this but it’s not working:
String Info “Info [JSONPATH([name()=‘liveStreams’]/[name()=‘stream’]/[name()=‘label’]/) %s]” {http="<[http://campulverde.info/liveStreams.xml]"}
What I’m doing wrong?
thx!
Documentation has an typo JSONPATH vs XPATH
:)))
Still something else is wrong with that example. Look what i get:
with this: String Info “Info [XPATH([name()=‘liveStreams’]/[name()=‘stream’]/[name()=‘label’]/) %s]” {http="<[http://campulverde.info/liveStreams.xml]"}
you have to give a closer look
there is something missing " :
"
azimuth’]/):%s °C]
I added “:”. Still no difference then the last print screen
[name()='PTZStatus']/*[name()='AbsoluteHigh']/*[name()='azimuth']/):%s °C]
vs
[name()='liveStreams']/[name()='stream']/[name()='label']/) %s]
you could try it with
String Info "Info [XPATH(/*[name()='liveStreams']/*[name()='stream']/*[name()='label']/):%s]" {...}
Sorry for not using code fences.
Nope, still not working with the same code from you
String Info "Info [XPATH(/*[name()='liveStreams']/*[name()='stream']/*[name()='label']/):%s]" {http="<[http://campulverde.info/liveStreams.xml]"}
But you have installed the XPATH transformation!
What does the log say?
@gsmatei this works
String http_Info "Info [%s]" {http="<[http://campulverde.info/liveStreams.xml:60000:XPATH(/*[name()='liveStreams']/*[name()='stream']/*[name()='label'])]"}
Looks like it’s installed.
Log file says:
2018-05-07 15:46:22.416 [ERROR] [el.item.internal.GenericItemProvider] - Binding configuration of type 'http' of item 'Info' could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: bindingConfig 'http://campulverde.info/liveStreams.xml' doesn't represent a valid in-binding-configuration. A valid configuration is matched by the RegExp '(.*?)(\{.*\})?:(?!//)(\d*):(.*)'
at org.openhab.core.binding.internal.BindingConfigReaderDelegate.processBindingConfiguration(BindingConfigReaderDelegate.java:50)[176:org.openhab.core.compat1x:2.1.0]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:325)[123:org.eclipse.smarthome.model.item:0.9.0.b5]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:297)[123:org.eclipse.smarthome.model.item:0.9.0.b5]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.processBindingConfigsFromModel(GenericItemProvider.java:182)[123:org.eclipse.smarthome.model.item:0.9.0.b5]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.modelChanged(GenericItemProvider.java:367)[123:org.eclipse.smarthome.model.item:0.9.0.b5]
at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:286)[122:org.eclipse.smarthome.model.core:0.9.0.b5]
at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:136)[122:org.eclipse.smarthome.model.core:0.9.0.b5]
at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:234)[122:org.eclipse.smarthome.model.core:0.9.0.b5]
at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.processWatchEvent(FolderObserver.java:297)[122:org.eclipse.smarthome.model.core:0.9.0.b5]
at org.eclipse.smarthome.core.service.WatchQueueReader.run(WatchQueueReader.java:206)[98:org.eclipse.smarthome.core:0.9.0.b5]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Yes!!! Now it’s working!!!
String http_Info "Info [%s]" {http="<[http://campulverde.info/liveStreams.xml:60000:XPATH(/*[name()='liveStreams']/*[name()='stream']/*[name()='label'])]"}
Super thx!!!
Thanks, I was basically copying the one use for openhab service
Learned something, always good