Author Topic: Future Advanced Lighting Control  (Read 8196 times)

joosieroosie

  • First post!
  • Posts: 1
    • View Profile
Future Advanced Lighting Control
« on: July 04, 2009, 10:25:37 pm »
Hi All,

Firstly, I just wish to say Linux MCE looks amazing, congrats to you all for how it has come along as an open source rival (if not successor) to the commercial home automation ventures out there.  Please do keep it running and don't let it fall like so many other great projects have.
Now I've done some ass-kissing, I should give you a little background:
I've been doing a large amount of research on Linux MCE recently since finding out about it a few months ago (though this is my first post on here).  I've not yet set up Linux MCE but I'm hoping to build a full home automation system once I've moved from the UK to USA at end of summer.  For the past couple of years I've run an Ubuntu MythTV server with a couple of frontends.  Once in USA, I'm looking at investing in a 4-8 apartment rental property and "future-proofing" the apartments with a central internet connection and CAT6 plus Coax outlets in each room for IP switching or point-to-point a/v connections.  I would be living in one of the apartments which I'd set up with Linux MCE.  I may look at MCE systems for the other rented apartments depending on whether the tenants want it, though that would be a very daunting task and may not yet be cost effective for rental properties (until home automation becomes as standard to people as having electricity or internet).

Anyway, when not geeking out on Ubuntu and MCE, I'm a lighting designer/programmer for theatre and architecture by profession.  I noticed the current version of MCE can handle basic lighting control (user directed on/off/dim) and some simple lighting states controlled by real-time triggers or other user-defined macros, like sunset/sunrise presets.  Most of this control seems to use domestic automation systems as a base like X10.  Someone on here mentioned that you were looking into the possibility of developing more advanced lighting control in the next MCE version possibly with control over timed fades, etc.  In theatre and live performance we have been using centralized computer control over lighting and sound for a number of years, which has now become extremely sophisticated and adaptable.  I understand Linux MCE doesn't need this level of control, but wanted to see if my expertise in this area would be of any use to you as you develop this side of MCE.

A few ideas from the world of theatre lighting:
*  We use central or distributed dimming systems that are usually controlled by a single dedicated computer lighting console with an industry standard 8bit data control protocol called DMX512.  Each DMX connection can run 512 independent control channels with each channel able to be set to any of 256 distinct values.  This is transmitted over a single CAT5/6 or screened twisted-pair (also known as microphone cable), and is "daisy-chained" between each lighting fixture using XLR connectors.  DMX is also now supported over TCP/IP, the most common being ArtNet (there has already been a Linux driver written for ArtNet).  There are also a number of cheap USB or ethernet to DMX converters available now, Enttec sell a few including a very cheap Open-source USB converter for under $100.

*  DMX control is not limited to just the dimming of light intensity but can control a number of other attributes for automated lights or other effects like fog machines, strobes, video servers, etc.  It is also used for controlling many RGB LED lighting fixtures that are getting cheaper and being used more and more in architectural projects.  LED fixtures are becoming very popular as they are eco-friendly but allow much better control and light quality than compact fluorescent units, so we will likely see them used more in domestic and commercial applications over the coming years.  RGB fixtures have Red, Green and Blue LEDs in them for full colour-mixing to allow the user to instantly "call up" any colour of light required or create dynamic rainbow colour fades that can last a few minutes or a few days.  If Linux MCE could use a USB/Ethernet to DMX adapter as an interface then it would open up a world of possibilities for lighting control in the home or in public buildings.

*  We also sometimes use MIDI (Musical Instrument Digital Interface) for triggering lighting consoles from show control systems, or creating more complex control sequences.  I don't know whether Linux MCE has any plans to support MIDI or MIDI-MSC as an interface either on physical ports or through MIDI-over-IP.  However, this would allow for a lot of cheap methods to trigger professional lighting and sound systems via MCE (or vice-versa)

