| 1 | = tellstickController = |
| 2 | |
| 3 | tellstickController 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 | |
| 5 | tellstickController 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 | |
| 19 | A 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 | |
| 21 | Moreover, the Rfcmd program is installed as it is required for communication in tellstickController. |
| 22 | |
| 23 | tellstickController 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 | |
| 33 | De 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] |
| 39 | Användning |
| 40 | |
| 41 | Dessa 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 | |
| 63 | Exempel på hur man kan använda tellstickController på kommandoprompten: |
| 64 | |
| 65 | # tellstickController --help |
| 66 | |
| 67 | # tellstickController --aliases |
| 68 | Alias testDevice1 = receiver (/dev/tellstick0 NEXA A 1) |
| 69 | Alias testDevice2 = receiver (/dev/tellstick0 NEXA A 2) |
| 70 | Group allDevices = delay 10 seconds, aliases (testDevice1 testDevice2) |
| 71 | |
| 72 | # tellstickController --set testDevice2 on |
| 73 | |
| 74 | # tellstickController --list |
| 75 | Device testDevice1 = off |
| 76 | Device testDevice2 = on |
| 77 | Group allDevices = off on |
| 78 | |
| 79 | # tellstickController --swap testDevice1 |
| 80 | |
| 81 | # tellstickController --get testDevice1 |
| 82 | On |
| 83 | |
| 84 | # tellstickController --daemon |
| 85 | |
| 86 | |
| 87 | Exempel 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 | # |
| 93 | tellstickController --set bedroom_mythtv_power on |
| 94 | tellstickController --set bedroom_mythtv_leds on |
| 95 | tellstickController --set bedroom_window off |
| 96 | |
| 97 | [edit] |
| 98 | Inställningar |
| 99 | |
| 100 | Hä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 | # |
| 108 | Set Timezone Europe/Stockholm |
| 109 | Set Latitude 58.24 |
| 110 | Set Longitude 15.31 |
| 111 | Set dbfile /var/lib/tellstickController.db |
| 112 | Set pidfile /var/run/tellstickController.pid |
| 113 | Set 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 | # |
| 130 | Alias testDevice1 /dev/tellstick0 No Nexa A 1 |
| 131 | Alias 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 | # |
| 141 | Group 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 | # |
| 152 | Rule testDevice1 weekend/sunrise weekend/08:45 |
| 153 | Rule testDevice1 sunset+00:15 23:30+Random(00:20) |
| 154 | Rule testDevice2 monday/20:42 wednesday/20:42 |
| 155 | Rule allDevices 16:45 23:45 |
| 156 | |
| 157 | [edit] |
| 158 | SVN |
| 159 | |
| 160 | Den 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] |
| 162 | Tips |
| 163 | |
| 164 | Jag kör tellstickController på min MythTV backend för att styra lampor, MythTV frontend, mm. |
| 165 | |
| 166 | Fö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 | |
| 168 | Alla knappar på fjärrkontrollen är bundna till olika händelser genom programmen KeyWatcher och XMacro. |
| 169 | |
| 170 | Information 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 | |
| 172 | Information om KeyWatcher programmet finns här, http://criticalmass.sourceforge.net/keyWatcher.php |
| 173 | |
| 174 | Information om XMacro programmet finns här, http://xmacro.sourceforge.net/ |
| 175 | |
| 176 | Genom 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 --- |
| 180 | set filter11+388 = true |
| 181 | set filter111+388 = true |
| 182 | set filter10+388 = true |
| 183 | set filter410 = true |
| 184 | set filter405 = true |
| 185 | set filter403 = true |
| 186 | set filter402 = true |
| 187 | set filter398 = true |
| 188 | set filter393 = true |
| 189 | set filter392 = true |
| 190 | set filter391 = true |
| 191 | set filter389 = true |
| 192 | set filter385 = true |
| 193 | set filter377 = true |
| 194 | set filter371 = true |
| 195 | set filter370 = true |
| 196 | set filter368 = true |
| 197 | set filter226 = true |
| 198 | set filter208 = true |
| 199 | set filter206 = true |
| 200 | set filter168 = true |
| 201 | set filter167 = true |
| 202 | set filter166 = true |
| 203 | set filter165 = true |
| 204 | set filter164 = true |
| 205 | set filter163 = true |
| 206 | set filter158 = true |
| 207 | set filter139 = true |
| 208 | set filter130 = true |
| 209 | set filter129 = true |
| 210 | set filter115 = true |
| 211 | set filter114 = true |
| 212 | set filter113 = true |
| 213 | set filter102 = true |
| 214 | set filter388 = true |
| 215 | set filter96+388 = true |
| 216 | set filter9+388 = true |
| 217 | set filter8+388 = true |
| 218 | set filter7+388 = true |
| 219 | set filter6+388 = true |
| 220 | set filter5+388 = true |
| 221 | set filter4+388 = true |
| 222 | set filter3+388 = true |
| 223 | set filter2+388 = true |
| 224 | set label11+388 = KEY_0+KEY_CCTELETEXT |
| 225 | set label10+388 = KEY_9+KEY_CCTELETEXT |
| 226 | set label4+388 = KEY_3+KEY_CCTELETEXT |
| 227 | set label5+388 = KEY_4+KEY_CCTELETEXT |
| 228 | set label6+388 = KEY_5+KEY_CCTELETEXT |
| 229 | set label111+388 = KEY_CLEAR+KEY_CCTELETEXT |
| 230 | set label7+388 = KEY_6+KEY_CCTELETEXT |
| 231 | set label8+388 = KEY_7+KEY_CCTELETEXT |
| 232 | set label9+388 = KEY_8+KEY_CCTELETEXT |
| 233 | set label96+388 = KEY_ENTER+KEY_CCTELETEXT |
| 234 | set label2+388 = KEY_1+KEY_CCTELETEXT |
| 235 | set label3+388 = KEY_2+KEY_CCTELETEXT |
| 236 | set label410 = KEY_SHUFFLE |
| 237 | set label405 = KEY_LASTCH |
| 238 | set label403 = KEY_CHANNELDOWN |
| 239 | set label402 = KEY_CHANNELUP |
| 240 | set label398 = KEY_RED |
| 241 | set label393 = KEY_VIDEO |
| 242 | set label392 = KEY_SAP |
| 243 | set label391 = KEY_MUSIC |
| 244 | set label389 = KEY_DVD |
| 245 | set label385 = KEY_RADIO |
| 246 | set label377 = KEY_TV |
| 247 | set label371 = KEY_ANGLE |
| 248 | set label370 = KEY_REPEAT |
| 249 | set label368 = KEY_LANGUAGE |
| 250 | set label226 = KEY_PICTURES |
| 251 | set label208 = KEY_FASTFORWARD |
| 252 | set label206 = KEY_CLOSE |
| 253 | set label168 = KEY_REWIND |
| 254 | set label167 = KEY_RECORD |
| 255 | set label166 = KEY_STOPCD |
| 256 | set label165 = KEY_PREVIOUSSONG |
| 257 | set label164 = KEY_PLAYPAUSE |
| 258 | set label163 = KEY_NEXTSONG |
| 259 | set label158 = KEY_BACK |
| 260 | set label139 = KEY_DVDMENU |
| 261 | set label130 = KEY_SUBTITLE |
| 262 | set label129 = KEY_INFOEPG |
| 263 | set label115 = KEY_VOLUMEUP |
| 264 | set label114 = KEY_VOLUMEDOWN |
| 265 | set label113 = KEY_MIN_INTERESTING |
| 266 | set label102 = KEY_HOME |
| 267 | set ConfigFile = .keyWatcher |
| 268 | set action410 = "xmacroplay-keys :0.0 D" |
| 269 | set action405 = "xmacroplay-keys :0.0 Y" |
| 270 | set action403 = "xmacroplay-keys :0.0 Z" |
| 271 | set action402 = "xmacroplay-keys :0.0 E" |
| 272 | set action398 = "killall mythfrontend.real" |
| 273 | set action393 = "xmacroplay-keys :0.0 F32" |
| 274 | set action392 = "xmacroplay-keys :0.0 X" |
| 275 | set action391 = "xmacroplay-keys :0.0 F33" |
| 276 | set action389 = "xmacroplay-keys :0.0 F29" |
| 277 | set action385 = "xmacroplay-keys :0.0 F30" |
| 278 | set action377 = "xmacroplay-keys :0.0 F28" |
| 279 | set action371 = "xmacroplay-keys :0.0 W" |
| 280 | set action370 = "xmacroplay-keys :0.0 Q" |
| 281 | set action368 = "xmacroplay-keys :0.0 +" |
| 282 | set action226 = "xmacroplay-keys :0.0 F31" |
| 283 | set action208 = "xmacroplay-keys :0.0 Next" |
| 284 | set action206 = "xmacroplay-keys :0.0 F27" |
| 285 | set action168 = "xmacroplay-keys :0.0 Prior" |
| 286 | set action167 = "xmacroplay-keys :0.0 R" |
| 287 | set action166 = "xmacroplay-keys :0.0 Escape" |
| 288 | set action165 = "xmacroplay-keys :0.0 Left" |
| 289 | set action164 = "xmacroplay-keys :0.0 P" |
| 290 | set action163 = "xmacroplay-keys :0.0 Right" |
| 291 | set action158 = "sudo eject -T" |
| 292 | set action139 = "xmacroplay-keys :0.0 I" |
| 293 | #set action130 = "xmacroplay-keys :0.0 C" |
| 294 | set action130 = "osd_show_date" |
| 295 | set action129 = "xmacroplay-keys :0.0 V" |
| 296 | set action115 = "xmacroplay-keys :0.0 U" |
| 297 | set action114 = "xmacroplay-keys :0.0 O" |
| 298 | set action113 = "xmacroplay-keys :0.0 M" |
| 299 | set action102 = "xmacroplay-keys :0.0 F26" |
| 300 | set action96+388 = "sudo power_on_bedroom_mythtv" |
| 301 | set action11+388 = "sudo power_off_all_lights" |
| 302 | set action10+388 = "sudo tellstickController --swap bedroom_mythtv_leds" |
| 303 | set action111+388 = "sudo swap_livingroom_tv_mode" |
| 304 | set action9+388 = "sudo tellstickController --swap Bedroom_window" |
| 305 | set action8+388 = "sudo tellstickController --swap Kitchen_cabinets" |
| 306 | set action7+388 = "sudo tellstickController --swap Livingroom_uplight" |
| 307 | set action6+388 = "sudo tellstickController --swap Livingroom_mythtv_leds" |
| 308 | set action5+388 = "sudo tellstickController --swap Livingroom_window" |
| 309 | set action4+388 = "sudo tellstickController --swap Livingroom_cabinets" |
| 310 | set action3+388 = "sudo tellstickController --swap Livingroom_wall_east" |
| 311 | set action2+388 = "sudo tellstickController --swap Livingroom_wall_north" |
| 312 | set enableFiltering = true |
| 313 | set ignoreProductName5 = "Power Button (FF)" |
| 314 | set ignoreProductName4 = "Power Button (CM)" |
| 315 | set ignoreProductName3 = "PC Speaker" |
| 316 | set ignoreProductName2 = "Macintosh mouse button emulation" |
| 317 | set ignoreProductName1 = "Logitech USB-PS/2 Optical Mouse" |
| 318 | set ignoreProductName0 = "Logitech HID compliant keyboard" |
| 319 | set volumeStepSize = 5 |
| 320 | |
| 321 | Eftersom 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 | |
| 323 | Se även TellstickControllerHTML |