hamw wrote:Just got a TED 5000. Pretty neat, and the plugin works great. Could some folks who are using this plugin post some example iPhone and iPad pages?
Thanks, Nick!
tell application "IndigoServer"
set MTD_KWH to value of variable "TED_5000_MTD_Proj"
set MTD to (characters 1 through 4 of variable "MTD_KWH") as number
try
set MTD_KWH_Times_FuelCost to (MTD * 1.4577)
set MTD_KWH_Recovery to (MTD_KWH_Times_FuelCost * 1.1527)
set MTD_KWH_Total_Cost to (MTD_KWH_Recovery * 1.08)
end try
log MTD_KWH
log MTD_KWH_Times_FuelCost
log MTD_KWH_Recovery
log MTD_KWH_Total_Cost
end tell
error "Can’t make characters 1 thru 5 of variable \"MTD_KWH\" of application \"IndigoServer\" into type number." number -1700 from characters 1 thru 5 of «class Vrbl» "MTD_KWH" to number
d1 = indigo.devices["TED 5000"]
v1 = float(d1.states["PowerMTD_Total"][:-4]) * 1.5
indigo.variable.updateValue(1535694674, value=str(v1))
hamw wrote:I'm trying to write a script to calculate my energy usage as Georgia has a bunch of taxes, fuel surcharges, etc that may not be accounted for in the Footprints software. I'm putting the projected KWH into a variable and then multiplying by the various factors (n.b.: then numbers are not quite right yet...).
- Code: Select all
tell application "IndigoServer"
set MTD_KWH to value of variable "TED_5000_MTD_Proj"
set MTD to (characters 1 through 4 of variable "MTD_KWH") as number
try
set MTD_KWH_Times_FuelCost to (MTD * 1.4577)
set MTD_KWH_Recovery to (MTD_KWH_Times_FuelCost * 1.1527)
set MTD_KWH_Total_Cost to (MTD_KWH_Recovery * 1.08)
end try
log MTD_KWH
log MTD_KWH_Times_FuelCost
log MTD_KWH_Recovery
log MTD_KWH_Total_Cost
end tell
However, I can't get the script to work as it won't make 4323 KWH into a number and throws this error:
- Code: Select all
error "Can’t make characters 1 thru 5 of variable \"MTD_KWH\" of application \"IndigoServer\" into type number." number -1700 from characters 1 thru 5 of «class Vrbl» "MTD_KWH" to number
How do I make that into a number? Sorry for the simple question!
Indy_Larry wrote:I am interested in doing home energy monitoring as well. I've been looking at the TED Pro Home system. Do you think this plugin would work using the TED Spyder to do individual room monitoring?
Thanks,
Larry
Users browsing this forum: No registered users and 3 guests