Item render others useless.



  • Re: OpenHab mqtt binding only one topic

    I have just started to look into openHAB and immediately ran in to a problem with theese lines:

    Switch OfficeRelay "Relay" <socket> (Office) {mqtt=">[rpi_work:office/switch/in/f9fda134fe18/relay:command::MAP(onoff.map)],<[rpi_work:office/switch/out/f9fda134fe18/relay:state:MAP(onoff.map)]}
    Switch OfficePin16 "PIN16" <hue> (Office) {mqtt=">[rpi_work:office/switch/in/f9fda134fe18/pin16:command:
    :MAP(onoff.map)],<[rpi_work:office/switch/out/f9fda134fe18/pin16:state:MAP(onoff.map)]}

    onoff.map:
    ON=on
    OFF=off
    off=OFF
    on=ON

    It seems like either one of the items makes all the items "below" useless i.e. they cannot be loaded into my sitemap.
    Each switch by it self works, as long as it is declared above the other.

    Does anyone have a solution to this problem?


  • Hero Member

    hi @jotar

    Do you mean that when you use the sitemap in a browser, that everything under it does not work?

    If so then you are likel missing something in your sitemap file.... If you use the Openhab designer, it will likely show any syntax/formatting issues.



  • Hi @gregl

    EDIT:
    Found the problem!
    Missing end quotes on both my "mqtt" items.

    I'm not so sure it has to do with the sitemap, for it is very simple:

    sitemap home label="Office"
    {
    	Frame label="TEST" 
        {
    		Switch item=OfficePin16
    		Switch item=OfficeRelay
    		Text item=OneWireTempSensor1
        }
    }
    

    Without changing my sitemap I get the following results:

    In my items file i have two Groups declared:
    Group Office
    Group Sensors

    Result 1:

    Number OneWireTempSensor1 "Temp 1 [%.1f °C]" <temperature> (Office, Sensors) {onewire="deviceId=28.FF14AE060000;propertyName=temperature;refreshinterval=10"}
    Switch OfficeRelay "Relay" <socket> (Office) {mqtt=">[office:odum.se/switch/in/f9fda134fe18/relay:command:*:MAP(onoff.map)],<[office:odum.se/switch/out/f9fda134fe18/relay:state:MAP(onoff.map)]}
    Switch OfficePin16 "PIN16" <hue> (Office) {mqtt=">[office:odum.se/switch/in/f9fda134fe18/pin16:command:*:MAP(onoff.map)],<[office:odum.se/switch/out/f9fda134fe18/pin16:state:MAP(onoff.map)]}
    

    alt text

    Items OfficeRelay and OneWireTempSensor1 is being displayed and functioning properly. OfficePin16 is not.

    Result 2

    Switch OfficeRelay "Relay" <socket> (Office) {mqtt=">[office:odum.se/switch/in/f9fda134fe18/relay:command:*:MAP(onoff.map)],<[office:odum.se/switch/out/f9fda134fe18/relay:state:MAP(onoff.map)]}
    Switch OfficePin16 "PIN16" <hue> (Office) {mqtt=">[office:odum.se/switch/in/f9fda134fe18/pin16:command:*:MAP(onoff.map)],<[office:odum.se/switch/out/f9fda134fe18/pin16:state:MAP(onoff.map)]}
    Number OneWireTempSensor1 "Temp 1 [%.1f °C]" <temperature> (Office, Sensors) {onewire="deviceId=28.FF14AE060000;propertyName=temperature;refreshinterval=10"}
    

    alt text

    Item OfficeRelay is being displayed and functioning properly. OfficePin16 and OneWireTempSensor1 are not.

    Result 3

    Switch OfficePin16 "PIN16" <hue> (Office) {mqtt=">[office:odum.se/switch/in/f9fda134fe18/pin16:command:*:MAP(onoff.map)],<[office:odum.se/switch/out/f9fda134fe18/pin16:state:MAP(onoff.map)]}
    Number OneWireTempSensor1 "Temp 1 [%.1f °C]" <temperature> (Office, Sensors) {onewire="deviceId=28.FF14AE060000;propertyName=temperature;refreshinterval=10"}
    Switch OfficeRelay "Relay" <socket> (Office) {mqtt=">[office:odum.se/switch/in/f9fda134fe18/relay:command:*:MAP(onoff.map)],<[office:odum.se/switch/out/f9fda134fe18/relay:state:MAP(onoff.map)]}
    

    alt text

    Item OfficePin16 is being displayed and functioning properly. OfficeRelay and OneWireTempSensor1 are not.

    This is a piece of the log for the result 3:

    2016-06-17 07:45:59.332 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
    2016-06-17 07:45:59.371 [WARN ] [.o.u.w.i.render.SwitchRenderer] - Cannot determine item type of 'OfficeRelay'
    org.openhab.core.items.ItemNotFoundException: Item 'OfficeRelay' could not be found in the item registry
            at org.openhab.core.internal.items.ItemRegistryImpl.getItem(ItemRegistryImpl.java:80) ~[na:na]
            at org.openhab.ui.internal.items.ItemUIRegistryImpl.getItem(ItemUIRegistryImpl.java:554) ~[na:na]
            at org.openhab.ui.webapp.internal.render.SwitchRenderer.renderWidget(SwitchRenderer.java:57) ~[org.openhab.ui.webapp_1.8.3.jar:na]
            at org.openhab.ui.webapp.internal.render.PageRenderer.renderWidget(PageRenderer.java:158) [org.openhab.ui.webapp_1.8.3.jar:na]
            at org.openhab.ui.webapp.internal.render.PageRenderer.processChildren(PageRenderer.java:121) [org.openhab.ui.webapp_1.8.3.jar:na]
            at org.openhab.ui.webapp.internal.render.PageRenderer.processChildren(PageRenderer.java:138) [org.openhab.ui.webapp_1.8.3.jar:na]
            at org.openhab.ui.webapp.internal.render.PageRenderer.processPage(PageRenderer.java:86) [org.openhab.ui.webapp_1.8.3.jar:na]
            at org.openhab.ui.webapp.internal.servlet.WebAppServlet.service(WebAppServlet.java:127) [org.openhab.ui.webapp_1.8.3.jar:na]
            at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61) [org.eclipse.equinox.http.servlet_1.1.300.v20120522-1841.jar:na]
            at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128) [org.eclipse.equinox.http.servlet_1.1.300.v20120522-1841.jar:na]
            at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60) [org.eclipse.equinox.http.servlet_1.1.300.v20120522-1841.jar:na]
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) [javax.servlet_3.0.0.v201112011016.jar:na]
            at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598) [org.eclipse.jetty.servlet_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:486) [org.eclipse.jetty.servlet_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) [org.eclipse.jetty.server_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065) [org.eclipse.jetty.server_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413) [org.eclipse.jetty.servlet_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) [org.eclipse.jetty.server_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999) [org.eclipse.jetty.server_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) [org.eclipse.jetty.server_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) [org.eclipse.jetty.server_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) [org.eclipse.jetty.server_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) [org.eclipse.jetty.server_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.server.Server.handle(Server.java:350) [org.eclipse.jetty.server_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) [org.eclipse.jetty.server_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) [org.eclipse.jetty.server_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) [org.eclipse.jetty.server_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630) [org.eclipse.jetty.http_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) [org.eclipse.jetty.http_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) [org.eclipse.jetty.server_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:606) [org.eclipse.jetty.io_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46) [org.eclipse.jetty.io_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603) [org.eclipse.jetty.util_8.1.3.v20120522.jar:8.1.3.v20120522]
            at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538) [org.eclipse.jetty.util_8.1.3.v20120522.jar:8.1.3.v20120522]
            at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65]
    2016-06-17 07:45:59.389 [ERROR] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item OfficeRelay for widget org.openhab.model.sitemap.Switch
    2016-06-17 07:45:59.395 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item OfficeRelay for widget org.openhab.model.sitemap.Switch
    2016-06-17 07:45:59.404 [ERROR] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item OfficeRelay for widget org.openhab.model.sitemap.Switch
    2016-06-17 07:45:59.411 [ERROR] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item OfficeRelay for widget org.openhab.model.sitemap.Switch
    2016-06-17 07:45:59.419 [ERROR] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item OfficeRelay for widget org.openhab.model.sitemap.Switch
    2016-06-17 07:45:59.428 [ERROR] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item OneWireTempSensor1 for widget org.openhab.model.sitemap.Text
    2016-06-17 07:45:59.437 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item OneWireTempSensor1 for widget org.openhab.model.sitemap.Text
    2016-06-17 07:45:59.444 [ERROR] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item OneWireTempSensor1 for widget org.openhab.model.sitemap.Text
    2016-06-17 07:45:59.452 [ERROR] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item OneWireTempSensor1 for widget org.openhab.model.sitemap.Text
    

    I am wondering if the items OfficePin16 and OfficeRelay are not correctly declared?
    Being new to this I fail to see what is wrong.
    If they are correct, then what can be done to make them work properly?
    Could it be some problem with encoding or line endings?
    Any help I could get would be most appreciated.


Log in to reply
 

Suggested Topics

  • 22
  • 3
  • 19
  • 1
  • 7
  • 132

18
Online

11.2k
Users

11.1k
Topics

112.5k
Posts