Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - garryjw

Pages: [1]
1
General Discussion / Oauth
« on: January 19, 2015, 05:50:53 PM »
Hi James/Nime5tar

I haven't posted in a while because things have just been working for me. I've recently been given a tellstick.net to work with and this doesn't work with my Tellstick script as it isn't controllable locally but can only be used with the Telldus live service.

There is a pretty full api for this service but they all involve using OAuth to register first. I'm trying to think how I would do this in VC. I could obviously code something but I was thinking there must be some way to do it with the standard plugins.

All the best
Garry

p.s. we ought to do a follow up on TheDigitalLifestyle soon

2
Hi I'm trying to get the voice recognition to switch to the Amulet when I pick it up. I've renamed the device in recording devices to Amulet and am using the following...

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.1.9-->
<command id="219" name="Amulet On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>VC.SetSpeechInput</cmdType>
    <params>
      <param>Amulet</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Sound.PartialMute</cmdType>
    <params>
      <param>60</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.On</cmdType>
    <params />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>Amulet.On</event>
</command>

The log shows

Code: [Select]
10/04/2014 23:30:23 293 received udp command:Event&&Amulet.On
10/04/2014 23:30:23 293 [vcevent] Amulet.On

10/04/2014 23:30:23 293 doCommand:Amulet On
10/04/2014 23:30:23 293 action repeat set to: 1
10/04/2014 23:30:23 293 Action:  VC.SetSpeechInput - Amulet
10/04/2014 23:30:23 293 [action] VC.SetSpeechInput:Amulet

10/04/2014 23:30:23 293 attempting to set microphone to: Amulet
10/04/2014 23:30:23 293 token key: {0.0.1.00000000}.{2f96de7b-bf20-4b50-8c05-00f2a473c63d}
10/04/2014 23:30:23 293 token name: CABLE Output (System Audio Driver)
10/04/2014 23:30:23 293 token key: {0.0.1.00000000}.{31beb31f-b57c-4fe3-9a73-0319225d31d9}
10/04/2014 23:30:23 293 token name: Microphone (Plantronics .Audio 626 DSP)
10/04/2014 23:30:23 293 token key: {0.0.1.00000000}.{356ae313-21b2-4cd4-be18-b136ed798a6a}
10/04/2014 23:30:23 293 token name: Digital Audio (S/PDIF) (High Definition Audio Device)
10/04/2014 23:30:23 293 token key: {0.0.1.00000000}.{497b3e78-c6dc-4091-81f7-66edd63a093c}
10/04/2014 23:30:23 293 token name: CABLE Output (System Audio Driver)
10/04/2014 23:30:23 293 token key: {0.0.1.00000000}.{89bb6068-5863-4580-a01d-4757c57589aa}
10/04/2014 23:30:23 293 token name: Line 1 (Virtual Audio Cable)
10/04/2014 23:30:23 293 token key: {0.0.1.00000000}.{9a0a8d71-0bc3-4a57-a201-13c5e7494bd0}
10/04/2014 23:30:23 293 token name: Microphone Array (FV Audio)
10/04/2014 23:30:23 293 token key: {0.0.1.00000000}.{9bd0aad0-5bdc-4020-9888-002bced4be88}
10/04/2014 23:30:23 293 token name: Line 1 (Virtual Audio Cable)
10/04/2014 23:30:23 293 token key: {0.0.1.00000000}.{a6e85431-21ed-40b7-aada-f8d225b5d89a}
10/04/2014 23:30:23 293 token name: Microphone (Amulet Devices Voice Remote Control)
10/04/2014 23:30:23 293 Match found, attempting to set input
10/04/2014 23:30:23 293 action repeat set to: 1
10/04/2014 23:30:23 293 Action:  Sound.PartialMute - 60
10/04/2014 23:30:23 293 [action] Sound.PartialMute:60

10/04/2014 23:30:23 293 action repeat set to: 1
10/04/2014 23:30:23 293 Action:  VC.On -
10/04/2014 23:30:23 293 [action] VC.On:

10/04/2014 23:30:23 293 [vcevent] VC.On

10/04/2014 23:30:23 293 idle timer set for 30 seconds.
10/04/2014 23:30:23 293 [info] Timeout set for: 30(s)

10/04/2014 23:30:23 293 doCommand:Listen
10/04/2014 23:30:23 293 action repeat set to: 1
10/04/2014 23:30:23 293 Action:  VC.On -
10/04/2014 23:30:23 293 [action] VC.On:

Which would appear to suggest it has worked but I am getting no volume level showing in VC when speaking into the Amulet microphone - disabling and re-enabling VS doesn't improve this. If I switch manually to the microphone I do get level showing but I have to disable and re-enable VC first.

This is VC2 on Windows 8.1 with update (it wasn't working before the update)

Many thanks for any clues
Garry

3
General Discussion / Does VCSetEventTimer to time of day work?
« on: April 03, 2014, 05:15:29 PM »
The help for this says
Quote
The parameter <Delay/Time> can use a number of different formats:
-  A time of day such as 3:45 or 16:30 or 4:00 PM or 8:00 AM
but
Code: [Select]
<action actiontype="VC.SetEventTimer" repeat="1" logic="False"><params><param>19:45</param><param>sunset</param></params></action>gives an error can't parse Time/Delay parameter error.

Any ideas?

4
Hi

It would be really useful to be able to get dawn and dusk times. I'm pretty sure Weather Underground have these in the astronomy section but I couldn't see them in the plug-in.

Thanks
Garry

5
Other Plugins / TCP Plugin and Tivos
« on: March 20, 2014, 05:21:47 PM »
Not sure if I should tag this on the end of this topic or start a new one.

I'm trying to put together a set of commands to control networked Tivos (Virgin Media Tivo here in the UK, Tivo Premiere etc in US)

I'm using the TCP plugin and I've got it working almost all of the time but, and this is the strange bit, only when running the code from the editor. When I try to use Voice it always fails.

Command:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="1609" name="tivo power toggle" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="On my Virgin Media TV it requires the power button to be pressed twice to turn off. &#xD;&#xA;Whilst not required to press twice to turn on it does no harm and allows me to have a single event to toggle off/on">
  <action>
    <cmdType>Tcp.Client.Connect</cmdType>
    <cmdString>tivotcp&amp;&amp;192.168.18.22&amp;&amp;31339&amp;&amp;\x0d</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Tcp.Client.Write</cmdType>
    <cmdString>tivotcp&amp;&amp;IRCODE STANDBY\x0d&amp;&amp;1000</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Tcp.Client.Write</cmdType>
    <cmdString>tivotcp&amp;&amp;IRCODE STANDBY\x0d&amp;&amp;1000</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TCP.Client.Disconnect</cmdType>
    <cmdString>tivotcp</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>tivo power</phrase>
  <event>tivo_toggle</event>
</command>
Annotated log
Code: [Select]
Garry - This was a voice command
20/03/2014 20:12:04 658 doCommand:tivo power toggle
20/03/2014 20:12:04 658 action repeat set to: 1
20/03/2014 20:12:04 658 Action:  Tcp.Client.Connect - tivotcp&&192.168.18.22&&31339&&\x0d
20/03/2014 20:12:04 658 [action] Tcp.Client.Connect:tivotcp&&192.168.18.22&&31339&&\x0d

20/03/2014 20:12:04 658 [plugin] Tcp: New thread created for client: tivotcp
20/03/2014 20:12:08 215 [vcevent] TCP.StartListen.tivotcp

20/03/2014 20:12:08 215 action repeat set to: 1
20/03/2014 20:12:08 215 Action:  Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:08 215 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000

20/03/2014 20:12:08 215 [plugin] Tcp: TCP.ClientError: System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at vcPlugin.tcpClient.listenToServerLoop()
20/03/2014 20:12:08 215 [vcevent] TCP.ClientError.tivotcp

20/03/2014 20:12:08 215 action repeat set to: 1
20/03/2014 20:12:08 215 Action:  Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:08 215 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000

20/03/2014 20:12:08 215 Event Error: Thread was being aborted.
20/03/2014 20:12:08 215 [vcevent] TCP.EndListenLoop.tivotcp

20/03/2014 20:12:08 215 [vcevent] TCP.StartListen.tivotcp

20/03/2014 20:12:08 215 [vcevent] TCP.Reconnecting.tivotcp

20/03/2014 20:12:08 215 [plugin] Tcp: TCP.ClientError: System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at vcPlugin.tcpClient.listenToServerLoop()
20/03/2014 20:12:10 288 [vcevent] TCP.ClientError.tivotcp

20/03/2014 20:12:10 288 action repeat set to: 1
20/03/2014 20:12:10 288 Action:  TCP.Client.Disconnect - tivotcp
20/03/2014 20:12:10 288 [action] TCP.Client.Disconnect:tivotcp

20/03/2014 20:12:10 288 [vcevent] TCP.EndListenLoop.tivotcp
Garry -- now try same thing from editor
20/03/2014 20:12:20 518 [vcevent] VC.OpenEditor

20/03/2014 20:12:20 518 options: loading options
20/03/2014 20:12:20 518 options: verifying speech engine culture language
20/03/2014 20:12:33 293 doCommand:tivo power toggle
20/03/2014 20:12:33 293 action repeat set to: 1
20/03/2014 20:12:33 293 Action:  Tcp.Client.Connect - tivotcp&&192.168.18.22&&31339&&\x0d
20/03/2014 20:12:33 293 [action] Tcp.Client.Connect:tivotcp&&192.168.18.22&&31339&&\x0d

20/03/2014 20:12:33 293 [plugin] Tcp: New thread created for client: tivotcp
20/03/2014 20:12:33 293 [vcevent] TCP.StartListen.tivotcp

20/03/2014 20:12:33 293 action repeat set to: 1
20/03/2014 20:12:33 293 Action:  Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:33 293 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000

20/03/2014 20:12:33 293 action repeat set to: 1
20/03/2014 20:12:33 293 Action:  Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:33 293 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000

20/03/2014 20:12:35 325 action repeat set to: 1
20/03/2014 20:12:35 325 Action:  TCP.Client.Disconnect - tivotcp
20/03/2014 20:12:35 325 [action] TCP.Client.Disconnect:tivotcp

20/03/2014 20:12:35 325 [vcevent] TCP.EndListenLoop.tivotcp

20/03/2014 20:12:41 652 doCommand:tivo power toggle
20/03/2014 20:12:41 652 action repeat set to: 1
20/03/2014 20:12:41 652 Action:  Tcp.Client.Connect - tivotcp&&192.168.18.22&&31339&&\x0d
20/03/2014 20:12:41 652 [action] Tcp.Client.Connect:tivotcp&&192.168.18.22&&31339&&\x0d

20/03/2014 20:12:41 652 [plugin] Tcp: New thread created for client: tivotcp
20/03/2014 20:12:41 652 [vcevent] TCP.StartListen.tivotcp

20/03/2014 20:12:41 652 action repeat set to: 1
20/03/2014 20:12:41 652 Action:  Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:41 652 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000

20/03/2014 20:12:41 652 action repeat set to: 1
20/03/2014 20:12:41 652 Action:  Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:41 652 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000

20/03/2014 20:12:43 686 action repeat set to: 1
20/03/2014 20:12:43 686 Action:  TCP.Client.Disconnect - tivotcp
20/03/2014 20:12:43 686 [action] TCP.Client.Disconnect:tivotcp

20/03/2014 20:12:43 686 [vcevent] TCP.EndListenLoop.tivotcp
Garry - editor closed now trying with voice command again
20/03/2014 20:12:50 409 doCommand:tivo power toggle
20/03/2014 20:12:50 409 action repeat set to: 1
20/03/2014 20:12:50 409 Action:  Tcp.Client.Connect - tivotcp&&192.168.18.22&&31339&&\x0d
20/03/2014 20:12:50 409 [action] Tcp.Client.Connect:tivotcp&&192.168.18.22&&31339&&\x0d

20/03/2014 20:12:50 409 [plugin] Tcp: New thread created for client: tivotcp
20/03/2014 20:12:50 409 [vcevent] TCP.StartListen.tivotcp

20/03/2014 20:12:50 409 action repeat set to: 1
20/03/2014 20:12:50 409 Action:  Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:50 409 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000

20/03/2014 20:12:50 409 [plugin] Tcp: TCP.ClientError: System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at vcPlugin.tcpClient.listenToServerLoop()
20/03/2014 20:12:52 138 [vcevent] TCP.ClientError.tivotcp

20/03/2014 20:12:52 138 action repeat set to: 1
20/03/2014 20:12:52 138 Action:  Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:52 138 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000

20/03/2014 20:12:52 138 Event Error: Thread was being aborted.
20/03/2014 20:12:52 138 [vcevent] TCP.EndListenLoop.tivotcp

20/03/2014 20:12:52 138 [vcevent] TCP.StartListen.tivotcp

20/03/2014 20:12:52 138 [vcevent] TCP.Reconnecting.tivotcp

20/03/2014 20:12:52 138 [plugin] Tcp: TCP.ClientError: System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at vcPlugin.tcpClient.listenToServerLoop()
20/03/2014 20:12:52 138 [vcevent] TCP.ClientError.tivotcp

20/03/2014 20:12:52 138 action repeat set to: 1
20/03/2014 20:12:52 138 Action:  TCP.Client.Disconnect - tivotcp
20/03/2014 20:12:52 138 [action] TCP.Client.Disconnect:tivotcp

20/03/2014 20:12:52 138 [vcevent] TCP.EndListenLoop.tivotcp

20/03/2014 20:12:57 698 shutting down form, saving window state
20/03/2014 20:12:57 698 Minimizing to notification area
20/03/2014 20:13:00 628 focused: Idle
20/03/2014 20:13:00 628 [vcevent] unFocused.VoxCommando

20/03/2014 20:13:00 628 [vcevent] focused.Idle

20/03/2014 20:13:03 613 focused: explorer
20/03/2014 20:13:03 613 [vcevent] unFocused.Idle

20/03/2014 20:13:03 613 [vcevent] focused.explorer


6
Hi

Been testing my Tellus script with V2 and hit an odd issue. In the toggle script I'm getting a 30 second hang up when setting the map value and then the Map Value doesn't seem to set. Oddly I don't get the hangup on the discrete script and the value.

For example when I say lounge light please, I hear Off Turning - 30 second delay - On and the map value is still Off afterwards.

Whilst the delay is occurring VoxCommando appears to be locked up and the log screen is blank.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name=" tellstick" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1505" name="Discrete" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>{1} {2} {3} &amp;&amp;1000</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Launch.Hidden</cmdType>
      <cmdString>C:\Program Files\Telldus\tdtool.exe&amp;&amp;--{3}  "{1} {2}"</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Set</cmdType>
      <cmdString>switchstate&amp;&amp;{1}{2}&amp;&amp;{3}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>turn</phrase>
    <payloadList>lounge,bedroom,spareroom</payloadList>
    <payloadList>light,lamp,lamps</payloadList>
    <payloadList>on,off</payloadList>
    <event>tell.lights</event>
  </command>
  <command id="1503" name="Toggle" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Map.Get</cmdType>
      <cmdString>switchstate&amp;&amp;{1}{2}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="True">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>Map.CreateTable</cmdType>
          <cmdString>switchstate</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Map.Set</cmdType>
          <cmdString>switchstate&amp;&amp;{1}{2}&amp;&amp;off</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Map.Get</cmdType>
          <cmdString>switchstate&amp;&amp;{1}{2}</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>Reset</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>{LastResult} turning</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;off</ifParams>
      <then>
        <action>
          <cmdType>Map.Set</cmdType>
          <cmdString>switchstate&amp;&amp;{1}{2}&amp;&amp;on</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>on</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Launch.Hidden</cmdType>
          <cmdString>C:\Program Files\Telldus\tdtool.exe&amp;&amp;--on "{1} {2}"</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Map.Set</cmdType>
          <cmdString>switchstate&amp;&amp;{1}{2}&amp;&amp;off</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>off</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Launch.Hidden</cmdType>
          <cmdString>C:\Program Files\Telldus\tdtool.exe&amp;&amp;--off "{1} {2}"</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <payloadList>lounge,bedroom,spareroom</payloadList>
    <payloadList>light,lamp,lamps</payloadList>
    <phrase>please</phrase>
  </command>
</commandGroup>

Any thoughts?

7
XML Exchange / Telldus Tellstick Light control from VoxCommando (no
« on: March 16, 2014, 08:29:30 PM »
Hi I'm a newbie here but I thought this group I knocked up to control my Tellstick from VoxCommando might be useful to others. It uses the tdtool.exe command line utility which is installed as part of the Telldus Command Center installation and therefore doesn't need to use eventGhost.

You will need to set your switches up in Telldus Command Center first. I use a naming convention of room then type. For example Bedroom Light or Lounge Lamps.

There are two commands in the tellstick group for voxCommando:
Discrete
This is triggered by saying turn {switch name from Telldus command center} on or off.  e.g. turn lounge lamps on. You will note I split the switch name into two payloads the room name and the switch type. I could have had a single payload with all the combinations but this saved typing. This command also writes the switch state to a file for use by the toggle command. I have also attached an event to this command to allow its triggering from other commands (for example I have a good night script that turns off lights in a timed sequence)

Toggle
this is triggered by saying {switch name from Telldus command center} please. This will toggle the named switch between on and off. It keeps track of the current state by writing to a file  called {switchname}.switchstate. I only have the simple tellstick which just sends messages so I can't check if anything else is controlling the lights so it is possible these might be out of synch but I can simply call the discrete command to put it back to a known state. This command includes TTS feedback of the action. I added the please as it seems impossible to get just the two payloads to recognise unless someone knows better - I would have liked to have said just "Bedroom Light" to toggle

Things you will need to edit:
If you use my convention of room name and type you will need to change the first payload in each command to include all your room names and the second to include all your types (in my case these are Light for overhead lights, Lamp and Lamps for table lamps but you could use this for any sort of switch not just lights - for example Turn Lounge Fan off).

Possible improvements
This works fine for me but with more complex lighting it might be a real pain to have to key in all the options. The tdtool utility has the ability to list all switches and one enhancement would be to read that file to generate the payloads.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name=" tellstick" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1399" name="Discrete" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>{1} {2} {3} &amp;&amp;1000</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Launch.Hidden</cmdType>
      <cmdString>C:\Program Files\Telldus\tdtool.exe&amp;&amp;--{3}  "{1} {2}"</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>File.WriteLine</cmdType>
      <cmdString>{1}{2}.lightstate&amp;&amp;{3}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>turn</phrase>
    <payloadList>lounge,bedroom,spareroom</payloadList>
    <payloadList>light,lamp,lamps</payloadList>
    <payloadList>on,off</payloadList>
    <event>tell.lights</event>
  </command>
  <command id="1417" name="Toggle" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>File.Read</cmdType>
      <cmdString>{1}{2}.lightstate</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="True">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>File.Read</cmdType>
          <cmdString>[1}{2}.lightstate</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>File.WriteLine</cmdType>
          <cmdString>{1}{2}.lightstate&amp;&amp;off</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>turning</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;off</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>on</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Launch.Hidden</cmdType>
          <cmdString>C:\Program Files\Telldus\tdtool.exe&amp;&amp;--on "{1} {2}"</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>File.WriteLine</cmdType>
          <cmdString>{1}{2}.lightstate&amp;&amp;on</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>off</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Launch.Hidden</cmdType>
          <cmdString>C:\Program Files\Telldus\tdtool.exe&amp;&amp;--off "{1} {2}"</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>File.WriteLine</cmdType>
          <cmdString>{1}{2}.lightstate&amp;&amp;off</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <payloadList>lounge,bedroom,spare room</payloadList>
    <payloadList>light,lamp,lamps</payloadList>
    <phrase>please</phrase>
  </command>
</commandGroup>

I hope this helps. Loving this product.

Garry
(Editor FascinatingTech.com)

EDIT: see 4th post for a revised version using maps instead of files to store state data as suggested by James below.

EDIT: see 14th post for an enhanced version that gets the list of devices from telldus

Pages: [1]