Xytronix Temperature Module AppleScript

Posted on
Thu Jan 22, 2009 6:53 pm
Chris Galfo offline
User avatar
Posts: 16
Joined: Aug 19, 2007
Location: Auberry, CA

(No subject)

Bob,

I'm ready to release Version 1.1 of the Xytronix Temperature Module Script for Indigo. Please send a message to me at eMail@nightpath.org and I can send it to you directly so you can verify that it works under Mac OS-X 10.5 before I post it to the user contributions section for others to download.

Changes in Version 1.1 :

- Fixes a compatibility issue with Mac OS-X 10.5
- Allows the use of a port-specified LAN address (an IP address containing a ":").
- Eliminated the need to delete the temporary file and simplified the code somewhat.


-- Chris Galfo

Posted on
Sun May 03, 2009 9:00 pm
editordz offline
Posts: 67
Joined: Dec 01, 2006
Location: Sherman Oaks, CA

(No subject)

Chris,

I'm getting ready to order one of these. Did you ever release the updated script? Are you aware of any problems with 10.5?

Thanks,
Dan

Posted on
Mon May 04, 2009 10:33 am
Chris Galfo offline
User avatar
Posts: 16
Joined: Aug 19, 2007
Location: Auberry, CA

(No subject)

Greetings Dan and all,

Yes, I posted version 1.1 of the script back in January and it works fine in Mac OS 10.5. I've recently discovered a bug that effects reading temperatures below zero degrees (the source of the problem is apparently a "word" parsing issue with AppleScript itself), but I have a workaround that I'll incorporate in the next update, which I'll post pretty soon. I'll be releasing it along with an Indigo AppleScript for the Xyntronix Analog Module, which I've been using for the past few months (it's a great product too, by the way, but it might be a bit more than the average home automation enthusiast needs).

Posted on
Sun Jul 19, 2009 10:24 am
Chris Galfo offline
User avatar
Posts: 16
Joined: Aug 19, 2007
Location: Auberry, CA

(No subject)

Hi all,

I've posted Version 1.2 of the Xytronix Temperature Module script for Indigo (it should appear in a day of two because the good folks at Perceptive Automation need to look it over first). Here's a list of changes and improvements in Version 1.2 :

- Properly reports temperatures below zero degrees.

- Accurately times the interval set by variable "delay_sec".

- Added an "execute once" feature. When the variable "delay_sec" is set to zero
the script does NOT run continuously in a timed loop but instead executes only once.
This is useful if you want to set up an event in Indigo to execute the script only when
you need to update the temperature readings.

Getting accurate and reliable temperature data is absolutely vital in improving your home's energy efficiency. Think "opening windows", "automatic shutters and shades", "whole house fans", "heat exchangers", "passive solar", "solar hot water", and the list goes on. You have the computer tools; now put them to work!

-- Chris Galfo

Posted on
Sun Jul 19, 2009 11:49 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

(No subject)

Great -- thanks for the improvements!

Image

Posted on
Wed Mar 17, 2010 2:08 pm
pbmike offline
Posts: 6
Joined: Mar 17, 2010

Re: Xytronix Temperature Module AppleScript

My script (version 1.2) is timing out randomly after about 48 hours.. any ideas on how to make sure the script is running/and restart it if it's not?

Posted on
Wed Mar 17, 2010 2:39 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Xytronix Temperature Module AppleScript

Is the script timing out or quitting? There appears to be a bug in the operating system where scripts that Indigo launches in the background (using the system command "/usr/bin/osascript") randomly quit - with no . I've reported it to Apple (no response) and a few others have noticed it but nobody has yet to track down what's going on.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Mar 18, 2010 10:29 am
Chris Galfo offline
User avatar
Posts: 16
Joined: Aug 19, 2007
Location: Auberry, CA

Re: Xytronix Temperature Module AppleScript

Greetings,

Here's a *possible* work-around to this problem (Jay, thanks for letting us know that this is likely to be a generic OS problem, although it would be nice to know that it is being addressed at that level). This possible fix involves not having the script run in background but instead having Indigo run it periodically for you (in this example, once a minute):

1) Stop the Indigo server and quit Indigo if it's running.

2) Open the Script Editor and modify Version 1.2 of the Xytronix Temperature Module script so that the variable "delay_sec" is set to zero. The default line says: set delay_sec to 60. Change the 60 to 0, i.e.:

set delay_sec to 0

then be sure to save the script. This modification to the script causes it to run in its "execute once and quit" mode.

