Comfort  Automation/ Security System Forums Home
Home Search search Menu menu Not logged in - Login | Register

Comfort UPNP <-> SmartThings <-> Amazon Echo
 Moderated by: slychiu, mattbrain, benstinton Page:    1  2  3  4  5  6  ...  Next Page Last Page  
 New Topic   Printer Friendly 
 Rating:  Rating
AuthorPost
 Posted: Thursday Oct 13th, 2016 06:32 pm
   
1st Post
mattbrain
UCM Pi Users


Joined: Tuesday Jun 12th, 2007
Location: United Kingdom
Posts: 185
Status: 
Offline

  back to top

Hi All
I have been busily beavering away on a pet project and have developed a UPNP interface for Comfort. The Interface is written in node.js and can run as a service on a RPi or similar. 
This allows Samsung SmartThings (and presumably other similar systems) to discover and instantiate Comfort devices (primarily Zones, Outputs and if desired basic alarm control).
Using SmartThings as a central hub, I am then able to connect Amazon Echo, IFTTT and other services to it as well as control other devices under SmartThings control (Phillips Hue etc)
Whilst it works well for me, it is still very much a work in progress and I would like to know:
1. Is there enough community interest in this to justify cleaning up my code and making it more generic (by reading configuration from Comfigurator)
2. What other features would people like / find useful aside from Zone, Outputs and Basic Alarm
3. Are there any willing volunteers who would like to give it a go?
Thanks,
Matt



 Posted: Friday Oct 14th, 2016 11:02 am
   
2nd Post
wexfordman
UCM Pi Users
 

Joined: Monday Jan 1st, 2007
Location: Cork, Ireland
Posts: 546
Status: 
Offline

  back to top

Hi Matt, is it possible that your interface can control devices inactivate macros and responses connected to comfort?

I'm interested in getting something like echo or Google's new home to talk tomcomfort but completely illiterate in how to do it.



 Posted: Friday Oct 14th, 2016 01:58 pm
   
3rd Post
mattbrain
UCM Pi Users


Joined: Tuesday Jun 12th, 2007
Location: United Kingdom
Posts: 185
Status: 
Offline

  back to top

Absolutely, the UPNP interface is a two way street, the UPNP device can report status via direct polling or unsolicited events as a result of a subscription and devices can be controlled using the UPNP control function.

The UPNP standard defines the interface protocols and some simple standard devices but allows the implementer to build a solution based on the standard but utilising propriety features on a device. This is the approach I have opted for as there really isn't a suitable  device defined in the standard.

Samsung SmartThings can utilise both standard and propriety UPNP devices and provides a programming language which allows custom UPNP devices to be instantiated and then exposed to other services such as Amazon Echo and IFTTT via the SmartThings framework.
In order to use the Amazon Echo (or other 'simpler' home automation devices) without the benefit of SmartThings, the Comfort UPNP interface would need to be customised to emulate a device which is natively supported by the Echo - and this is something I am thinking of adding as a configuration option - it would mean reduced functionality, for example we could emulate a WeMo switch to expose a Comfort output but we wouldn't be able to expose the Flash or FlashOnce function available on the Comfort outputs (as WeMo switches only support on and off).


In my implementation I have decided to use the SmartThings hub as the centre of the HA universe. I have left the Comfort system running essential alarm related tasks and these are enriched by functions and interfaces on SmartThings. The SmartThings hub receives events and sends commands to the following devices:

Cytech Comfort
Honeywell Evohome
IFTTT
Amazon Echo
Sonos


IFTTT also brokers requests to and from other services such as

BMW Connected Drive
Life360
etc

So, you might ask, what is all the point of this? Well, an example of the things I can now do are:

If the garage door is closed (Comfort Zone) and
The car is started (BMW Connected Drive IFTTT) and
The car is at home (BMW Connected Drive IFTTT) and
There has recently been movement in the garage (Comfort Zone) then
Open the garage door (Comfort Output) then
If the car is driving (BMW Connected Drive IFTTT) then
Close the garage door (Comfort Output) then
If the house is empty (SmartThings presence detection) then set the alarm.


