Announcement

Collapse
No announcement yet.

script before speak

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

    script before speak

    You can run a script before speak, but is it also possible to run a script before channel change?
    I want to check if the player is on or off with a script, but IR is allready transmitted when the script before speak runs.
    I found hstvtuner.asp. When is this run and can I use this to check on/off of recorder?
    Peter
    Peter

    http://ohh.pcgsm.nl

    #2
    hstvtuner.asp is the page that is run when you click one of the channels on the tv grid page. It would be possible to do your check in that page but that will only work when you are viewing the grid page.

    As to the reminder/record events I don't know of any way to run a script before the event sends the IR. From the post for HS 2.0, it sounds like it will be possible then.

    For now, you could use the Run Script on the event edit page and then in the Run Script Parameters include the channel number. Then in a custom script you could do your checks, then send the IR from your script as well.
    --
    Jeff Farmer
    HS 3, HSPhone
    My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
    Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

    Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

    Comment


      #3
      CFGuy,

      I have the following script:

      sub main()
      dim aan, topfield
      topfield = "t12"
      if hs.IsOff(topfield) then
      hs.writelog "av","topfield was uit"
      hs.SendIR "topfield,power"
      end if
      hs.SetDeviceStatus "t20", 2
      hs.speak "de opname wordt gestart"
      hs.SendIR "topfield,,,,,,,,,,,,,,,,,green"
      hs.SendIR "topfield,,,stop,,,,,,,,,,,,,,"
      hs.SendIR "topfield,3"
      hs.speak "naar kanaal 3"
      hs.SendIR "topfield,,,,,,,,,,,,,,,,,,rec"
      hs.SendIR "topfield,,,,,exit"
      hs.speak "hij moet nu opnemen"

      end sub

      hs.SendIR "topfield,,,,,,,,,,,,,,,,,,,3" is to change to channel 3
      you sayed I could use a parameter, how do I do this?
      I save the file as topfield.txt in the script dir.

      Peter
      Peter

      http://ohh.pcgsm.nl

      Comment


        #4
        On the HSTV event editor, there is a place to select a sript. It is labeled Run Script. Just below that is Run Script Params.
        In the Script Params, you can enter a delimited list of the values you want sent to your script. The variables are listed in the Speak section.
        They are:
        #showTitle# - Show Title
        #chanName# - Channel name
        #chanNick# - Channel nickname
        #chanNum# - Channel number
        #showDate# - Start date
        #showTime# - Start time
        #showEnd# - Stop time
        #showLength# - duration
        #showDesc# - description
        #showRating# - rating

        So you might enter something like this in the Run Script Params.
        #showTitle#,#chanName#,#chanNum#

        Then you would change your script to something like this.

        Sub Main(strParams)
        dim aan, topfield
        topfield = "t12"
        arrParams = Split(strParams,",")
        strTitle = arrParams(0)
        strChan = arrParams(1)
        strChNum = arrParams(2)

        if hs.IsOff(topfield) then
        hs.writelog "av","topfield was uit"
        hs.SendIR "topfield,power"
        end if
        hs.SetDeviceStatus "t20", 2
        hs.speak "de opname wordt gestart"
        hs.SendIR "topfield,,,,,,,,,,,,,,,,,green"
        hs.SendIR "topfield,,,stop,,,,,,,,,,,,,,"
        hs.SendIR "topfield,3"
        hs.speak "naar kanaal 3"
        hs.SendIR "topfield,,,,,,,,,,,,,,,,,,rec"
        hs.SendIR "topfield,,,,,exit"
        hs.speak "hij moet nu opnemen"

        End Sub

        Then just use the variables (strTitle, strChan and strChNum) where you need them in your script.
        --
        Jeff Farmer
        HS 3, HSPhone
        My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
        Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

        Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

        Comment


          #5
          Thanks for your explenation.

          It works great!
          Is it possible to put the script name and the arguments fixed in the form?
          They are allways the same now.
          Is it also possible to do something simular for the stop record event?
          I want to check if the tv is on and then stop the record, but leave the satrecorder on and if the tv is off, also switch the satrecorder off.

          Thanks for your help!

          Peter
          Peter

          http://ohh.pcgsm.nl

          Comment


            #6
            hmm, no, I didn't add the ability to set those as defaults. I will add that to my to do list though.
            --
            Jeff Farmer
            HS 3, HSPhone
            My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
            Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

            Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

            Comment


              #7
              Originally posted by peterpc
              Thanks for your explenation.

              It works great!
              Is it possible to put the script name and the arguments fixed in the form?
              They are allways the same now.
              Is it also possible to do something simular for the stop record event?
              I want to check if the tv is on and then stop the record, but leave the satrecorder on and if the tv is off, also switch the satrecorder off.

              Thanks for your help!

              Peter
              CFGuy,
              how is your todo list going?

              Peter
              Peter

              http://ohh.pcgsm.nl

              Comment

              Working...
              X