Announcement

Collapse
No announcement yet.

Event to tell me if my garage door is opened or closed?

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

    Event to tell me if my garage door is opened or closed?

    Hopefully this is simple, but I have a UPB I/O module on my garage. I can see in Status if the garage is closed (ON) or open (off) based on the connection. What I'd like to be able to do is ask 'Garage Status' and the system tell me the garage door is open, if it's open, or tell me it's closed, if it's closed.

    Is there a way, with a single voice command, to have it speak something based on state?

    Thanks!

    #2
    You can use a script with an If. . .Then. . .Else statement.

    Something like this (but check for typos and syntax) 'DC' is the device code for your I/O module.

    If hs.DeviceStatus("DC") = 2 Then
    hs.Speak("Garage is Open", True)
    Else
    hs.Speak("Garage is Closed", True)
    End If
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      Thanks Uncle Michael... that should be perfect. Is there a tutorial somewhere on implementing scripts with HS2? I'm using pretty typical EVENT triggers and actions right now. I certainly understand basic scripting, but am unsure of how they work with HS2 / where they get placed / how they get called.

      Thanks!

      Comment


        #4
        Scripts are placed in the scripts directory and there are a few samples in that dir. HomeSeer supports .txt (vbscript) and .vb (.net) scripts.
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment


          #5
          Thanks Rupp. I was just about to reply that I was a bonehead and should have done my homework. I created a dummy event, and saw the default scripts that showed up. Searching for them in the HS2 directory revealed the obvious scripts folder. Will disect and figure them out.

          I don't like to spam with obvious questions without first doing due diligence. Sorry about that.

          Comment


            #6
            Originally posted by Adam12hicks View Post
            Thanks Rupp. I was just about to reply that I was a bonehead and should have done my homework. I created a dummy event, and saw the default scripts that showed up. Searching for them in the HS2 directory revealed the obvious scripts folder. Will disect and figure them out.

            I don't like to spam with obvious questions without first doing due diligence. Sorry about that.
            No worries. Many of us like helping but it is nice when a person has this attitude.
            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

            Comment


              #7
              Well that was easy :-) Wrote my first script to voice activate when I leave the house in the mornings (I'm always the last to leave)

              It's simple, but it's a start... and it works exactly as I need it to!

              ----

              Sub Main
              On Error Resume Next
              If hs.DeviceStatus("\46") = "2" Then 'Check UPB I/O module to determine if garage is closed
              hs.Speak "The garage was closed. I am opening it now", True
              hs.transmit "\43","On" 'Activate UPB I/O module to open garage
              Else
              hs.Speak "Garage is already open, have a nice day", True
              End If
              hs.transmit "[29","On" 'Activate UPB link to turn off all house lights, turn on garage

              hs.Speak "Before you leave, here's a quick weather check."
              If hs.DeviceValue("^1") < 90 Then 'Check UltraWeatherBug current temperature
              hs.Speak "It's not too bad out there. Only", True
              hs.Speak (hs.DeviceValue("^1")), True 'Say the current temp
              hs.Speak "degrees", True
              Else
              hs.speak "Another hot day in Texas. It's"
              hs.speak (hs.DeviceValue("^1")), True
              hs.speak "degrees", True
              End If
              End Sub

              ----

              I never could have done this without HomeSeer. I know I'm a newbie, but I'm definitely having a lot of fun with it. I was simply using a UPB timed event controller for all of my devices before. This breathes new life into the system.

              Adam

              Comment


                #8
                Here's a script that I utilize for two garage doors.

                The D1 is just a "switch" to turn on and off speech. The zone detection is via 3 separate switches per door going to one alarm zone each.

                I do not have any auto features configured with opening or closing the door but do have events which report what the status is when the alarm is on or off.

                Code:
                Sub Main()
                
                ' Global Variables
                
                dim  t
                
                ' Main APP
                
                t=hs.GetLastEvent
                
                hs.SetVolume 3, 3, true
                
                ' Speak Garage door one is closed
                
                if hs.plugin("HAI_System").ZoneStatus(20) = "Secure" and t="Garage Door 1 Closed Speech" then
                	hs.speak "Garage door one is closed.",true
                if hs.IsOff("D1") then hs.execx10 "d1","on",0
                        hs.WaitEvents
                end if
                
                ' Speak Garage door one is open
                
                if hs.plugin("HAI_System").ZoneStatus(20) = "Not Ready" and t="Garage Door 1 Open Speech" then
                         hs.speak "Garage door one is open.",true
                end if
                
                ' Speak Garage door two is closed
                
                if hs.plugin("HAI_System").ZoneStatus(21) = "Secure" and t="Garage Door 2 Closed Speech" then
                	hs.speak "Garage door two is closed.",true
                if hs.IsOff("D1") then hs.execx10 "d1","on",0
                        hs.execx10 "d1","on",0
                end if
                
                ' Speak Garage door two is open
                
                if hs.plugin("HAI_System").ZoneStatus(21) = "Not Ready" and t="Garage Door 2 Open Speech" then
                	hs.speak "Garage door two is open.",true
                end if
                
                End Sub
                - Pete

                Auto mator
                Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                Comment

                Working...
                X