I can also do simpler stuff like:

If SCSRIO button 1 pressed (Comfort Output) then Boost kitchen temperature by 2 degrees for 2 hours (Honeywell Evohome).

Amazon Echo integration also allows me do things like:

"Alexa, turn off the patio lights"
 "Alexa, turn on the Alarm" (although you may wish to obfuscate the 'Alarm' keyword)

The UPNP interface already allows for devices to be controlled, in terms of activating responses, the Comfort protocol has the R! function which could be exposed via UPNP or you could tie a response to a virtual input and use that as a trigger.

TL;DR
Yup, using UPNP the Comfort system can be integrated into the new wave of home automation devices (with of course Apple being awkward but not out of the question)

Last edited on Friday Oct 14th, 2016 02:11 pm by mattbrain



 Posted: Friday Oct 14th, 2016 05:55 pm
   
4th Post
slychiu
Administrator


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

  back to top

Thats great. But isnt UPNP for hardware plugged into a Computer?



 Posted: Friday Oct 14th, 2016 08:01 pm
   
5th Post
mattbrain
UCM Pi Users


Joined: Tuesday Jun 12th, 2007
Location: United Kingdom
Posts: 185
Status: 
Offline

  back to top

Not at all, although I can see how it could be confused with it. UPnP, specification can be found here: http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf is a mechanism to allow networked devices such as routers, modems, media centre, home automation devices to advertise services, be discovered and controlled by end points. This is the same mechanism which is used for Smart TV's to find media content on the local network and games consoles to 'punch' open paths in routers for peer to peer games. Its a pretty neat spec with the intention of allowing networked stuff you buy to just work when you get it home. You would be surprised by just how much stuff is already busy advertising services on your home network.

The implementation I have is an interface between the Comfort proprietary serial protocol and the UPNP standard, exposing Comfort zones, outputs, basic alarm and other functions and services which can be queried, controlled and subscribed to by third party devices without needing to develop specific interfaces for them such as SmartThings, Amazon Echo, etc etc.
 

Last edited on Friday Oct 14th, 2016 08:17 pm by mattbrain



 Posted: Sunday Oct 16th, 2016 07:57 pm
   
6th Post
benchan001
Member
 

Joined: Monday Apr 19th, 2010
Location:  
Posts: 5
Status: 
Offline

  back to top

Hi Matt,

This is interesting as I have spoken w/ Mr Chiu about using a Raspberry Pi 3 as my Alexa AVS. The conversation began as using Z-Wave; however, he did point me out to your UPNP and Smarthings that may help simplify matters.

I'm interested in testing your Comfort UPNP w my incoming Raspberry Pi 3s. My goal is voice integration with Alexa AVS (RP3) via my Comfort System.

All the Best,

Ben



 Posted: Sunday Oct 16th, 2016 08:00 pm
   
7th Post
benchan001
Member
 

Joined: Monday Apr 19th, 2010
Location:  
Posts: 5
Status: 
Offline

  back to top

Hi Matt,

This is interesting as I have spoken w/ Mr Chiu about using a Raspberry Pi 3 as my Alexa AVS. The conversation began as using Z-Wave; however, he did point me out to your UPNP and Smarthings that may help simplify matters.

I'm interested in testing your Comfort UPNP w my incoming Raspberry Pi 3s. My goal is voice integration with Alexa AVS (RP3) via my Comfort System.

All the Best,

Ben



 Posted: Sunday Oct 16th, 2016 09:03 pm
   
8th Post
mattbrain
UCM Pi Users


Joined: Tuesday Jun 12th, 2007
Location: United Kingdom
Posts: 185
Status: 
Offline

  back to top

Hi Ben

That should be do-able, so long as the Alexia AVS offers the same functionality as the Echo (which is what I am using).

