Kirby
, i got the following from Rich about the temperature API and the current temperature value, It seems to me that his focus pulls the .devvalue property for his template regardless of the setting to use status.
, i got the following from Rich about the temperature API and the current temperature value, It seems to me that his focus pulls the .devvalue property for his template regardless of the setting to use status.
Here is the function in the HSTouch plugin that gets the temp. Note how it uses the thermostat API to find the temp device. The key here is subtype=1 for the temp.
Private Function GetTemp(ByRef dvRoot As Scheduler.Classes.DeviceClass, uselocal As Boolean) As Double
Dim dvChild As Scheduler.Classes.DeviceClass
For Each ref In dvRoot.AssociatedDevices(Nothing)
dvChild = GetDeviceByRefLocal(ref, uselocal)
Select Case dvChild.DeviceType_Get(Nothing).Device_Type
Case DeviceTypeInfo.eDeviceType_Thermostat.Temperature
If dvChild.DeviceType_Get(Nothing).Device_SubType = 1 Or dvChild.DeviceType_Get(Nothing).Device_SubType = 0 Then
' subtype 1=temp, subtype 5=humidity, etc.
Return dvChild.devValue(Nothing)
End If
End Select
Next
Return 0
End Function
Private Function GetTemp(ByRef dvRoot As Scheduler.Classes.DeviceClass, uselocal As Boolean) As Double
Dim dvChild As Scheduler.Classes.DeviceClass
For Each ref In dvRoot.AssociatedDevices(Nothing)
dvChild = GetDeviceByRefLocal(ref, uselocal)
Select Case dvChild.DeviceType_Get(Nothing).Device_Type
Case DeviceTypeInfo.eDeviceType_Thermostat.Temperature
If dvChild.DeviceType_Get(Nothing).Device_SubType = 1 Or dvChild.DeviceType_Get(Nothing).Device_SubType = 0 Then
' subtype 1=temp, subtype 5=humidity, etc.
Return dvChild.devValue(Nothing)
End If
End Select
Next
Return 0
End Function
Comment