Announcement

Collapse
No announcement yet.

Advice on controlling my DIY garage opener

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

    Advice on controlling my DIY garage opener

    I've been using HS3 for a while now and I have been keeping it simple. I have only been controlling simple z-wave switches and outlets. Normal daily use lights/outlets and typical holiday lighting, etc. I got a little more detailed and added control/notification of my home alarm using the Vista Alarm plug-in and added a little bit of simple control through Google Home and IFTTT.

    So, recently, I decided I wanted to go a little deeper and start doing a little experimentation with implementing RPi's and scripting into my home automation. I created a working garage door opener using an RPi that I activate via a URL. I created a virtual device that will act as the controller for the garage door opener and then created an event in HS3 that sends a direct script using GetURL. This event is triggered when the value of the virtual device changes.

    This is working, but not quite as refined as I would like. The virtual device has an open and close control button (even though they both trigger the exact same event) so this kind of confuses my wife sometimes (not sure why).

    I was thinking I might create some type of virtual device, but where it only had one control button that was "Operate garage door" or something. Then the status icon could be changed by whatever the garage door sensor state is in (open/close). But, when I had an event that was triggered by the change in the garage door sensor that then changed the status of the garage door opener virtual device, it kind of created a nice, but unwanted, loop!

    I'm trying to use this whole process as a learning/teaching process, so that's why I'm getting a little more detailed into the controls. I'm sure I'm over complicating this and I don't really know exactly what I want, but thought some of you experts would have some advice.

    Thanks!

    Corey

    #2
    Here's an idea... I'm assuming your sensor tells you door is closed or not closed...

    For your virtual device, set up 6 total statuses (statii?):

    0 - Open - Status only
    1 - Closed - Status only
    2 - Open - Control only
    2 - Opening - Status only
    3 - Close - Control only
    3 - Closing - Status only

    This give you 4 states and 2 controls... the reason for double 2 and double 3 is to have a different label on the status and the control button.

    On the event side, set up as:

    If virtual device garage door is set or changed to opening *and* if the sensor says closed then operate the door

    If virtual device garage door is set or changed to closing *and* if the sensor says not closed then operate the door

    Use your existing logic for closed/open to change the virtual device based on sensor position. Setting it up this way should get rid of the feedback loop because the control buttons and the sensor trigger completely different states.

    This should work, but doesn't account for what happens if you push the button while it's in transit or if it get stopped midway... you'd need more sensors and/or some time-out logic (hasn't reached desired state in xx, operate again until it's where it's supposed to be)

    Comment

    Working...
    X