Announcement

Collapse
No announcement yet.

1 - liner into script

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

    1 - liner into script

    The answer is obvious to someone with skills, but that is not me. I have a one liner that updates a device string. It was getting cumbersome, so I thought I could put it in a script.
    PHP Code:
    Sub Main(ByVal Params As Object)
    hs.setdevicestring(633"Today: " hs.DeviceStringByName("Forecast UltraWeatherWU3 Plugin S1 Today's Prediction")
    " Tonight: " hs.DeviceStringByName("Forecast UltraWeatherWU3 Plugin S1 Tonight's Prediction"
    " Tomorrow: " hs.DeviceStringByName("Forecast UltraWeatherWU3 Plugin S1 Tomorrow's Prediction")
    hs.DeviceStringByName("Utility Tomorrow+1")
    ": "
    hs.DeviceStringByName("Extended Forecast UltraWeatherWU3 Plugin S1 2 Day Prediction (Day)"),true)
    End Sub 
    Error:
    PHP Code:
    Nov-25 2:48:14 PM         Error    Compiling script G:\Program Files\HomeSeer HS3\scripts\forecast.vbSyntax error.
    Nov-25 2:48:14 PM         Error    Compiling script G:\Program Files\HomeSeer HS3\scripts\forecast.vbSyntax error.
    Nov-25 2:48:14 PM         Error    Compiling script G:\Program Files\HomeSeer HS3\scripts\forecast.vbSyntax error.
    Nov-25 2:48:14 PM         Error    Compiling script G:\Program Files\HomeSeer HS3\scripts\forecast.vbSyntax error.
    Nov-25 2:48:14 PM         Error    Compiling script G:\Program Files\HomeSeer HS3\scripts\forecast.vbSyntax error.
    Nov-25 2:48:14 PM         Error    Compiling script G:\Program Files\HomeSeer HS3\scripts\forecast.vb')' expected.
    Nov-25 2:48:14 PM         Error    Compiling script G:\Program Files\HomeSeer HS3\scripts\forecast.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'use any aliases.
    Nov-25 2:48:13 PM         Event    Running script in backgroundG:/Program Files/HomeSeer HS3/scripts/forecast.vb("Main","1"
    Larry

    #2
    Put the whole command on one line, or end each line with a space and then an underscore.


    Code:
    Sub Main(ByVal Params As Object) 
    hs.setdevicestring(633, "Today: " & hs.DeviceStringByName("Forecast UltraWeatherWU3 Plugin S1 Today's Prediction") & " Tonight: " & hs.DeviceStringByName("Forecast UltraWeatherWU3 Plugin S1 Tonight's Prediction")  & " Tomorrow: " & hs.DeviceStringByName("Forecast UltraWeatherWU3 Plugin S1 Tomorrow's Prediction") & hs.DeviceStringByName("Utility Tomorrow+1") & ": " & hs.DeviceStringByName("Extended Forecast UltraWeatherWU3 Plugin S1 2 Day Prediction (Day)"),true) 
    End Sub
    Or:

    Code:
    Sub Main(ByVal Params As Object) 
    hs.setdevicestring(633, "Today: " & hs.DeviceStringByName("Forecast UltraWeatherWU3 Plugin S1 Today's Prediction") _
    & " Tonight: " & hs.DeviceStringByName("Forecast UltraWeatherWU3 Plugin S1 Tonight's Prediction") _
    & " Tomorrow: " & hs.DeviceStringByName("Forecast UltraWeatherWU3 Plugin S1 Tomorrow's Prediction") _
    & hs.DeviceStringByName("Utility Tomorrow+1") _
    & ": " _
    & hs.DeviceStringByName("Extended Forecast UltraWeatherWU3 Plugin S1 2 Day Prediction (Day)"),true) 
    End Sub
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      Thank you.
      Larry

      Comment

      Working...
      X