SmartThings and OH2?

Is there any add on to get SmartThings to work with OH2

(I don’t know if that changed in the meantime)

@DariBer, If you’re still interested, I got this project working with openHAB2 and SmartThings.

I’ve been working on a Smartthings binding. It is available for testing on github at: https://github.com/BobRak/OpenHAB-Smartthings. If you try it any feedback would be appreciated.

I’m trying to do that now. I’m having a lot of issues with it…Would you mind sharing how you got the bridge working on OpenHAB? I know how to do the stuff through the SmartThings API, just not OpenHAB.

Hi Bob,

I almost have the binding working. I have some Bosch motion detectors setup.

And while i do see the notifications in my logs, see below, I am unable to create rule to triggers when the event is seen. I see the following in the log file:

2018-11-02 13:02:09.079 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler SmartthingsThingHandler of thing smartthings:motionSensor:Home:Sensor1 tried updating channel motion although the handler was already disposed.
2018-11-02 13:02:09.082 [INFO ] [ings.handler.SmartthingsThingHandler] - Smartthings updated State for channel: smartthings:motionSensor:Home:Sensor1:motion to active

My rules file:

import org.openhab.core.library.types
import org.openhab.core.persistence
import org.openhab.model.script.actions
import org.java.math
import org.joda.datetime.DateTime

// https://www.openhab.org/addons/bindings/astro/#full-example

val String logfile = "TriggerRules"

rule "MotionRule"
when
    Channel "smartthings:motionSensor:Home:Sensor1" triggered START
or
    Channel "smartthings:motionSensor:Home" triggered START
or
    Channel "smartthings:motionSensor:Home:SENSOR1" triggered ACTIVE
or
    Channel "smartthings:motionSensor:Home:Sensor1" triggered ACTIVE
or
    Channel "smartthings:motionSensor:Home:Sensor1#state" triggered START
or
    Channel "smartthings:motionSensor:Home:Sensor1#state" triggered ACTIVE
or
    Channel "smartthings:motionSensor:Home:Sensor1#state" triggered

or
    Channel "smartthings:motionSensor:Home:Sensor1:motion" triggered
or
    Channel "smartthings:motionSensor:Home:Sensor2:motion" triggered

then
   logInfo(logfile, "MotionRule triggerd---------------------- ")
   Plus_TTS.sendCommand("Boooo")
   sendCommand(OfficeLight5_Toggle, OFF)
end

Any idea what I am missing?

Hi:

I’m not an expert at rules. But here is what I can offer.

Looking at the Rules documentation (https://www.openhab.org/docs/configuration/rules-dsl.html#defining-rules) I think you want to be using an Item rule. Such as: Item received command [].

The part has to be an item name. The best way to find the accurate item names for your system is to use the following url in a browser: http://:8080/rest/items. then do a find for name": following the : you’ll find the name.

So your rule should look something like:

rule “MotionRule”

when

Item <ItemName> received command

then

if( <ItemName>.state == OPEN ) {

	// do something

}

else {

	// Do the CLOSED action

}

end

Where is your item name from the browser search.

Like I said, I’m not an expert at rule but I’ve used this pattern and it works.

Good luck and let me know how it goes:

Bob

Just wanted to say thank you for the great work on the smartthings binding Bob Raker. I installed per your instruction from the link above and had it running on my setup. I had two motion sensors and one open contact sensor working with the binding triggering rules and shutting lights on and off.I have since replaced the functionality with a zigbee doggle but your binding works great!!

Hi Andrew, which dongle did you use and what binding for the dongle are you using?

I purchased Linear HUSBZB-1 for around $30 on Amazon at the time. Tried to post link but it is not the exact item anymore (or may be but they are calling it differently now)
I use @chris excellent zigbee and zwave binding which runs both and this stick has receivers for both. I don’t have any zwave stuff yet but binding seems to work for zwave. (controller auto discovers and initializes)
kind of funny you post today in thread about smartthings because a day or two ago the second of my two smartthings motion detectors stopped sending motion reports. They both still report voltage and temperature. Smartthings door contact sensor died a few days early
I think the hub I paid $60 for might still run but I unplugged it months ago

Bob,
Is there any way to use both the MQTT binding and your SmartThings binding at the same time?

Both ask me to put the same MAC address into the Device Network Id field - which is not allowed since it has to be unique.

(Is there a thread to discuss your new binding?)

Are you talking about the OpenHAB MQTT binding or the MQTT bridge discussed above? The Smartthings binding I have developed for OpenHAB allows you to connect a Smartthings hub directly to OpenHAB. It is available here. The binding uses the mac address internally to keep track of multiple users of the hub. It never sends the mac address back to OpenHAB so I don’t think there should be a conflict. The hub sends messages to OpenHAB using a url that starts with http://OpenHabIp:OpenHabPort/smartthings/ so as long as no other OpenHAB binding is using the /smartthings path there should not be a conflict.

I hope this answers your question. If not, please ask again.

I think this is an OK place to discuss the binding. If you use it and discover problems with it please raise an issue on github here.

@BobRak
I used your binding from about 6 or 8 months ago and it worked very well. I have since given up on st

I recently found the ST android app times-out on the preference screen of OpenHabDevice. After a lot of reinstalling of OH and ST and rolling back to find the issue, which is probably a timeout change in ST platform, I found this issue seems to be the number of supported items, a work-around was to remove half of the items in CAPABILITY_MAP (OpenHabAppV2 code), now it is OK. May save others some time if they use this. Cheers

welcome to the OpenHAB community Glen and thanks for tips

Bei mir sieht alles soweit gut aus mit der Smartthing Bindung, leider bekommt die Bindung beim switch der Samsung Klima Anlage Windfree nur den Status. Ein und ausschalten so wie andere commands funktionieren leider nicht.

Welcome to the openHAB Forum.
This is an international Forum, hence all post should be in english!

For a German Forum look here

I am unable to find the Jar file link for some reason and I’d love to connect Smartthings with Openhab because there is a problem if you’re using one of the market bluetooth binding and Z wave binding together as it messes up the serial ports and there is no solution. The other workaround is to use Smartthings and connect it with Openhab for extensive rules. I’d appreciate the Jar file link.

@alijaf
Click here for a link to the jar file. Look here for the installation instruction.. Scroll down for the Readme.md contents. It is a long install procedure so take your time and make sure not to skip any steps.

Thank you so much for the help, I really appreciate that, I have now successfully connected Smartthings with Openhab and everything works great so far and this has solved my biggest challenge and now I can use Market Bluetooth binding for Presence and for any Z Wave device I can use Smartthings.