Do you know if it supports UPNP as the Echo does - maybe try 'discover my devices' and see what it does.

I am happy to bundle up what I have into something which can be installed, it is still early days, and whilst it has been running faultlessly for a couple of weeks I need to stress it's still in development and may barf.

Finally, it is currently written to support the Ethernet interface on a UCM, i'm sure i could also add a serial interface support but it isn't highest priority at the moment - can you confirm you have one?

Thanks,

Matt



 Posted: Sunday Oct 16th, 2016 09:17 pm
   
9th Post
benchan001
Member
 

Joined: Monday Apr 19th, 2010
Location:  
Posts: 5
Status: 
Offline

  back to top

Hi Matt,

I presently have the older UCM/Serial. I'll need to request an upgrade to the Ethernet UCM.

I'll plan to have 2 RPi3 and use Home Assistant as the hub and Alexa AVS. 1 connected to Comfort, 1 RPI3 in the bedroom.

I'll plan to loan 1 RPi3 to Mr. Chiu and the Cytech team for further testing. It's been 5 years since I've configured my Comfort/CBUS system, and it's just about the right time for enhancements via Alexa.

Looking forward to testing your UPNP :)

Thanks,

Ben



 Posted: Sunday Oct 16th, 2016 09:25 pm
   
10th Post
benchan001
Member
 

Joined: Monday Apr 19th, 2010
Location:  
Posts: 5
Status: 
Offline

  back to top

Hi Matt,

I presently have the older UCM/Serial. I'll need to request an upgrade to the Ethernet UCM.

I'll plan to have 2 RPi3 and use Home Assistant as the hub and Alexa AVS. 1 connected to Comfort, 1 RPI3 in the bedroom.

I'll plan to loan 1 RPi3 to Mr. Chiu and the Cytech team for further testing. It's been 5 years since I've configured my Comfort/CBUS system, and it's just about the right time for enhancements via Alexa.

Looking forward to testing your UPNP :)

Thanks,

Ben



 Posted: Monday Oct 17th, 2016 04:10 pm
   
11th Post
mattbrain
UCM Pi Users


Joined: Tuesday Jun 12th, 2007
Location: United Kingdom
Posts: 185
Status: 
Offline

  back to top

Hey Ben

That should work, as I mentioned earlier, it would be useful to know whether the Alexa on the Pi does support UPNP. I should have some time later this week to implement a WeMo emulator and send it across for you to test prior to getting your UCM/Ethernet.

What Comfort interfaces do you need to have exposed, currently I have zones and outputs (as per the screenshots below from SmartThings). The Alarm status and arming is a work in progress. 

As an added bonus I have also added IFTTT support via the maker channel for zones and outputs which allows them to trigger events on IFTTT, which can be configured on a per zone/output basis, but haven't yet implemented any IFTTT functions (so IFTTT can't initiate actions on the alarm).

