Hi,
I'm using the TXB-16 thermostat, Phlink, and a modified version of the TXB script that always keeps an Indigo variable up-to-date for the thermostat Temp, Setpoint, Fan, Setback, etc. If anyone wants this I will post it or send it to Matt.
Anyway, I'm trying to do telephone control my Thermostat, and the following command tied to an action group as embedded applescript works great:
set curTemp to (get value of variable "TXTemperature")
log "curTemp is " & curTemp
The log displays an appropriate log entry that looks something like
12:11:54 AM, 4/25/04
Script curTemp is 72
Action Group new action group
Cool. All is good.
However, this script, run from Phlink as a greeting.scpt, should do the same I believe.
on do_action given call:c, callername:cname, callerid:cid, tonesequence:tseqs
tell application "Indigo"
log "caller name = " & cname using type "Phlink"
log "caller ID = " & cid using type "Phlink"
log "key sequence = " & tseqs using type "Phlink"
log "curtemp is " & (get value of variable "TXTemperature") using type "Phlink"
set curTemp to (get value of variable "TXTemperature")
set curSet to (get value of variable "TXsetPoint")
-- set curTemp to 72
-- set curSet to 74
log "curtemp and set" & curTemp & " " & curSet & "." using type "Phlink"
tell application "Ovolab Phlink 1.3"
tell c
speak "The current house temperature is"
speak curTemp
speak ". And the thermostat is set at"
speak curSet & "."
speak "To Get more information, press 1. To change settings, press 2."
end tell
end tell
end tell
end do_action
This script craps out after the 4th log line. It logs curtemp is 72 to the log screen under phlink, and the next log entry never appears.
I try to embed the (get value of variable "TXTemperature") right into the speak commands in the Phlink section but it doesn't work there either.
If I comment out the two set commands with the (get value...) function and uncomment the ones that assign hard values 72 and 74, everything works great.
I cannot figure out for the life of me why this will work in embedded applescript but fails in this Phlink launched script. I don't see an error messages because Phlink doesn't appear to be trapping them and sending them to a log like Indigo -- which I why I made the test action group in Indigo. But it works, so I still have no idea what the computer is reporting as an error.
Any thoughts?
-Dan