Announcement

Collapse
No announcement yet.

Away Mode Random Lights

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

    Comment


      Originally posted by fcol View Post
      I'm new to Homeseer (HS3) and am trying to use this script for the first time. I edited the INI file per the instructions. But I'm ashamed to admit I have no idea how to "simply open the included ASP web page “ManageRandomLights.ash”". I tried opening in IE11 and Firefox but I just get a dialog box asking me what application to use.
      First I'm going to assume you're using HS3 and NOT Windows 10; with the latter I won't be able to help at all as I don't use it.

      The ASH file not opening is the problem. Why the file isn't opening is what we need to understand. I've tried unsuccessfully to recreate this message.

      In the browser, enter "http://xxx.xxx.xxx.xxx/RandomLights.asp" (without the quotes), where xxx.xxx.xxx.xxx is the IP address of your HS machine. Provided the file is located in your \HTML folder within HS, it ought to open properly.

      The ASH file IS the user interface, used to edit data, and on the initial run will create the necessary data file (CSV) in the "\Data\Away Mode Random Lights\" folder.

      I also tried launching the Away Mode Random Lights.vben script manually via an Event. The log states "Running script in background: C:/Program Files (x86)/HomeSeer HS3/scripts/Away Mode Random Lights.vben" but I feel like there should be some kind of user interface... I also didn't see a CSV get created in the Data folder.
      The log message indicates that the script did run and without errors. I'd suggest turning off logging on these events to avoid filling the log with this message. However, until the data file has been properly created, the script will do nothing.

      As I said, the ASH (ASP) is your interface, used to edit the CSV data file located in the \Data\Away Mode Random Lights\ folder. The ASH file should open in a browser. This is something we haven't run into up until now.

      I'm currently in the prep stages to assemble and post a final version, and right now I don't have the current (older to me) version installed on any machine.
      For now, please copy the contents of your INI file and post it here. I'll at least be able to check that for validity.


      Open this included ZIP and extract the two TEST files into your \HTML folder under HS, then run them as I described above. This will tell us whether or not Windows recognizes the file types. You should see a message "ASP script ran successfully" (then a script error which will be normal for these).
      Attached Files
      Real courage is not securing your Wi-Fi network.

      Comment


        It's totally working (on Win10) - I just needed to append my custom port number to the IP address. When it didn't work initially, I compounded the user error by trying to open the .ash file directly. Thanks!

        Comment


          Originally posted by fcol View Post
          It's totally working (on Win10) - I just needed to append my custom port number to the IP address. When it didn't work initially, I compounded the user error by trying to open the .ash file directly. Thanks!
          Thanks for the feedback. These are things I need to document a little more clearly.
          Real courage is not securing your Wi-Fi network.

          Comment


            Device does not exist

            I downloaded and installed the script. I tried to setup one light for testing. When I add the device and submit changes, I get a log entry that says: A Home/Away device is defined but the device does not exist .

            The light I am using is located in "Family Room" and the device name is "Family Room Light" I have tried adding it by code "I1" as well and still get the same error.

            If I make a change to the config.ini, do I have to stop and start something? If so, how?

            Thanks,

            Greg

            Comment


              Originally posted by gherd11 View Post
              I downloaded and installed the script. I tried to setup one light for testing. When I add the device and submit changes, I get a log entry that says: A Home/Away device is defined but the device does not exist .

              The light I am using is located in "Family Room" and the device name is "Family Room Light" I have tried adding it by code "I1" as well and still get the same error.

              If I make a change to the config.ini, do I have to stop and start something? If so, how?

              Thanks,

              Greg

              From the above, it sounds like you tried to define the device using the ASP page. This won't work. Any devices need to be added to the Config file, (Away Mode Random Lights.ini), under the section [Lights], manually before you add any schedules.

              (from your info the definition would be)

              [Lights]
              Light1 = Family Room Family Room Light

              Or

              [Lights]
              Light1 = I1


              Secondly, I've never actually done any testing using a single device and/or schedule, so if this is the case, and your device is defined properly, you may well have uncovered a bug. This is the first time in two years I've heard of this one.

              You haven't mentioned whether you're using HS2 or HS3. This too could make the difference in the case of a bug that I'd need to research.
              The script uses Homeseer's own functions, which only return True/False, to determine the existence of the device name/code.
              Real courage is not securing your Wi-Fi network.

              Comment


                Originally posted by Wadenut View Post
                From the above, it sounds like you tried to define the device using the ASP page. This won't work. Any devices need to be added to the Config file, (Away Mode Random Lights.ini), under the section [Lights], manually before you add any schedules.

                (from your info the definition would be)

                [Lights]
                Light1 = Family Room Family Room Light

                Or

                [Lights]
                Light1 = I1


                Secondly, I've never actually done any testing using a single device and/or schedule, so if this is the case, and your device is defined properly, you may well have uncovered a bug. This is the first time in two years I've heard of this one.

                You haven't mentioned whether you're using HS2 or HS3. This too could make the difference in the case of a bug that I'd need to research.
                The script uses Homeseer's own functions, which only return True/False, to determine the existence of the device name/code.
                I am using HS3, latest revision. I had tried entering I1 in the ini file as well as several other devices by code and still received the same error. After entering info in the .ini, do I still use the ASP page to configure other variables?

                Comment


                  Originally posted by gherd11 View Post
                  I am using HS3, latest revision. I had tried entering I1 in the ini file as well as several other devices by code and still received the same error. After entering info in the .ini, do I still use the ASP page to configure other variables?
                  The ASP is only used to configure and edit schedules for existing devices.

                  I've misled you a bit. The error you mentioned refers to the "Home/Away" device, not a controlled device. My apology, I'd forgotten about that test.

                  This is defined in the first section of the INI file under [Options] as HomeDevice =
                  enter the name/location or DC of this device followed by a comma and the expected status to define Away mode, IE: Off.

                  If you don't intend to use a device to control the Home/Away function, leave this blank in which case the script will always assume AWAY. If you do have a device which defines this status, enter its location and name, or device code there. That should solve the problem.

                  In my case this looks like HomeDevice = System Occupation,Off
                  (Where "System" is the Location, and "Occupation" is the device name. "Off" is the status I've defined as AwayMode.)
                  Real courage is not securing your Wi-Fi network.

                  Comment


                    Closer

                    Originally posted by Wadenut View Post
                    The ASP is only used to configure and edit schedules for existing devices.

                    I've misled you a bit. The error you mentioned refers to the "Home/Away" device, not a controlled device. My apology, I'd forgotten about that test.

                    This is defined in the first section of the INI file under [Options] as HomeDevice =
                    enter the name/location or DC of this device followed by a comma and the expected status to define Away mode, IE: Off.

                    If you don't intend to use a device to control the Home/Away function, leave this blank in which case the script will always assume AWAY. If you do have a device which defines this status, enter its location and name, or device code there. That should solve the problem.

                    In my case this looks like HomeDevice = System Occupation,Off
                    (Where "System" is the Location, and "Occupation" is the device name. "Off" is the status I've defined as AwayMode.)
                    I got it to work. I replaced your occupied device with mine and got past the initial error but the script did not like using the device code of I1. I changed Light 1 to the device location and name and it did work.

                    Thank you for the help. I hope to test further and see how far I can push it. I recently setup geo fencing which will set occupied based on the location of 4 family iphones. If all goes well, the system will automatically set occupied and random lights will be able to trigger anytime no one is home in the evening.

                    To that end, I can set the time for each device in your ASP but is there a way to define sunset instead of a fixed time? Also, I notice a couple of entries in the homeseer log every minute or so. Is there a way to suppress these? The log ends up with a LOT of entries and it is difficult to find other logged items. It would be nice to suppress log entries all together and enable them for troubleshooting.
                    Last edited by gherd11; January 16, 2017, 07:31 PM.

                    Comment


                      Originally posted by gherd11 View Post
                      I got it to work. I replaced your occupied device with mine and got past the initial error but the script did not like using the device code of I1. I changed Light 1 to the device location and name and it did work.

                      To that end, I can set the time for each device in your ASP but is there a way to define sunset instead of a fixed time? Also, I notice a couple of entries in the homeseer log every minute or so. Is there a way to suppress these? The log ends up with a LOT of entries and it is difficult to find other logged items. It would be nice to suppress log entries all together and enable them for troubleshooting.
                      There is no way to detect sunset/sunrise directly. My intention here was to use the "Home/Away" device as the switch to control this. What I'd suggest is creating a composite device, Night + Away, which you'd have to control via your own events of course. "Seasons" were meant to help overcome this as well by defining date ranges or periods during which a particular data (schedule) file is active. Originally there would have been four seasons, hence the nomenclature, however later I expanded this to a user defined set (I've defined 26 periods here, each active for two weeks. This seems to have worked well for me).

                      As for the logging, 1st you'll want to turn off logging for the script event; I expect you already have done this. Unfortunately however, HS has never provided any means to supress logging of delayed events such as those created by the script during Away execution. I find this annoying as well, but it's out of my control.
                      Real courage is not securing your Wi-Fi network.

                      Comment


                        BUG ALERT

                        IF you have a season beginning or ending on Feb 29 (leap year) you will encounter an error. Since I've had no complaints, I expect I'm the only one affected so far.

                        I've fixed this in the upcoming version, but in the meantime, if you have this case, simply edit your config and change the season parameter to 02/28 in place of 02/29. The next leap year will be 2020.
                        Real courage is not securing your Wi-Fi network.

                        Comment


                          Error in GetSeasion

                          Hi,
                          I used your application about a year ago, and today I installed the latest version. You seem to have put a lot of effort into making it a very useful tool.

                          Everything is working except I get an error involving seasons. e.g.

                          Error in GetSeason: Conversion from string "01/20/2017" to type 'Date' is not valid.

                          As expected it defaults to season_0.

                          I wonder if there is something I have missed in the update.

                          Best regards

                          Stewart

                          Comment


                            Originally posted by Stewart Baker View Post
                            Hi,
                            I used your application about a year ago, and today I installed the latest version. You seem to have put a lot of effort into making it a very useful tool.

                            Everything is working except I get an error involving seasons. e.g.

                            Error in GetSeason: Conversion from string "01/20/2017" to type 'Date' is not valid.

                            As expected it defaults to season_0.

                            I wonder if there is something I have missed in the update.

                            Best regards

                            Stewart
                            hmmm. I wouldn't expect that date to cause an issue, but I do wonder why the script would be looking at January 20 at all now that we're in May. Are you using the format DD/MM/YYYY or MM/DD/YYYY or something else? I'd have thought all possibilities would be handled, but I may have missed something.

                            I did run into a problem with Feb 29 this year (my schedule had been generated last year) and did take steps to deal with that before I posted the update.

                            I'll ask you to ZIP up all of your schedule files so far, as well as your Configuration file and the Log snippit, so I can have a look. Just include the Zip file with a response. I'll try to duplicate the error.
                            Last edited by Wadenut; May 6, 2017, 07:07 AM.
                            Real courage is not securing your Wi-Fi network.

                            Comment


                              As soon as you mentioned "date format" a light went on !

                              I had read the help .pdf without thinking that the UK and US date formats are different. DD/MM/YY vs MM/DD/YY.

                              I had |01/01|01/20 changing to |01/01|20/01 works...

                              Many thanks

                              Stewart

                              Comment


                                Perhaps another trap I can add then, although I think either ought to have worked.
                                Real courage is not securing your Wi-Fi network.

                                Comment

                                Working...
                                X