Announcement

Collapse
No announcement yet.

Error when setting tado overide mode

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

  • #31
    fuzzysb Fist impression looks good, i will do a full test tomorrow and keep you posted

    Comment


    • #32
      fuzzysb as promised i did my test run

      All problems with "set themostat"seem to be resolved, decimal / heat / off
      small observation "Tado overide mode" "Tado mode" should be "Unitil next automatic change"; tado mode = full controle by program in tado

      one problem left, it is no longer posible to set the heat setpoint via a script, this is overwritten by the value of the tado thermostat after the 5 min refresh time

      see example code:

      Sub Main(params as Object)
      Dim devSetHeatPoint as Integer = 1882

      hs.SetDeviceValueByRef(devSetHeatPoint, 19.4, True)
      End Sub

      once again thanks for your efforts

      Henk

      Comment


      • #33
        Red64

        that's normal behaviour, this is the detail for the SetDeviceByRef command

        SetDeviceValueByRef

        Purpose
        This function sets a value that is associated with this device. Values are used to hold the dim level of a device. You can also use them as user variables in your scripts. Note that HomeSeer will overwrite this value if a command was received for this device. If you are going to use this as storage for your own information, pick a device that does not exist in your home.

        Parameters

        Parameter: dvRef
        Type: Integer
        Description: This is the device reference ID number.

        Parameter: value
        Type: double integer
        Description: This is a numeric value, such as "50".

        Parameter: trigger
        Type: Boolean
        Description: When set to FALSE, the value will be changed without triggering events that are set to trigger when the device changes. Set this to True normally so that events can trigger when the device's value is updated.

        Returns
        None.

        Example

        Code:
        Sub Main(ByVal Parms As Object)
                 ' set the value of device whose reference ID is 1234 to 60.54
                  hs.SetDeviceValueByRef(1234, 60.54, True)
        end sub
        So with the true value events will run, but my plugin would never be notified unless you have a trigger on an event listening for when the device value changes. which is obviously something you don't want to have to set up.

        To Successfully set the value from a script so my plugin is notified, you will need to use Capi Control, something like the following should work and emulate setting the temp via a script

        so for example i created HeatSetPoint.vb in my scripts dir with the following script

        Code:
        Public Sub Main(ByVal Parms As Object)
                Dim arrParm() As String
                arrParm = Split(Parms, ";", -1, 1)
                Dim myDev as Integer = Integer.Parse(arrParm(0))
            Dim myValue as double = Double.Parse(arrParm(1))
            Dim objCAPIControl As CAPIControl
                hs.WriteLog("SetHeatPoint", "Dev ID is : " & myDev)
                hs.WriteLog("SetHeatPoint", "temp is is : " & myValue)
            objCAPIControl = hs.CAPIGetSingleControlByUse(myDev,ePairControlUse._HeatSetPoint)
            If objCAPIControl IsNot Nothing Then
                objCAPIControl.ControlValue = myValue
                hs.CAPIControlHandler(objCAPIControl)
            End If
        End Sub

        if i set the device and temp seperated by a ; then it will set succesfully.

        Click image for larger version

Name:	Capture.PNG
Views:	4
Size:	217.7 KB
ID:	1283054

        Comment


        • #34
          fuzzysb Thanks, this script works great
          Sorry for the long delay was a bit busy

          I use a script to correct the tado thermostat when overshooting, this happens a lot with floorheating due to a bug in the tado system.

          Comment

          Working...
          X