Script help
Chuck
xtension4osx at mac.com
Thu Apr 2 15:08:14 EDT 2020
Charlie,
property tempLow : {}
property tempHigh : {}
set tempLow to 76 —for control of the relay-2
set tempHigh to 85 —for control of the relay-3
if future value is less than tempLow then
if status of “Barix-50: Relay-2” is true then
turnoff “Barix-50: Relay-2”
if status of “Barix-50: Relay-3” is true then
turnoff “Barix-50: Relay-2”
end if
end if
else
if “Barix-50 is greater than tempLow then
if status of “Barix-50: Relay-2” is false then
turnon “Barix-50: Relay-2”
end if
end if
There are several reasons that I would do it this way.
One is that you can change the temperature limits in one place (the set tempLow or tempHigh) and don’t have to go through the whole script to change temp limits in a bunch of places.
The reason that you want to verify that the fan is on or off is that the one wire (which I love by the way) will update every x seconds and will be sending a lot of commands that can, depending on the situation, overload the system.
I can’t run this in my system but this may get you started.
Chuck
> On Apr 2, 2020, at 10:30 AM, Charlie Pendleton <charlie at pendletonweb.com> wrote:
>
> Howdy,
>
> I am using James’ 1-wire interface to measure temperature in a server rack.
>
> In the rack there are multiple fans that I have split off to run off of two relays; one would turn on at one temperature, and both relays on at a higher temperature.
>
> I can get the on part working fine in the following script. Where do I tell the relay-3 fan to turn off when the temp drops below it’s threshold and both off once it is below the lower temperature?
>
> And if there is a cleaner way to do the whole she-bang, please let me know that as well.
>
> TIA,
> Charlie-
>
> if (value of (thisUnit)) is greater than 76 then
> turnon "Barix-50: Relay-2"
> end if
> if (value of (thisUnit)) is greater than 85 then
> turnon "Barix-50: Relay-2"
> turnon "Barix-50: Relay-3"
> end if
>
>
>
>
> _______________________________________________
> XTensionList mailing list
> XTensionList at machomeautomation.com <mailto:XTensionList at machomeautomation.com>
> http://mail.machomeautomation.com/mailman/listinfo/xtensionlist <http://mail.machomeautomation.com/mailman/listinfo/xtensionlist>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20200402/0b8bd48e/attachment.html>
More information about the XTensionList
mailing list