BobRak / OpenHAB-Smartthings

53 stars 54 forks source link

Problem with Discovery #58

Closed rberger closed 5 years ago

rberger commented 5 years ago

I'm pretty sure I followed all the instructions for setting up SmartThings and then OpenHab2. But when I try to discover anything from Smartthings I get nothing.

Here is the log of doing discovery. Its getting an exception:

2018-12-03 00:22:13.092 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"discovery": "yes", "openHabStartTime": 1543825332561}" with path "/discovery" to the Smartthings hub, recieved HTTP status 202
2018-12-03 00:22:13.786 [WARN ] [org.apache.karaf.services.eventadmin] - EventAdmin: Exception during event dispatch [org.osgi.service.event.Event [topic=org/openhab/binding/smartthings/discovery] {data={"data":["{\"capability\": \"indicator\", \"attribute\": \"indicatorStatus\", \"name\": \"Kitchen Lights\", \"id\": \"85e4a8ec-1c5d-4805-908a-c648e651deb6\" }","{\"capability\": \"presenceSensor\", \"attribute\": \"presence\", \"name\": \"Robert's iPhone\", \"id\": \"b18a65b9-6096-4991-8ccb-6eac32fd0854\" }","{\"capability\": \"presenceSensor\", \"attribute\": \"presence\", \"name\": \"Sue's iPhone\", \"id\": \"c58ab8a3-e927-4e86-9520-fb3f4d1f8a33\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Front Basement Light\", \"id\": \"2b9c55e2-294b-484f-b1fd-61610383087f\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Entryway Light\", \"id\": \"2df37de8-9c0a-497d-9d12-f589121870dc\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Front Porch Light\", \"id\": \"b8a6584f-3058-4c2d-9801-9a96eaf85a70\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Kitchen Lights\", \"id\": \"85e4a8ec-1c5d-4805-908a-c648e651deb6\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Livingroom Chandelier\", \"id\": \"ac3c560c-c90f-43a1-8dc8-5d2cb31887b9\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Livingroom North 0\", \"id\": \"b128ec4a-c9d5-4dca-ae44-c78e9755cb67\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Livingroom North 1\", \"id\": \"ab43d0a9-d398-4681-b402-85a823c394f7\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Office Overhead Lights\", \"id\": \"3fe27c0e-8cd5-4b84-8579-3192a736af19\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Small Bathroom Lights\", \"id\": \"f17c4de8-b1da-4c27-bd78-336a558f1a8c\" }"],"hubTime":"--hubTime--","openHabStartTime":null}, timestamp=1543825333785} | {org.osgi.service.event.EventHandler}={service.id=357, service.bundleid=218, service.scope=singleton, event.topics=org/openhab/binding/smartthings/discovery} | Bundle(org.openhab.binding.smartthings_2.4.0.201811132213 [218])]
com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: For input string: "--hubTime--"
    at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:323) [22:com.google.gson:2.7.0]
    at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:313) [22:com.google.gson:2.7.0]
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129) [22:com.google.gson:2.7.0]
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) [22:com.google.gson:2.7.0]
    at com.google.gson.Gson.fromJson(Gson.java:887) [22:com.google.gson:2.7.0]
    at com.google.gson.Gson.fromJson(Gson.java:852) [22:com.google.gson:2.7.0]
    at com.google.gson.Gson.fromJson(Gson.java:801) [22:com.google.gson:2.7.0]
    at com.google.gson.Gson.fromJson(Gson.java:773) [22:com.google.gson:2.7.0]
    at org.openhab.binding.smartthings.discovery.SmartthingsDiscoveryService.handleEvent(SmartthingsDiscoveryService.java:169) [218:org.openhab.binding.smartthings:2.4.0.201811132213]
    at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415) [3:org.apache.karaf.services.eventadmin:4.1.5]
    at org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutBlacklistTiming(HandlerTask.java:82) [3:org.apache.karaf.services.eventadmin:4.1.5]
    at org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:104) [3:org.apache.karaf.services.eventadmin:4.1.5]
    at org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:166) [3:org.apache.karaf.services.eventadmin:4.1.5]
    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) [?:?]
