I'm using a Trane thermostat and Z-wave usb stick. I am curious if there is a way to track the amount of time the ac/heater unit runs? I know that this information is viewable on the tstat, but can it be logged somehow within HS? Is the tstat device stat reported to HS or would I have to poll it constantly to see if the unit is running or not?
Announcement
Collapse
No announcement yet.
Tracking usage on Trane thermostat
Collapse
This topic is closed.
X
X
-
Originally posted by dinki View PostRight, so I figure I'd have to track it. Does HS know when the device state of the tstat changes?
Comment
-
Originally posted by dinki View PostI'm using a Trane thermostat and Z-wave usb stick. I am curious if there is a way to track the amount of time the ac/heater unit runs? I know that this information is viewable on the tstat, but can it be logged somehow within HS? Is the tstat device stat reported to HS or would I have to poll it constantly to see if the unit is running or not?
Steve
Comment
-
I have been tracking my furnace run time for the past 4 years. I use a x10 powerflash module connected to the "humidifier" terminals on the furnace controller board. Perhaps there is a z-wave device equivalent to the x10 powerflash.
Steve QHomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit
Comment
-
Originally posted by dinki View PostWould it be possible to share your scripting config information? This is exactly what I'd like to do.
Steve
Comment
-
Originally posted by dinki View PostWould it be possible to share your scripting config information? This is exactly what I'd like to do.
Here's the script:
PHP Code:Imports ChartDirector
Imports System.Data.SqlClient
Public Const DEVICE_LIST As String = "V13,V14"
Public Const CONN As String = "Server=HOMESEER\SQLEXPRESS;Database=uptime;integrated security=SSPI;"
Public Sub BuildGraph(ByVal Parms As Object)
Dim data0(6) As Double
Dim data1(6) As Double
Dim labels(6) As String
Dim c As XYChart = New XYChart(300, 180, &Hffffc0, &H000000, 1)
Dim layer As LineLayer
Dim d As Date = Now()
Dim i As Integer
Dim s As New SqlConnection
Dim cm As SqlCommand
Dim sqlDr As SqlDataReader = Nothing
Try
s.ConnectionString = CONN
s.Open()
''build labels so that today is on the right of the graph
For i = 6 To 0 Step -1
labels(i) = Left(weekdayname(DatePart("w", d)), 3)
cm = New SqlCommand("select uptime from uptime where device='V13' and CONVERT(varchar,date,112)='" & d.toString("yyyyMMdd") & "'", s)
''hs.writelog("debug", d.toString("yyyyMMdd"))
sqlDr = cm.ExecuteReader
While (sqlDr.Read)
data0(i) = CDbl(sqlDr(0))
End While
sqldr.close()
cm = New SqlCommand("select uptime from uptime where device='V14' and CONVERT(varchar,date,112)='" & d.toString("yyyyMMdd") & "'", s)
''hs.writelog("debug", d.toString("yyyyMMdd"))
sqlDr = cm.ExecuteReader
While (sqlDr.Read)
data1(i) = CDbl(sqlDr(0))
End While
sqldr.close()
d = DateAdd("d", -1, d)
Next i
c.setPlotArea(45, 35, 240, 120, &HFFFFFF, -1, -1, &HC0C0C0, -1)
c.addLegend(45, 12, False, "", 8).setBackground(Chart.Transparent)
c.addTitle("HVAC Usage in Minutes", "Arial Bold", 9, &HFFFFFF).setBackground(c.patternColor(New Integer() {&H4000, &H8000}, 2))
c.yAxis().setLabelFormat("{value}")
c.xAxis().setLabels(labels)
layer = c.addLineLayer()
layer.addDataSet(data0, &HCF4040, "LR TStat").setDataSymbol(Chart.SquareSymbol, 7)
layer.addDataSet(data1, &H40CF40, "BR TStat").setDataSymbol(Chart.DiamondSymbol, 9)
layer.setDataLabelFormat("{value|0}")
c.makeChart("C:\Program Files\HomeSeer 2\html\Images\hvacUptime.jpg")
Catch ex As exception
hs.writelog("Uptime", ex.message)
Finally
s.close()
End Try
End Sub
Public Sub Main(ByVal Parms As Object)
Dim s As New SqlConnection
Dim c As SqlCommand
Dim sensors As String = DEVICE_LIST
Dim ary() As String
Dim i As Integer
ary = Split(sensors, ",")
s.ConnectionString = CONN
Try
s.Open()
For i = 0 To UBound(ary)
c = New SqlCommand("delete from uptime where device='" & ary(i) & "' and CONVERT(varchar,date,101)=CONVERT(varchar,getdate(),101)", s)
c.executenonquery()
c = New SqlCommand("INSERT INTO [uptime].[dbo].[uptime] ([device],[uptime],[date]) " & _
"VALUES('" & ary(i) & "'," & CInt(hs.DeviceValue(ary(i))) & ",getdate())", s)
c.ExecuteNonQuery()
Next i
Catch ex As Exception
hs.WriteLog("uptime", ex.Message)
Finally
s.Close()
c = Nothing
s = Nothing
End Try
End Sub
Public Sub PurgeRecords(ByVal Parms As Object)
Dim s As New SqlConnection
Dim c As SqlCommand
s.ConnectionString = CONN
Try
s.Open()
c = New SqlCommand("delete from uptime.dbo.uptime where(DATEDIFF(day, dateTime, GETDATE()) >= 30)", s)
c.ExecuteNonQuery()
Catch ex As Exception
hs.WriteLog("uptime", ex.Message)
Finally
s.Close()
c = Nothing
s = Nothing
hs.WriteLog("uptime", "PurgeRecords completed.")
End Try
End Sub
Public Sub ShrinkDatabase(ByVal Parms As Object)
Dim s As New SqlConnection
Dim c As SqlCommand
s.ConnectionString = CONN
Try
s.Open()
c = New SqlCommand("dbcc shrinkdatabase (uptime,2)", s)
c.ExecuteNonQuery()
Catch ex As Exception
hs.WriteLog("uptime", ex.Message)
Finally
s.Close()
c = Nothing
s = Nothing
hs.WriteLog("uptime", "ShrinkDatabase completed.")
End Try
End Sub
HS4Pro on a Raspberry Pi4
54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI
HSTouch Clients: 1 Android
Comment
-
Originally posted by dinki View Post@rmasonjr, thanks. I'm trying out the BLStat plugin but do appreciate your posting.HS4Pro on a Raspberry Pi4
54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI
HSTouch Clients: 1 Android
Comment
Comment