I have attached four images from the SmartThings interface, the first one shows a typical room with Comfort zone and outputs (which are PIR's and lights respectively).



The second image shows an output device control interface, which shows the functions which can be performed on the output (On, Off, Flash Once, Flash the final icon being a toggle to enable IFTTT)


The third image is the same for a zone, with functions to enable the IFTTT maker or bypass the zone.


The final image is an illustration of a zones history as viewed in the App.




 Posted: Monday Oct 17th, 2016 04:54 pm
   
12th Post
mattbrain
UCM Pi Users


Joined: Tuesday Jun 12th, 2007
Location: United Kingdom
Posts: 185
Status: 
Offline

  back to top

The link to Alexa in my implementation is via SmartThings, which exposes the devices in the Alexa app after being discovered via 'Alexa, discover my devices':





From there, I have grouped them together into logical groups, as below:





Allowing me to say 'Alexa, turn on the side passage lights'.


For an installation which isn't going to use SmartThings, I need to modify the UPNP to support emulate a device supported natively - I think WeMo lights, sockets, switches and motion sensors are best suited for this - they are widely supported and simple enough to easily emulate - it does mean that some of the advanced functions (such as zone bypass) aren't available as the range of functions per device is limited - but if all you are after is to interact with the alarm in a basic manner (react to zones, interact with outputs, set / unset the alarm) it should be more than sufficient.



 Posted: Tuesday Oct 18th, 2016 03:56 pm
   
13th Post
cgiltrow
Member
 

Joined: Monday Jun 12th, 2006
Location: Johannesburg, South Africa
Posts: 107
Status: 
Offline

  back to top

Hi Matt,

This looks great!  I wrote (and published in these forums) an interface into Comfort using VB and have been wanting to rewrite it in node.js for a while.  I would like to see what you have done and can possibly contribute.

Thanks,

Clinton.



 Posted: Tuesday Oct 18th, 2016 04:43 pm
   
14th Post
mattbrain
UCM Pi Users


Joined: Tuesday Jun 12th, 2007
Location: United Kingdom
Posts: 185
Status: 
Offline

  back to top

Hey Clinton

I would welcome your feedback, and having more people try this out should certainly help with fleshing out the functionality.

I'm going to do a bit of tidying up of the code later this week (as its a bit scruffy atm) and then pop it onto GitHub. It does has some dependencies on other node modules (some of which I have had to modify as they were only partial implementations) so the install process is a little tortuous but I'm hoping to have those changes merged back into the main branch.

I'll put a link on the first entry of this topic once I have uploaded it along with some other tools to help with determining third party compatibility.

Thanks,

Matt




 Posted: Tuesday Oct 18th, 2016 07:24 pm
   
15th Post
benchan001
Member
 

Joined: Monday Apr 19th, 2010
Location:  
Posts: 5
Status: 
Offline

  back to top

Hi Matt,

These are excellent screenshots showing the Comfort Outputs.

Just wanted to see how you selected Smartthings as your central hub.

Have you considered a RPi 3 implementation?

My RPi 3s will be arriving next week and I look forward to testing your UPNP Comfort interface.

All the Best,

Ben



 Posted: Wednesday Oct 19th, 2016 06:34 pm
   
16th Post
mattbrain
UCM Pi Users


Joined: Tuesday Jun 12th, 2007
Location: United Kingdom
Posts: 185
Status: 
Offline

  back to top

Hi Ben

You ask a good question about why I am using SmartThings.

I was lucky enough to be a beta tester in the UK and got one for free! However, now i have it, i would happily pay retail price for it - it allows me to connect a wide range of devices via the local network, z-wave, zigbee and devices exposed on the internet via o-auth.

The way I view this is Comfort provides a robust platform to monitor my house (intruders, fire etc) and SmartThings adds-on complex home automation which is vendor independent and open.

Combining the 2 allows me to make use of the status reports and control exposed by Comfort in a more complex home automation solution.

A (very rough) diagram of my solution is below - I have deliberately missed out some of the devices as it quickly gets too big to be easily readable but you should get the general idea:



As you can see, I have developed a UPNP compliant interface for comfort along with SmartThings device handlers which understand it. This allows me to take advantage of many of the Comfort features which aren't easily represented by standard UPNP devices.

An alternative solution (which I am working on), can replace my comfort UPNP interface with one which follows the simply BinaryDevice UPNP interface, emulating a WeMo switch for each zone, output and alarm set/unset. This removes the need to use SmartThings allowing devices which are WeMo compatible to directly link to the Comfort system. Each Zone, Output and Alarm State will have single binary control and will be represented as separate devices via UPNP.

As shown below this will allow devices such as the Amazon Echo to interface with Comfort directly without requiring SmartThings. It does have its limitations, in so much as it won't allow you to take advantage of some advanced features, and may require further customisation if you want to trigger actions, query counters, timers etc but will allow you to query the status of a zone or turn an output on/off.

Both solutions require a Raspberry Pi or other device which can run node, on the RPi I am using (model B2) it only uses around 5% CPU so could quite easily run on something much less powerful should it be required. On a RPi3 as you have, I am confident it won't even break a sweat!

Hope this all makes sense, I'm hoping to have some code for you to test shortly.


Thanks,

Matt



 Posted: Wednesday Oct 19th, 2016 09:44 pm
   
17th Post
DavidJ
Member
 

Joined: Tuesday Feb 26th, 2008
Location: Little Berkhamsted, United Kingdom
Posts: 83
Status: 
Offline

  back to top

HI Matt,I am very interested in HA but come at it from an end user perspective, seems most involved in HA are enthusiasts with who have to attain excellent technical know how.I have had a Comfort system for more that twelve years and its been constantly upgraded and programmed by my maintaining engineer, so a little bit expensive. I must say however on the whole I am really pleased.I do however find creating responses etc, through comfigurator way over my head and therefore saught a more manageable way of controlling basic HA so I opted for Smartthings. I found ST very unreliable and along with many on the ST forum saw many shortcomings, not least constant loss of communication with devices. I have now moved to Vera Plus and have to say there is little in it..... I mainly moved to Vera as it appears one user on here managed to make it work though it required adding the Comfort ZWave UCM.Anyway to my point, I would be really keen of finding a means of communicating with Comfort through either ST or Vera.Your gateway sounds a massive step forward.Any advice assistance would be much appreciated,Regards

David



 Posted: Wednesday Oct 19th, 2016 09:53 pm
   
18th Post
mattbrain
UCM Pi Users


Joined: Tuesday Jun 12th, 2007
Location: United Kingdom
Posts: 185
Status: 
Offline

  back to top

Hi David

I would be delighted if you would give it a go.

I am aware of some of the short-comings with ST; some of which were due to it probably being released before some of it was fully baked, very ambitious goals and a heavy reliance on the cloud. 

It is possible to mitigate against these issues, and some of the stuff coming to the platform now (such as CoRE) are really advanced. I guess if you can separate out the home security / home safety from home automation by leaving the former on the Comfort with the latter on ST you aren't losing any of the stability and reliability of Comfort to the essentials whilst getting the benefit of broader integration via ST.

I'll need to put some notes together on installation, and if you're prepared to try stuff out and help me test it we should all benefit. Do you have access to a Raspberry Pi (any model with Ethernet should work fine) - as this is the current platform I am using for the UPNP interface. Additionally, do you have a UCM with Ethernet?

Thanks,

Matt



 Posted: Wednesday Oct 19th, 2016 10:00 pm
   
19th Post
DavidJ
Member
 

Joined: Tuesday Feb 26th, 2008
Location: Little Berkhamsted, United Kingdom
Posts: 83
Status: 
Offline

  back to top

Hi Matt, I have a Rpi v1 knocking around with Ethernet.  Yes my UCM is an Ethernet version.  Happy to use it through Smartthings which is back in its box. Appreciate your advise. 



 Posted: Wednesday Oct 19th, 2016 10:09 pm
   
20th Post
mattbrain
UCM Pi Users


Joined: Tuesday Jun 12th, 2007
Location: United Kingdom
Posts: 185
Status: 
Offline

  back to top

Hi David

Sounds great - ok, i'm going to work tomorrow on providing some instructions and tidying up some of the debugging so we can see what is occurring. You will need to get the latest raspbian image from https://www.raspberrypi.org/downloads/ and set up a clean sdcard as per their instructions.

So long as the RPi is on the same network as the alarm, and you can ssh into it we should be all set.

You will need to get the latest configuration file for your alarm, as the UPNP interface reads that to identify elements to expose, and put it in the same folder as the software.

Can you give me an idea of how big your system is - do you have any SEMs and how many active zones / outputs do you have?

Thanks,

Matt



 Current time is 11:23 pmPage:    1  2  3  4  5  6  ...  Next Page Last Page  
Top




UltraBB 1.172 Copyright © 2007-2014 Data 1 Systems