General notes on how we control lighting in live performance:
*  Each light - be it just a dimmer, an RGB colour flood, or an entire automated fixture - can be individually controlled or grouped together for simplicity.  As a lighting designer, I can then combine individual lighting levels to build a whole lighting state/look/cue for a specific moment in the theatre performance (much like MCE's scenario builder).
*  These lighting states or cues are then placed into a "cue-stack" that allows for each look to be recalled either manually (at a specific moment in the show), or triggered by a timed sequence or an outside event (like a sound effect).
*  Each lighting state or cue has a number of time attributes that allow a lighting designer to control how the lighting "moves" from the previous cue into the next one.  These include:
    Delay - the time between when the cue is triggered and when the lighting actually changes
    Fade Up - the time it takes for any lights that will be brighter in the next cue (from the previous cue) to fade up to their final programmed intensity
    Fade Down - the time it takes for any lights to lower in intensity from the previous cue
*    If all three attributes are set at zero then the lighting will change instantly (like a bump to full intensity as someone walks into the room).  If the state has a fade up/down of a few secs then the lighting will dim or brighten accordingly (like a reading spotlight fades up fast while there is a slow fade down of the room's ambient lighting).  If there is a delay time as well then the lighting will wait until after an event trigger has occurred (like the lights take 5secs to fade down but will wait until 10secs after you've started the movie - this would let you get settled in your chair and put the remote down before it plunges you into darkness)

There are a number of other cue attributes used in lighting consoles - like linking cues to create sequences, multipart cues where different groups of lights change levels over different timings, and often you will have one set of Delay/Up/Down times for lighting intensities and another set of Delay/Up/Down times for other attributes like colour changes or physical movement of the light.  However, most of these are only required if you need extremely precise control like you do with a theatre show (and if this level of control was needed then perhaps it would be better to have MCE triggering an actual lighting console).  But I would say Linux MCE might benefit from the basic idea of Delay/Fade Up/Fade Down for each user created scenario.

As to fixtures, MCE can already handle single dimmers (it's just the interface change from X10, etc. to a DMX adapter).  However, it'd be wonderful to have basic control of RGB LED lighting fixtures or other automated fixtures from within Linux MCE.  A number of software based lighting controllers handle RGB fixtures with a visual colour palette/picker (like you have in a paint program) for selecting a specific colour, this is then translated by the software into the R, G, B DMX channel values.  I'm not suggesting MCE becomes a full lighting control system, but just having some control over things like intensity, colour and fade timing would allow for MCE users to really develop lighting mood and atmosphere in the home.

Web-links:
DMX512 - http://en.wikipedia.org/wiki/DMX512-A
ArtNet - http://www.nomis52.net/?section=projects&sect2=artnet&page=whatis
Enttec - http://www.enttec.com/
MIDI - http://en.wikipedia.org/wiki/Musical_Instrument_Digital_Interface
DMX controlled LED Fixtures on eBay - http://shop.ebay.com/items/?_nkw=led+dmx&_sacat=0&_trksid=p3286.m270.l1313&_odkw=led+par&_osacat=0
Other DMX controlled LED fixtures - http://www.ultraleds.co.uk/rgb-dmx-led-section-c-90.html
Strand Lighting Palette Offline Lighting Control (Windows only) - http://www.strandlighting.com/clientuploads/directory/downloads/PaletteOLE10.6.1.Vista32.exe

Thank you so much for reading my bloody lengthy message, I just felt I should get this out into the ether for people to read.  And please let me know if you need me to expand/clarify anything or send some control software examples of what I'm discussing.

Roosie

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Future Advanced Lighting Control
« Reply #1 on: July 05, 2009, 12:33:34 am »
Currently there are varying levels for support for X10, Insteon, ZWave, EIB/KNX, PLCBus, with the ZWave and Insteon being probably the most common.

However, this is a "framework" product... by design it is intended to be extensible. If you have the protocol specifications, there is nothing stopping you adding DMX control if you wish. You would create a DCE Device which would act as a "translation module", if you will. It would register with the LMCE network and receive DCE commands and events for lighting, and translate them to and from the DMX protocol. Then LMCE will be integrated with DMX. You can interface with pretty much anything you want, via serial, USB, TCP/IP, I/R, etc. And if the controller is USB making it pnp is easy... tell LMCE which vendor:product ID to look out for, for your DMX controller and it will automatically trigger installing your new module and configuring it for use.

These modules could a simple one using the Generic Serial Device template, and require little to no programming at all, right up to a sophisticated, native C++ serial DCE device. Your choice. First determine what the protocol is like, and how the USB device presents this to the kernel (ie, does it just present as a virtual RS232 interface to talk to, does it present its own /dev device interface, etc), then there will be plenty of people around here who can give you advice on how to create the necessary DCE device.

If LMCE doesn't currently issue DCE commands that relate to the actions you are looking for (eg triggering complex lighting macros, as opposed to simply changing the dim level, etc) you can even add new commands to the DCE protocol, and then just need to implement the code in the lighting plugin so that it knows when to send these commands. It can be as simple as adding new scenarios to the UI that relate to the new DCE command, then LMCE will send that new command to your new DCE device, which will translate it into DMX and pass it on.

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: Future Advanced Lighting Control
« Reply #2 on: July 05, 2009, 12:58:30 am »
Hi All,

Firstly, I just wish to say Linux MCE looks amazing, congrats to you all for how it has come along as an open source rival (if not successor) to the commercial home automation ventures out there.  Please do keep it running and don't let it fall like so many other great projects have.
Now I've done some ass-kissing, I should give you a little background:
I've been doing a large amount of research on Linux MCE recently since finding out about it a few months ago (though this is my first post on here).  I've not yet set up Linux MCE but I'm hoping to build a full home automation system once I've moved from the UK to USA at end of summer.  For the past couple of years I've run an Ubuntu MythTV server with a couple of frontends.  Once in USA, I'm looking at investing in a 4-8 apartment rental property and "future-proofing" the apartments with a central internet connection and CAT6 plus Coax outlets in each room for IP switching or point-to-point a/v connections.  I would be living in one of the apartments which I'd set up with Linux MCE.  I may look at MCE systems for the other rented apartments depending on whether the tenants want it, though that would be a very daunting task and may not yet be cost effective for rental properties (until home automation becomes as standard to people as having electricity or internet).

Anyway, when not geeking out on Ubuntu and MCE, I'm a lighting designer/programmer for theatre and architecture by profession.  I noticed the current version of MCE can handle basic lighting control (user directed on/off/dim) and some simple lighting states controlled by real-time triggers or other user-defined macros, like sunset/sunrise presets.  Most of this control seems to use domestic automation systems as a base like X10.  Someone on here mentioned that you were looking into the possibility of developing more advanced lighting control in the next MCE version possibly with control over timed fades, etc.  In theatre and live performance we have been using centralized computer control over lighting and sound for a number of years, which has now become extremely sophisticated and adaptable.  I understand Linux MCE doesn't need this level of control, but wanted to see if my expertise in this area would be of any use to you as you develop this side of MCE.

A few ideas from the world of theatre lighting:
*  We use central or distributed dimming systems that are usually controlled by a single dedicated computer lighting console with an industry standard 8bit data control protocol called DMX512.  Each DMX connection can run 512 independent control channels with each channel able to be set to any of 256 distinct values.  This is transmitted over a single CAT5/6 or screened twisted-pair (also known as microphone cable), and is "daisy-chained" between each lighting fixture using XLR connectors.  DMX is also now supported over TCP/IP, the most common being ArtNet (there has already been a Linux driver written for ArtNet).  There are also a number of cheap USB or ethernet to DMX converters available now, Enttec sell a few including a very cheap Open-source USB converter for under $100.

*  DMX control is not limited to just the dimming of light intensity but can control a number of other attributes for automated lights or other effects like fog machines, strobes, video servers, etc.  It is also used for controlling many RGB LED lighting fixtures that are getting cheaper and being used more and more in architectural projects.  LED fixtures are becoming very popular as they are eco-friendly but allow much better control and light quality than compact fluorescent units, so we will likely see them used more in domestic and commercial applications over the coming years.  RGB fixtures have Red, Green and Blue LEDs in them for full colour-mixing to allow the user to instantly "call up" any colour of light required or create dynamic rainbow colour fades that can last a few minutes or a few days.  If Linux MCE could use a USB/Ethernet to DMX adapter as an interface then it would open up a world of possibilities for lighting control in the home or in public buildings.

*  We also sometimes use MIDI (Musical Instrument Digital Interface) for triggering lighting consoles from show control systems, or creating more complex control sequences.  I don't know whether Linux MCE has any plans to support MIDI or MIDI-MSC as an interface either on physical ports or through MIDI-over-IP.  However, this would allow for a lot of cheap methods to trigger professional lighting and sound systems via MCE (or vice-versa)

General notes on how we control lighting in live performance:
*  Each light - be it just a dimmer, an RGB colour flood, or an entire automated fixture - can be individually controlled or grouped together for simplicity.  As a lighting designer, I can then combine individual lighting levels to build a whole lighting state/look/cue for a specific moment in the theatre performance (much like MCE's scenario builder).
*  These lighting states or cues are then placed into a "cue-stack" that allows for each look to be recalled either manually (at a specific moment in the show), or triggered by a timed sequence or an outside event (like a sound effect).
*  Each lighting state or cue has a number of time attributes that allow a lighting designer to control how the lighting "moves" from the previous cue into the next one.  These include:
    Delay - the time between when the cue is triggered and when the lighting actually changes
    Fade Up - the time it takes for any lights that will be brighter in the next cue (from the previous cue) to fade up to their final programmed intensity
    Fade Down - the time it takes for any lights to lower in intensity from the previous cue
*    If all three attributes are set at zero then the lighting will change instantly (like a bump to full intensity as someone walks into the room).  If the state has a fade up/down of a few secs then the lighting will dim or brighten accordingly (like a reading spotlight fades up fast while there is a slow fade down of the room's ambient lighting).  If there is a delay time as well then the lighting will wait until after an event trigger has occurred (like the lights take 5secs to fade down but will wait until 10secs after you've started the movie - this would let you get settled in your chair and put the remote down before it plunges you into darkness)

There are a number of other cue attributes used in lighting consoles - like linking cues to create sequences, multipart cues where different groups of lights change levels over different timings, and often you will have one set of Delay/Up/Down times for lighting intensities and another set of Delay/Up/Down times for other attributes like colour changes or physical movement of the light.  However, most of these are only required if you need extremely precise control like you do with a theatre show (and if this level of control was needed then perhaps it would be better to have MCE triggering an actual lighting console).  But I would say Linux MCE might benefit from the basic idea of Delay/Fade Up/Fade Down for each user created scenario.

As to fixtures, MCE can already handle single dimmers (it's just the interface change from X10, etc. to a DMX adapter).  However, it'd be wonderful to have basic control of RGB LED lighting fixtures or other automated fixtures from within Linux MCE.  A number of software based lighting controllers handle RGB fixtures with a visual colour palette/picker (like you have in a paint program) for selecting a specific colour, this is then translated by the software into the R, G, B DMX channel values.  I'm not suggesting MCE becomes a full lighting control system, but just having some control over things like intensity, colour and fade timing would allow for MCE users to really develop lighting mood and atmosphere in the home.

Web-links:
DMX512 - http://en.wikipedia.org/wiki/DMX512-A
ArtNet - http://www.nomis52.net/?section=projects&sect2=artnet&page=whatis
Enttec - http://www.enttec.com/
MIDI - http://en.wikipedia.org/wiki/Musical_Instrument_Digital_Interface
DMX controlled LED Fixtures on eBay - http://shop.ebay.com/items/?_nkw=led+dmx&_sacat=0&_trksid=p3286.m270.l1313&_odkw=led+par&_osacat=0
Other DMX controlled LED fixtures - http://www.ultraleds.co.uk/rgb-dmx-led-section-c-90.html
Strand Lighting Palette Offline Lighting Control (Windows only) - http://www.strandlighting.com/clientuploads/directory/downloads/PaletteOLE10.6.1.Vista32.exe

Thank you so much for reading my bloody lengthy message, I just felt I should get this out into the ether for people to read.  And please let me know if you need me to expand/clarify anything or send some control software examples of what I'm discussing.

Roosie

Hi,

I cant see anything in your message above that could not be implemented. You are the 'subject matter' expert and with a modest amount of effort and possibly a little help from others here to get started you could build a DCE plugin  and associated device templates to deliver the kind of sophisticated lighting control you describe.

Welcome!

Andrew
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

koenb

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Future Advanced Lighting Control
« Reply #3 on: July 08, 2009, 09:12:41 am »
I was actually thinking of doing the same (my company already promoted a couple of FOSS DMX related master thesisses) so we have device drivers and routines around. But how do I start implementing my driver in your Linux MCE? Were do I find this explanation? We have an artnode driver and a DMX device driver and I've also some experience with the Entec USB-DMX driver.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Future Advanced Lighting Control
« Reply #4 on: July 08, 2009, 11:10:31 am »
Hello, :)

Come by #linuxmce-devel on irc.freenode.net, and we can help you set up a development environment, and get you started on your device template, which will be used by our tools to generate the C++ stubs you need.

-Thom

gonesurfing

  • Veteran
  • ***
  • Posts: 61
    • View Profile
Re: Future Advanced Lighting Control
« Reply #5 on: July 13, 2009, 01:12:35 pm »
HI
i have cueserver from interactive technologies that controls my dmx512 lighting in my home, its packed full of handy features and is easy to use and setup,i have started to add a template for it in linuxmce as it can be controled over a network with ruby or,it sends and receives messages via udp or serial in ascll
can any one help with with the ruby ,all i need to do -
to turn a light on                           chxxxatyyy                                   ch=channel , xxx=a number from 1 to 512 ,at=at ,and yyy=a number from 1 to 100
to turn a light off                           chxxxrel                                       ch=channel  ,xxx=a number from  1 to 512 ,rel=release
to turn a scene on  or off              cuezzzzzgo                                 cue=cue ,zzzzz= a number from 1 to 5000 ,go=go                                       
thats it !
i hope the first part of this post is helpful and would be very grateful for a little help
thanks steve

koenb

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Future Advanced Lighting Control
« Reply #6 on: July 29, 2009, 11:08:58 am »
I've now a 'standard' RS232 serial interface in to which I can send DMX command strings in the sense of :
- channel @ value : 001@100
- channel + channel @ value : 002+020@050
- channel thru channel @ value : 003T014@075
- record scene : R001
- call scene : C010
- ... and some other commands (viewing incoming dmx, dmx rate, errors, ...)

I've build a microcontroller board which translates this commands into DMX strings. It also takes DMX input which gives me other control options.
For each of the commands the microcontroller responds differently with a string send back over the serial port.

How do I implement this in the linuxMCE code?
How do I attach specific lamps to a specific channel?
Where can I find documentation about this process?

Can anyone give me an example how to implement such 'standard' serial port devices and how to take them up in the LinuxMCE code? I'm an C programmer with not very much C++ experience.

PS: If people are interested in this microcontroller board, this will come available on my website soon. I'm building an RC5, IR, MIDI, AD/DA interface board also.

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Future Advanced Lighting Control
« Reply #7 on: July 30, 2009, 12:17:31 am »
Look into the GSD (Generic Serial Device). This is a LMCE DCE Device, it is a "framework" device which you can add to your system and then configure so as to avoid having to code your own device from scratch. LMCE has its own protocol (DCE) which is used to send/receive commands and events. Once you have added a GSD, you can then configure it to tell LMCE which commands it implements (in this case they will be the lighting control commands send from the lighting plugin), then you configure each of these commands inside GSD to send a particular string to your serial port. It will do the rest. Check the wiki

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Future Advanced Lighting Control
« Reply #8 on: July 30, 2009, 12:18:41 am »
If you prefer to write your device in C++, look at the DCEGen page in the wiki. You will need to get a full development environment set up in order to do it, if you choose this route.

-Thom

koenb

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Future Advanced Lighting Control
« Reply #9 on: August 10, 2009, 08:20:56 am »
HI
i have cueserver from interactive technologies that controls my dmx512 lighting in my home, its packed full of handy features and is easy to use and setup,i have started to add a template for it in linuxmce as it can be controled over a network with ruby or,it sends and receives messages via udp or serial in ascll
can any one help with with the ruby ,all i need to do -
to turn a light on                           chxxxatyyy                                   ch=channel , xxx=a number from 1 to 512 ,at=at ,and yyy=a number from 1 to 100
to turn a light off                           chxxxrel                                       ch=channel  ,xxx=a number from  1 to 512 ,rel=release
to turn a scene on  or off              cuezzzzzgo                                 cue=cue ,zzzzz= a number from 1 to 5000 ,go=go                                       
thats it !
i hope the first part of this post is helpful and would be very grateful for a little help
thanks steve

Hi Steve,

Could you email me your code as an example?

gonesurfing

  • Veteran
  • ***
  • Posts: 61
    • View Profile
Re: Future Advanced Lighting Control
« Reply #10 on: September 05, 2009, 06:49:36 am »