BobRak / OpenHAB-Smartthings

53 stars 54 forks source link

no updates from contact sensor #57

Closed arrow53 closed 5 years ago

arrow53 commented 5 years ago

I'm on OH 2.4 snapshot. Ubuntu 18.04 apt install.

I have a Samsung Smartthings multipurpose sensor (the older model). While I can get an outlet to work fine, I'm unable to get the multipurpose sensor to send any information to me. So, in the logs I see some HTTP good responses and I can see MySwitch change (and watch the lamp plugged into it turn on) but I never get messages from the sensor even when I move the contacts. Do I need to request somehow?

2018-11-08 17:58:32.971 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"capabilityKey": "temperatureMeasurement", "deviceDisplayName": "MySensor", "capabilityAttribute": "temperature"}" with path "/state" to the Smartthings hub, recieved HTTP status 202
2018-11-08 17:58:33.229 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"capabilityKey": "battery", "deviceDisplayName": "MySensor", "capabilityAttribute": "battery"}" with path "/state" to the Smartthings hub, recieved HTTP status 202
2018-11-08 17:58:33.485 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"capabilityKey": "switch", "deviceDisplayName": "MyOutlet", "capabilityAttribute": "switch"}" with path "/state" to the Smartthings hub, recieved HTTP status 202
2018-11-08 17:58:33.746 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"capabilityKey": "contactSensor", "deviceDisplayName": "MySensor", "capabilityAttribute": "contact"}" with path "/state" to the Smartthings hub, recieved HTTP status 202
2018-11-08 18:06:23.693 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"capabilityKey": "switch", "deviceDisplayName": "MyOutlet", "capabilityAttribute": "switch", "value": "on"}" with path "/update" to the Smartthings hub, recieved HTTP status 202
2018-11-08 18:06:26.320 [INFO ] [hings.internal.SmartthingsHttpClient] - Sent message "{"capabilityKey": "switch", "deviceDisplayName": "MyOutlet", "capabilityAttribute": "switch", "value": "off"}" with path "/update" to the Smartthings hub, recieved HTTP status 202

my smartthings.items

Switch  OfficeLight    "Office light"     <light>      { channel="smartthings:switch:Home:OfficeLight:switch" }
Contact MainGarageDoor       "Garage door status [%s]" <garagedoor>       { channel="smartthings:contactSensor:Home:MainGarageDoor:contact" }
Number  MainGarageTemp       "Garage temperature [%.0f]"  <temperature>   { channel="smartthings:temperatureMeasurement:Home:MainGarageTemp:temperature" }
Number  MainGarageBattery    "Garage battery [%.0f]"  <battery>           { channel="smartthings:battery:Home:MainGarageBattery:battery" }

and smartthings.things

Bridge smartthings:smartthings:Home    [ smartthingsIp="172.22.1.29", smartthingsPort=39500 ] {
    Thing switch                   OfficeLight             [ smartthingsName="MyOutlet" ]
    Thing contactSensor            MainGarageDoor          [ smartthingsName="MySensor" ]
    Thing temperatureMeasurement   MainGarageTemp          [ smartthingsName="MySensor" ] 
    Thing battery                  MainGarageBattery       [ smartthingsName="MySensor" ] 
}

I do think I have the multipurpose sensor enabled in the app ok but maybe there is something else I need to do?

BobRak commented 5 years ago

Usually when I have problems like this I find that I have not included the device in the Smartthing App for the OpenHabAppV2 SmartApp. Or, that I missed saving the changes (the Save button in the upper right corner). I would suggest checking that first. If that doesn't help you can look at the Smartthings logs and see if Smartthings is trying to send a message back to OpenHAB. See the Troubleshooting.md file.

Are you using a sitemap display (i.e. the BasicUI) or the PaperUI. I've noticed that the PaperUI doesn't show contact status. I asked a question about this in the Community forum and got a few responses that the PaperUI isn't designed to show ContactSensor status.

BTW I have 2 of those sensors so I know they work.

Bob

arrow53 commented 5 years ago

@arrow53 tried adding a sitemap but no luck. I do see updates in the smartthings log

Sending '{"path":"/smartthings/state","body":{"deviceDisplayName":"MySensor","value":"closed","capabilityAttribute":"contact"}}' 
Forwarding device event to openhabDevice: {"path":"/smartthings/state","body":{"deviceDisplayName":"MySensor","value":"closed","capabilityAttribute":"contact"}}

maybe share your sitemap entry?

Is there a way to "pull" the temp/battery? I could try that.

arrow53 commented 5 years ago

i had the wrong IP address configured so wasn't getting responses back.