Announcement

Collapse
No announcement yet.

Passing a Parm via Actions, Script

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

  • tledford
    replied
    A backslash is an "escape character" in most programming languages.

    I bet that with a data type string, the "\" in the "\41" is being interpreted as an escape character.

    Leave a comment:


  • alphatech
    replied
    This explain lot of things, I guess also why I can't read the Device Description. I wish something would be easy.

    I appreciated all your help.

    Leave a comment:


  • jon00
    replied
    I don't use mcstemperature, however I would have thought he would set the device value.

    Just to explain about virtual devices - you can set 3 parameters on a device:

    DeviceString - this is what you normally see on the web page.
    DeviceValue - this is a storage area and must be a Integer.
    DeviceStatus - This provides a method to see if the device is on or off for example.

    You are seeing the device string on the web page which is showing you the humidity value of 45% etc. Unfortunately, you cannot just read this instead of the device value as you would need to filter out the HTML code contained within.

    You may need to post in Michaels forum to see if the device value is set or wait until someone else who uses the plugin appears.

    Leave a comment:


  • alphatech
    replied
    Nothing it is easy in Life :-) Michael McSharry mcsTemperature

    Leave a comment:


  • jon00
    replied
    What plugin are you using for the weather?

    Leave a comment:


  • alphatech
    replied
    Sorry I'm confuse, what do you mean by "It maybe that the plugin has not set the device value for the \41 virtual device. " Can it be fixed?
    The R2 seems to be the same type
    <TABLE border=0 cellSpacing=1 cellPadding=0 width="100%"><TBODY><TR><TD id=dv7854 class=tablecellcustom><TABLE><TBODY><TR><TD></TD><TD vAlign=center align=left>45%</TD></TR></TBODY></TABLE></TD><TD class=tableroweven>Outside</TD><TD class=tableroweven>Temperature</TD><TD class=tableroweven>Forecast Humidity </TD><TD class=tableroweven>R2</TD><TD class=tableroweven noWrap>Humidity</TD><TD class=tableroweven noWrap>Today 12:44:06 PM </TD></TR></TBODY></TABLE>
    Thank you for your patience.

    Leave a comment:


  • jon00
    replied
    It maybe that the plugin has not set the device value for the \41 virtual device.

    Leave a comment:


  • alphatech
    replied
    If I replace the Device R2 with \41 the results are 0. Do you know if I need to use something special for this type \41/
    <TABLE border=0 cellSpacing=1 cellPadding=0 width="100%"><TBODY><TR><TD id=dv2035 class=tablecellcustom><TABLE><TBODY><TR><TD></TD><TD vAlign=center align=left>69%</TD></TR></TBODY></TABLE></TD><TD class=tablerowodd>Basement</TD><TD class=tablerowodd>Humidity</TD><TD class=tablerowodd>Family Basement </TD><TD class=tablerowodd>\41</TD><TD class=tablerowodd noWrap>Humidity</TD><TD class=tablerowodd noWrap>Today 1:49:00 PM </TD></TR></TBODY></TABLE>
    Thanks,
    Aldo

    Leave a comment:


  • alphatech
    replied
    Thank you all, Rupp, the extra quote fixed the issue.

    Aldo

    Leave a comment:


  • jon00
    replied
    Also, you have spelt string incorrectly:

    Sub Main(ByVal parms() as Sring)

    Something like this should work:

    Run script:TemperatureEmail.vb("Main", "R2")

    Sub Main(ByVal parms as String)
    Dim Temp as String
    Temp = hs.devicevalue(parms)
    hs.WriteLog("Test", Temp)

    Leave a comment:


  • stevea
    replied
    Parms() as Sring probably isn't a happy thing. VB.NET knows what a "String" is, but not a "Sring"....

    Leave a comment:


  • Rupp
    replied
    Originally posted by aldo View Post
    Run script:TemperatureEmail.vb("Main", ""R2")

    Sub Main(ByVal parms() as Sring)
    Dim Temp as String
    Temp = hs.devicevalue(parms)
    hs.WriteLog("Test", Temp())


    5/26/2010 12:34:56 PM SCR Option Strict Offimports Schedulerimports SystemPublic Module scriptcode53#Region "Automatically generated code, do not modify"'Automatically generated code, do not modify'Event Sources Begin Public WithEvents hs As Scheduler.hsapplication Public WithEvents hsp As scheduler.hsp Public WithEvents hssystem As scheduler.phone0'Event Sources End'End of automatically generated code#End RegionSub Main(ByVal parms() as Sring)Dim Temp as StringTemp = hs.devicevalue(parms)hs.WriteLog("Test", Temp()) End SubEnd Module
    5/26/2010 12:34:56 PM Error Script compile error: Type 'Sring' is not defined.on line 14
    5/26/2010 12:34:56 PM Event Running script in background: TemperatureEmail.vb("Main", ""R2")

    Thanks
    Did you include the zero as shown? Also looks like there are an extra set of quotes in the prototype line.

    Leave a comment:


  • alphatech
    replied
    Run script:TemperatureEmail.vb("Main", ""R2")

    Sub Main(ByVal parms() as Sring)
    Dim Temp as String
    Temp = hs.devicevalue(parms)
    hs.WriteLog("Test", Temp())


    5/26/2010 12:34:56 PM SCR Option Strict Offimports Schedulerimports SystemPublic Module scriptcode53#Region "Automatically generated code, do not modify"'Automatically generated code, do not modify'Event Sources Begin Public WithEvents hs As Scheduler.hsapplication Public WithEvents hsp As scheduler.hsp Public WithEvents hssystem As scheduler.phone0'Event Sources End'End of automatically generated code#End RegionSub Main(ByVal parms() as Sring)Dim Temp as StringTemp = hs.devicevalue(parms)hs.WriteLog("Test", Temp()) End SubEnd Module
    5/26/2010 12:34:56 PM Error Script compile error: Type 'Sring' is not defined.on line 14
    5/26/2010 12:34:56 PM Event Running script in background: TemperatureEmail.vb("Main", ""R2")

    Thanks

    Leave a comment:


  • Rupp
    replied
    Change hs.WriteLog("Test", Temp) to hs.WriteLog("Test", Temp(0)) and see if that works

    Leave a comment:


  • alphatech
    replied
    It gives me this error. Thanks for your help.

    5/26/2010 10:55:27 AM SCR Option Strict Offimports Schedulerimports SystemPublic Module scriptcode44#Region "Automatically generated code, do not modify"'Automatically generated code, do not modify'Event Sources Begin Public WithEvents hs As Scheduler.hsapplication Public WithEvents hsp As scheduler.hsp Public WithEvents hssystem As scheduler.phone0'Event Sources End'End of automatically generated code#End RegionSub Main(ByVal parms() as String)Dim Temp = hs.devicevalue(parms)hs.WriteLog("Test", Temp)End SubEnd Module
    5/26/2010 10:55:27 AM Error Script compile error: Value of type '1-dimensional array of String' cannot be converted to 'String'.on line 16
    5/26/2010 10:55:26 AM Event Running script in background: TemperatureEmail.vb("Main", "R2")

    Leave a comment:

Working...
X