BobRak / OpenHAB-Smartthings

53 stars 54 forks source link

Problems getting started #18

Closed durera closed 6 years ago

durera commented 6 years ago

I'm not having much luck getting started here:

d8de65d0-29ca-48da-a539-c1cbd891c235  11:20:02 PM: debug Subscribing to event handler null
d8de65d0-29ca-48da-a539-c1cbd891c235  11:20:02 PM: debug Subscribing inputHandler to device "[Plug1]" with attribute "switch"
d8de65d0-29ca-48da-a539-c1cbd891c235  11:20:02 PM: debug Updated with settings: [switch:[Plug1], openhabDevice:OpenHabDevice]
bd22d17d-65bc-4437-bf34-9f7854325d9a  11:20:02 PM: trace getPhrases(), state.welcomeIssue = null
bd22d17d-65bc-4437-bf34-9f7854325d9a  11:19:44 PM: trace getPhrases(), state.welcomeIssue = null
 11:19:34 PM: info Waiting on events...
 11:19:34 PM: info For past logs for individual things go to the My Devices section, find the device and click on the Events link on the device information page.
 11:19:34 PM: info This console provides live logging of your SmartThings.
Bridge smartthings:smartthings:Home    [ smartthingsIp="192.168.1.98", smartthingsPort=39500 ] {
    Thing switch stPlug1Switch [ smartthingsName="Plug1" ]
}

Karaf Shell logger

log4j2.logger.shell.name = org.apache.karaf.shell.support log4j2.logger.shell.level = OFF log4j2.logger.shell.appenderRefs = stdout log4j2.logger.shell.appenderRef.stdout.ref = STDOUT

 Security audit logger

log4j2.logger.audit.name = org.apache.karaf.jaas.modules.audit log4j2.logger.audit.level = INFO log4j2.logger.audit.additivity = false log4j2.logger.audit.appenderRefs = audit log4j2.logger.audit.appenderRef.audit.ref = AUDIT

openHAB specific logger configuration

log4j2.logger.smartthingsBinding.name=org.openhab.binding.smartthings log4j2.logger.smartthingsBinding.level = DEBUG

log4j2.logger.openhab.name = org.openhab log4j2.logger.openhab.level = INFO

``` - I don't see any reference to the smartthings addon in the Bindings list in Paper UI, which may or may not be expected? I'm guessing this means I haven't even successfully installed the addon but this is the first addon I've installed manually so maybe that's expected as it wasn't installed through the UI. - There are no errors in the openhab log, if I messed up the installation of the addon I would have expected to see something there, but all I see different from when I started up prior to trying this out is the additional `Loading model 'smartthings.things'` log message.
BobRak commented 6 years ago

I'm sorry you are having troubles getting the binding to work. From what you've sent I'm not seeing any obvious problem with your installation.

Are you seeing any log message that indicate they are messages from DEBUG level logging? My first message that is smartthing specific is:

2017-12-27 22:12:27.498 [DEBUG] [.c.thing.internal.ThingManager:907 ] - Thing handler factory 'SmartthingsHandlerFactory' added

If you are not seeing any DEBUG level message I would figure that out first. The first smartthing message I see at INFO level is:

2017-12-27 22:12:28.305 [INFO ] [.s.internal.SmartthingsServlet:56 ] - Started Smartthings servlet at /smartthings

If you are not seeing this I would say that the binding isn't getting loaded. In my installation the /usr/share/openhab2 directory looks like:

` drwxrwxrwx 2 openhab openhab 4096 Aug 31 23:08 addons

drwxr-xr-x 2 root root 4096 Feb 20 2017 bin

-rw-r--r-- 1 openhab openhab 11232 Jan 22 2017 LICENSE.TXT drwxr-xr-x 7 openhab openhab 4096 Feb 20 2017 runtime -rwxr-xr-x 1 openhab openhab 73 Jan 22 2017 start_debug.sh -rwxr-xr-x 1 openhab openhab 116 Jan 22 2017 start.sh `

And, my addons directory looks like:

-rwxrw-rw- 1 openhabian openhabian 44249 Dec 11 20:39 org.openhab.binding.smartthings-2.2.0-SNAPSHOT.jar

Please check those items and let me know.

Right now I am swamped and have very limited time to spend working on OH2 addons but I'll do my best to answer your questions.

Thanks,

Bob

BobRak commented 6 years ago

Did the comments I sent you 10 days ago? Ok, have you just given up. Now another user is reporting similar problems. I'll set up a new system soon and see if I can reproduce the problem you are reporting. Please let me know your status.

durera commented 6 years ago

I've had another crack at it this weekend (hadn't had a chance to get back to this over Christmas sadly) and tracked down my mistake.

Schoolboy error at the very first hurdle: I had done this: wget https://github.com/BobRak/OpenHAB-Smartthings/blob/master/org.openhab.binding.smartthings/target/org.openhab.binding.smartthings-2.2.0-SNAPSHOT.jar to obtain the addon.

That's not the right URL, it needed to be: https://github.com/BobRak/OpenHAB-Smartthings/raw/master/org.openhab.binding.smartthings/target/org.openhab.binding.smartthings-2.2.0-SNAPSHOT.jar

So I didn't even have a valid jar file, just a html page :) Which is why nothing was showing up in the logs. It would have been nice if openhab could have logged something like "Hey dummy, invalid jar file in the addons directory" or something, and it never crossed my mind before to check if the thing I had downloaded was actually what I thought I had downloaded the first time around.

Having corrected that I see the addon springing into life, easiest way to show proof of life for future reference would be by looking in the events log .. it's clear as day there when this starts up:

2018-01-07 11:18:16.237 [hingStatusInfoChangedEvent] - 'smartthings:smartthings:home' changed from UNINITIALIZED to INITIALIZING
2018-01-07 11:18:16.342 [hingStatusInfoChangedEvent] - 'smartthings:smartthings:home' changed from INITIALIZING to ONLINE
2018-01-07 11:18:16.386 [hingStatusInfoChangedEvent] - 'smartthings:switch:home:stPlug1Switch' changed from UNINITIALIZED to INITIALIZING
2018-01-07 11:18:16.453 [hingStatusInfoChangedEvent] - 'smartthings:switch:home:stPlug1Switch' changed from INITIALIZING to ONLINE

I created a simple .items file to connect a couple of switches and have them being turned on/off via OpenHab now (although I did get a bit confused for a while when only plug 1 was responding to commands; until I remembered that I had to enable support for plug 2 via the smartApp, as I'd only added plug 1 when I made my first pass at this).

Switch Plug1_Power        "Standing Lamp"           <switch>       (GF_LivingRoom) ["SmartThings"] { channel="smartthings:switch:home:stPlug1Switch:switch" }
Switch Plug2_Power        "Digitial PhotoFrame"     <switch>       (GF_LivingRoom) ["SmartThings"] { channel="smartthings:switch:home:stPlug2Switch:switch" }

Basically, it all worked first time once I actually download the addon properly, looking forward to giving it a more thorough run through in the coming weeks 👍

BobRak commented 6 years ago

Thank you for the feedback.

I just deployed a new release (including jar file) that corrects a number of issues with device configuration. It also corrects a bug in the messages handling between OpenHAB and the Smartthings hub that cause slow response. This release is much faster. Thanks to @fx for figuring this out.