Jump to content

SCRIPT: Z-TRM3, feil med setpoint


Recommended Posts

Dette er en "dirty hack" som tar endringer i setpoint-devicen og sender dem til termostaten som en parameter. Ideelt skulle termostaten selvfølgelig gjort dette selv, men inntil HeatIt får fikset det (for dette er et problem på veldig mange systemer) så får vi gjøre det på denne måten.

 

Du må lage et event som trigger på alle endringer på termostatens SetPoint device.

Og da kjører du dette scriptet med parameter "NodeNummerTilTermostaten,DeviceRefTilSetPointDevice"

    Sub Main(ByVal Parms As Object)
        'Moskus 2020

        Dim homeID As String = "HOMEID"
        Dim nodeNumber As Byte = Parms.ToString.Split(","c)(0)
        Dim deviceRef As Integer = Parms.ToString.Split(","c)(1)
        Dim parameter As Byte = 9
        Dim value As Integer = hs.DeviceValue(deviceRef)

        'Options: {homeid, nodeID, Parameter, ParamSize, Convert.ToInt32(value)}
        Dim reply As String = hs.PluginFunction("Z-Wave", "", "Configuration_Set", New Object() {homeID, nodeNumber, parameter, Convert.ToByte(2), Convert.ToInt32(value * 10)})

        If False Then 'Change "False" to "True" To debug
            Select Case reply
                Case 0, ""
                    reply = "UNKNOWN"
                Case 1
                    reply = "Successful"
                Case 2
                    reply = "Queued"
                Case 3
                    reply = "Failed"
            End Select
            hs.WriteLog("SetParameter", "Set node " & nodeNumber & "s parameter " & parameter & " to " & value & ": " & reply)
        End If

    End Sub

 

 

  • Like 2
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...