Samsung SmartThings Integration

rsw686

Active Member
This has been a project of mine over the last few months. It started as a way to control my lights as Amazon's Alex integrated with SmartThings and I was already using SmartThings to manage my Z-Wave lock PIN codes. As it stands now I have two way integration with OmniPro units and thermostats and read only integration with OmniPro area and zones. You do need to be running my HAILogger application as a middleman between SmartThings and the OmniPro II controller. The HAILogger provides a web service API for the SmartThings hub to talk to over the local network.
 
Once you have the HAILogger running and the SmartApp and Device Handlers added to the Samsung SmartThings IDE you point the SmartApp to the IP/port of the computer running the HAILogger. The SmartApp will auto discover and add the devices from the OmniPro controller. I did make some assumptions about zone types when I mapped them to SmartThings capabilities.
 
This allows you to use the SmartThings Smart Home Monitor to monitor, send notifications, and perform actions for security, leaks, and smoke events. I have the security section always armed and monitoring the OmniPro Area burglary sensor. If the OmniPro II burglary alarm goes off this contact is reported as open and SmartThings will react.
 
Area
Burglary Alarm -> Contact Sensor
Water Alarm -> Water Sensor
Fire Alarm -> Smoke Detector
Gas Alarm -> Carbon Monoxide Detector
Security Mode -> No capability mapping
 
When the OmniPro Area 1 security mode changes the SmartThings hub mode will change as well
OFF, DAY -> Home
NIGHT -> Night
AWAY -> Away
VACATION -> Vacation 
 
Zone Types
Entry/Exit, X2EntryDelay, X24EntryDelay, Perimeter-> Contact Sensor
AwayInt -> Motion Sensor
Water -> Water Sensor
Fire -> Smoke Detector, Tamper Alert (for trouble condition)
Gas -> Carbon Monoxide Detector, Tamper Alert (for trouble condition)
 
Download SmartApp and Device Handlers from GitHub
Download HAILogger 1.0.7
Download HAILogger source code from GitHub
 

Attachments

  • IMG_6153.PNG
    IMG_6153.PNG
    27.1 KB · Views: 137
  • IMG_6155.PNG
    IMG_6155.PNG
    24.1 KB · Views: 132
  • IMG_6154.PNG
    IMG_6154.PNG
    22.6 KB · Views: 109
  • IMG_6156.PNG
    IMG_6156.PNG
    22 KB · Views: 89
Wow thanks for the info. I know a few others have been working on variations of this, but your solution seems to fit me the best. 
 
How do you control the Omni units?  What dialog do you use on the Echo to control a light? In other-words, how are unit names mapped from the Omni to the Smarthings, and then how does the Echo map those names? Your instruction says it "autodiscovers" these from the panel.
 
I just bought a Smarthings Hub to experiment.  I no longer have a PC running all the time, as I'm Mac based and run a Mac server, but with any luck I can run the logger under a PC emulator.  If not I can get a cheap PC to run it.  I'm guessing it doesn't use much resources.
 
I'll post the C# for the HAILogger on GitHub hopefully later today. I haven't tested it, but it might run with mono on Linux / Mac.
 
The SmartApp is the parent for all the devices on SmartThings. It assigns them the same name you configured in PC Access on the OmniPro. You can however change them in SmartThings. I don't have any control over the Alex integration. Amazon and Samsung are responsible for that part. When you tell Alexa to discover your devices it uses the same name SmartThings had. Only on / off and dimming levels work with Alexa for single devices. Samsung didn't built any scene support.
 
https://support.smartthings.com/hc/en-us/articles/205275404-How-to-connect-Amazon-Alexa-with-SmartThings
 
I have an Echo and two Dots. I find myself mainly use Alex for playing music / turning off/on a light in a bedrooms, etc. For my kitchen I still use the lighting keypads over Alex as its more convenient. I do like the notification capability of the SmartThings app, which is why I built out the zone and area support. It's too bad Haiku/Space seems dead as I was originally going to go with that for the web service backend for the SmartThings app.
 
Thank you rsw686!
 
Here still using your provided (a few years back) HAI Logger utility.  IE: just time checking...
 
pete_c said:
Thank you rsw686!
 
Here still using your provided (a few years back) HAI Logger utility.  IE: just time checking...
 
Good to hear! I've had mine running for years for timesync purposes. The HAI OmniPro time drift is horrible otherwise. I edited the first post and included a link to the HAILogger source code on GitHub.
 
According to some reports, Home Depot will have Dots for $39 and Echos for $139 on Black Friday. Amazon will probably have similar prices.
 
I agree that it won't be the primary way to control lights, but it will provide some entertainment for guests.  I use HLC with keypads with scenes most of the time. 
 
