Announcement

Collapse
No announcement yet.

Jon00 RSS

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

    Jon00 RSS

    Can I create an event, to trigger on words from an RSS feed?
    I use the 'Jon00 RSS News feeds' script to pull the RSS (only 1 headline) to an virtual device.

    Now I would like to trigger some x10 devices based on specific words in the virtual device.

    #2
    I believe you can do this with the supertrigger plugin. WebAgent was another plugin geared for events based on internet data. It was not migrated from hs1 to hs2. A script can also be used or jon00's existing script augmented. Pluck is/was a internet data monitor that I used for awhile. I do ot know if it is still around.

    Comment


      #3
      The easiest way would be to run a separate script to do this. Something like this vb script:

      PHP Code:
      Sub Main(ByVal Parms As Object)

      Dim Housecode As String
      Dim Searchword 
      As String
      Dim Devicedata 
      As String
      Dim MyEvent 
      As String

      Housecode
      ="q1"
      Devicedatahs.devicestring (Housecode)

      Searchword="hello"
      MyEvent "Event name 1"
      If Instr(1,Devicedata,searchword,1) > 0 then hs.triggerevent (MyEvent)

      Searchword="world"
      MyEvent "Event name 2"
      If Instr(1,Devicedata,searchword,1) > 0 then hs.triggerevent (MyEvent)

      end sub 
      You could add this to the same event that the RSS script is triggered from but make sure you tick the 'wait for script to finished' tick box for that script.
      Jon

      Comment


        #4
        Thanks !

        Are the 'hello' and 'world' handled as an 'hello' OR 'world or 'hello' AND 'world' ?

        Comment


          #5
          No they are two different triggers.

          If the string "hello" is found in the RSS feed, then the event "event name 1" would trigger. Likewise if the string "world" was found in the RSS feed, then "event name 2" would trigger.

          You can copy the 3 lines of code that do the work for more triggers.
          Jon

          Comment


            #6
            I created an time based event, running every hour:

            1. Run script: MyRSS.vb("main","0") + wait until finished
            2. Run script: <script you just gave me>

            Output in log file:

            Code:
            12-5-2009 16:34:58   Info  Event Trigger "myRSS update" 
            12-5-2009 16:34:58   Info  Running script and waiting: MyRSS.vb("main","0") 
            12-5-2009 16:34:58   Info  Running script in background: check-rss 
            12-5-2009 16:34:58   Error  Running script, script run or compile error in file: check-rss1006:')' wordt verwacht in line 1 More info: ')' wordt verwacht
            It has some Dutch words... but it seems it has a problem on line 1 of the second script; a missing ')' ?

            The virtual device updates correctly with RSS information.

            Comment


              #7
              what have you called the second script?
              Jon

              Comment


                #8
                check-rss

                Comment


                  #9
                  Try naming it to: checkrss.vb
                  Jon

                  Comment


                    #10
                    Done...

                    Fixed

                    Thanks !

                    Comment


                      #11
                      I have now built the coolest thing ever… (being a newbie to homeseer);
                      The Jon00 RSS script pulls the latest pager information from the fire department’s website (RSS feed ). If it contains the pager code for the fire department I work for and it is night time, it will turn on the lights in the hallway (x10) so I can find my shoes and car keys and get to my car faster…. And save some lives
                      10 minutes after I leave it will turn the lights off again.

                      Comment


                        #12
                        Excellent use for Homeseer...and keep up the good work with fire fighting!
                        Jon

                        Comment


                          #13
                          I just installed your script and followed all the steps in the guide. But when I run the script, it only speaks one item from the feed(irrepsective which feed i use). I've checked the virtual devices it created and they do contain more than one news item. What am I doing wrong?

                          Comment


                            #14
                            Yes, it has been set within the script to read one feed only. I've been meaning to add a new optional parameter to set the number of items spoken and this has now been done.

                            Please download version 1.06. You can now set the number of items spoken via parameter f (see the docs for more info)
                            Jon

                            Comment


                              #15
                              Thanx Jon... works like a charm! :-)

                              Comment

                              Working...
                              X