Samsung SmartThings Integration

Is there a way to re-run zone discovery after it's installed? I've made some zone changes and need to update smartthings to match. Thanks.
 
junying said:
I did get a reply email and got access. Played around with the version of the SDK Ryan linked, as well as old ones. Got it to connect to OmniLink 1, but the classes are just not documented for OmniLink 1 well enough for me to get all the code changed. So bought an upgrade chip. Popped in, changed CoreServer.cs to set the model to Omni IIe, instead of the default constructor which is OmniPro II. BTW I emailed tech support and they were pretty responsive. That's how I figured out how to connect to IIe.
 
So now my problem is the smartapp doesn't add the devices, even though HAILogger sees all the switches and thermostats. Livelog says welcome=null. I checked I can access the logger from outside of my firewall. There is a configuration for Area. Is that just 1?
 
Thanks for your help. It's a well written piece of code!
junging and rsw686 - Can you share your code change to connect to the Omni IIe -- and does HAILogger subsequently operate with the IIe as it would the II?
 
And any guidance on recompiling, since I'm on a Mac w/o Visual Studio.
 
I'm working with an Omni IIe (3.14A) and am getting the fatal "ERROR: CoreServer: Model does not match file" message.
 
It would be nice if the model selection was a HAILogger.ini configuration option -- or if the base code would simply support both models OOTB.
 
Thanks!
 
garyg said:
junging and rsw686 - Can you share your code change to connect to the Omni IIe -- and does HAILogger subsequently operate with the IIe as it would the II?
 
And any guidance on recompiling, since I'm on a Mac w/o Visual Studio.
 
I'm working with an Omni IIe (3.14A) and am getting the fatal "ERROR: CoreServer: Model does not match file" message.
 
It would be nice if the model selection was a HAILogger.ini configuration option -- or if the base code would simply support both models OOTB.
 
Thanks!
 
I'm not a coding expert, but I stole some code from https://rickystechblog.wordpress.com/2012/04/06/hai-sdk-issues-with-any-system-other-than-omnipro-ii/ and added the bolded bits below to CoreServer.cs:
 
---------------------
 
        private void HandleIdentifyController(clsOmniLinkMessageQueueItem M, byte[] B, bool Timeout)
        {
            if (Timeout)
                return;
 
            if ((B.Length > 3) && (B[2] == (byte)enuOmniLink2MessageType.SystemInformation))
            {
                clsOL2MsgSystemInformation MSG = new clsOL2MsgSystemInformation(HAC.Connection, B);
 
         foreach (enuModel enu in Enum.GetValues(typeof(enuModel)))
         {
              if (enu == MSG.ModelNumber)
             {
                  HAC.Model = enu;
                   break;
              }
         }
            if (HAC.Model == MSG.ModelNumber)
            {
                HAC.CopySystemInformation(MSG);
                Event.WriteInfo("CoreServer", "CONTROLLER IS: " + HAC.GetModelText() + " (" + HAC.GetVersionText() + ")");
 
                Connected();
                return;
             }
 
             Event.WriteError("CoreServer", "Model does not match file");
             HAC.Connection.Disconnect();
            }
        }
 
---------------------
 
Seems to have fixed the problem for me!  Good luck!
 
Now, a couple questions of my own:
 
1)  Does anyone know how to change the temperature reading from Fahrenheit to Celcius?
2)  Is there any way to edit the handler to use the controller state (i.e. "away" vs "home" vs "vacation") to trigger certain routines on Smartthings?  For example, if my OMNI enters the "away" state, I'd like Smartthings to automatically run the "Goodbye" routine.  Can't seem to figure this one out.
 
Earlier in this post I mentioned that Email wasn't working for me now with V.8.
 
Found out last night that it does work and depends on how the HAILogger.exe program is being run.
 
I had left the HAILogger program in manual mode here:
 
IE: mono HAILogger.exe -i  and only tested in this mode.  I configured stunnel to work with email.  Watching the stunnel logs never saw the HAILogger program send an email.
 
Last night configured the HAILogger program as a service (mono-service) and noticed that email worked fine watching the STunnel logs.  Still in Upstart mode here on one 16.04 64bit Ubuntu mini computer.
 
exec /usr/bin/mono-service --no-daemon /HAILogger/HAILogger.exe
 
I used tail -f on the stunnel and HAILogger logs to watch it work.
 
Got a Samsung Smartthings update firmware email today.
 
Looking at hub status this morning shows:
 
Last Updated 2017-08-30 8:13 PM UTC
Status     ACTIVE
Firmware Version : 000.018.00022
 
 
pete_c said:
Got a Samsung Smartthings update firmware email today.
 
Looking at hub status this morning shows:
 
Last Updated 2017-08-30 8:13 PM UTC
Status     ACTIVE
Firmware Version : 000.018.00022
 
Yeah, that was strange how they didn't have time to warn people.  It must have been a pretty serious vulnerability.
 
Been having a few ISP disconnect issues over the last couple of weeks. 
 
This is generating Samsung Smartthings Hub HAI Logger messages.
 
Still not seeing alarm on and off messages from the HAI Logger though. 
 
The Smartthings Hub messages have a link to the Smartthings Hub and now T-Mobile/Barracuda firewall is rejecting those messages.
 
Help!
 
I am trying to get HAILogger to talk to my Omni Pro II (3.6b) so I can talk to SmartThings Hub V2
 
I have gotten the HAILogger to run (I think) and this is what i see in the command prompt.
 
c:\HAILogger>hailogger
INFO: CoreServer: Starting up server 1.0.8.0
INFO: WebService: Listening on http://0.0.0.0:8000/
INFO: CoreServer: CONNECTION STATUS: Connecting
INFO: CoreServer: CONTROLLER IS: OmniPro II (3.6B)
INFO: CoreServer: Retrieving named units
INFO: CoreServer: Unsolicited notifications enabled
VERBOSE: ThermostatTimer: Added to watch list Downstairs
VERBOSE: ThermostatTimer: Polling status received for Downstairs
VERBOSE: ThermostatTimer: Added to watch list Upstairs
VERBOSE: ThermostatTimer: Polling status received for Upstairs
VERBOSE: WebService: Subscribe
VERBOSE: WebNotification: Adding subscription to http://10.0.0.22:39500/notify/omnilinkVERBOSE: ThermostatStatus: 1 Downstairs, Status: 69 OFF, Heat: 68, Cool: 72, Mode: AUTO, Fan: AUTO, Hold: OFF
 
I can not get the service to run or the web pages to load.
 

c:\HAILogger>install
 
c:\HAILogger>InstallUtil /LogToConsole=true HAILogger.exe
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.832
Copyright (c) Microsoft Corporation.  All rights reserved.
 
Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///c:\HAILogger\HAILogger.exe' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded..
 

I loaded my Sql and the ODBC and I think they are right.
 
What do I do next?
 
thanks
Joe
 
Testers wanted.
 
Looks like there is an issue with the ALL ON commands / Network on the Omni Pro 2.
 
I was able to test the issue here creating an ALL ON button.
 
Curious if anyone wants to try this.
 
1 - Create an ALL ON button
2 - hit the all on button via a console or HAI Touchscreen a few times
3 - check your email and see if you are getting a notification of a disconnect from the panel.
 
Here getting a disconnect of the HAILogger program from the panel. 
 
Using a microrouter here and if I ping from the LAN interface of the microrouter to the NIC port on the panel I get extended ping times when I hit the ALL ON button but no disconnects except for the HAILogger program.
 
Bump
 
I am doing this because here I did document a network issue with the network port on the Omni Pro 2 panel many years ago.  
 
I personally fixed this (and documented it here) by installing a micro router between the network interface and the rest of my network. 
 
I am thinking this new issue is related to the same old issue above and would like to open a ticket with Leviton for a fix relating to this issue.
 
Easy to test
 
1 - create a button on your configuration set up that does an ALLON
2 - press it a few times while watching the network interface (do a ping)
 
Thank you rsw686 and anyone else that contributed to this. I think this is my first post after lurking here for several years - this solution is great.
I wish Leviton would put more effort into developing like these so that users wouldn't have to, so I'm extremely thankful to have found this.
 
I have my SmartThings app working perfectly, communicating in both directions with the OPII using a Mac to run HAILogger via Mono. I activated the alarm (AWAY) from the restaurant tonight as a test with no problems.
 
I also learned a little bit along the way as well - thanks for that too!
 
john999 said:
Is there a way to re-run zone discovery after it's installed? I've made some zone changes and need to update smartthings to match. Thanks.
Hi john999-
I was able to do this without code modifications, but it is not exactly pretty.
1. Stop HAILogger, then restart it. This appears to update the list of units, zones, buttons, etc. and thus make it available.
2. Remove the OmniPro SmartApp from the SmartThings app, then re-add it. 
 
The problem with this is that any changes that you made (like renaming the units/ zones, etc.) are lost when you delete the SmartApp. So you end up having to re-do all of that... So it would be worthwhile do make sure that you have at least got the communication points set up the way you want them.
 
 
ibash said:
Now, a couple questions of my own:
 
2)  Is there any way to edit the handler to use the controller state (i.e. "away" vs "home" vs "vacation") to trigger certain routines on Smartthings?  For example, if my OMNI enters the "away" state, I'd like Smartthings to automatically run the "Goodbye" routine.  Can't seem to figure this one out.
Yes there is, at least with the most current version of the ST app on the iPhone.
There is a little something extra you apparently have to do (figured this out by looking at the png's that were attached to the original post) - you have to install the "Smart Home Monitor" SmartApp to the Smart Things App. Before I did this, I could not find a way to interact with the ST alarm status. Once this is in place, do this from your phone:
1. Automation tab => Add a Routine
2. Name it and hit Next
3. Specify the things you want to happen at the top.
4. Under Additional Settings at the bottom, hit "Automatically Perform 'name you gave the routine'"
5. Choose "Alarm Changes State"
 
The issue that I had (and still have after the reinstall) is that the ST Alarm status does not sync with the Omni status. It did collect all of the zones from the OmniPro and collected them very nicely in the "Right Now" tab of the Smart Home Monitor (accessed from the Dashboard), but the Status never changes. I think that this is supposed to be linked directly through the HAILogger and should work "automatically" but so far I am not seeing it.
 
I do have a workaround without messing with the code, however... See below.
 
john999 said:
Has anyone been able to modify the code to allow arming/disarming through SmartThings?
I was able to do this out of the box, so to speak, but only because of the buttons that I had configured. We have keyfob buttons that act as zones (those were not imported to HAILogger, presumably because of their not being set up as an entry zone). When the buttons are pressed, OmniPro automation runs a virtual button also set up on the Omni, and another automation block takes some action on THAT button being pressed - such as arming or disarming the Omni Alarm.
 
As it turns out, these OPII buttons are also mapped through the HAILogger and appear in the ST app. When I press the "ARM" button that the OmniPro SmartApp generated in the ST app, the corresponding ARM button on the OmniPro is pressed. And the OmniPro is arms itself. So, two-way communication currently exists.
 
After discovering this, I set up some extra buttons and zones to use solely as communications flags so I can do the lighting control from the ST Hub. I will also go ahead and do the same thing with the alarm status so that the the problem I described above is addressed. I haven't tested this yet, but it seems like it should be pretty straightforward code on both sides (PC Access and ST App).
 
 
UPB has been a disaster at my 100-yr old house, so I bought some Z-Wave devices that work great so far. I like the idea of keeping the automation out of the security system anyway, so I was happy to spend the money on the ST hub instead of the Z-Wave controller for the OPII.
 
I'm not 100% sure about the security of this endeavor, as I am sure that this opens up the door for easier hacking of the security system. However, it will enable me to do what I want, and I kind of feel like there was already a hole there since Haiku could do all of this stuff directly. It is really a shame that Leviton let that fade into obscurity. As I understand it, all of this could have been with HaikuHelper several years ago but that no longer seems to be available,
 
Back
Top