Changes between Initial Version and Version 1 of tellstickController


Ignore:
Timestamp:
Jun 18, 2009, 12:59:10 PM (15 years ago)
Author:
jsandahl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • tellstickController

    v1 v1  
     1= tellstickController =
     2
     3tellstickController be used to control a number of remote receivers from the console or be run as a daemon controlling receivers according to certain rules.
     4
     5tellstickController was created with the objective of:
     6
     7  * enable control via aliases such as "BedroomMythtvPower" instead of "Nexa A 2".
     8  * having a saved permission (in a database file) for each receiver enabling turning on and off with one command.
     9  * running the software as a daemon and as regular commands (of course simultaneously).
     10  * having rules based on extendable expressions such as "monday+weekend/sunrise-00:30+random(01:00)".
     11  * having group management of receivers making it easier to establish rules.
     12  * enabling the use of more than one TellStick connected to a computer.
     13  * working in MythTV backend which requires the software to function in Linux.
     14  * enabling control of the software with a RF remote control from all rooms.
     15
     16
     17== Download ==
     18
     19A stable versio can be downloaded from the ftp server: En stabil version kan laddas ned från [http://download.telldus.se/TellStick/Software/tellstickController/tellstickController_v1_5_0.tar.gz http://download.telldus.se/TellStick/Software/tellstickController/tellstickController_v1_5_0.tar.gz].
     20
     21Moreover, the Rfcmd program is installed as it is required for communication in tellstickController.
     22
     23tellstickController is written in Perl and functions with a standard installation plus these three Perl-modules:
     24
     25{{
     26
     27  * DB_File;
     28  * DateTime;
     29  * DateTime::Event::Sunrise;
     30
     31}}
     32
     33De extra Perl-modulerna kan installeras så här om du använder en Ubuntu distribution: (Använda apt-get går också bra om aptitude inte fungerar)
     34
     35* sudo aptitude install libmldbm-perl
     36* sudo aptitude install libdatetime-event-sunrise-perl
     37
     38[edit]
     39Användning
     40
     41Dessa argument kan man använda med tellstickController:
     42
     43 -h, --help          Show this help text.
     44 -v, --verbose       Show extra information.
     45
     46 -d, --daemon        Starts in daemon mode.
     47
     48 -f, --file F        Set configfile to file F.
     49 -c, --check         Check content of configuration file.
     50
     51 -t, --test          Test mode, no real devices will used.
     52
     53 -a, --aliases       List of aliases for devices/groups.
     54 -l, --list          List states for all devices/groups.
     55
     56 -s, --set D S       Set device/group D to state S.
     57 -g, --get D         Get state for device/group D.
     58
     59 -x, --swap D        Swap state for device/group D.
     60 -w, --swapfirst G   Swap states for group G based on first device state.
     61
     62
     63Exempel på hur man kan använda tellstickController på kommandoprompten:
     64
     65# tellstickController --help
     66
     67#  tellstickController --aliases
     68Alias testDevice1 = receiver (/dev/tellstick0 NEXA A 1)
     69Alias testDevice2 = receiver (/dev/tellstick0 NEXA A 2)
     70Group allDevices = delay 10 seconds, aliases (testDevice1 testDevice2)
     71
     72# tellstickController --set testDevice2 on
     73
     74# tellstickController --list
     75Device testDevice1 = off
     76Device testDevice2 = on
     77Group allDevices = off on
     78
     79# tellstickController --swap testDevice1
     80
     81# tellstickController --get testDevice1
     82On
     83
     84# tellstickController --daemon
     85
     86
     87Exempel på hur man kan sätta ihop enkla shell script:
     88
     89#!/bin/sh
     90#
     91# Power on bedroom MythTV, turn on backlight leds and turn off window lamp.
     92#
     93tellstickController --set bedroom_mythtv_power on
     94tellstickController --set bedroom_mythtv_leds on
     95tellstickController --set bedroom_window off
     96
     97[edit]
     98Inställningar
     99
     100Här är ett exempel på hur filen tellstickController.conf kan se ut.
     101
     102# List of location settings.
     103#
     104# Usage example:
     105# Set  Key       Value
     106# Set  Timezone  Europe/Stockholm
     107#
     108Set  Timezone   Europe/Stockholm
     109Set  Latitude   58.24
     110Set  Longitude  15.31
     111Set  dbfile     /var/lib/tellstickController.db
     112Set  pidfile    /var/run/tellstickController.pid
     113Set  logfile    /var/log/tellstickController.log
     114
     115# Aliases for recevier devices.
     116#
     117# Usage example:
     118# Alias  Name           Sender           Dimmer  Protocol  Housecode  Channel
     119#
     120# Alias  BedroomWindow  /dev/tellstick0  yes     Nexa      A          1
     121# Alias  device42       /dev/tellstick1  No      Waveman   B          3
     122#
     123#   or
     124#
     125# Usage example:
     126# Alias  Name              Sender        Dimmer  Protocol  Channel
     127#
     128# Alias  MythTv_Backlight  /dev/ttyUSB0  No      Sartano   000000001
     129#
     130Alias  testDevice1  /dev/tellstick0  No  Nexa  A  1
     131Alias  testDevice2  /dev/tellstick0  No  Nexa  A  2
     132
     133
     134# Groups used for handling a list of aliases.
     135#
     136# Usage examples:
     137# Group  Name              Delay  Aliases
     138# Group  Livingroom_walls  60     Livingroom_wall_north  Livingroom_wall_east
     139# Group  Kitchen            5     Kitchen_cabinets       Kitchen_window
     140#
     141Group  allDevices  10  testDevice1  testDevice2
     142
     143
     144# Timer rules for reciever devices.
     145#
     146# Usage examples:
     147# Rule  Alias             DeviceOn       DeviceOff
     148# Rule  BedroomWindow     Sunrise        Sunrise+01:30
     149# Rule  BedroomWindow     18:33          23:10+Random(00:45)
     150# Rule  MythTv_Backlight  Weekend/Sunset Weekend/23:45
     151#
     152Rule  testDevice1  weekend/sunrise  weekend/08:45
     153Rule  testDevice1  sunset+00:15     23:30+Random(00:20)
     154Rule  testDevice2  monday/20:42     wednesday/20:42
     155Rule  allDevices   16:45            23:45
     156
     157[edit]
     158SVN
     159
     160Den absolut senaste version (som oftast fungerar helt okey ;-) finns i subversion och kan checkas ut med detta kommando: svn checkout http://svn.telldus.se/telldus/trunk/tellstickcontroller
     161[edit]
     162Tips
     163
     164Jag kör tellstickController på min MythTV backend för att styra lampor, MythTV frontend, mm.
     165
     166Förutom att automatiskt styra lamporna via regler i tellstickcontroller.conf och tellstickcontrollerDaemon, så kan jag styra alla mottagare manuellt med en Logitech UltraX rf remote ifrån alla rum.
     167
     168Alla knappar på fjärrkontrollen är bundna till olika händelser genom programmen KeyWatcher och XMacro.
     169
     170Information om hur man kan använda alla knappar på fjärrkontrollen finns här, http://mythtv.org/wiki/index.php/Logitech_UltraX_Media_Remote
     171
     172Information om KeyWatcher programmet finns här, http://criticalmass.sourceforge.net/keyWatcher.php
     173
     174Information om XMacro programmet finns här, http://xmacro.sourceforge.net/
     175
     176Genom att använda knappen KEY_CCTELETEXT som en shift-knapp på fjärrkontrollen, så har jag kunnat lägga in två-knapps makros för olika händelser. Tex genom att trycka på de båda knapparna KEY_CCTELETEXT + KEY_1 samtidigt, kan jag styra en en lampa i vardagsrummet mha tellstickController. Så här ser min konfig-fil för KeyWatcher ut. Den är skapad via KeyConfig (GUI frontend för KeyWatcher).
     177
     178# This is a generated file. Edit carefully!
     179# --- Variable section ---
     180set filter11+388 = true
     181set filter111+388 = true
     182set filter10+388 = true
     183set filter410 = true
     184set filter405 = true
     185set filter403 = true
     186set filter402 = true
     187set filter398 = true
     188set filter393 = true
     189set filter392 = true
     190set filter391 = true
     191set filter389 = true
     192set filter385 = true
     193set filter377 = true
     194set filter371 = true
     195set filter370 = true
     196set filter368 = true
     197set filter226 = true
     198set filter208 = true
     199set filter206 = true
     200set filter168 = true
     201set filter167 = true
     202set filter166 = true
     203set filter165 = true
     204set filter164 = true
     205set filter163 = true
     206set filter158 = true
     207set filter139 = true
     208set filter130 = true
     209set filter129 = true
     210set filter115 = true
     211set filter114 = true
     212set filter113 = true
     213set filter102 = true
     214set filter388 = true
     215set filter96+388 = true
     216set filter9+388 = true
     217set filter8+388 = true
     218set filter7+388 = true
     219set filter6+388 = true
     220set filter5+388 = true
     221set filter4+388 = true
     222set filter3+388 = true
     223set filter2+388 = true
     224set label11+388 = KEY_0+KEY_CCTELETEXT
     225set label10+388 = KEY_9+KEY_CCTELETEXT
     226set label4+388 = KEY_3+KEY_CCTELETEXT
     227set label5+388 = KEY_4+KEY_CCTELETEXT
     228set label6+388 = KEY_5+KEY_CCTELETEXT
     229set label111+388 = KEY_CLEAR+KEY_CCTELETEXT
     230set label7+388 = KEY_6+KEY_CCTELETEXT
     231set label8+388 = KEY_7+KEY_CCTELETEXT
     232set label9+388 = KEY_8+KEY_CCTELETEXT
     233set label96+388 = KEY_ENTER+KEY_CCTELETEXT
     234set label2+388 = KEY_1+KEY_CCTELETEXT
     235set label3+388 = KEY_2+KEY_CCTELETEXT
     236set label410 = KEY_SHUFFLE
     237set label405 = KEY_LASTCH
     238set label403 = KEY_CHANNELDOWN
     239set label402 = KEY_CHANNELUP
     240set label398 = KEY_RED
     241set label393 = KEY_VIDEO
     242set label392 = KEY_SAP
     243set label391 = KEY_MUSIC
     244set label389 = KEY_DVD
     245set label385 = KEY_RADIO
     246set label377 = KEY_TV
     247set label371 = KEY_ANGLE
     248set label370 = KEY_REPEAT
     249set label368 = KEY_LANGUAGE
     250set label226 = KEY_PICTURES
     251set label208 = KEY_FASTFORWARD
     252set label206 = KEY_CLOSE
     253set label168 = KEY_REWIND
     254set label167 = KEY_RECORD
     255set label166 = KEY_STOPCD
     256set label165 = KEY_PREVIOUSSONG
     257set label164 = KEY_PLAYPAUSE
     258set label163 = KEY_NEXTSONG
     259set label158 = KEY_BACK
     260set label139 = KEY_DVDMENU
     261set label130 = KEY_SUBTITLE
     262set label129 = KEY_INFOEPG
     263set label115 = KEY_VOLUMEUP
     264set label114 = KEY_VOLUMEDOWN
     265set label113 = KEY_MIN_INTERESTING
     266set label102 = KEY_HOME
     267set ConfigFile = .keyWatcher
     268set action410 = "xmacroplay-keys :0.0 D"
     269set action405 = "xmacroplay-keys :0.0 Y"
     270set action403 = "xmacroplay-keys :0.0 Z"
     271set action402 = "xmacroplay-keys :0.0 E"
     272set action398 = "killall mythfrontend.real"
     273set action393 = "xmacroplay-keys :0.0 F32"
     274set action392 = "xmacroplay-keys :0.0 X"
     275set action391 = "xmacroplay-keys :0.0 F33"
     276set action389 = "xmacroplay-keys :0.0 F29"
     277set action385 = "xmacroplay-keys :0.0 F30"
     278set action377 = "xmacroplay-keys :0.0 F28"
     279set action371 = "xmacroplay-keys :0.0 W"
     280set action370 = "xmacroplay-keys :0.0 Q"
     281set action368 = "xmacroplay-keys :0.0 +"
     282set action226 = "xmacroplay-keys :0.0 F31"
     283set action208 = "xmacroplay-keys :0.0 Next"
     284set action206 = "xmacroplay-keys :0.0 F27"
     285set action168 = "xmacroplay-keys :0.0 Prior"
     286set action167 = "xmacroplay-keys :0.0 R"
     287set action166 = "xmacroplay-keys :0.0 Escape"
     288set action165 = "xmacroplay-keys :0.0 Left"
     289set action164 = "xmacroplay-keys :0.0 P"
     290set action163 = "xmacroplay-keys :0.0 Right"
     291set action158 = "sudo eject -T"
     292set action139 = "xmacroplay-keys :0.0 I"
     293#set action130 = "xmacroplay-keys :0.0 C"
     294set action130 = "osd_show_date"
     295set action129 = "xmacroplay-keys :0.0 V"
     296set action115 = "xmacroplay-keys :0.0 U"
     297set action114 = "xmacroplay-keys :0.0 O"
     298set action113 = "xmacroplay-keys :0.0 M"
     299set action102 = "xmacroplay-keys :0.0 F26"
     300set action96+388 = "sudo power_on_bedroom_mythtv"
     301set action11+388 = "sudo power_off_all_lights"
     302set action10+388 = "sudo tellstickController --swap bedroom_mythtv_leds"
     303set action111+388 = "sudo swap_livingroom_tv_mode"
     304set action9+388 = "sudo tellstickController --swap Bedroom_window"
     305set action8+388 = "sudo tellstickController --swap Kitchen_cabinets"
     306set action7+388 = "sudo tellstickController --swap Livingroom_uplight"
     307set action6+388 = "sudo tellstickController --swap Livingroom_mythtv_leds"
     308set action5+388 = "sudo tellstickController --swap Livingroom_window"
     309set action4+388 = "sudo tellstickController --swap Livingroom_cabinets"
     310set action3+388 = "sudo tellstickController --swap Livingroom_wall_east"
     311set action2+388 = "sudo tellstickController --swap Livingroom_wall_north"
     312set enableFiltering = true
     313set ignoreProductName5 = "Power Button (FF)"
     314set ignoreProductName4 = "Power Button (CM)"
     315set ignoreProductName3 = "PC Speaker"
     316set ignoreProductName2 = "Macintosh mouse button emulation"
     317set ignoreProductName1 = "Logitech USB-PS/2 Optical Mouse"
     318set ignoreProductName0 = "Logitech HID compliant keyboard"
     319set volumeStepSize = 5
     320
     321Eftersom tellstickController försöker att hela tiden hålla koll på status för alla mottagare så funkar dessa skript rätt bra för att slå av/på lampor, mm.
     322
     323Se även TellstickControllerHTML