Closed rberger closed 5 years ago
Hi
I am getting this exact error with my setup. Might be worth mentioning that I am using a v3 Hub.
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
Thanks! Let me know if there is anything I can do to help! Just for the record I'm using a v2 Smartthings Hub
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
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
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.
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.
2018-12-05 20:13:31.346 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"capabilityKey": "switchLevel", "deviceDisplayName": "Kitchen Lights", "capabilityAttribute": "level", "value": "on"}" with path "/update" to the Smartthings hub, recieved HTTP status 202
923e61c1-e489-438e-b283-ecc3f25e79ed 8:18:30 PM: error java.lang.NumberFormatException: For input string: "on" @line 868 (actionLevel)
923e61c1-e489-438e-b283-ecc3f25e79ed 8:18:30 PM: debug Setting device Kitchen Lights with attribute level to value on
923e61c1-e489-438e-b283-ecc3f25e79ed 8:18:30 PM: debug openhabUpdateHandler - Capability Dimmer Switch with device name Kitchen Lights changed to on using action actionLevel
923e61c1-e489-438e-b283-ecc3f25e79ed 8:18:30 PM: debug openhabUpdateHandler - found device for Kitchen Lights
923e61c1-e489-438e-b283-ecc3f25e79ed 8:18:30 PM: debug Received update event from openhabDevice: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, hubStartTime:1544069910262, openHabStartTime:null, path:update, value:on]
923e61c1-e489-438e-b283-ecc3f25e79ed 8:18:30 PM: debug Received device event from Message : [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, hubStartTime:1544069910262, openHabStartTime:null, path:update, value:on]
2a25a3f2-f37e-4036-820e-0e295daac291 8:18:30 PM: debug Creating event with message: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, hubStartTime:1544069910262, openHabStartTime:null, path:update, value:on]
2a25a3f2-f37e-4036-820e-0e295daac291 8:18:30 PM: debug Msg '[index:70, mac:0011328B4939, headers:[content-length:118, accept-encoding:gzip, post /update http/1.1:null, host:192.168.20.22:39500, user-agent:Jetty/9.3.21.v20170918, content-type:application/json], body:{"capabilityKey": "switchLevel", "deviceDisplayName": "Kitchen Lights", "capabilityAttribute": "level", "value": "on"}, header:POST /update 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: 118, data:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, value:on], json:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, value:on]]'
2a25a3f2-f37e-4036-820e-0e295daac291 8:18:30 PM: debug Creating event with message: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, hubStartTime:1544069910262, openHabStartTime:null, path:update, value:on]
2a25a3f2-f37e-4036-820e-0e295daac291 8:18:30 PM: debug Msg '[index:70, mac:0011328B4939, headers:[content-length:118, accept-encoding:gzip, post /update http/1.1:null, host:192.168.20.22:39500, user-agent:Jetty/9.3.21.v20170918, content-type:application/json], body:{"capabilityKey": "switchLevel", "deviceDisplayName": "Kitchen Lights", "capabilityAttribute": "level", "value": "on"}, header:POST /update 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: 118, data:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, value:on], json:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, value:on]]'
2018-12-05 20:19:31.650 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"capabilityKey": "switchLevel", "deviceDisplayName": "Kitchen Lights", "capabilityAttribute": "level", "value": "off"}" with path "/update" to the Smartthings hub, recieved HTTP status 202
923e61c1-e489-438e-b283-ecc3f25e79ed 8:19:32 PM: error java.lang.NumberFormatException: For input string: "off" @line 868 (actionLevel)
923e61c1-e489-438e-b283-ecc3f25e79ed 8:19:32 PM: debug Setting device Kitchen Lights with attribute level to value off
923e61c1-e489-438e-b283-ecc3f25e79ed 8:19:32 PM: debug openhabUpdateHandler - Capability Dimmer Switch with device name Kitchen Lights changed to off using action actionLevel
923e61c1-e489-438e-b283-ecc3f25e79ed 8:19:32 PM: debug openhabUpdateHandler - found device for Kitchen Lights
923e61c1-e489-438e-b283-ecc3f25e79ed 8:19:32 PM: debug Received update event from openhabDevice: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, hubStartTime:1544069972208, openHabStartTime:null, path:update, value:off]
923e61c1-e489-438e-b283-ecc3f25e79ed 8:19:32 PM: debug Received device event from Message : [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, hubStartTime:1544069972208, openHabStartTime:null, path:update, value:off]
2a25a3f2-f37e-4036-820e-0e295daac291 8:19:32 PM: debug Creating event with message: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, hubStartTime:1544069972208, openHabStartTime:null, path:update, value:off]
2a25a3f2-f37e-4036-820e-0e295daac291 8:19:32 PM: debug Msg '[index:71, mac:0011328B4939, headers:[content-length:119, accept-encoding:gzip, post /update http/1.1:null, host:192.168.20.22:39500, user-agent:Jetty/9.3.21.v20170918, content-type:application/json], body:{"capabilityKey": "switchLevel", "deviceDisplayName": "Kitchen Lights", "capabilityAttribute": "level", "value": "off"}, header:POST /update 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: 119, data:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, value:off], json:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, value:off]]'
2a25a3f2-f37e-4036-820e-0e295daac291 8:19:32 PM: debug Creating event with message: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, hubStartTime:1544069972208, openHabStartTime:null, path:update, value:off]
2a25a3f2-f37e-4036-820e-0e295daac291 8:19:32 PM: debug Msg '[index:71, mac:0011328B4939, headers:[content-length:119, accept-encoding:gzip, post /update http/1.1:null, host:192.168.20.22:39500, user-agent:Jetty/9.3.21.v20170918, content-type:application/json], body:{"capabilityKey": "switchLevel", "deviceDisplayName": "Kitchen Lights", "capabilityAttribute": "level", "value": "off"}, header:POST /update 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: 119, data:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, value:off], json:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Kitchen Lights, value:off]]'
59d29ff6-717e-4ad2-a757-f3b2593eff0d 8:25:09 PM: info postEventToEndpoint: event successfully posted.
59d29ff6-717e-4ad2-a757-f3b2593eff0d 8:25:09 PM: debug Property Change Event switch: on (source: DEVICE)
59d29ff6-717e-4ad2-a757-f3b2593eff0d 8:28:02 PM: info postEventToEndpoint: event successfully posted.
59d29ff6-717e-4ad2-a757-f3b2593eff0d 8:28:02 PM: debug Property Change Event switch: off (source: DEVICE)
Setting On on Openhab Dimmer UI does not change the state in Smartthings
2018-12-05 21:00:56.030 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"capabilityKey": "switchLevel", "deviceDisplayName": "Entryway Light", "capabilityAttribute": "level", "value": "on"}" with path "/update" to the Smartthings hub, recieved HTTP status 202
923e61c1-e489-438e-b283-ecc3f25e79ed 9:00:57 PM: error java.lang.NumberFormatException: For input string: "on" @line 868 (actionLevel)
923e61c1-e489-438e-b283-ecc3f25e79ed 9:00:57 PM: debug Setting device Entryway Light with attribute level to value on
923e61c1-e489-438e-b283-ecc3f25e79ed 9:00:57 PM: debug openhabUpdateHandler - Capability Dimmer Switch with device name Entryway Light changed to on using action actionLevel
923e61c1-e489-438e-b283-ecc3f25e79ed 9:00:57 PM: debug openhabUpdateHandler - found device for Entryway Light
923e61c1-e489-438e-b283-ecc3f25e79ed 9:00:57 PM: debug Received update event from openhabDevice: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, hubStartTime:1544072456948, openHabStartTime:null, path:update, value:on]
923e61c1-e489-438e-b283-ecc3f25e79ed 9:00:57 PM: debug Received device event from Message : [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, hubStartTime:1544072456948, openHabStartTime:null, path:update, value:on]
9dc6fcf6-73a9-4365-aea9-23e2167b3002 9:00:56 PM: debug updating TS
9dc6fcf6-73a9-4365-aea9-23e2167b3002 9:00:56 PM: debug event from: Main Room Motion Sensor, value: inactive, source: DEVICE, description: null
c3fbb58a-271a-402c-893c-c5c78bc90ed3 9:00:56 PM: debug motionOrContactHandler(Main Room Motion Sensor motion:inactive)
2a25a3f2-f37e-4036-820e-0e295daac291 9:00:56 PM: debug Creating event with message: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, hubStartTime:1544072456948, openHabStartTime:null, path:update, value:on]
2a25a3f2-f37e-4036-820e-0e295daac291 9:00:56 PM: debug Msg '[index:84, mac:0011328B4939, headers:[content-length:118, accept-encoding:gzip, post /update http/1.1:null, host:192.168.20.22:39500, user-agent:Jetty/9.3.21.v20170918, content-type:application/json], body:{"capabilityKey": "switchLevel", "deviceDisplayName": "Entryway Light", "capabilityAttribute": "level", "value": "on"}, header:POST /update 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: 118, data:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, value:on], json:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, value:on]]'
2a25a3f2-f37e-4036-820e-0e295daac291 9:00:56 PM: debug Creating event with message: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, hubStartTime:1544072456948, openHabStartTime:null, path:update, value:on]
2a25a3f2-f37e-4036-820e-0e295daac291 9:00:56 PM: debug Msg '[index:84, mac:0011328B4939, headers:[content-length:118, accept-encoding:gzip, post /update http/1.1:null, host:192.168.20.22:39500, user-agent:Jetty/9.3.21.v20170918, content-type:application/json], body:{"capabilityKey": "switchLevel", "deviceDisplayName": "Entryway Light", "capabilityAttribute": "level", "value": "on"}, header:POST /update 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: 118, data:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, value:on], json:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, value:on]]'
Setting Off on Openhab Dimmer UI does not change the state in Smartthings
2018-12-05 21:02:39.159 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"capabilityKey": "switchLevel", "deviceDisplayName": "Entryway Light", "capabilityAttribute": "level", "value": "off"}" with path "/update" to the Smartthings hub, recieved HTTP status 202
923e61c1-e489-438e-b283-ecc3f25e79ed 9:02:39 PM: error java.lang.NumberFormatException: For input string: "off" @line 868 (actionLevel)
923e61c1-e489-438e-b283-ecc3f25e79ed 9:02:39 PM: debug Setting device Entryway Light with attribute level to value off
923e61c1-e489-438e-b283-ecc3f25e79ed 9:02:39 PM: debug openhabUpdateHandler - Capability Dimmer Switch with device name Entryway Light changed to off using action actionLevel
923e61c1-e489-438e-b283-ecc3f25e79ed 9:02:39 PM: debug openhabUpdateHandler - found device for Entryway Light
923e61c1-e489-438e-b283-ecc3f25e79ed 9:02:39 PM: debug Received update event from openhabDevice: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, hubStartTime:1544072559025, openHabStartTime:null, path:update, value:off]
923e61c1-e489-438e-b283-ecc3f25e79ed 9:02:39 PM: debug Received device event from Message : [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, hubStartTime:1544072559025, openHabStartTime:null, path:update, value:off]
2a25a3f2-f37e-4036-820e-0e295daac291 9:02:39 PM: debug Creating event with message: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, hubStartTime:1544072559025, openHabStartTime:null, path:update, value:off]
2a25a3f2-f37e-4036-820e-0e295daac291 9:02:39 PM: debug Msg '[index:85, mac:0011328B4939, headers:[content-length:119, accept-encoding:gzip, post /update http/1.1:null, host:192.168.20.22:39500, user-agent:Jetty/9.3.21.v20170918, content-type:application/json], body:{"capabilityKey": "switchLevel", "deviceDisplayName": "Entryway Light", "capabilityAttribute": "level", "value": "off"}, header:POST /update 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: 119, data:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, value:off], json:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, value:off]]'
2a25a3f2-f37e-4036-820e-0e295daac291 9:02:39 PM: debug Creating event with message: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, hubStartTime:1544072559025, openHabStartTime:null, path:update, value:off]
2a25a3f2-f37e-4036-820e-0e295daac291 9:02:39 PM: debug Msg '[index:85, mac:0011328B4939, headers:[content-length:119, accept-encoding:gzip, post /update http/1.1:null, host:192.168.20.22:39500, user-agent:Jetty/9.3.21.v20170918, content-type:application/json], body:{"capabilityKey": "switchLevel", "deviceDisplayName": "Entryway Light", "capabilityAttribute": "level", "value": "off"}, header:POST /update 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: 119, data:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, value:off], json:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, value:off]]'
Setting On on the Smartthings does change the state of Openhab to on
2018-12-05 21:21:18.665 [INFO ] [ings.handler.SmartthingsThingHandler] - Smartthings updated State for channel: smartthings:switchLevel:65a0c026:Entryway_Light:level to 99
2018-12-05 21:21:18.665 [INFO ] [ings.handler.SmartthingsThingHandler] - State timing data, Request time until data recieved and processed 0, Hub processing time: 62
2018-12-05 21:21:18.791 [INFO ] [ings.handler.SmartthingsThingHandler] - Smartthings updated State for channel: smartthings:switchLevel:65a0c026:Entryway_Light:level to 100
2018-12-05 21:21:18.792 [INFO ] [ings.handler.SmartthingsThingHandler] - State timing data, Request time until data recieved and processed 0, Hub processing time: 68
2df37de8-9c0a-497d-9d12-f589121870dc 9:21:20 PM: debug Parse returned [Entryway Light switch is on, Entryway Light level is 100%]
2df37de8-9c0a-497d-9d12-f589121870dc 9:21:20 PM: debug parse() >> zwave.parse(zw device: 04, command: 2603, payload: 64 64 00 )
2a25a3f2-f37e-4036-820e-0e295daac291 9:21:19 PM: debug Msg '[index:96, mac:0011328B4939, ip:C0A81423, port:1F9A, requestId:c82e4d9a-d26a-46bf-8487-800629cc4ad8, 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]'
2a25a3f2-f37e-4036-820e-0e295daac291 9:21:18 PM: debug Msg '[index:95, mac:0011328B4939, ip:C0A81423, port:1F9A, requestId:ffd77ea8-1d76-4b2e-82bd-fdb7e75adca5, 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 9:21:18 PM: debug Forwarding device event to openhabDevice: {"path":"/smartthings/state","hubStartTime":1544073678618,"body":{"deviceDisplayName":"Entryway Light","value":"100","capabilityAttribute":"level","hubTime":"--hubTime--"}}
923e61c1-e489-438e-b283-ecc3f25e79ed 9:21:18 PM: debug Entered input handler for Entryway Light with attribute level changed to 100
2a25a3f2-f37e-4036-820e-0e295daac291 9:21:18 PM: debug hub elapsed time is 68
2a25a3f2-f37e-4036-820e-0e295daac291 9:21:18 PM: debug Sending '{"path":"/smartthings/state","hubStartTime":1544073678618,"body":{"deviceDisplayName":"Entryway Light","value":"100","capabilityAttribute":"level","hubTime":"--hubTime--"}}' to 192.168.20.35:8090 with mac: 00:11:32:8B:49:39
2a25a3f2-f37e-4036-820e-0e295daac291 9:21:18 PM: debug hub elapsed time is 68
2a25a3f2-f37e-4036-820e-0e295daac291 9:21:18 PM: debug Sending '{"path":"/smartthings/state","hubStartTime":1544073678618,"body":{"deviceDisplayName":"Entryway Light","value":"100","capabilityAttribute":"level","hubTime":"--hubTime--"}}' to 192.168.20.35:8090 with mac: 00:11:32:8B:49:39
923e61c1-e489-438e-b283-ecc3f25e79ed 9:21:18 PM: debug Forwarding device event to openhabDevice: {"path":"/smartthings/state","hubStartTime":1544073678571,"body":{"deviceDisplayName":"Entryway Light","value":"99","capabilityAttribute":"level","hubTime":"--hubTime--"}}
923e61c1-e489-438e-b283-ecc3f25e79ed 9:21:18 PM: debug Entered input handler for Entryway Light with attribute level changed to 99
2a25a3f2-f37e-4036-820e-0e295daac291 9:21:18 PM: debug hub elapsed time is 62
2a25a3f2-f37e-4036-820e-0e295daac291 9:21:18 PM: debug Sending '{"path":"/smartthings/state","hubStartTime":1544073678571,"body":{"deviceDisplayName":"Entryway Light","value":"99","capabilityAttribute":"level","hubTime":"--hubTime--"}}' to 192.168.20.35:8090 with mac: 00:11:32:8B:49:39
2a25a3f2-f37e-4036-820e-0e295daac291 9:21:18 PM: debug hub elapsed time is 62
2a25a3f2-f37e-4036-820e-0e295daac291 9:21:18 PM: debug Sending '{"path":"/smartthings/state","hubStartTime":1544073678571,"body":{"deviceDisplayName":"Entryway Light","value":"99","capabilityAttribute":"level","hubTime":"--hubTime--"}}' to 192.168.20.35:8090 with mac: 00:11:32:8B:49:39
59d29ff6-717e-4ad2-a757-f3b2593eff0d 9:21:18 PM: info postEventToEndpoint: event successfully posted.
59d29ff6-717e-4ad2-a757-f3b2593eff0d 9:21:18 PM: debug Property Change Event level: 100 (source: DEVICE)
59d29ff6-717e-4ad2-a757-f3b2593eff0d 9:21:18 PM: info postEventToEndpoint: event successfully posted.
59d29ff6-717e-4ad2-a757-f3b2593eff0d 9:21:18 PM: debug Property Change Event level: 99 (source: DEVICE)
59d29ff6-717e-4ad2-a757-f3b2593eff0d 9:21:18 PM: info postEventToEndpoint: event successfully posted.
59d29ff6-717e-4ad2-a757-f3b2593eff0d 9:21:18 PM: debug Property Change Event switch: on (source: DEVICE)
2df37de8-9c0a-497d-9d12-f589121870dc 9:21:18 PM: debug Parse returned [Entryway Light switch is on, Entryway Light level is 100%]
2df37de8-9c0a-497d-9d12-f589121870dc 9:21:18 PM: debug parse() >> zwave.parse(zw device: 04, command: 2603, payload: 64 64 00 )
2df37de8-9c0a-497d-9d12-f589121870dc 9:21:18 PM: debug Parse returned [Entryway Light switch is on, Entryway Light level is 99%]
2df37de8-9c0a-497d-9d12-f589121870dc 9:21:18 PM: debug parse() >> zwave.parse(zw device: 04, command: 2003, payload: 63 )
Setting Off on the Smartthings does not change the state of Openhab Dimmer UI to off
2018-12-05 21:22:32.569 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"capabilityKey": "switchLevel", "deviceDisplayName": "Entryway Light", "capabilityAttribute": "level", "value": "off"}" with path "/update" to the Smartthings hub, recieved HTTP status 202
923e61c1-e489-438e-b283-ecc3f25e79ed 9:22:32 PM: error java.lang.NumberFormatException: For input string: "off" @line 868 (actionLevel)
923e61c1-e489-438e-b283-ecc3f25e79ed 9:22:32 PM: debug Setting device Entryway Light with attribute level to value off
923e61c1-e489-438e-b283-ecc3f25e79ed 9:22:32 PM: debug openhabUpdateHandler - Capability Dimmer Switch with device name Entryway Light changed to off using action actionLevel
923e61c1-e489-438e-b283-ecc3f25e79ed 9:22:32 PM: debug openhabUpdateHandler - found device for Entryway Light
923e61c1-e489-438e-b283-ecc3f25e79ed 9:22:32 PM: debug Received update event from openhabDevice: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, hubStartTime:1544073752485, openHabStartTime:null, path:update, value:off]
923e61c1-e489-438e-b283-ecc3f25e79ed 9:22:32 PM: debug Received device event from Message : [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, hubStartTime:1544073752485, openHabStartTime:null, path:update, value:off]
2a25a3f2-f37e-4036-820e-0e295daac291 9:22:32 PM: debug Creating event with message: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, hubStartTime:1544073752485, openHabStartTime:null, path:update, value:off]
2a25a3f2-f37e-4036-820e-0e295daac291 9:22:32 PM: debug Msg '[index:97, mac:0011328B4939, headers:[content-length:119, accept-encoding:gzip, post /update http/1.1:null, host:192.168.20.22:39500, user-agent:Jetty/9.3.21.v20170918, content-type:application/json], body:{"capabilityKey": "switchLevel", "deviceDisplayName": "Entryway Light", "capabilityAttribute": "level", "value": "off"}, header:POST /update 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: 119, data:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, value:off], json:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Entryway Light, value:off]]'
Changing the dim level works in both directions
Setting On on Openhab Dimmer UI does not change the state in Smartthings
2018-12-05 21:32:44.376 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"capabilityKey": "switchLevel", "deviceDisplayName": "Livingroom North 0", "capabilityAttribute": "level", "value": "on"}" with path "/update" to the Smartthings hub, recieved HTTP status 202
923e61c1-e489-438e-b283-ecc3f25e79ed 9:32:44 PM: error java.lang.NumberFormatException: For input string: "on" @line 868 (actionLevel)
923e61c1-e489-438e-b283-ecc3f25e79ed 9:32:44 PM: debug Setting device Livingroom North 0 with attribute level to value on
923e61c1-e489-438e-b283-ecc3f25e79ed 9:32:44 PM: debug openhabUpdateHandler - Capability Dimmer Switch with device name Livingroom North 0 changed to on using action actionLevel
923e61c1-e489-438e-b283-ecc3f25e79ed 9:32:44 PM: debug openhabUpdateHandler - found device for Livingroom North 0
923e61c1-e489-438e-b283-ecc3f25e79ed 9:32:44 PM: debug Received update event from openhabDevice: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Livingroom North 0, hubStartTime:1544074364293, openHabStartTime:null, path:update, value:on]
923e61c1-e489-438e-b283-ecc3f25e79ed 9:32:44 PM: debug Received device event from Message : [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Livingroom North 0, hubStartTime:1544074364293, openHabStartTime:null, path:update, value:on]
2a25a3f2-f37e-4036-820e-0e295daac291 9:32:44 PM: debug Creating event with message: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Livingroom North 0, hubStartTime:1544074364293, openHabStartTime:null, path:update, value:on]
2a25a3f2-f37e-4036-820e-0e295daac291 9:32:44 PM: debug Msg '[index:A3, mac:0011328B4939, headers:[content-length:122, accept-encoding:gzip, post /update http/1.1:null, host:192.168.20.22:39500, user-agent:Jetty/9.3.21.v20170918, content-type:application/json], body:{"capabilityKey": "switchLevel", "deviceDisplayName": "Livingroom North 0", "capabilityAttribute": "level", "value": "on"}, header:POST /update 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: 122, data:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Livingroom North 0, value:on], json:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Livingroom North 0, value:on]]'
Setting Off on Openhab Dimmer UI does not change the state in Smartthings
2018-12-05 21:33:40.864 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"capabilityKey": "switchLevel", "deviceDisplayName": "Livingroom North 0", "capabilityAttribute": "level", "value": "off"}" with path "/update" to the Smartthings hub, recieved HTTP status 202
923e61c1-e489-438e-b283-ecc3f25e79ed 9:33:40 PM: error java.lang.NumberFormatException: For input string: "off" @line 868 (actionLevel)
923e61c1-e489-438e-b283-ecc3f25e79ed 9:33:40 PM: debug Setting device Livingroom North 0 with attribute level to value off
923e61c1-e489-438e-b283-ecc3f25e79ed 9:33:40 PM: debug openhabUpdateHandler - Capability Dimmer Switch with device name Livingroom North 0 changed to off using action actionLevel
923e61c1-e489-438e-b283-ecc3f25e79ed 9:33:40 PM: debug openhabUpdateHandler - found device for Livingroom North 0
923e61c1-e489-438e-b283-ecc3f25e79ed 9:33:40 PM: debug Received update event from openhabDevice: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Livingroom North 0, hubStartTime:1544074420785, openHabStartTime:null, path:update, value:off]
923e61c1-e489-438e-b283-ecc3f25e79ed 9:33:40 PM: debug Received device event from Message : [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Livingroom North 0, hubStartTime:1544074420785, openHabStartTime:null, path:update, value:off]
2a25a3f2-f37e-4036-820e-0e295daac291 9:33:40 PM: debug Creating event with message: [capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Livingroom North 0, hubStartTime:1544074420785, openHabStartTime:null, path:update, value:off]
2a25a3f2-f37e-4036-820e-0e295daac291 9:33:40 PM: debug Msg '[index:A4, mac:0011328B4939, headers:[content-length:123, accept-encoding:gzip, post /update http/1.1:null, host:192.168.20.22:39500, user-agent:Jetty/9.3.21.v20170918, content-type:application/json], body:{"capabilityKey": "switchLevel", "deviceDisplayName": "Livingroom North 0", "capabilityAttribute": "level", "value": "off"}, header:POST /update 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: 123, data:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Livingroom North 0, value:off], json:[capabilityAttribute:level, capabilityKey:switchLevel, deviceDisplayName:Livingroom North 0, value:off]]'
Setting On on Smartthings does NOT set Openhab Dimmer UI to On
59d29ff6-717e-4ad2-a757-f3b2593eff0d 9:34:21 PM: info postEventToEndpoint: event successfully posted.
59d29ff6-717e-4ad2-a757-f3b2593eff0d 9:34:21 PM: debug Property Change Event switch: on (source: DEVICE)
Setting Off on Smartthings does NOT set Openhab Dimmer UI to Off
59d29ff6-717e-4ad2-a757-f3b2593eff0d 9:35:05 PM: info postEventToEndpoint: event successfully posted.
59d29ff6-717e-4ad2-a757-f3b2593eff0d 9:35:05 PM: debug Property Change Event switch: off (source: DEVICE)
Changing Dimming level works in both directions
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.
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
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
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
@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
I replaced "--hubTime--", with now(), in OpenHabAppV2.groovy and it seemed to fix my errors.
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.
@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.
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!
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:
On The Smartthings side: