Announcement

Collapse
No announcement yet.

[VB.NET] my.Alert

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

  • [VB.NET] my.Alert

    Discussion Thread for my.Alert.

    If you have any questions, suggestions or need help building the regular expression, don't hesitate to post here please!
    Last edited by electron; December 4th, 2012, 07:35 PM.
    HSPRO 2.4 (ESXi 4.1) | my.Alert NEW | my.Trigger | HSTouch | ACRF2 | UltraM1G | BLWeather | BLLan | Rover
    (aka xplosiv)
    Do You Cocoon? Home Automation News, Tutorials, Reviews, Forums & Chat

  • #2
    Did you copy the code from my examples? It looks like the forum software really screwed up my examples, so I removed them. Instead, I linked an example ini file, which you can copy & paste from without any problems.
    Yes, I had copied. Your new ini file is hard to read, but AAPL now partially worked and wrote the contents to the ini file. eBay didn't work, but that may be because that item is no longer live. I'll point to a current item later...

    If you did copy the data correctly, can you confirm you used quotes around the parameters (your post doesn't), and mention what version of Homeseer you are running? Thanks!
    My version of Homeseer is in my signature. I did use quotes, but again the forum software had messed it up and assumed the string was an email address.

    Code:
    12/4/2012 12:32:49 PM  my.Alert  Debug --- ProcessData(): size of processed data is 6 
    12/4/2012 12:32:49 PM  my.Alert  Debug --- ProcessData(): data : 576.75 
    12/4/2012 12:32:49 PM  my.Alert  Debug --- CleanData(): Scrubbing HTML data 
    12/4/2012 12:32:49 PM  my.Alert  Debug --- CleanData(): 576.75 
    12/4/2012 12:32:49 PM  my.Alert  Debug --- FormatData(): Before: 576.75 
    12/4/2012 12:32:49 PM  my.Alert  Debug --- FormatData(): After: 576.75 
    12/4/2012 12:32:49 PM  my.Alert  Debug --- ProcessData(): 576.75 
    12/4/2012 12:32:49 PM  my.Alert  Debug --- ProcessData(): Saved data is 1 long, new data is 6 long 
    12/4/2012 12:32:49 PM  my.Alert  Info --- ProcessData(): Change detected, saving data to my.Alert.ini 
    12/4/2012 12:32:49 PM  my.Alert  Debug --- monitor(): New data detected 
    12/4/2012 12:32:49 PM  Error  Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: The string was not recognized as a valid DateTime. There is a unknown word starting at index 0. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at System.DateTime.Parse(String s) at scriptcode8.scriptcode8.Main(String dummy) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments) 
    12/4/2012 12:32:49 PM  Error  Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: The string was not recognized as a valid DateTime. There is a unknown word starting at index 0. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at System.DateTime.Parse(String s) at scriptcode11.scriptcode11.Main(String dummy) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments) 
    12/4/2012 12:32:55 PM  Event  Event Trigger "my.Alert - eBay" 
    12/4/2012 12:32:55 PM  Event  Running script in background: MyAlert.vb("monitor","0@eBay") 
    12/4/2012 12:32:55 PM  my.Alert  Info --- Executing my.Alert 
    12/4/2012 12:32:55 PM  my.Alert  Debug --- 2 parameter(s) specified: 0@eBay 
    12/4/2012 12:32:55 PM  my.Alert  Debug --- Setting sSettingLogLevel to 0 
    12/4/2012 12:33:10 PM  my.Alert  Script Exception Error: Object reference not set to an instance of an object.

    Comment


    • #3
      Thanks for testing.

      I posted a copy of a clean my.Alert.ini file, hopefully this will make it easier for people to copy the examples. Not sure what you meant by 'hard to read', as you only have to copy/paste the profile.

      Surprised that auction expired, I used that example yesterday because it had 5 days or so left.

      Now I just need to come up with more useful examples.
      Last edited by electron; December 4th, 2012, 02:16 PM.
      HSPRO 2.4 (ESXi 4.1) | my.Alert NEW | my.Trigger | HSTouch | ACRF2 | UltraM1G | BLWeather | BLLan | Rover
      (aka xplosiv)
      Do You Cocoon? Home Automation News, Tutorials, Reviews, Forums & Chat

      Comment


      • #4
        Would it work to get the lake water temp from this site?
        http://waterdata.usgs.gov/ia/nwis/uv?06604200
        Thanks,
        Tim
        FB Page - https://www.facebook.com/pages/Capt-Tim/209398425902188

        HSTouch Layouts - https://www.facebook.com/media/set/?...5902188&type=3

        No, Im from Iowa. I only work in outer space. Captain Kirk

        Comment


        • #5
          Yep, very easy, I just added it as an example to the my.Alert.ini file, just copy & paste the laketemp profile, and you are good to go.
          HSPRO 2.4 (ESXi 4.1) | my.Alert NEW | my.Trigger | HSTouch | ACRF2 | UltraM1G | BLWeather | BLLan | Rover
          (aka xplosiv)
          Do You Cocoon? Home Automation News, Tutorials, Reviews, Forums & Chat

          Comment


          • #6
            Thank you.
            Will try it out.

            Tim
            FB Page - https://www.facebook.com/pages/Capt-Tim/209398425902188

            HSTouch Layouts - https://www.facebook.com/media/set/?...5902188&type=3

            No, Im from Iowa. I only work in outer space. Captain Kirk

            Comment


            • #7
              I have added an earthquake profile example, which lets you watch for the latest major earthquakes from the USGS website. Useful if you have family in Japan or other earthquake prone areas.
              HSPRO 2.4 (ESXi 4.1) | my.Alert NEW | my.Trigger | HSTouch | ACRF2 | UltraM1G | BLWeather | BLLan | Rover
              (aka xplosiv)
              Do You Cocoon? Home Automation News, Tutorials, Reviews, Forums & Chat

              Comment


              • #8
                I added more profiles (including CNN breaking news for the old timers here), and figured out a way of posting them directly on the forums thanks to Rich, so it's a lot easier to follow the examples now.
                HSPRO 2.4 (ESXi 4.1) | my.Alert NEW | my.Trigger | HSTouch | ACRF2 | UltraM1G | BLWeather | BLLan | Rover
                (aka xplosiv)
                Do You Cocoon? Home Automation News, Tutorials, Reviews, Forums & Chat

                Comment


                • #9
                  Thanks for a great script, I use it for several solutions

                  If the regex match more then one it's take only the first match. Is it possible to use index number to receive the second or deeper?
                  <title>[^<]*)<br /> RegExReplace=title<br /> Index=1,2,3,4,5<br /> DeviceString=Y11,Y12,Y13,Y14,Y15<br /> Content=News1 Title<br /> Content2=News2 Title<br /> Content3=News3 Title<br /> Content4=News4 Title<br /> Content5=News5 Title<br /> [/php]</title>
                  Attached Files
                  Please excuse any spelling and grammatical errors I may make.
                  --
                  Tasker Plugin / Speech Droid
                  Tonlof | Sweden

                  Comment


                  • #10
                    Thanks for letting me know you are using it, really means a lot!

                    I am actually working on this feature right now, because I have the same needs. It didn't support this originally, since it was designed to trigger whenever it found any match. I didn't see the web scraper potential until I finished the first test script.

                    Now that I know someone else wants this feature, I'll bump the priority of the next release.

                    Mind sharing how you are using the script (don't have to)?
                    HSPRO 2.4 (ESXi 4.1) | my.Alert NEW | my.Trigger | HSTouch | ACRF2 | UltraM1G | BLWeather | BLLan | Rover
                    (aka xplosiv)
                    Do You Cocoon? Home Automation News, Tutorials, Reviews, Forums & Chat

                    Comment


                    • #11
                      It sounds really good, really looking forward to it.

                      For the moment I use it to grab information from...
                      News from various newspapers.
                      Several TV Channel program info.
                      Bank interest
                      Petrol price
                      Electricity price
                      Gold price
                      Crude
                      Price check on different products.
                      Some statics/info from different locale websites.

                      Searching every minute on a buy & sell market after latest received products like tablets and Sonos system. If there is a great price I have a chance to make the first call
                      Please excuse any spelling and grammatical errors I may make.
                      --
                      Tasker Plugin / Speech Droid
                      Tonlof | Sweden

                      Comment


                      • #12
                        Hi Dan, I'm definitely looking forward to the new enhancements as well. I'm using it for similar purposes as Tonlof: news from local paper, gas prices, information from my electrical meter (on the supplier's website - no local access), etc.

                        Cheers!

                        Comment


                        • #13
                          Alert Help

                          Great script thanks for sharing it. It's pulling in some great information and bringing my system to life. Could use a little help. Trying to scrape the current lake level from this website. Hard part for me is how to identify the current level since I don't know how to have regex look for today's date.
                          The url is http://www.duke-energy.com/lakes/lev...ke=lake-norman

                          The data looks like this at the bottom of the page: 04/18/2013 98.4 97.4 93.7 00.0 NA

                          I am trying to pick out the 98.4 number. Any help would be appreciated.

                          Comment


                          • #14
                            Originally posted by Tonyl View Post
                            Great script thanks for sharing it. It's pulling in some great information and bringing my system to life. Could use a little help. Trying to scrape the current lake level from this website. Hard part for me is how to identify the current level since I don't know how to have regex look for today's date.
                            The url is http://www.duke-energy.com/lakes/lev...ke=lake-norman

                            The data looks like this at the bottom of the page: 04/18/2013 98.4 97.4 93.7 00.0 NA

                            I am trying to pick out the 98.4 number. Any help would be appreciated.
                            Hi Tony, I don't think you can use dateformat in regex. It's not a problem to make more scripting to grab your info with dateinfo but I think this is more simple.

                            Change your url to Lake Norman Today page.

                            PHP Code:
                            [lakelevel]
                            URL=http://www.duke-energy.com/lakes/levels/lake-norman.asp?lake=lake-norman&range=today
                            RegExSearch=<td align="center">(?<lakelevel>[^<]*) 
                            RegExReplace=lakelevel
                            Content
                            =98.6 
                            Please excuse any spelling and grammatical errors I may make.
                            --
                            Tasker Plugin / Speech Droid
                            Tonlof | Sweden

                            Comment


                            • #15
                              Actually, you can do this, just grab the 'last match'. There is a technical term for this, but instead of boring you with the details, I'll try to post an example later today.
                              HSPRO 2.4 (ESXi 4.1) | my.Alert NEW | my.Trigger | HSTouch | ACRF2 | UltraM1G | BLWeather | BLLan | Rover
                              (aka xplosiv)
                              Do You Cocoon? Home Automation News, Tutorials, Reviews, Forums & Chat

                              Comment

                              Working...
                              X