Announcement

Collapse
No announcement yet.

Need Help With Simple Script Problem

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

    Need Help With Simple Script Problem

    I just purchased Homeseer, and LOVE it! I'm just starting to get my feet wet with script writing, and have a long way to go! I can't seem to find a solution to a simple problem that I'm sure can be solved. I have a coffee maker connected to an appliance module with status (G8). I use the pot to brew tea for iced tea. I want to be able to turn the pot on (local trigger)and walk away from it, and have it turn off 12 minutes later. The following script will work, with the event "Teapot Off" being the timed event that will turn the pot back off:

    sub main()

    hs.PollDevice "G8"

    if hs.IsOn("G8") then

    hs.TriggerEvent "Teapot Off"

    end if

    end sub

    I have this script running once a minute. My problem is the logging. Once a minute I get two log entries; one for when the event is run, and one for the status of the polled device. If I check "Do not log this event" in the event properties, I still get the status of the polled device logged. I've tried using hs.NoLog, but it apparently only works with the hs.ExecX10 command.

    I don't want to fill my log with insignicant entries, and I don't want to turn off the logging entirely. If anyone has a solution, I sure would appreciate it! This is starting to drive me nutser!!

    #2
    Another approach could be to set up an event to triggers on G8 On. Then inside this event run a script that creates an event to turn off the device later. Look up NewTimeEvent in the HS help file.

    Like:
    hs.NewTimeEvent Coffee Pot Off",4:00 pm, "9/21/03", 1, 1, 1, 1, 1, 1, 1, "G8:Off", 1, "","System"

    -Rupp
    Isn't Disney World a people trap operated by a mouse?
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Rupp's idea won't work as I noticed you said turn it on locally. This is exactly what I helped somebody else set up and I too noticed the limitation on having the PollStatus appear in the log constantly. I could not find a workaround for that. Since I have access to the code however, you can bet that I will address it in a future release.

      For now your best option is to not control it locally but to instead use perhaps a cheap stick-on X-10 RF transmitter/receiver pair to provide an X-10 ON button near the coffee pot and then HS can be used to turn it off after a period of time from when it hears the ON command.

      Another option is to limit through the use of conditions the time that the poll status command is sent so that it is not doing it all day - e.g. from 6AM to 10AM perhaps, and then at 10:01AM send an OFF command to make sure it is off. Also, change the recurrance to 5 minutes from 1 minute as it is probably not necessary to be that granular on turning off the coffee pot.

      Regards,

      Rick Tinker
      HomeSeer Technologies

      Regards,

      Rick Tinker (a.k.a. "Tink")

      Comment


        #4
        Thanks, Rick for your encouraging comment. I feel better now. I will look forward to a code change in a future update. It could be as simple as adding a command to the code to turn *ALL* logging off or on. This way I could turn all logging off as the first step in the script, check the status, then turn logging back on.

        Comment


          #5
          My idea will work if you simply place a key chaine remote next to the coffee pot and turn it on that way.

          -Rupp
          Isn't Disney World a people trap operated by a mouse?
          💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

          Comment


            #6
            Is there any way to make this sort of thing work if it is switched on locally? This is a WAF issue. Right now, if we remember we forgot to turn the pot off when we left the house, we can tell HS to turn it off, but it won't get turned off automatically.

            I am hoping something got changed in HS since this thread was last updated.

            Thanks,
            Frob

            Comment


              #7
              Originally posted by Rupp
              Another approach could be to set up an event to triggers on G8 On. Then inside this event run a script that creates an event to turn off the device later. Look up NewTimeEvent in the HS help file.

              Like:
              hs.NewTimeEvent Coffee Pot Off",4:00 pm, "9/21/03", 1, 1, 1, 1, 1, 1, 1, "G8:Off", 1, "","System"
              Hi Rupp, I presume we are talking HS1 here as hs.newevent is not supported by HS2, and I'm having a terrible time trying to convert my scripts that create events.
              sigpic
              A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

              Comment


                #8
                Gogs,

                As Rupp's post was dated 2003, he must have been a clairvoyant to write that for HS2!
                Jon

                Comment


                  #9
                  Originally posted by jon00
                  Gogs,

                  As Rupp's post was dated 2003, he must have been a clairvoyant to write that for HS2!
                  WHAT!

                  You mean Rupp is not clairvoyant!

                  Erm, sorry, the thread popped up in new posts, I did not look at the date. However, it's reassuring to know I was right, he was referring to HS1.

                  Pity actually, because I was hoping someone might pick up on the problem I have converting a script to create an event to HS2.

                  Anyway, thats life.

                  Take care Jon, and still love your website, haven't seen the cat on the cam yet, No I don't mean the good lady!
                  sigpic
                  A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

                  Comment


                    #10
                    So I gather this still can't be done, even in HS2?

                    Thanks,
                    Frob

                    Comment


                      #11
                      Originally posted by Gogs
                      Hi Rupp, I presume we are talking HS1 here as hs.newevent is not supported by HS2, and I'm having a terrible time trying to convert my scripts that create events.
                      Gog's,
                      As far as I know NewTimeEvent is still supported or at least it doesn't say it isn't in my help files. I'm still using this in other code and haven't had a problem either. So am I missing something?
                      💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                      Comment


                        #12
                        NewTimeEvent is working fine with HS2. DooMotion uses it quite heavily to handle delayed events based upon motion.

                        I noticed the NewTimeEvent example was missing some quotes and parentheses need to be added for HS2 VB.NET script (leave them off for VBScript .txt file):

                        hs.NewTimeEvent("Coffee Pot Off","4:00 pm", "9/21/03", 1, 1, 1, 1, 1, 1, 1, "G8:Off", 1, "","System")
                        Last edited by Jim Doolittle; September 9, 2005, 06:06 PM.
                        Jim Doolittle

                        My Twitter
                        My Hardware & Software

                        Comment


                          #13
                          Hi Rupp,

                          I had not actually used NewTimeEvent, I was using NewEvent which is not supported by HS2 and just assumed it would be the same for all those commands.

                          To get New event to work I had to change it to NewEventGetRef
                          sigpic
                          A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

                          Comment

                          Working...
                          X