Air Quality Binding error

Dear Community!

So here is the error which I get very frequently. Sometimes when I get this error, the item’s outputs are empty


2018-04-11 19:07:52.098 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - transformation throws exception [transformation=org.eclipse.smarthome.transform.map.internal.MapTransformationService@11152b2, value=-]
org.eclipse.smarthome.core.transform.TransformationException: An error occurred while opening file.
        at org.eclipse.smarthome.transform.map.internal.MapTransformationService.internalLoadTransform(MapTransformationService.java:66) [227:org.eclipse.smarthome.transform.map:0.10.0.b1]
        at org.eclipse.smarthome.transform.map.internal.MapTransformationService.internalLoadTransform(MapTransformationService.java:1) [227:org.eclipse.smarthome.transform.map:0.10.0.b1]
        at org.eclipse.smarthome.core.transform.AbstractFileTransformationService.transform(AbstractFileTransformationService.java:134) [118:org.eclipse.smarthome.core.transform:0.10.0.b1]
        at org.eclipse.smarthome.ui.internal.items.ItemUIRegistryImpl.transform(ItemUIRegistryImpl.java:462) [155:org.eclipse.smarthome.ui:0.10.0.b1]
        at org.eclipse.smarthome.ui.internal.items.ItemUIRegistryImpl.getLabel(ItemUIRegistryImpl.java:386) [155:org.eclipse.smarthome.ui:0.10.0.b1]
        at org.eclipse.smarthome.ui.basic.internal.render.AbstractWidgetRenderer.preprocessSnippet(AbstractWidgetRenderer.java:118) [205:org.eclipse.smarthome.ui.basic:0.10.0.b1]
        at org.eclipse.smarthome.ui.basic.internal.render.TextRenderer.renderWidget(TextRenderer.java:42) [205:org.eclipse.smarthome.ui.basic:0.10.0.b1]
        at org.eclipse.smarthome.ui.basic.internal.render.PageRenderer.renderWidget(PageRenderer.java:172) [205:org.eclipse.smarthome.ui.basic:0.10.0.b1]
        at org.eclipse.smarthome.ui.basic.internal.render.PageRenderer.processChildren(PageRenderer.java:137) [205:org.eclipse.smarthome.ui.basic:0.10.0.b1]
        at org.eclipse.smarthome.ui.basic.internal.render.PageRenderer.processChildren(PageRenderer.java:158) [205:org.eclipse.smarthome.ui.basic:0.10.0.b1]
        at org.eclipse.smarthome.ui.basic.internal.render.PageRenderer.processPage(PageRenderer.java:100) [205:org.eclipse.smarthome.ui.basic:0.10.0.b1]
        at org.eclipse.smarthome.ui.basic.internal.servlet.WebAppServlet.service(WebAppServlet.java:159) [205:org.eclipse.smarthome.ui.basic:0.10.0.b1]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [85:org.eclipse.jetty.security:9.3.22.v20171030]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.Server.handle(Server.java:534) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [79:org.eclipse.jetty.io:9.3.22.v20171030]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [79:org.eclipse.jetty.io:9.3.22.v20171030]
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [79:org.eclipse.jetty.io:9.3.22.v20171030]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [90:org.eclipse.jetty.util:9.3.22.v20171030]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [90:org.eclipse.jetty.util:9.3.22.v20171030]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [90:org.eclipse.jetty.util:9.3.22.v20171030]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [90:org.eclipse.jetty.util:9.3.22.v20171030]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [90:org.eclipse.jetty.util:9.3.22.v20171030]
        at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.io.FileNotFoundException: /openhab/conf/transform/airquality.map (No such file or directory)
        at java.io.FileInputStream.open0(Native Method) ~[?:?]
        at java.io.FileInputStream.open(FileInputStream.java:195) ~[?:?]
        at java.io.FileInputStream.<init>(FileInputStream.java:138) ~[?:?]
        at java.io.FileInputStream.<init>(FileInputStream.java:93) ~[?:?]
        at java.io.FileReader.<init>(FileReader.java:58) ~[?:?]
        at org.eclipse.smarthome.transform.map.internal.MapTransformationService.internalLoadTransform(MapTransformationService.java:62) ~[?:?]
        ... 37 more

Add a mapping for - to your .map files. “-” means your Item is NULL, i.e. uninitialized. Something like

-=Uninitialized

All Items are initialized with NULL and remain in that state until the Item gets set to a new state. Often if one is using persistence the Item gets updated to the last state in the database almost immediately but sometimes it doesn’t happen fast enough.

Thanks I’ll try this out! Since I haven’t had any airquality.map file there I have created one with the command you adviced.
Hope this solves!

However, now I don’t get any string and other items shown on the sitemap. I can see the values in the PaperUI, but not on the sitemap. What seems to be wrong?

These seems to be the errors which I get:

2018-04-12 14:24:33.575 [WARN ] [airquality.handler.AirQualityHandler] - Error in aqicn.org (Air Quality) response: missing data sub-object
2018-04-12 14:28:00.395 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'UNDEF' with the file 'airquality.map' : Target value not found in map for 'UNDEF'

Ps.: Sorry, on the PaperUI also doesn’t seems to work, it just stored a value… after restart, I can’t see any data from this binding and it says (in PaperUI things section) that it is offline: missing data sub-object

The error is the same as above. You need an UNDEF type in your .map file. I can’t help with the problems with the binding itself. I don’t use this binding.

Thanks for your help, I have added UNDEF in the map file already, forgot to edit…
I’ll try to dig deeper in it, because I haven’t found any reference to errors like this!