Announcement

Collapse
No announcement yet.

Help with open/closed statuses and speak results only if open

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

    #16
    Originally posted by keithj69 View Post
    Adjustments made as the door sensors were 255 for open and the windows were 100. Thank you. Working great now. Thank you for the help.
    Changing the script lines from "if hs.DeviceValue(devw) = 1 then" to "if hs.DeviceValue(devw) > 0 then" would probably work for both.
    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

    Comment


      #17
      Hi,

      Trying to get your script to work but getting an error in the log

      "VB.Net script exception(0), re-starting: Object reference not set to an instance of an object. "

      This is my very first script ever run, so perhaps I'm missing some basic libraries ??

      Comment


        #18
        Since moving to windows 10 I am getting the following errors in the logs trying to run this vb. Any ideas what is going on with this? I am clueless.
        Code:
         [TABLE="class: log_table_row, cellspacing: 0"]
        [TR]
        [TD="class: LogDateLong LogDateTime1, colspan: 1, align: left"][COLOR=#FF0000]May-16 10:24:39 AM [/COLOR][/TD]
         			[TD="class: LogPri1, colspan: 1, align: left"][COLOR=#FF0000]  [/COLOR][/TD]
         			[TD="class: LogType1, colspan: 3, align: left"][COLOR=#FF0000]Error [/COLOR][/TD]
         			[TD="class: LogEntry1, colspan: 8, align: left"][COLOR=#FF0000]Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\doors_windows.vb: Expression expected. [/COLOR][/TD]
         		[/TR]
        [/TABLE]
        [TABLE="class: log_table_row, cellspacing: 0"]
        [TR]
        [TD="class: LogDateLong LogDateTime0, colspan: 1, align: left"][COLOR=#FF0000]May-16 10:24:39 AM [/COLOR][/TD]
         			[TD="class: LogPri0, colspan: 1, align: left"][COLOR=#FF0000]  [/COLOR][/TD]
         			[TD="class: LogType0, colspan: 3, align: left"][COLOR=#FF0000]Error [/COLOR][/TD]
         			[TD="class: LogEntry0, colspan: 8, align: left"][COLOR=#FF0000]Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\doors_windows.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. [/COLOR][/TD]
         		[/TR]
        [/TABLE]

        Comment


          #19
          Daveyboy keithj69

          Still having these issues? I came across your posts when looking into an issue with the same script for another user. I posted an update to the script here: https://forums.homeseer.com/forum/de...61#post1337461
          HS 4.2.8.0: 2134 Devices 1252 Events
          Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

          Comment


            #20
            Thank you. I will test it in a bit.

            Comment


              #21
              Originally posted by randy View Post
              Also check your door and window sensors for their open and closed values. They must use 0 and 1 for closed and open. If they use 0 and 100, the script will need to be modified.
              I have a hodegpodge of devices and tech so my Open values might be 1, 100 or 255. How would I go about adding those devices to the door or window array in the script?

              I tried changing the statement "if hs.DeviceValue(devw) = 1 then" to use "if hs.DeviceValue(devw) <> 0 then" and it does give the correct amount of open windows or doors in my log (yes, I know this will include unreachable stuff as well but figured it was a workaround) but it's not giving the name of the open windows or doors. It correctly turns on the virtual device and shows in status "Door Sensor," and that's it.

              Not very good at scripting. I found the not equal <> vbscript using Google but that's about the extent of my scripting knowledge.

              All I am seeing in my log is:

              Code:
               [LEFT][FONT=B612 Mono][COLOR=#000000][FONT=Roboto][SIZE=16px]3/5/2022 7:19:02 PM[/SIZE][/FONT][/COLOR][/FONT][/LEFT]
               
              [FONT=B612 Mono][COLOR=#000000]Script[/COLOR][/FONT]
              [FONT=B612 Mono][COLOR=#000000]DoorWindow[/COLOR][/FONT]
              [FONT=B612 Mono][COLOR=#000000]Window Count: 1[/COLOR][/FONT]
              
              [LEFT][FONT=B612 Mono][COLOR=#000000][FONT=Roboto][SIZE=16px]3/5/2022 7:19:02 PM[/SIZE][/FONT][/COLOR][/FONT][/LEFT]
               
              [FONT=B612 Mono][COLOR=#000000]Script[/COLOR][/FONT]
              [FONT=B612 Mono][COLOR=#000000]DoorWindow[/COLOR][/FONT]
              [FONT=B612 Mono][COLOR=#000000]Door Sensor Open[/COLOR][/FONT]
              
              [LEFT][FONT=B612 Mono][COLOR=#000000][FONT=Roboto][SIZE=16px]3/5/2022 7:19:02 PM[/SIZE][/FONT][/COLOR][/FONT][/LEFT]
               
              [FONT=B612 Mono][COLOR=#000000]HomeSeer[/COLOR][/FONT]
              [FONT=B612 Mono][COLOR=#000000]Event[/COLOR][/FONT]
              [FONT=B612 Mono][COLOR=#000000]Running script in background (DoorWindow Script): doors_windows.vb("windows")[/COLOR][/FONT]
              
              [LEFT][FONT=B612 Mono][COLOR=#000000][FONT=Roboto][SIZE=16px]3/5/2022 7:19:02 PM[/SIZE][/FONT][/COLOR][/FONT][/LEFT]
               
              [FONT=B612 Mono][COLOR=#000000]HomeSeer[/COLOR][/FONT]
              [FONT=B612 Mono][COLOR=#000000]Event[/COLOR][/FONT]
              [FONT=B612 Mono][COLOR=#000000]Event Trigger "Door/Window Sensor DoorWindow Script"[/COLOR][/FONT]

              Comment

              Working...
              X