Caused by: java.lang.NumberFormatException: For input string: "--hubTime--"
    at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043) ~[?:?]
    at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110) ~[?:?]
    at java.lang.Double.parseDouble(Double.java:538) ~[?:?]
    at com.google.gson.stream.JsonReader.nextLong(JsonReader.java:964) ~[?:?]
    at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:321) ~[?:?]
    ... 17 more

On The Smartthings side:

2a25a3f2-f37e-4036-820e-0e295daac291  12:22:13 AM: error received a request with an unknown path: HTTP/1.1 200 OK 
Content-Length: 0 
Server: Jetty(9.3.21.v20170918)
2a25a3f2-f37e-4036-820e-0e295daac291  12:22:13 AM: debug Msg '[index:C7, mac:0011328B4939, ip:C0A81423, port:1F9A, requestId:a83b2fc8-faf2-47c2-8852-f369aa318c92, headers:[content-length:0, http/1.1 200 ok:null, server:Jetty(9.3.21.v20170918)], body:null, header:HTTP/1.1 200 OK 
Content-Length: 0 
Server: Jetty(9.3.21.v20170918), status:200]'
923e61c1-e489-438e-b283-ecc3f25e79ed  12:22:13 AM: debug Discovery returned data for 12 devices.
923e61c1-e489-438e-b283-ecc3f25e79ed  12:22:13 AM: debug Discovery is returning FINAL JSON: {"path":"/smartthings/discovery","hubStartTime":null,"body":{"openHabStartTime":null,"hubTime":"--hubTime--","data":["{\"capability\": \"indicator\", \"attribute\": \"indicatorStatus\", \"name\": \"Kitchen Lights\", \"id\": \"85e4a8ec-1c5d-4805-908a-c648e651deb6\" }","{\"capability\": \"presenceSensor\", \"attribute\": \"presence\", \"name\": \"Robert's iPhone\", \"id\": \"b18a65b9-6096-4991-8ccb-6eac32fd0854\" }","{\"capability\": \"presenceSensor\", \"attribute\": \"presence\", \"name\": \"Sue's iPhone\", \"id\": \"c58ab8a3-e927-4e86-9520-fb3f4d1f8a33\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Front Basement Light\", \"id\": \"2b9c55e2-294b-484f-b1fd-61610383087f\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Entryway Light\", \"id\": \"2df37de8-9c0a-497d-9d12-f589121870dc\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Fr...[TRUNCATED]
2a25a3f2-f37e-4036-820e-0e295daac291  12:22:13 AM: debug Sending '{"path":"/smartthings/discovery","hubStartTime":null,"body":{"openHabStartTime":null,"hubTime":"--hubTime--","data":["{\"capability\": \"indicator\", \"attribute\": \"indicatorStatus\", \"name\": \"Kitchen Lights\", \"id\": \"85e4a8ec-1c5d-4805-908a-c648e651deb6\" }","{\"capability\": \"presenceSensor\", \"attribute\": \"presence\", \"name\": \"Robert's iPhone\", \"id\": \"b18a65b9-6096-4991-8ccb-6eac32fd0854\" }","{\"capability\": \"presenceSensor\", \"attribute\": \"presence\", \"name\": \"Sue's iPhone\", \"id\": \"c58ab8a3-e927-4e86-9520-fb3f4d1f8a33\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Front Basement Light\", \"id\": \"2b9c55e2-294b-484f-b1fd-61610383087f\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Entryway Light\", \"id\": \"2df37de8-9c0a-497d-9d12-f589121870dc\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Front Porch Light\", \"id\": \"b8a6584f-3...[TRUNCATED]
2a25a3f2-f37e-4036-820e-0e295daac291  12:22:13 AM: debug Sending '{"path":"/smartthings/discovery","hubStartTime":null,"body":{"openHabStartTime":null,"hubTime":"--hubTime--","data":["{\"capability\": \"indicator\", \"attribute\": \"indicatorStatus\", \"name\": \"Kitchen Lights\", \"id\": \"85e4a8ec-1c5d-4805-908a-c648e651deb6\" }","{\"capability\": \"presenceSensor\", \"attribute\": \"presence\", \"name\": \"Robert's iPhone\", \"id\": \"b18a65b9-6096-4991-8ccb-6eac32fd0854\" }","{\"capability\": \"presenceSensor\", \"attribute\": \"presence\", \"name\": \"Sue's iPhone\", \"id\": \"c58ab8a3-e927-4e86-9520-fb3f4d1f8a33\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Front Basement Light\", \"id\": \"2b9c55e2-294b-484f-b1fd-61610383087f\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Entryway Light\", \"id\": \"2df37de8-9c0a-497d-9d12-f589121870dc\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Front Porch Light\", \"id\": \"b8a6584f-3...[TRUNCATED]
2a25a3f2-f37e-4036-820e-0e295daac291  12:22:13 AM: debug Creating event with message: [path:discovery]
2a25a3f2-f37e-4036-820e-0e295daac291  12:22:13 AM: debug Msg '[index:C6, mac:0011328B4939, headers:[post /discovery http/1.1:null, content-length:55, accept-encoding:gzip, host:192.168.20.22:39500, user-agent:Jetty/9.3.21.v20170918, content-type:application/json], body:{"discovery": "yes", "openHabStartTime": 1543825332561}, header:POST /discovery HTTP/1.1 
Accept-Encoding: gzip 
User-Agent: Jetty/9.3.21.v20170918 
Content-Type: application/json 
Host: 192.168.20.22:39500 
Content-Length: 55, data:[discovery:yes, openHabStartTime:1543825332561], json:[discovery:yes, openHabStartTime:1543825332561]]'
2a25a3f2-f37e-4036-820e-0e295daac291  12:22:13 AM: debug Creating event with message: [path:discovery]
2a25a3f2-f37e-4036-820e-0e295daac291  12:22:13 AM: debug Msg '[index:C6, mac:0011328B4939, headers:[post /discovery http/1.1:null, content-length:55, accept-encoding:gzip, host:192.168.20.22:39500, user-agent:Jetty/9.3.21.v20170918, content-type:application/json], body:{"discovery": "yes", "openHabStartTime": 1543825332561}, header:POST /discovery HTTP/1.1 
Accept-Encoding: gzip 
User-Agent: Jetty/9.3.21.v20170918 
Content-Type: application/json 
Host: 192.168.20.22:39500 
Content-Length: 55, data:[discovery:yes, openHabStartTime:1543825332561], json:[discovery:yes, openHabStartTime:1543825332561]]'
kurtwarwick commented 5 years ago

Hi

I am getting this exact error with my setup. Might be worth mentioning that I am using a v3 Hub.

BobRak commented 5 years ago

Hi Robert and Kurt: This looks like a bug on my part. All of this timing stuff was added recently and I must have missed something. I'll investigate and get a fix as soon as I can. I probably need a couple of days. Thanks for reporting this and thanks for using this binding. Bob

rberger commented 5 years ago

Thanks! Let me know if there is anything I can do to help! Just for the record I'm using a v2 Smartthings Hub

kurtwarwick commented 5 years ago

Thanks Bob!

I did a small workaround and changed all references of hubTime to be 1. Not actually the time, but allowed me to move on with getting set up. I must say, this binding is amazing and works really well! Thanks for all the hard work!

Kurt

BobRak commented 5 years ago

Kurt and Robert:

I have it figured out... I kept looking at my code and everything looked Ok and I couldn't figure out why --hubTime- would be getting sent back. Then when I looked in the GitHub repo I discovered that the SmartThings "My Device Handler" : OpenHabDeviceHandler.groovy was not copied correctly into the target directory. Have a look at the OpenHabDeviceHandler.groovy file at:

OpenHAB-Smartthings/org.openhab.binding.smartthings/src/main/smartthings/DeviceHandlers/

It will show that it was updated 22 days ago. This is the correct version. The build process is supposed to copy it to

OpenHAB-Smartthings/org.openhab.binding.smartthings/target/smartthings/DeviceHandlers/

but if you look at the OpenHabDeviceHandler.groovy file at that location it will show it updated 11 months ago.

Please install the one that is 22 days old and let me know if that takes care of the problem.

I'll work on getting the build to work correctly and deploy another version once I've heard that solves the problem.

Also, I want to submit the binding to OpenHAB soon and am trying to verify that it works correctly with all devices. That is impossible for me as I only have a few devices. Please let me know if it doesn't work correctly with any of your devices.

Thanks,

Bob

rberger commented 5 years ago

That seems to have fixed it for me! Thanks.

Do you want to know what does work, or just what doesn't work?

Please do let me know if there is anything else I can do to help you out.

rberger commented 5 years ago

So the discovery seems to work perfectly. But I'm seeing that for the Things that are Dimmer Switches, the On/Off toggle on the OpenHab Dimmer UI doesn't work as described below. (i.e the Openhab on/off toggle doesn't do anything and toggling on/off on smarthings is not reflected in the Openhab dimmer UI)

Smarthings also has another "thing" that shows up in OpenHab discovery that is just a switch associated with each Dimmer. That does work both ways.

I would have expected that the on/off UI toggle on the Dimmer Thing would control the switch aspect of the dimmer as well and I would not need to have a second switch thing for each dimmer.

Dimmer switches:

GE 12724

Zooz S2 Zen27 Dimmer Switch

Zooz S2 Zen26 On/Off Switch

GE 22670 Link Smart LED Light Bulb, BR30 Zigbee

rberger commented 5 years ago

I'm not sure if this is an OpenHab/Smartthings issue, but for the Samsung SmartSense Multi Sensor, I am getting the proper contact open/close messages in the Openhab log, but the Contact UI doesn't show the state at all.

paper_ui
2018-12-05 21:56:11.879 [INFO ] [ings.handler.SmartthingsThingHandler] - Smartthings updated State for channel: smartthings:contactSensor:65a0c026:Balcony_Door:contact to OPEN
2018-12-05 21:57:39.442 [INFO ] [ings.handler.SmartthingsThingHandler] - Smartthings updated State for channel: smartthings:contactSensor:65a0c026:Balcony_Door:contact to CLOSED

All the other parameters from the Multi Sensor seems to be working.

The SmartSense Motion Sensor also seems to be working fine

BobRak commented 5 years ago

Robert: Thanks for the feedback. It is very helpful for me to know what doesn't work so I can fix it before submitting to openHAB. It is also helpful to get feedback on what does work.

With regards to the contact sensor not showing up in the paper UI I also experienced that and submitted a question on the openHAB community and got the response that isn't supported in the Paper UI. Personally I think that is confusing. Especially since it includes many much more complicated devices, like dimmers and color. Click here.

I'll look into the dimmer issue. I recently moved from Northern CA to Southern WA and left the one hardwired dimmer I owned behind. But, there should be a simulator. I'll try it when I get a chance and let you find out.

Bob

BobRak commented 5 years ago

Robert:

I've been working on the dimmer issue. As I said, I don't have a real dimmer to use. I am using the simulated dimmer. When I configure the OpenHabAppV2 in the ST app I am able to select the same simulated dimmer as both a Switch and Dimmer switch. Are you seeing the same thing?

When you run discovery in OpenHAB does it then come back with two things for the same device. One is a Switch and the other is a Switch Level?

When you look at the dimmer in the ST App does it show that you can change both the brightness and On/Off on the same device?

It seems that ST has the concept that there is one device with 2 sets of capabilities. See the ST Capabilities reference here.

I can see if it is possible to work on both of these capabilities with one device in OpenHAB.

Are you using both a sitemap and a the Paper UI or only the Paper UI?

Thanks,

Bob

BobRak commented 5 years ago

@rberger I just uploaded a new version of the Smartthings code that I think will help with how the switch and dimmer work together. I also added some description in the README.md file. See the section Special note about Dimmers.

You will need to redeploy the file org.openhab.binding.smartthings-2.4.0-SNAPSHOT.jar which is here. And, the smartthings device handler OpenHabDeviceHandler.groovy which is located here. And, the smartthings SmartApp: OpenHabAppV2.groovy which is located here.

Also, I asked you some questions earlier which you may not have seen since I did not include your ID in the message, sorry.

I'm anxious for your feedback. I would like to start the submission process to openHAB and get this included in the openHAB application.

Bob

unparagoned commented 5 years ago

I replaced "--hubTime--", with now(), in OpenHabAppV2.groovy and it seemed to fix my errors.

thewag commented 5 years ago

Hello Bob, I've also run into the "discovery" problem. I've reviewed this thread and used the new device handler (you can see the hubTime code section to help verify that I have the correct version). It's a new Smartthings V3 hub. Here's info from various log files.

events.log 2019-02-23 19:11:58.885 [hingStatusInfoChangedEvent] - 'smartthings:smartthings:c4033659' changed from UNINITIALIZED to INITIALIZING 2019-02-23 19:11:59.165 [hingStatusInfoChangedEvent] - 'smartthings:smartthings:c4033659' changed from INITIALIZING to ONLINE

openhab.log 2019-02-23 19:13:17.248 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"discovery": "yes", "openHabStartTime": 1550967196885}" with path "/discovery" to the Smartthings hub, recieved HTTP status 202

Configuration \ Things Smartthings Hub Status: ONLINE

Location Events (smartthings.com) OpenHabDevice message is {"path":"discovery","hubStartTime":1550968023763,"openHabStartTime":1550968022699} Name Value archivable true date 2019-02-23 7:27:03.752 PM EST (2019-02-24T00:27:03.752Z) description OpenHabDevice message is {"path":"discovery","hubStartTime":1550968023763,"openHabStartTime":1550968022699} deviceId 79a3a914-5f97-45e3-a251-2151d28df058 deviceTypeId c52c2024-ac55-49e5-ab5d-9dfafb4c9003 displayed true eventSource DEVICE groupId cad9ee3c-b380-486d-abe0-5bd22d60f2a1 hubId 0ea85778-3638-4079-a635-8a6f506c94bb id e8a68760-37ca-11e9-a928-025ca5700d74 isStateChange true isVirtualHub false linkText OpenHabDevice locationId 1ef5bd52-1594-4649-a5f4-7220bba8f752 name message rawDescription index:0A, mac:00505698F2D9, headers:UE9TVCAvZGlzY292ZXJ5IEhUVFAvMS4xDQpBY2NlcHQtRW5jb2Rpbmc6IGd6aXANClVzZXItQWdlbnQ6IEpldHR5LzkuNC4xMS52MjAxODA2MDUNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbg0KSG9zdDogMTkyLjE2OC4xMjMuMjk6Mzk1MDANCkNvbnRlbnQtTGVuZ3RoOiA1NQ==, body:eyJkaXNjb3ZlcnkiOiAieWVzIiwgIm9wZW5IYWJTdGFydFRpbWUiOiAxNTUwOTY4MDIyNjk5fQ== translatable false unixTime 1550968023752 value {"path":"discovery","hubStartTime":1550968023763,"openHabStartTime":1550968022699} viewed false

OpenHabDeviceHandler Device OpenHabDevice Name OpenHabDeviceHandler Label OpenHabDevice Type OpenHabDeviceHandler Version Published Device Network Id 00505698F2D9 Status ACTIVE Hub SmartThings Hub Group Basement Last Activity At 2019-02-23 7:27 PM EST Date Created 2019-02-23 9:21 AM EST Last Updated 2019-02-23 9:24 AM EST Data No data found for device Current States No states found Preferences (edit)
Name Type Value ip string 192.168.123.225 mac string 00:50:56:98:F2:D9 port string 8080 Execution Location Cloud Events List Events In Use By

Live Logging / smartthings.com 79a3a914-5f97-45e3-a251-2151d28df058 7:32:58 PM: debug Creating event with message: [path:discovery, hubStartTime:1550968378384, openHabStartTime:1550968377555] 79a3a914-5f97-45e3-a251-2151d28df058 7:32:58 PM: debug Msg '[index:0B, mac:00505698F2D9, headers:[post /discovery http/1.1:null, content-length:55, accept-encoding:gzip, host:192.168.123.29:39500, user-agent:Jetty/9.4.11.v20180605, content-type:application/json], body:{"discovery": "yes", "openHabStartTime": 1550968377555}, header:POST /discovery HTTP/1.1 Accept-Encoding: gzip User-Agent: Jetty/9.4.11.v20180605 Content-Type: application/json Host: 192.168.123.29:39500 Content-Length: 55, data:[discovery:yes, openHabStartTime:1550968377555], json:[discovery:yes, openHabStartTime:1550968377555]]' 79a3a914-5f97-45e3-a251-2151d28df058 7:32:58 PM: debug Creating event with message: [path:discovery, hubStartTime:1550968378384, openHabStartTime:1550968377555] 79a3a914-5f97-45e3-a251-2151d28df058 7:32:58 PM: debug Msg '[index:0B, mac:00505698F2D9, headers:[post /discovery http/1.1:null, content-length:55, accept-encoding:gzip, host:192.168.123.29:39500, user-agent:Jetty/9.4.11.v20180605, content-type:application/json], body:{"discovery": "yes", "openHabStartTime": 1550968377555}, header:POST /discovery HTTP/1.1 Accept-Encoding: gzip User-Agent: Jetty/9.4.11.v20180605 Content-Type: application/json Host: 192.168.123.29:39500 Content-Length: 55, data:[discovery:yes, openHabStartTime:1550968377555], json:[discovery:yes, openHabStartTime:1550968377555]]' 7:32:48 PM: info Waiting on events... 7:32:48 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. 7:32:48 PM: info This console provides live logging of your SmartThings.

DeviceHandler def hubTime = now() def hubStartTime = parsed.hubStartTime; def elapsedTime = null if(hubStartTime != null) { elapsedTime = hubTime - hubStartTime parsed.body.hubTime = elapsedTime } else { // We should not ever get here unless an older version of the OpenHab binding is running parsed.body.hubTime = 0 } parsed.body.hubEndTime = hubTime log.debug "hub elapsed time is ${elapsedTime}"

Appreciate any assistance you can provide Cheers Michael.

BobRak commented 5 years ago

@thewag Here are a couple of things to check: Looking at the SmartthingsInstallation.md in the Create the Device section. Make sure you have the Device network ID, MAC, IP and port of your openHAB server set correctly. If these aren't correct the hub is unable to send anything back to the openHAB server.

Make sure you ave installed the Classic Smartthings App on your phone

Again, from the SmartthingsInstallation.md in the Configuration in the Smartthings Classic App make sure you have selected the devices that you want to talk to openHAB. Only selected devices will send data to openHAB.

Let me know how it goes.

thewag commented 5 years ago

Bob, thanks!! My mistake was using the wrong version of mobile Smartthings apps. Once I installed the Smartthings Classic app, everything was fine. Thanks for the response as well as your time and effort to work on this... it's really appreciated!