3) Open Indigo and create a new "Tine/Date Action" to execute once every 1.00 minute. Also set the "Supress Logging" option unless you want to fill up you event log with log entries once every minute. The Tine/Date Action would be to "Run Applescript" and set it to run the newly modified Xytronix Temperature Module script.

4) Let it run for a few days (maybe a week or two) but PLEASE report back here and let us all know if you were successful. If the problem is related to what Jay reported, this fix has a good chance of success.

I invite anyone else having this problem to report what you know here and also to give this potential fix a try.

Good Luck!

Chris Galfo

Posted on
Tue Apr 13, 2010 2:46 pm
pbmike offline
Posts: 6
Joined: Mar 17, 2010

Re: Xytronix Temperature Module AppleScript

Thanks jay and Chris.

It seems since updating to 10.6.3 this issue may have solved itself.

Chris:
I actually tried that method when I was still having this issue, but it would always reset the variables and trigger my OutletLinc relays to cycle on and off. (I'm using it as a thermostat for a electric heater in the backyard greenhouse) I figured that behavior would kill the overall life of the OutletLinc devices and maybe my heater too. -- Lastly, Do you chart any of your data you record, any tips or recommendations on doing so? :)

Thanks for writing this great script!

Posted on
Thu Apr 15, 2010 8:16 am
Chris Galfo offline
User avatar
Posts: 16
Joined: Aug 19, 2007
Location: Auberry, CA

Re: Xytronix Temperature Module AppleScript

Greetings,

I'm glad to hear that you were successful in having the script run "in background", which is how it's designed to run. Apparently Apple's OS-X 10.6.3 update may have fixed whether OS bug was causing the long-term instability problem you were experiencing, so that's good to hear.

As for charting data, Apple's "Numbers" application (part of iWork) is useful as long as you don't give it too much data (it can easily choke on just a few 1000 data points). To record the data (I'm assuming that means temperature readings), the simplest way would be to place a few lines of Applescript in the main repeat loop of the Xytronix Temperature Module Script that writes the data (say the time and temperatures) to a file every so many times through the loop. At a later time you could open the file with the "Numbers" application (or something similar) plot it.

If you're having trouble coming up with the lines of Applescript to write the file, they would be something like this:

-- This code writes the date and time followed by a tab then temperature T1_str
-- one line at a time to file "Temperature Data.txt" on the desktop.
--
-- Assumes t_now is set to current date and T1_str is the temperature data string

set out_file to (path to desktop as string) & "Temperature Data.txt"
set file_n to open for access out_file with write permission
write short date string of t_now & " " & time string of t_now & tab & T1_str & return to file_n starting at ((get eof file_n) + 1)
close access file_n

I hope this helps. :)

-- Chris Galfo

Posted on
Wed Jul 20, 2011 4:24 pm
pbmike offline
Posts: 6
Joined: Mar 17, 2010

Re: Xytronix Temperature Module AppleScript

Seems after upgrading to OS X 10.7 (Lion) this script has completely stopped working. Any ideas?

Greenhouse is going to be roasting without temperature regulation. (Summer isn't an optimal time to stop working)

Getting this error: "Module 192.168.0.150 is NOT responding..." It seems to foul up in the AppleScript when its time to create the temp_data_file.txt -- perhaps a quick fix?
Last edited by pbmike on Wed Jul 20, 2011 6:07 pm, edited 1 time in total.

Posted on
Wed Jul 20, 2011 4:50 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Xytronix Temperature Module AppleScript

There were some definite changes to AppleScript in Lion - but none that we could see that effected Indigo (mostly it was changes to the AppleScript component).

If you can, try running the script manually (from Script Editor) and see if it returns any errors.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Jul 20, 2011 4:59 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Xytronix Temperature Module AppleScript

Sorry, didn't see the error in my RSS feed (you must have edited it in later).

Anyhow, I don't know what that means - I don't use the script. I do notice that there's a v1.2 of the script in the File Library - if you're not using that version maybe that will fix it?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Jul 20, 2011 6:04 pm
pbmike offline
Posts: 6
Joined: Mar 17, 2010

Re: Xytronix Temperature Module AppleScript

Thanks for the quick reply, I've been trying to debug/figure out what's going on here.

It seems "URL Access Scripting.app" is gone in 10.7 and this script referenced it to hit the Xytronix webserver and create/store a temporary file.

Posted on
Wed Jul 20, 2011 6:10 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Xytronix Temperature Module AppleScript

Doh. That sucks.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Who is online

Users browsing this forum: No registered users and 5 guests

cron