View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 3 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Wed Oct 20, 2004 8:43 pm 
Offline
Joined: Thu Sep 30, 2004 10:22 pm
Posts: 7
Ok so I have been playing with myth for some about 3 weeks. It is fantastic and has changed the way I watch TV.
It is so nice and the front end seemed really easy to add my own menus.

Since about 88 I have been using X10 light controls and have been in about 4 apartments. After getting myth stable and messing around a bit I decided to marry the two. I looked into a few packages for controlling X10 thru Linux and settled on Heyu (http://heyu.tanj.com/heyu2/). I checked out all the man pages and purchased a CM11A from ebay for about $22 this unit connects up to your serial port and allows you to Control your lights from the computer. I have always been one to use Open source and Now want to give back a bit. So here is a semi step by step of how I used MythTV to control my lights.

--Log into the system.
--change to super user (Root)

su

--Down loaded heyu2 and installed using there instructions
--I then set up a group for heyu and added mythtv to the group

addgroup heyu

vi /etc/group


--add users you want to be able to control lights

heyu:x:1003:mythtv,otheruser,yetanotheruser

--change owner of the file to heyu group

chown -c :heyu /usr/local/bin/heyu2

--I also did the same for /etc/heyu/x10.conf

--I edited the config file to add some scenes

vi /etc/heyu/x10.conf

--Ok so I added some Alias to the config so I can use the names in the future.
--notlr not so exciting but is all the lights that are not my living room.

ALIAS hall A1
ALIAS kitchen A2
ALIAS living A3
ALIAS bedroom A4
ALIAS notlr A1,2,4


--I then set up my Scene for movie Lighting.
--the dimb brings the light to full power then dimbs it down to the proper setting.
-- So this movie scene turns down all the lights in my apartment to levels I like.
-- I got to these settings by playing with the command line heyu2 commands.
-- the dim level can be between 1 and 22
-- So my living room is a bit brighter then the rest of my apartment.

SCENE movie dimb notlr 15;dimb living 14

--I also added these lines(You can skip this if you want)
SCRIPT_MODE SCRIPTS
SCRIPT a5 on :: movie.sh


--this is a bit more complex Heyu has a daemon (This requires you to build init.d files) that can run and watch the X10 for a "Trigger"
--What this tells the computer is if I push a5 on any X10 controller run the script movie.sh
--this script is a linux script in /usr/local/bin/movie.sh that sends "heyu2 movie" to launch the scene.
--This allows me to launch this scene from any of my x10 controllers.

--Ok so now we have a config and scenes test the scene by typing heyu2 movie you should see the lights take the "Scene"
--There may be a slight delay for all the commands to go (no more than 5 seconds)
heyu2 movie

--now to build our new script
vi /usr/local/bin/movie.sh

--save this file (This is a simple script here I have a bit more happening but did not want to complicate this.)
chmod -x /usr/local/bin/movie.sh
--This tells the OS this is a executable script.

--we will need to now build our new menu
vi /usr/share/mythtv/lights.xml
<lightsmenu name="Lights Menu">
<button>
<type>Movie</type>
<text>Movie Lights</text>
<action>EXEC /usr/local/bin/movie.sh</action>
</button>
</lightsmenu>


--save this file

--now to attach our new menu
vi /usr/share/mythtv/mainmenu.xml
<button>
<type>Lights</type>
<text>Lights</text>
<action>MENU lights.xml</action>
</button>

--save this file and you should be off and running.

This is a simple example I have given but you can take this and really run with it.

If you have any questions feel free to ask. I may post the Init.d file I created it there is any real interest in this with this system. This was a really quick and rough telling of the tale but It worked fine for me.


Dave.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 21, 2005 1:34 pm 
Offline
Joined: Tue Oct 25, 2005 1:22 pm
Posts: 108
Location: USA, New Hampshire
Thats great I have been looking for this for a while. Great job!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 23, 2005 7:56 am 
Offline
Joined: Thu Dec 15, 2005 8:15 pm
Posts: 46
Location: Michigan
Thank you so much for this post! It didn't work for me, but it motivated me sure enough.

My backend only has one serial port, and it'll be dedicated to DirecTV. But... I also have a PowerLinc USB that I use with my Macs (no serial ports in years). So, I stumbled across this:

Project WiSH Universal X10 driver. It compiled on installed on my Knoppmyth box easily enough, and damned if the examples didn't make my lights work. It'll work with both of the PowerLincs (serial and USB) as well as the orginal X10 controller. What I *don't* know, though, is whether it'll continue to run its pre-programmed Macros. If you don't care about that, then this is a good alternative to the original post. I imagine you could do nsf exports of the devices and built in control to all of your front ends (that's what I'll eventually try).


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu