Announcement

Collapse
No announcement yet.

Script error after the update

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

  • Script error after the update

    After updating the plugin to 1.0.6.1, I'm getting these messages in the log.

    <TABLE class=log_table_row cellSpacing=0> <TBODY> <TR> <TD class="LogDateLong LogDateTime1" style="WHITE-SPACE: nowrap" align=left>May-02 6:49:18 PM </TD> <TD class=LogPri1 align=left></TD> <TD class=LogType1 colSpan=3 align=left>JowiHue </TD> <TD class=LogEntry1 colSpan=8 align=left>Please check parameters with documentation? </TD></TR></TBODY></TABLE> <TABLE class=log_table_row cellSpacing=0> <TBODY> <TR> <TD class="LogDateLong LogDateTime0" style="WHITE-SPACE: nowrap" align=left>May-02 6:49:18 PM </TD> <TD class=LogPri0 align=left></TD> <TD class=LogType0 colSpan=3 align=left>JowiHue </TD> <TD class=LogEntry0 colSpan=8 align=left>Error in PluginFunction calling SetLightsHueSat: Exception has been thrown by the target of an invocation. </TD></TR></TBODY></TABLE> <TABLE class=log_table_row cellSpacing=0> <TBODY> <TR> <TD class="LogDateLong LogDateTime1" style="WHITE-SPACE: nowrap" align=left>May-02 6:49:18 PM </TD> <TD class=LogPri1 align=left></TD> <TD class=LogType1 colSpan=3 align=left>Daytime </TD> <TD class=LogEntry1 colSpan=8 align=left>Daytime </TD></TR></TBODY></TABLE>

    PHP Code:
     Sub Main(ByVal parm As Object
            
    Dim level As Integer 
            Dim LightlevelStatus 
    As String "" 
            
    Dim SunsetTime As DateTime 
            Dim SunriseTime 
    As DateTime 
            Dim DateRightNow 
    As DateTime 
            Dim SuccessLight 
    As Boolean 
            SunsetTime 
    hs.SunsetDt 
            SunriseTime 
    hs.SunriseDt 
            DateRightNow 
    DateTime.Now 
             
    If SunriseTime <= DateRightNow And SunsetTime >= DateRightNow Then 
                
    'Daytime 
                hs.WriteLog ("Daytime" , "Daytime")
                LightlevelStatus = hs.PluginFunction("Insteon", "", "GetDeviceSetting", New Object() {"13.EE.B4", "Current Light Level"}) 
                '
    hs.writelog ("test"lightlevelstatus
                
    level CInt(LightlevelStatus
                 If 
    level >= 100 Then 
                    
    ' Set Hue Studio Light to Low light 
                    SuccessLight = hs.PluginFunction("JowiHue", "", "SetLightsHueSat", {False, "Hue Lamp Studio", 1, 8239, 200, 10}) 
                    hs.WriteLog("StudioLight", level) 
                ElseIf level >= 80 Then 
                    ' 
    set Hue Studio Light to Low light 
                    SuccessLight 
    hs.PluginFunction("JowiHue""""SetLightsHueSat", {False"Hue Lamp Studio"102510020010}) 
                    
    hs.WriteLog("StudioLight"level
                ElseIf 
    level >= 60 Then 
                    
    ' set Studio Hue Lamp to Yellow 
                    SuccessLight = hs.PluginFunction("JowiHue", "", "SetLightsHueSat", {False, "Hue Lamp Studio", 100, 42000, 255, 10}) 
                    hs.WriteLog("StudioLight", level) 
                ElseIf level >= 40 Then 
                    ' 
    set Studio Hue Lamp to White 
                    SuccessLight 
    hs.PluginFunction("JowiHue""""SetLightsHueSat", {False"Hue Lamp Studio"2003400025510}) 
                    
    hs.WriteLog("StudioLight"level
                Else 
                    
    ' set Studio Hue Lamp to High White 
                    SuccessLight = hs.PluginFunction("JowiHue", "", "SetLightsHueSat", {False, "Hue Lamp Studio", 255, 35100, 255, 10}) 
                    hs.WriteLog("StudioLight", level) 
                End If 
            Else 
                '
    Nighttime 
                hs
    .WriteLog ("Nighttime" "Nightime")
                 
    SuccessLight hs.PluginFunction("JowiHue""""SetLightsHueSat", {False"Hue Lamp Studio"2551192925510}) 
            
    End If 
         
    End Sub 
    Not sure what I'm doing wrong.

    Thanks,
    Aldo

  • #2
    Aldo,

    I have checked the statement and there is nothing wrong with it. But if you perform this command while the lights are off, it errors. Appearently I am missing some error catching in this part.

    But if you change your statements in :

    SuccessLight = hs.PluginFunction("JowiHue", "", "SetLightsHueSat", {True, "Hue Lamp Studio", 1, 8239, 200, 10})
    hs.WriteLog("StudioLight", level)

    It should work. I will check why it does now error while lights are off.
    -- Wim

    Plugins:RFXCOM, HSTouch Server, Squeezebox, BLGData, Restart, Jon00's Perfmon and Network monitor, WeatherXML, BLBackup, TenScripting, BC4, Pushover, PHLocation, JowiHue, Zwave, Sonos
    650 devices ---- 336 events ----- 40 scripts

    Comment


    • #3
      As always, thank you for the quick response. I changed to True and I'm still having the same error.

      <TABLE class=log_table_row style="WIDTH: 970px; WHITE-SPACE: normal; WORD-SPACING: 0px; TABLE-LAYOUT: fixed; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); FONT: 13px 'Lucida Console', Monaco, monospace; WIDOWS: 1; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px" cellSpacing=0> <TBODY> <TR> <TD class="LogDateLong LogDateTime0" style="FONT-SIZE: 10pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 150px; BACKGROUND: rgb(239,239,239); WHITE-SPACE: nowrap; PADDING-LEFT: 3px; PADDING-RIGHT: 3px" align=left>May-03 9:52:19 AM</TD> <TD class=LogPri0 style="FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 30px; BACKGROUND: rgb(239,239,239); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" align=left></TD> <TD class=LogType0 style="FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 100px; BACKGROUND: rgb(239,239,239); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" colSpan=3 align=left>JowiHue</TD> <TD class=LogEntry0 style="WORD-WRAP: break-word; FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; BACKGROUND: rgb(239,239,239); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" colSpan=8 align=left>Please check parameters with documentation?</TD></TR></TBODY></TABLE> <TABLE class=log_table_row style="WIDTH: 970px; WHITE-SPACE: normal; WORD-SPACING: 0px; TABLE-LAYOUT: fixed; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); FONT: 13px 'Lucida Console', Monaco, monospace; WIDOWS: 1; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px" cellSpacing=0> <TBODY> <TR> <TD class="LogDateLong LogDateTime1" style="FONT-SIZE: 10pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 150px; BACKGROUND: rgb(255,255,255); WHITE-SPACE: nowrap; PADDING-LEFT: 3px; PADDING-RIGHT: 3px" align=left>May-03 9:52:19 AM</TD> <TD class=LogPri1 style="FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 30px; BACKGROUND: rgb(255,255,255); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" align=left></TD> <TD class=LogType1 style="FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 100px; BACKGROUND: rgb(255,255,255); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" colSpan=3 align=left>JowiHue</TD> <TD class=LogEntry1 style="WORD-WRAP: break-word; FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; BACKGROUND: rgb(255,255,255); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" colSpan=8 align=left>Error in PluginFunction calling SetLightsHueSat: Exception has been thrown by the target of an invocation.</TD></TR></TBODY></TABLE> <TABLE class=log_table_row style="WIDTH: 970px; WHITE-SPACE: normal; WORD-SPACING: 0px; TABLE-LAYOUT: fixed; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); FONT: 13px 'Lucida Console', Monaco, monospace; WIDOWS: 1; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px" cellSpacing=0> <TBODY> <TR> <TD class="LogDateLong LogDateTime0" style="FONT-SIZE: 10pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 150px; BACKGROUND: rgb(239,239,239); WHITE-SPACE: nowrap; PADDING-LEFT: 3px; PADDING-RIGHT: 3px" align=left>May-03 9:52:19 AM</TD> <TD class=LogPri0 style="FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 30px; BACKGROUND: rgb(239,239,239); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" align=left></TD> <TD class=LogType0 style="FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 100px; BACKGROUND: rgb(239,239,239); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" colSpan=3 align=left>Daytime</TD> <TD class=LogEntry0 style="WORD-WRAP: break-word; FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; BACKGROUND: rgb(239,239,239); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" colSpan=8 align=left>Daytime</TD></TR></TBODY></TABLE>

      Thanks,
      Aldo

      Comment


      • #4
        So sorry, it was my fault, I changed the name of the lamp few days back and I forgot to change it in the script. Coincidence, I updated the plugin and I got mislead.

        Thanks,
        Aldo

        Comment


        • #5
          Aldo,

          Maybe only partly your fault. The plugin should have reported that the light was unknown. I will work on that.

          Wim
          -- Wim

          Plugins:RFXCOM, HSTouch Server, Squeezebox, BLGData, Restart, Jon00's Perfmon and Network monitor, WeatherXML, BLBackup, TenScripting, BC4, Pushover, PHLocation, JowiHue, Zwave, Sonos
          650 devices ---- 336 events ----- 40 scripts

          Comment

          Working...
          X