Closed anthonygillet closed 6 years ago
Anthony:
Are you configuring with the PaperUI or files? If you are using the PaperUi have you configures the Smartthings Hub? If you are using files please send me the appropriate parts of your things and items file. I am configuring with files and have a powerMeter device and it is working correctly.
Bob
It's odd, the errors went away after a few hours. Things appear to be working properly now, I am getting updates for power and energy. I'll close this issue out.
Just to answer your question, I am using files to configure. Here are the things and items I have configured.
Thing switch SmartPlug1 "Smart Plug 1 Switch" [ smartthingsName="Smart Plug 1" ]
Thing energyMeter SmartPlug1 "Smart Plug 1 Energy Meter" [ smartthingsName="Smart Plug 1" ]
Thing powerMeter SmartPlug1 "Smart Plug 1 Power Meter" [ smartthingsName="Smart Plug 1" ]
Thing switch SmartPlug2 "Smart Plug 2 Switch" [ smartthingsName="Smart Plug 2" ]
Thing energyMeter SmartPlug2 "Smart Plug 2 Energy Meter" [ smartthingsName="Smart Plug 2" ]
Thing powerMeter SmartPlug2 "Smart Plug 2 Power Meter" [ smartthingsName="Smart Plug 2" ]
Thing switch SmartPlug3 "Smart Plug 3 Switch" [ smartthingsName="Smart Plug 3" ]
Thing energyMeter SmartPlug3 "Smart Plug 3 Energy Meter" [ smartthingsName="Smart Plug 3" ]
Thing powerMeter SmartPlug3 "Smart Plug 3 Power Meter" [ smartthingsName="Smart Plug 3" ]
Switch smart_plug_1 "Smart Plug 1 [%s]" <switch> { channel="smartthings:switch:Home:SmartPlug1:switch" }
Number smart_plug_1_energy "Smart Plug 1 Energy Meter [%.2f%%]" <energy> { channel="smartthings:energyMeter:Home:SmartPlug1:energy" }
Number smart_plug_1_power "Smart Plug 1 Power Meter [%.2f%%]" <power> { channel="smartthings:powerMeter:Home:SmartPlug1:power" }
Switch smart_plug_2 "Smart Plug 2 [%s]" <switch> { channel="smartthings:switch:Home:SmartPlug2:switch" }
Number smart_plug_2_energy "Smart Plug 2 Energy Meter [%.2f%%]" <energy> { channel="smartthings:energyMeter:Home:SmartPlug2:energy" }
Number smart_plug_2_power "Smart Plug 2 Power Meter [%.2f%%]" <power> { channel="smartthings:powerMeter:Home:SmartPlug2:power" }
Switch smart_plug_3 "Smart Plug 3 [%s]" <switch> { channel="smartthings:switch:Home:SmartPlug3:switch" }
Number smart_plug_3_energy "Smart Plug 3 Energy Meter [%.2f%%]" <energy> { channel="smartthings:energyMeter:Home:SmartPlug3:energy" }
Number smart_plug_3_power "Smart Plug 3 Power Meter [%.2f%%]" <power> { channel="smartthings:powerMeter:Home:SmartPlug3:power" }
When using devices that have powerMeter and energyMeter capabilities, there are warnings produced in the logs about missing handlers / callbacks.
After discovery / before adding Thing: 2017-12-27 17:41:55.267 [WARN ] [s.internal.SmartthingsHandlerFactory] - Unable to locate handler for display name: Smart Plug 2 with attribute: power
After adding Thing: 2017-12-27 17:51:25.504 [WARN ] [org.apache.karaf.services.eventadmin] - EventAdmin: Exception during event dispatch [org.osgi.service.event.Event [topic=org/openhab/binding/smartthings/state] {data={"deviceDisplayName":"Smart Plug 2","value":"94.519","capabilityAttribute":"power"}} | {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory, org.osgi.service.event.EventHandler}={event.topics=org/openhab/binding/smartthings/state, component.name=binding.smartthings, component.id=241, service.id=396, service.bundleid=240, service.scope=bundle} | Bundle(org.openhab.binding.smartthings_2.2.0.201712120439 [240])] java.lang.IllegalStateException: Could not update state, because callback is missing at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateState(BaseThingHandler.java:303) [116:org.eclipse.smarthome.core.thing:0.10.0.201712141004] at org.openhab.binding.smartthings.handler.SmartthingsThingHandler.handleStateMessage(SmartthingsThingHandler.java:144) [240:org.openhab.binding.smartthings:2.2.0.201712120439] at org.openhab.binding.smartthings.internal.SmartthingsHandlerFactory.handleEvent(SmartthingsHandlerFactory.java:143) [240:org.openhab.binding.smartthings:2.2.0.201712120439] at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415) [3:org.apache.karaf.services.eventadmin:4.1.3] at org.apache.felix.eventadmin.impl.tasks.HandlerTask.run(HandlerTask.java:70) [3:org.apache.karaf.services.eventadmin:4.1.3] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?] at java.lang.Thread.run(Thread.java:748) [?:?]