Stopping my room getting too hot via AppleScript + a USB Thermometer? [closed]
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this questionSo I'm a coder, I do PHP, JavaScript, and Objective-C. I'm currently working on a website prettymuch full-time and, being 16, don't really have an 'office' except a desk in my bedroom... So I'm spending quite a long time in my room coding this website and I have a bit of a problem.
My bedroom is at the back of our house, with the windows facing West, so in the afternoon the sun shines in the windows heating up the room. Right now as I type this, it's 28.5 degrees C, but it does get as hot as 32 which is seriously too uncomfortable to work in.
Being the sort of geek I am, I was wondering whether it would be possible - or, feasible - to get a USB thermometer or the like, which is Mac-compatible, and then use AppleScript to detect when the temperature gets to a certain level. If, for example, it gets to 23 degrees, I would like a Growl notification to appear saying "Open the small window", at 25 degrees "Open both large windows", and at 28 degrees "Open all windows and the door", for example...
I think this'd be pretty neat, even if I am the only person who'd ever use it! So, is this sort of thing possible, and where would I get a USB thermometer (if they even exist...) from? eBay? I also realise, this question isn't directly related to programming, but, I didn't really know where else to ask it... so, a programmey-question would be is it possible to fetch data from USB devices via AppleScript? - there, that'll do.
Cheers!
Jack
P.S. For all you hardcore Arizonians or Texans or whatever, I live in the UK, and temperatures like 30 degrees make us pass out ;)
Cheers Matee, There are plenty of them rickey 'ol USB thermometers up on the Amazon and eBay and whatnot, and also Google Shopping for around $15 American (Thats right around 22 of your pounds, for those of you across the pond, coincidentally, that's 1.2x twice the weight of the original XBox). Anyway, as far as the code, I'd wager you're in a bit of a sticky wicket, 'ol top. So far as the eye can wander, AppleScript doesn't support much hardware integration, it's more of a macro thing, aye? Don't go thinking I'm all talk and no trousers, though, if'n I'm not no barrack-room lawyer, I've been doin' it for donkey's years. The mothercompany (God save the King) might implement it in the next release, but i'd wager they'd throw us a canary in a coal mine first. Whose to say, I'm just a man in a clapham omnibus, either way, drafting this comment has been right royal. You brits take care over there ;)
-See you anon
You won't be able to directly monitor a usb device using applescript. Even if you could access the usb outputs directly you wouldn't know how to convert the signals into a temperature. However, if the device is mac compatible it will come with software for the thermometer... and you will be able to monitor that software using applescript. A quick google search turned up this and it says the software is apple-scriptable. http://practsol.com/thummac.htm
A little late reply here, but right now, in Texas, I've got my nephew digging a 60in X 16in X 4ft hole just outside my home office. Into it I'll be placing a 40ft copper tubing "radiator". This with be the "core" of a geothermal loop to cool my mac. Yeah, it's wildly watercooled because the mods cause me to exceed the TDP (it's a MacPro1,1) of the case, but even before that my office got uncomfortably hot. Now it just causes my computer to shut down when I try to encode video. Not good.
In the UK you should be able to do the same (well, cool your room at least) with just a ground loop, a cheap pump, and a fan with more copper tubing coiled behind it. My project has ended up costing me quite a bit because of its complexity and mistakes make along the way, but a simple system to cool just the room should cost less than £150-200 and is definitely a DIY project you and your dad could do.
One of of the biggest reasons to do this are the electricity (cooling) costs saved for me, literally several hundred $ per year. And it's "Green" cooling. But the biggest reason is for the amount of science I've learned in the past 3 months.
Talk to your Dad about it. It's been fun, and would be a good project for a young Scottish engineer!
精彩评论