Announcement

Collapse
No announcement yet.

Errors in script

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

  • Errors in script

    I have created a script to load heating schedules. Something is wrong, its showing a lot of errors in the log. I have created this from changing another working script. I am not sure what I've done wrong. Probably something obvious but I cannot see it.
    Device 308 is my Hall temperature sensor.

    This is the script:

    Code:
    Sub Main(ByVal Parms As Object)
             Dim TempHall As Double
            TempHall = hs.DeviceValueEx(308)
            Dim TempKitchen As Double
            TempKitchen = hs.DeviceValueEx(17)
            Dim TempOutside As Double
            TempOutside = hs.DeviceValueEx(14)
             Select Case TempHall
                 Case > 19.2
                    hs.TriggerEvent("Load Heating off")
                 Case 18.9 To 19.2
                    hs.TriggerEvent("Load Heating mornings only")
                 Case 18.6 To 18.9                
                    hs.TriggerEvent("Load Heating mornings and evenings")
                 Case 18.2 to 18.6
                    If TempOutside is < 1
                    hs.TriggerEvent("Load Heating very cold")
                    Else
                    hs.TriggerEvent("Load Heating cold")
                    EndIf
                 Case < 18.2
                    hs.TriggerEvent("Load Heating very cold")
                 
             End Select
         End Sub
    These are the errors:

    Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.vb: 'EndIf' statements are no longer supported; use 'End If' instead.
    Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.vb: '>' expected.
    Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.vb: Element is missing an end tag.
    Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.vb: Character '1' (0x31) is not allowed at the beginning of an XML name.
    Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.vb: White space cannot appear here.
    Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.vb: 'Is' operator does not accept operands of type 'Double'. Operands must be reference or nullable types.
    Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.vb: End of statement expected.
    Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.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.

  • #2
    Try changing this

    Code:
                    If TempOutside is < 1
                    hs.TriggerEvent("Load Heating very cold")
                    Else
                    hs.TriggerEvent("Load Heating cold")
                    EndIf
    To this;

    Code:
                    If TempOutside < 1 Then
                    hs.TriggerEvent("Load Heating very cold")
                    Else
                    hs.TriggerEvent("Load Heating cold")
                    End If
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #3
      Originally posted by mrhappy View Post
      Try changing this

      Code:
                      If TempOutside is < 1
                      hs.TriggerEvent("Load Heating very cold")
                      Else
                      hs.TriggerEvent("Load Heating cold")
                      EndIf
      To this;

      Code:
                      If TempOutside < 1 Then
                      hs.TriggerEvent("Load Heating very cold")
                      Else
                      hs.TriggerEvent("Load Heating cold")
                      End If
      I had changed it to End If, as that was one of the errors which I understood. Its just when opening the event to copy and paste here it hadn't updated. The old glitch... The errors are still there so there is something else wrong.
      I had not seen the 'Then' first of all, but now corrected that too and still getting these erors:

      Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.vb: '=' expected.

      Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.vb: Element is missing an end tag.

      Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.vb: Character '1' (0x31) is not allowed at the beginning of an XML name.

      Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.vb: White space cannot appear here.

      Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.vb: 'Is' operator does not accept operands of type 'Double'. Operands must be reference or nullable types.

      Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\HeatScheduleLogic.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.
      Last edited by mikee123; October 25th, 2016, 05:21 AM.

      Comment


      • #4
        Just double check this line is being changed also, I've put the code into Visual Studio and it does not error

        Code:
        If TempOutside is < 1
        Should be

        Code:
        If TempOutside < 1 Then
        My Plugins:

        Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
        Yeelight 3P | Nanoleaf 3P

        Comment


        • #5
          That was the problem, I did overlook that. Seems to be working fine now, no errors any more.

          Thanks

          Comment

          Working...
          X