I guess you could also create a dummy unit that can map to a scene.  For example lets say you have a "party" scene as an example.  Could you not name a unit "party" and when the unit goes "on" you could have the Omni send the "party on" scene?  So you could say "Alexa turn on the party" and when the "party" unit turned on, the Omni could turn on the "party" scene. Yes a bit of a kludge, but it should work.
 
Goofing around a bit today running HAILogger on a Wintel server VB and as a Mono-service.
 
I only have the Amazon Echo here but do not have a Smarthings box yet.
 
I can see the API web gui fine when running HAILogger in Wintel.

Testing in Ubuntu 16.04 64 bit with Mono 4.X.
 
configured the HAILogger.exe.config as follows:
 
<add name="DataMessagesSwitch" value="1"/>
<add name="TraceLevelSwitch" value="4"/>
 
Starting the HAI-logger as a mono service like this.
 
mono-service -m:testing -d:/HAILogger --no-daemon HAILogger.exe
 
Looking at the syslog like this:
 
tail -f /var/log/syslog
 
and see this:
 
Nov 20 16:30:21 ics-HS3 mono: testing: Service HAILogger started
 
Do not see anything else right now and the web gui api doesn't seem to be running (in mono linux).
 
It is very verbose when running via command line on the Windows server box and I see the web api just fine.
 
I'm guessing the issue is with it finding the config file. Try adding -c path\to\config.ini as an argument. I'll have to test it out later. I'd like to get it installed on raspberry pi or similar. I'll have version 1.0.6 posted soon which has the auxillary temp sensors and buttons exposed in the API.
 
For us novices... So I just got my SmartThings to play with.  So if I run the logger, does the SmartThings hub automatically see your HAI units, or do you have to do something else in the logger? 
 
Here's an overview of how to get it up and running.
 
HAILogger
1. Open the HAILogger.ini file and set your OmniPro 2 panel IP and encryption keys
2. Make note of your computer IP address and run the HAILogger application
3. Check the console output for the lines WebServer: Listening on and CoreServer: CONTROLLER IS. These let you know the web service is up and running and it connected to the OmniPro 2 controller.
 
SmartThings
1. Login to SmartThings web interface
2. Click My Device Handlers, select From Code, paste the contents from GitHub and repeat for all device files
3. Click My SmartApps, select From Code, paste the contents from GitHub
4. Open the SmartThings app on your phone
5. Select Marketplace -> SmartApps -> scroll to bottom My Apps
6. Select OmniPro Integration and enter the IP address of the computer running HAILogger and port 8000
 
At this point the app will query the logger, you should see this in the HAILogger console, and the devices will automatically add to SmartThings.
 
If you haven't seen it already check out the SmartTiles app. You can create a dashboard in a few minutes. Besides the locks, everything else on the screenshot below is from the OmniPro 2 controller.
 
The other thing I like about SmartThings is it keeps history for all devices. You can click a door contact and see every time it was opened / closed, etc.
 

Attachments

  • smarttiles.PNG
    smarttiles.PNG
    53.7 KB · Views: 67
THANKS. That is a big help.  I have an Amazon Echo, IFTTT, and a SmartThings, and everything claims it speak with everything, but instructions on how to actually set these up are spare. I'm just in the early stages of deciding what I should connect to what.  Like it seem the Echo can connect to everything itself, so I'm not sure why i would connect them to SmartThings and THEN to the Echo.  All my Zigbee locks are connected to my Omni, so should I connect them to my SmartThings instead?  Lots of decisions. 
 
So the SmartThings Hub is running from my iPhone app., and its reported as "on-line" but when I log into the SmartThings web interface, it says I don't have a hub connected. Go figure.
 
4. Open the SmartThings app on your phone
5. Select Marketplace -> SmartApps -> scroll to bottom My Apps
6. Select OmniPro Integration and enter the IP address of the computer running HAILogger and port 8000
 
By default your OmniPro Integration app is assigned to the "Safety & Security" category.  I tried changing the category to "My Apps" but the category input box is disabled.  Also, the app doesn't seem to appear in the "Safety & Security" area although it is categorized as such.
 
I've tried changing the category to "My Apps" in the name space but this only causes the category to be blank.  That is, the category input box is blank and it is disabled.
 
Any assistance would be greatly appreciated.
 
ano said:
So the SmartThings Hub is running from my iPhone app., and its reported as "on-line" but when I log into the SmartThings web interface, it says I don't have a hub connected. Go figure.
 
SmartThings appears to have multiple clusters and your hub is assigned to one. When you go to their main login page (https://graph.api.smartthings.com/login/auth) my hub doesn't show in my hubs. I click My Locations -> Home and then I'm redirected to another login page (https://graph-na02-useast1.api.smartthings.com/login/auth), which after logging in shows my hub. Once you find your login page just bookmark it for future reference. I'm not sure why its like this.
 
Back
Top