Announcement

Collapse
No announcement yet.

Can I create a virtual thermostat ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can I create a virtual thermostat ?

    I want to create a virtual thermostat. It needs to behave like a normal thermostat, with heat setpoints. It will not be enough to create a 'normal' virtual switch to load the temperature too, as I need this device to load a schedule from BLStat. If I want any chance of BLStat recognising it as a thermostat, it would have to be like a thermostat. I have tried entering Z-Wave Heating Setpoint into device type (String) in my virtual device, but that has not worked. I also tried copying the device type from the root of my thermostat, that did not work either. I guess I need the virtual thermostat to show this in advanced:
    Device Type Internal Thermostat API, Type: Thermostat Setpoint, SubType: Heating 1

    #2
    You can but it is not straightforward and will rely on you getting into scripting and using the functions here - http://www.homeseer.com/support/home...ype_object.htm

    I have never done it I don't think but it should in theory work the same as a Z-Wave thermostat.

    Comment


      #3
      i have only just started with scripting, so not a lot of experience or understanding. But I take I have to write a script, run it once probably to change the device type of my virtual switch to a thermostat. So I need to modify this:

      Dim DT As DeviceAPI.DeviceTypeInfo = Nothing
      Dim dv As Scheduler.Classes.DeviceClass = Nothing ' The device has a reference ID of 417 dv = hs.GetDeviceByRef(417) If dv Is Nothing Then .... (log an error and exit the procedure) DT = dv.DeviceType_Get(hs)
      If DT IsNot Nothing Then
      DT.Device_API = DeviceAPI.DeviceTypeInfo.eDeviceAPI.Plug_In dv.DeviceType_Set(hs) = DT hs.SaveEventsDevices End If


      Hm I am struggling from here. My virtual device ref is 417
      The device am trying to copy (maybe we can read it from it and copy it over to the virtual device) is ref 227 for the setpoint, the root is ref 152

      Comment


        #4
        I thought I try this:

        Sub Main(parm as object)
        Retrieve the DeviceTypeInfo object:

        Dim DT as DeviceAPI.DeviceTypeInfo = Nothing
        ' The device has a reference ID of 227
        dv = hs.GetDeviceByRef(227)
        DT = dv.DeviceType_Get(hs)
        If DT IsNot Nothing Then
        ...
        End If

        Change the DeviceTypeInfo and Save the change

        Dim DT As DeviceAPI.DeviceTypeInfo = Nothing

        Dim dv As Scheduler.Classes.DeviceClass = Nothing
        ' The device has a reference ID of 417
        dv = hs.GetDeviceByRef(417)
        If dv Is Nothing Then .... (log an error and exit the procedure)
        DT = dv.DeviceType_Get(hs)

        If DT IsNot Nothing Then

        DT.Device_API = DeviceAPI.DeviceTypeInfo.eDeviceAPI.Plug_In
        dv.DeviceType_Set(hs) = DT
        hs.SaveEventsDevices
        End If
        End Sub

        didnt work. A lot of errors...

        Jul-17 12:58:36
        Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\vsthermostat.vb: Method arguments must be enclosed in parentheses. Jul-17 12:58:36 Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\vsthermostat.vb: 'Retrieve' is not declared. It may be inaccessible due to its protection level. Jul-17 12:58:36 Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\vsthermostat.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

        Comment

        Working...
        X