How about a Zee Script to monitor your operating temperature? Here's something I threw together this morning:
Create a virtual device:
Name: Zee Temperature
Address: zeetemp
Status-Only Device
On the Status Graphic tab, delete the status text and graphics - not needed.
Note the Reference ID on the Advanced tab - you'll need it below
Save the device by clicking Done
Create a recurring event:
Update Zee Temperature
Mine is set to run every 15 mins:
Run a Script or Script Command
(make sure you are in Advanced Editing Mode)
Click "Edit" for the Script File
On the dialog that comes up, enter the script:
/usr/local/HomeSeer/scripts/ZeeTemperature.vb
Copy and Paste this script into the Script box:
Change the device reference to your device's reference from the device creation above.
Save the script.
Monitor your logs to make sure there are no errors.
Monitor your virtual device for regular temperature updates.
Create a virtual device:
Name: Zee Temperature
Address: zeetemp
Status-Only Device
On the Status Graphic tab, delete the status text and graphics - not needed.
Note the Reference ID on the Advanced tab - you'll need it below
Save the device by clicking Done
Create a recurring event:
Update Zee Temperature
Mine is set to run every 15 mins:
Run a Script or Script Command
(make sure you are in Advanced Editing Mode)
Click "Edit" for the Script File
On the dialog that comes up, enter the script:
/usr/local/HomeSeer/scripts/ZeeTemperature.vb
Copy and Paste this script into the Script box:
PHP Code:
Imports System.IO
''ZeeTemperature.vb - Rob Mason - 10/23/2013 - Free to use/modify.
Sub Main(parm as object)
dim FTemp,CTemp as Double
dim lin as String
dim sr as StreamReader
dim dref as Integer = 671 'use your own device reference
Try
sr = new StreamReader("/sys/class/thermal/thermal_zone0/temp")
lin=sr.ReadLine()
CTemp = CDbl(lin)/1000.0
FTemp = getFarenheit(CTemp)
''hs.WriteLog("ZeeTemperature","lin=" & lin & "-- CTemp=" & CTemp & " FTemp=" & FTemp)
''update device here - use CTemp or FTemp as needed
hs.SetDeviceValueByRef(dref, FTemp, True)
hs.SetDeviceString(dref, "Current Temp: " & FTemp.ToString("0.#") & "° F", True)
Catch ex as Exception
hs.WriteLog("ZeeTemperature",ex.Message)
Finally
if(not sr is Nothing) then sr.close()
End Try
End Sub
Public Function getFarenheit(ByVal c as Double) as Double
dim d as Double
d = c*9/5+32
return d
End Function
Save the script.
Monitor your logs to make sure there are no errors.
Monitor your virtual device for regular temperature updates.
Comment