--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/a5SOw0TH_2UJ.
To post to this group, send email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openhab+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openhab?hl=en.
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.openhab.binding.hue"> |
<implementation class="org.openhab.binding.hue.internal.HueBinding"/> |
|
<service> |
<provide interface="org.osgi.service.event.EventHandler"/> |
<provide interface="org.osgi.service.cm.ManagedService"/> <!-- new --> </service> |
<property name="event.topics" type="String" value="openhab/command/*"/> |
|
<reference bind="addBindingProvider" cardinality="1..n" interface="org.openhab.binding.hue.HueBindingProvider" name="HueBindingProvider" policy="dynamic" unbind="removeBindingProvider"/> |
</scr:component> |
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/z9Tv6ymlaywJ.
java.lang.ClassNotFoundException: org.openhab.binding.hue.internal.HueActivator
Thats better cause I can debug it x-)
I want to do both... Send commands to the bulbs like (on, off, dimm etc.) but also polling the current status... But yes the hint was quiet good for my understanding of the whole thing and of course I wanted to start with the sending of commands ;)
I will now try to get the binding up and running...
Thanks again....
thanks!update():the update()-method must be implemented because your binding implements ManagedService. To register with the OSGi container ManagedService has to be provided. Which means you huebinding.xml has to be enhanced like that:
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.openhab.binding.hue"> <implementation class="org.openhab.binding.hue.internal.HueBinding"/> <service> <provide interface="org.osgi.service.event.EventHandler"/> </service> <property name="event.topics" type="String" value="openhab/command/*"/> <reference bind="addBindingProvider" cardinality="1..n" interface="org.openhab.binding.hue.HueBindingProvider" name="HueBindingProvider" policy="dynamic" unbind="removeBindingProvider"/> </scr:component> execute():I assume you are going to send messages to the lamp rather than receiving/polling information from it, do you? If yes, you should extend AbstractEventSubscriber instead of AbstractActiveBinding. You now should implement internalCommandReceived() or internalUpdateReceived() to execute your business code. By the way, the org.openhab.persistence.sense bundle contains code for JSON handling and HTTP request sending.Hope this helps,Thomas E.-E.P.S.: and yes, i WILL document that after Devoxx (the next week) ;-)
On Nov 7, 2012, at 5:58 PM, Shingoo <roman.h...@gmail.com> wrote:
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/XiAOZDKeMZMJ.
!ENTRY org.openhab.binding.hue 4 0 2012-11-07 20:35:30.295
!MESSAGE [SCR] Method was not found: addBindingProvider(...)
Details:
Problematic reference = Reference[name = HueBindingProvider, interface = org.openhab.binding.hue.HueBindingProvider, policy = dynamic, cardinality = 1..n, target = null, bind = addBindingProvider, unbind = removeBindingProvider]
of service component = org.openhab.binding.hue
component implementation class = org.openhab.binding.hue.internal.HueBinding
located in bundle with symbolic name = org.openhab.binding.hue
bundle location = reference:file:/Users/roman/Documents/HueDevelopment/openHAB_workspace/romanhartmann-shingoo/bundles/binding/org.openhab.binding.hue/
20:35:30.296 ERROR OSGi[:98] - [SCR] Method was not found: addBindingProvider(...)
Details:
Problematic reference = Reference[name = HueBindingProvider, interface = org.openhab.binding.hue.HueBindingProvider, policy = dynamic, cardinality = 1..n, target = null, bind = addBindingProvider, unbind = removeBindingProvider]
of service component = org.openhab.binding.hue
component implementation class = org.openhab.binding.hue.internal.HueBinding
located in bundle with symbolic name = org.openhab.binding.hue
bundle location = reference:file:/Users/roman/Documents/HueDevelopment/openHAB_workspace/romanhartmann-shingoo/bundles/binding/org.openhab.binding.hue/
and
20:35:30.338 ERROR OSGi[:98] - An unexpected runtime error has occurred.
org.osgi.service.component.ComponentException: The component was not built because some of its references could not be bound. The component is Component[
name = org.openhab.binding.hue
activate = activate
deactivate = deactivate
modified =
configuration-policy = optional
factory = null
autoenable = true
immediate = false
implementation = org.openhab.binding.hue.internal.HueBinding
state = Unsatisfied
properties = {event.topics=openhab/command/*}
serviceFactory = false
serviceInterface = [org.osgi.service.event.EventHandler, org.osgi.service.cm.ManagedService]
references = {
Reference[name = HueBindingProvider, interface = org.openhab.binding.hue.HueBindingProvider, policy = dynamic, cardinality = 1..n, target = null, bind = addBindingProvider, unbind = removeBindingProvider]
}
located in bundle = org.openhab.binding.hue_1.1.0.qualifier [98]
]
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/zkI-H-fzpZMJ.
--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/bkBgb26ZneoJ.
!ENTRY org.eclipse.equinox.event 4 0 2012-11-08 23:14:43.975
!MESSAGE Exception while dispatching event org.osgi.service.event.Event [topic=openhab/command/Hue_Bulb_2] to handler org.openhab.binding.hue.internal.HueBinding@70f5f42b
!STACK 0
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jersey.spi.service.ServiceFinder
at com.sun.jersey.api.client.Client.init(Client.java:213)
at com.sun.jersey.api.client.Client.access$000(Client.java:118)
at com.sun.jersey.api.client.Client$1.f(Client.java:191)
at com.sun.jersey.api.client.Client$1.f(Client.java:187)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
at com.sun.jersey.api.client.Client.<init>(Client.java:187)
at com.sun.jersey.api.client.Client.<init>(Client.java:159)
at com.sun.jersey.api.client.Client.create(Client.java:669)
at org.openhab.binding.hue.internal.bridge.HueBridge.getSettingsJson(HueBridge.java:64)
at org.openhab.binding.hue.internal.bridge.HueBridge.pairBridgeIfNecessary(HueBridge.java:19)
at org.openhab.binding.hue.internal.HueBinding.receiveCommand(HueBinding.java:37)
at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:62)
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
at org.openhab.core.internal.events.EventPublisherImpl.sendCommand(EventPublisherImpl.java:76)
at org.openhab.ui.webapp.internal.servlet.CmdServlet.service(CmdServlet.java:115)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:486)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:350)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:606)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
at java.lang.Thread.run(Thread.java:680)
23:14:43.992 ERROR OSGi[:98] - Exception while dispatching event org.osgi.service.event.Event [topic=openhab/command/Hue_Bulb_2] to handler org.openhab.binding.hue.internal.HueBinding@70f5f42b
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jersey.spi.service.ServiceFinder
at com.sun.jersey.api.client.Client.init(Client.java:213)
at com.sun.jersey.api.client.Client.access$000(Client.java:118)
at com.sun.jersey.api.client.Client$1.f(Client.java:191)
at com.sun.jersey.api.client.Client$1.f(Client.java:187)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
at com.sun.jersey.api.client.Client.<init>(Client.java:187)
at com.sun.jersey.api.client.Client.<init>(Client.java:159)
at com.sun.jersey.api.client.Client.create(Client.java:669)
at org.openhab.binding.hue.internal.bridge.HueBridge.getSettingsJson(HueBridge.java:64)
at org.openhab.binding.hue.internal.bridge.HueBridge.pairBridgeIfNecessary(HueBridge.java:19)
at org.openhab.binding.hue.internal.HueBinding.receiveCommand(HueBinding.java:37)
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/QlDTjO4dBOsJ.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/EME7adm2yvgJ.
--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/g-O1u8wGfV8J.
D:\openhab-devel\openhab\main\bundles\binding>mvn archetype:generate -B -DarchetypeGroupId=org.openhab.archetype -DarchetypeArtifactId=org.openhab.archetype.binding -DarchetypeVersion=1.2.0-SNAPSHOT -Dauthor=PAULI -Dversion=1.2.0 -DartifactId=org.openhab.binding.onkyo -Dpackage=org.openhab.binding.onkyo -Dbinding-name=onkyo[INFO] Scanning for projects...[ERROR] Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact org.openhab:targetplatform:target:openhab:1.3.0-SNAPSHOT -> [Help 1]org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact org.openhab:targetplatform:target:openhab:1.3.0-SNAPSHOT
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168)at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)Caused by: java.lang.RuntimeException: Could not resolve target platform specification artifact org.openhab:targetplatform:target:openhab:1.3.0-SNAPSHOTat org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.addTargetArtifact(DefaultTargetPlatformConfigurationReader.java:334)at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.setTarget(DefaultTargetPlatformConfigurationReader.java:288)at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.getTargetPlatformConfiguration(DefaultTargetPlatformConfigurationReader.java:71)at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.setupProject(DefaultTychoDependencyResolver.java:78)at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:77)at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:274)at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)... 11 more[ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR][ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException