Comfort  Automation/ Security System Forums Home

 Moderated by: admin  
AuthorPost
HenleyBranch
UCM Pi Users
 

Joined: Saturday Apr 30th, 2011
Location: United Kingdom
Posts: 75
Status: 
Offline

  back to top

Hi

I have two home control systems running, one based on Comfort for security and security-related X10 control of lights, and another based on Perceptive Automation Indigo running on a Mac server as part of our home network of Macs, controlling iTunes library, multi-device iOS control of X10 lights, scene setting etc. Both very reliable independently.

My project for the next 12 month is to integrate them better. Currently I have some X10 connectivity between them, for example, an alarm in Comfort generates a alert email and iMessage using Applescript on Indigo, using an X10 on command as a trigger. This has proven less reliable than using X10 for lighting control for some reason, but was the only way a novice like myself could initially find to do this.

Both systems are sitting on the wired ethernet network of the house, so there must be a better way. I am aware for example, using Comfigurator, that flags are reported live to Comfigurator by Comfort, so Comfort must be 'broadcasting' the status of those flags over TCP/IP.

I therefore want to get Indigo to listen in. I have a plug in for Indigo, which does exactly that http://www.cynic.org/indigo/plugins/online/network.html but I am outside my comfort (no pun) zone here and am not sure what protocol information I would need to get this to work.

Has anyone any experience of making this kind of 'listening' to Comfort's TCP/IP traffic work?

Any tips, gratefully received.

Henley

Last edited on Monday Dec 23rd, 2013 09:14 am by HenleyBranch

ident
Administrator


Joined: Wednesday Aug 9th, 2006
Location: Singapore
Posts: 3493
Status: 
Offline

  back to top

You can download the comfort serial protocol from http://www.cytech.biz/serial_interface_protocol.html?category_id=99

This wil show what commands you need to use to send commands and receive replies and reports from Comfort via TCP

HenleyBranch
UCM Pi Users
 

Joined: Saturday Apr 30th, 2011
Location: United Kingdom
Posts: 75
Status: 
Offline

  back to top

Thanks ident, very helpful.

Please excuse my ignorance, but does Comfort by default 'broadcast' events such as alarms via TCP to devices 'listening' on the network?

Henley

Home
Comfort Distributors
 

Joined: Wednesday Jul 12th, 2006
Location: United Kingdom
Posts: 771
Status: 
Offline

  back to top

You will of course need a UNIVERSAL UCM with Eth03

ident
Administrator


Joined: Wednesday Aug 9th, 2006
Location: Singapore
Posts: 3493
Status: 
Offline

  back to top

Please excuse my ignorance, but does Comfort by default 'broadcast' events such as alarms via TCP to devices 'listening' on the network?
No, Comfort will not broadcast TCP
Your device must connect to UCM/ETH on the IP address and Port which is configured in DS Manager (for eth02) or )CS manager for ETH03)
This allows the device to "listen" to the messages sent by Comfort when a zone goes open and closed, alarm happen etc as descrbed in the Serial Protocol


You will of course need a UNIVERSAL UCM with Eth03
If the device is meant to communicate using the Comfort protocol, then you must use the UCM/ETHxx.

A Universal UCM must be used when  3rd party device communicates with Comfort using the devices protocol.  The universal UCM can be programmed to send any message or string to another device

In your case, which seems to be software -based, the UCM/Eth03 seems to be more suitable since you should be able to program it to understand the comfort ptotocol







HenleyBranch
UCM Pi Users
 

Joined: Saturday Apr 30th, 2011
Location: United Kingdom
Posts: 75
Status: 
Offline

  back to top

Thanks Ident.

I am using UCM/ETH02 (I think - is there a way of telling without opening up the panel?)

Have followed instructions in serial protocol, and although I have established a connection on the correct IP and Port to Comfort I am struggling to get the responses from the UCM outlined in the protocol.

Hyperterminal mentioned is not part of Windows7. I am using ClearConnex ClearTerminal. I have set it up as per the instructions in the protocol but as a TCP connection. Do you have a recommended terminal product I should be using to test the connection / responses, and can you refer me to appropriate setup instructions?

ident
Administrator


Joined: Wednesday Aug 9th, 2006
Location: Singapore
Posts: 3493
Status: 
Offline

  back to top

I have downloaded ClearConnex to try itinary
In Connections, start a new connnection with the IP address and port of the UCM/ETH. For this purpose it does not matter whether you use ETH01 or ETH02
After connection you need to log in by sending the binary character 03 (which is the start of line character) followed by LI1234 assuming 1234 is your user code and return
The trick is in sending binary 03

You can define a Hotkey as I have done
/03 assign to F2 hotkey
Press the F2  key followed by LI1234 and Enter
This logs you in and you will see LU01







Now you can enter the commands in the serial protocol

eg
I?01 means Get Input 1 state
the reply is I?0100 means Input 1 is off
Remember to enter F2 before each line

HenleyBranch
UCM Pi Users
 

Joined: Saturday Apr 30th, 2011
Location: United Kingdom
Posts: 75
Status: 
Offline

  back to top

Thanks Ident. That worked!

Except I am not getting responses on separate lines. They are overtyping.

Presume something in settings.

HenleyBranch
UCM Pi Users
 

Joined: Saturday Apr 30th, 2011
Location: United Kingdom
Posts: 75
Status: 
Offline

  back to top

Just a note to add, thanks so much for your help Ident.

Took me a while to work out no space between /03 and LI1234

I finally have Comfort talking to Indigo over Ethernet!

Brilliant! Endless notification, Applescript, iTunes, CCTV possibilities now...

Henley

Vangelis
Member
 

Joined: Tuesday Jan 31st, 2012
Location:  
Posts: 138
Status: 
Offline

  back to top

Hi Henley,

Following this thread with interest! Am planning to go down the Indigo route in the New Year (already have Comfort2).

Guess you can now use the Comfort sensor status (via the Indigo Plug-In) for the Indigo UI on say a tablet?

Probably want to pick your brains on some of your setup if that's ok?

Vangelis

ident
Administrator


Joined: Wednesday Aug 9th, 2006
Location: Singapore
Posts: 3493
Status: 
Offline

  back to top

Except I am not getting responses on separate lines. They are overtyping. Presume something in settings.

Settings > Other preferences >Convert CR to CR/LF

HenleyBranch
UCM Pi Users
 

Joined: Saturday Apr 30th, 2011
Location: United Kingdom
Posts: 75
Status: 
Offline

  back to top

Hey Vangelis
A couple of other people DM'd about this, so I have posted brief instructions about how I did it. 
Seems to work well. Got Comfort responses controlling iTunes, running Applescripts etc. 
http://www.comfortforums.com/forum47/3764.html
Henley 

Vangelis
Member
 

Joined: Tuesday Jan 31st, 2012
Location:  
Posts: 138
Status: 
Offline

  back to top

OK so I am trying to emulate Henley's idea of having Comfort talk to my HA system through it's TCP connection, however I am not having much luck in getting Comfort to talk via the Serial Commands...

I have Comfort Ultra 2 with UCM/Eth2

Tried...

Comfigurator - this works and I can see the Serial cmds go back and forth in the viewer

Telnet to Eth2 IP port 1001 - Get connection but cannot see anything, no output is echoed to screen

Use ClearConnex - Not sure if I am using this correctly. I can establish a connection, however I am not sure where you type the cmds?? Either in the main window, or in the small window at the bottom?

Either way, I can see no output - have setup a hotkey for /03. The only output I get is when Comfort decides it's had enough and closes the connection and displays LU00 (even when I haven't typed in anything)

So not sure where I am going wrong as it all worked for Henley, when he added the magic /03 to his Lixxx cmd to login. Is there a time period when Comfort expect a cmd??

Can I just fire up the connection and enter /03LI1234 in the small window at the bottom of ClearConnex (where 1234 is my code)??

Vangelis

Vangelis
Member
 

Joined: Tuesday Jan 31st, 2012
Location:  
Posts: 138
Status: 
Offline

  back to top

I decided to have a look what my HA system thought of the cmds (Indigo) and in the logs I can see and unrecognised error to the string i send, in what looks like a different format...

\x03li1234

Not sure if it's getting hung up on the \ or / being sent or the fact each connection I try is sending the string in a different format

eg 03 or /03 or \x03 .....

Hopefully this will be a simple fix, but not seeing any output from Comfort is a little strange :(

Vangelis

slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5495
Status: 
Offline

  back to top

If the UCM does not see the STX is 03 character then it will ignore the message

This is probably what you are missing

Look up the documentation on how to enter non ASCII characters

also it should be LI not li as the commands are case sensitive

Vangelis
Member
 

Joined: Tuesday Jan 31st, 2012
Location:  
Posts: 138
Status: 
Offline

  back to top

I am unable to see in the Serial Command Interface doc the section on 'entering non-ASCII characters'

Also (in the documentation) the setup for HyperTerm is for Serial connection as opposed to Telnet. I mention this as I suspect there is a subtle difference in 'Settings' that I need to perform.

When there is no echo back from Comfort, it is difficult to work out if what you are sending is correct or not

I have tried various iterations of cmd format...

/03LI1234
/03li1234
LI1234
\x03LI1234
/03
LI1234 ......

All of which do not seem to work :(

Vangelis

slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5495
Status: 
Offline

  back to top

I mean the documentation for the terminal software you are using to enter the characters, not the Comfort protocol documentation

If you use Hyperterminal, you can enter 03 Hex by pressing <Control>C
It will appear as a Heart shape
The UCM Manual shows how to use Hyperterminal

Vangelis
Member
 

Joined: Tuesday Jan 31st, 2012
Location:  
Posts: 138
Status: 
Offline

  back to top

Thanks Slychiu - Will have another try when I am infront of my system.

Vangelis

Vangelis
Member
 

Joined: Tuesday Jan 31st, 2012
Location:  
Posts: 138
Status: 
Offline

  back to top

Update...

Using my Win XP machine I can carry out the following with success...

telnet to Comfort IP (port 1001) and issue Control+C followed by LI1234
I see the 'heart'+LU01 response

using Clear Terminal i can connect to Comfort IP (port 1001) and issue Control+C followed by LI1234
I see the LU01 (without 'heart' prefix)

all good so far, however, contrary to ident I have no success with ...

telnet to Comfort IP (port 1001) and issue /03LI1234
I see nothing

using Clear Terminal i can connect to Comfort IP (port 1001) and issue /03LI1234 (even using the HotKey Prefix)
I again see nothing

On my MacMini I also tried the telnet option but without any luck for either case (unsure what OSX thinks of the Control+C (^C) cmd)

So, I understand that the key mapping under osx might be different, however I do not understand why /03 prefix is not working with Telnet or Clear Terminal (the latter demonstrated by ident)

Running Comfort Ultra 2 (7.065)
UCM/Eth2 (7.061)

Any ideas? This is really frustrating as I know once the prefix works (/03) then the rest will be simple.

Unfortunately I don't think HenleyBranch is around as he is running the same setup as me and has this working...

Vangelis

slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5495
Status: 
Offline

  back to top

I have downloaded Clear Terminal and the results are the same as what ident showed

Assign F2 Hotkey to /03 in Settings > Hotkeys

Connect to the IP address
You should see status connected

To log in press the F2 key then enter 1234 and Enter

Attachment: ClearTerm.jpg (Downloaded 47 times)

Vangelis
Member
 

Joined: Tuesday Jan 31st, 2012
Location:  
Posts: 138
Status: 
Offline

  back to top

Hmm strange - So are you now saying that to login with Clear Terminal you use /031234 (without the LI as opposed to /03LI1234)

What Win platform are you using?? (just want to discount it being a WinXP thing.

Another thing I have found out is that OSX uses Unicode (2byte), so as the iOS Comfort App works, am I correct in assuming that when logging in, the App uses the same format as above??

I just want to rule out differences between Windows and OSX

Thank you for the support so far :)

Vangelis

slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5495
Status: 
Offline

  back to top

No, the command to log in is LI1234

You cannot type /03LI1234

The /03 is sent by the Hotkey


There is other options in Clear Terminal

Go to Tools > Send ASCII/BINARY and select Binary
Then click 03
Type LI1234 in the text box

Also go to View ? Select Display Mode and select Mixed to see the binary characters


Vangelis
Member
 

Joined: Tuesday Jan 31st, 2012
Location:  
Posts: 138
Status: 
Offline

  back to top

Thanks Slychiu

So what's the difference between pressing the HotKey to send /03 followed by me typing LI1234 and just typing /03LI1234 (without pressing the Hotkey) ?? Or am I confused?

Vangelis

slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5495
Status: 
Offline

  back to top

In the 1st case the hotkey sends the hexadecimal character 03
In the 2nd case it is sending the ascii characters /03LI1234 which is not correct

Vangelis
Member
 

Joined: Tuesday Jan 31st, 2012
Location:  
Posts: 138
Status: 
Offline

  back to top

Ahh - Got you now. I will try this out again when in front of my system.

Thanks..

Vangelis

Vangelis
Member
 

Joined: Tuesday Jan 31st, 2012
Location:  
Posts: 138
Status: 
Offline

  back to top

btw does the iPhone app send the text to Comfort in this way??

ie Hex 03 and Dec LI1234

Vangelis

slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5495
Status: 
Offline

  back to top

Yes, the same way

HenleyBranch
UCM Pi Users
 

Joined: Saturday Apr 30th, 2011
Location: United Kingdom
Posts: 75
Status: 
Offline

  back to top

OK, Vangelis, just to share your pain, apologies for my absence. Please do not think I have been enjoying Comfort Indigo connectivity nirvana, I just struggle to fit trouble-shooting this issue around the day job! Thanks Chiu, Ident, for the tips.

I 'nearly' have this working. I manage to make a 'read-only' connection to Comfort which allows Indigo to listen to the codes and react to them. This works really well as it allows things like the IP control of a Denon amp (welcome home with playlist - potentially by user), CCTV (when outside sensors detect motion - message a snapshot of cameras to iPhones), connectivity to Netatmo, sending iOS notifications of Comfort events etc. etc. When it works it is great.

However, how I am making this connection is not quite right, and it may persist for a day, or a week, or even several weeks, but then it drops and won't restart without a precise sequence of events. This has puzzled me for months.

I think this is because whilst I am able to get Indigo to make a persistent secure connection to Comfort, I am unable to get Indigo to send text in the correct format to Comfort. I think it is to do with this /03 character.

Initially I thought I had it all licked, but I have realised, I think it has been my sequence using ClearConnect which just happens to work, but which I have been unable to figure out how to solve a sustained connection, using Indigo. I'll explain my current connection sequence.

Using Indigo http://www.indigodomo.com on the Mac, I have used the Network plugin to create a connection to Indigo. This connects, persists, and actually locks out other connections such as Configurator.

Initially, I thought that LI1234 /03 was the correct sequence, following earlier comments in this thread last year with Ident.

However what I have realised, I think, is that I am not successfully managing to get the Indigo Network plug in to send any text which Comfort is recognising. What is actually happening is that I have been logging in with Clear Connex and then using that connection in to Indigo. I’ll explain.

If I establish the connection using the Network plugin http://www.cynic.org/indigo/plugins/online/network.html, I am unable to get any response from Comfort or even log in whatever combination of /03LI1234 or /LI 1234 or 1234 /LI.

If, however, I disconnect indigo from Comfort, then form a connection with Clear Connex as described in Chui’s post above, then close that connection in Clear Connex without logging out, then re-enable the connection in Indigo to Comfort, suddenly Indigo is listening to all the TCP traffic and can respond in the ways I describe above.

I think this is what I have been doing as it explains why I have had such an ‘unreliable’ connection since first trying this a year ago. The connection fails, I go back through, test in Clear Connex, and then find it actually works again, but it may actually be Clear Connex establishing the connection, not the Indigo network plug in.

I have established a TCP connection between Indigo and Comfort.
I have got Indigo listening to TCP traffic (albeit inadvertently using the method I describe above).

I have not got Indigo to be able to send to Comfort.

I appreciate this is not to do with Comfort directly, and is a pretty niche issue, but any assistance in getting this last step working would be great for myself, Vangelis and anyone else thinking of connecting Comfort to a Mac home server.

Last edited on Sunday Mar 8th, 2015 01:29 pm by HenleyBranch

HenleyBranch
UCM Pi Users
 

Joined: Saturday Apr 30th, 2011
Location: United Kingdom
Posts: 75
Status: 
Offline

  back to top

SOLVED!

Having looked into this today, discovered the answer is \x03 preceding each command! Ensure Carriage Return is the line format.

It was actually answered on a post I made some time ago on the Indigo forums that I hadn't seen...

http://forums.indigodomo.com/viewtopic.php?f=25&t=11273

So to send the login command, it is \x03LIxxxx, where xxxx is your Comfort user code.

Other commands also return two-way communication via TCP. All good.

Vangelis
Member
 

Joined: Tuesday Jan 31st, 2012
Location:  
Posts: 138
Status: 
Offline

  back to top

Hey HB - Weirdly I went through the same thing you did before I got it solved.

I would telnet to Comfort on my Win7 machine and issue Ctrl-C with LI1234 and it would login, then I would close this connection and have Indigo connect to Comfort via Network Plugin and it would see output (but with x03 prefixes). This put me on track for solving the issue (as you did)

So I now have an action that executes the Device Network Plugin with Comforts IP and waits for 'Connect to be True'. I then issue x03LI1234 to login

I check for a Disconnect (as Comfort will time out the connection eventually) and then auto-connect. This can be solved by changing the value in DS Client on Comfort (so connection doesn't time out - just not got round to it yet)

Vangelis

Last edited on Monday Mar 9th, 2015 03:27 pm by Vangelis

Ingo
UCM Pi Users


Joined: Sunday Jan 21st, 2007
Location: South Africa
Posts: 559
Status: 
Offline

  back to top

Maybe a safer option is to write some sort of 'keepalive routine' that sends 0x00 every 60s so that the connection doesn't timeout. Changing the DS timeout to 'never' runs the risk if the connection ever freezes then you need to reboot the UCM to recover. By sending the 0x00 you can keep it open and if it freezes then Comfort will drop the connection so you can reconnect again.

Ingo

Vangelis
Member
 

Joined: Tuesday Jan 31st, 2012
Location:  
Posts: 138
Status: 
Offline

  back to top

Thanks Ingo - I can then check for the Disconnect and fire an alert

Vangelis


UltraBB 1.172 Copyright © 2007-2014 Data 1 Systems