[Logo] Mango Community
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Mango for home control  XML
Forum Index » Mango M2M 1.12.5 and Earlier general discussion
Author Message
paulw

Initiate

Joined: 01/04/2007 21:46:20
Messages: 3
Offline

Hi,

I have a couple of "smart" devices in my home, an Elk M1 alarm and C-Bus lighting (This is an Australian product from Clipsal, it is also available in the UK and soon the US).
I have been looking for a way to "glue" these systems together - they both have TCP/IP interfaces so the physical interfacing is quite simple. I also want a web interface for control.

think Mango may be the platform I have been looking for. I haven't looked at the code yet, but I am pretty sure I can write a C-Bus interface pretty easily. The core control point in C-Bus is a "group address" which has a level from 0-255. When a group adress is assigned to an output unit like a dimmer then it is dimmer brightness. When assigned to an input unit such as a switch, the group address level can be set directly (or incremented/decremented). The TCP/IP interface allows a group address value to be read and set. It seems that a group address would map directly to a data point in Mango.

What I would like to do is have the ability to execute a program (such as a Javascript - I am planning on using Rhino) under certain conditions and have that script manipulate lights and/or the alarm. Do you think that this is "do-able"?

What "commands" does Mango support? Only "get" and "set" or other operations as well? I ask as the C-Bus system has a "ramp" command in addition to set & get. The ramp command allows you to specify a target value and a duration over which the address should "ramp" to the target. Can Mango support a command like this that has two parameters?

Paul
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

Hi Paul,

I'm not very familiar with C-Bus. Is its TCP/IP connection really TCP/IP (i.e. components can be plugged into a router), or does it simply use an RJ-45 plug for its own protocol?

You are certainly welcome to contribute data source code for C-Bus if you choose to implement it. We can help you understand the API for doing so.

What are the types of conditions under which you want control? Mango already is capable of some quite sophisticated event detection, and more will be added. There's a good chance that you won't need to write your own control code.

I'll have to split your "get/set" question into two. The "get" side is entirely controlled by the data source, so this can be as sophisticated and protocol-based as the implementer chooses to make it. The "set" side, however, is outside of direct data source control, and is currently value only. It is not inconceivable though that the definition of "set" be migrated into the data source realm, but that would be a future Mango version. In the meantime, you could work around this by allowing the definition of a "ramp-up" period at the data source or the point level. It would not be override-able at runtime, but it's a start.

This message was edited 1 time. Last update was at 01/04/2007 22:27:32


Best regards,
Matthew Lohbihler
paulw

Initiate

Joined: 01/04/2007 21:46:20
Messages: 3
Offline

Hi,

The low-level CBUS interface is a serial port. The ethernet interface is a serial interface with an embedded Lantronix server. While the documentation on the serial interface is available it is easier to work through the Clipsal gateway. This is a Java application that connects to the serial or network interface and exposes a high-level command interface on TCP socket. You can send commands like "on <address>" and "off <address>". My plan was to write the data source code to interface between Mango & the "C-Gate" software.

If I understand your reply on the "ramp" question you are suggesting that I could define a control point that defined the ramp time (0=instant, otherwise # of seconds) & then when a control point was set it could either issue an instant or ramp command based on the ramp time control point? That could work.

I have also given some thought to the Elk M1 interface. I could define control points that indicated the current alarm status (0=disarmed, 1=armed stay, 2=armed away etc) & also specific control points that when set controlled the alarm (for example, set a control point to a number that represents a user code, the interface code would then attempt to disarm the alarm using that user code).

The Elk interface is also a TCP socket with a simple ascii protocol (that is documented!), so once again I would need to write interface code.

Paul
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

My solution for your "ramp" issue was to provide a configuration-time field for, essentially, hard-coding the value, as opposed to having it be a run-time field that you can define each time you set the point.

The general design of a data source (at this time anyway, there are plans to re-engineer it to some degree) is a general definition level (the data source, or DS) and a point level definition level (the data points, or DP). At the DS level you would define fields like the serial port, baud rate, etc. The DP level would inherit all of the DS level attributes and then define things like addresses, nodes, and in your case ramp-up times.

A workaround for your problem could be to define multiple DPs on a single real instance, and then define all of your required ramp-up times in each. This is an obvious kludge - certainly not ideal - but would do the job to a degree.

Mango provides 4 data types: binary, multistate, numeric, and alphanumeric. For the ELK M1 interface, implementing your approach is easy: you would simply use the multistate data type. Your data source implementation can be coded to use a particular state to do whatever specifics you need.

If you are still interested in writing the data source and need some help, feel free to send me the protocol spec and i can help you out.

Best regards,
Matthew Lohbihler
paulw

Initiate

Joined: 01/04/2007 21:46:20
Messages: 3
Offline

I don't think that a single ramp value will work as you would want to vary the ramp rate depending upon the scenario - for example, when a movie starts you may want to dim the lights over 15 seconds, but at the end of the movie you may want to brighten the lights over only 5 seconds.

I was thinking that it should be possible to create a pseudo-DP in the DS that represented the ramp rate. Whenever a light level DP was changed, the interface code would refer to the ramp-rate pseudo-DP to determine the actual command that should be issued onto the C-BUS.

If you can give me a point in the direction of the classes/interfaces I need to implement in order to create a new data source I will have a look and see how far I can get.

Paul
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

Hi Paul,

This is more a discussion for the developers forum. As such, i've moved the thread here: http://mango.serotoninsoftware.com/forum/posts/list/25.page

Best regards,
Matthew Lohbihler
mjbcomputers

Initiate
[Avatar]

Joined: 21/08/2007 21:07:41
Messages: 48
Location: Colorado
Offline

Hello,
Could you make this device send the values to a database? You could add a device to your system which monitors the doors and could relay the alarm switch. This is what I have done using the Velman K8061 (http://store.qkits.com/moreinfo.cfm/K8061) Is the elk system similar to the Cadex System?
 
Forum Index » Mango M2M 1.12.5 and Earlier general discussion
Go to:   
Powered by JForum 2.1.9 © JForum Team