Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

gate and garage control vd's


AutoFrank

Question

Hi @CelticWebs

 

I've attached the gate and garage VD's I use but didn't strip out any parts as discussed.

 

Some comments to help as you pick through the code

Garage

  • I use the sonos-api for music control. The IP and Port that are set i the vd are for the api (XX.89, port 5005)
  • all the jT references are for the Hometable global variable
  • In the main loop i check status of /fibaro:getGlobal("G_SPC_ZONE_INPUT_7")/. This is my garage door sensor, it looks different because it is part of my siemens alarm whose status is mirrored in my HC2
  • the garage all off doesn't close the door - I'll be adding that soon

Full vd looks as follows

Please login or register to see this attachment.

 

Gate

My gate just requires a zero volt contacts close to either open or close so I have the relay set to 'auto-off' after 2 seconds and this is enough to trigger it

If I leave the relay open it will hold the gate open

The button options are standard enough, nothing different here

 

in the Main loop I use a global variable called stateTable. I use the table to check for changing states at parts of my setup

When the gate pen I want to take a photo but as the vd loop runs (constantly - every 3 seconds) I don't want an endless stream of pics if left open. To prevent this I write the status to the state table and what it next changes state I compare before setting the new state. This gives me one trigger point to take the one picture

Please login or register to see this code.

This sets the icon

Please login or register to see this code.

 

The rest should be easy enough to pick through

Please come back with any questions as it can be difficult sometimes to pick through some other persons code :-)

 

-f

 

Please login or register to see this link.

Please login or register to see this link.

Please login or register to see this link.

Please login or register to see this link.

Please login or register to see this attachment.

Please login or register to see this attachment.

Edited by AutoFrank
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Absolutely perfect, my garage door actually works in the same way as your gate which also requires a zero volt contact.  So they work in the exact what I need them too :)

 

Thank you for all your help and time.  I'll eb in touch if I need help or just to confirm I've got it going on my system.

 

Regards

Huw

Link to comment
Share on other sites

  • 0

Hi @AutoFrank, I was playing around and made a scene that uses Sankotronics door/win check VD to check if a door has been open for a long time. 

It's nowhere done, but maybe it is of use to you (or anyone else)

 

Jim

 

Please login or register to see this attachment.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • 11 minutes ago, jimicr said:

    Hi @AutoFrank, I was playing around and made a scene that uses Sankotronics door/win check VD to check if a door has been open for a long time. 

    It's nowhere done, but maybe it is of use to you (or anyone else)

     

    Jim

     

    Please login or register to see this attachment.

     

    Thanks @jimicr

    I'll take a look, may have a use for that :-)

     

    -f

    Link to comment
    Share on other sites

    • 0

    New version of doortimecheck, added possibility to annoy you with repeating alerts ;)

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    Hi @AutoFrank,

     

    Thanks for all your help, I'm just working with your VDs and I see they reference a StateTable, how is this State table built created please?

    Link to comment
    Share on other sites

    • 0

    Not sure if this is helpful to anyone else but I modified Franks original garage door / gate virtual device to better suit my requirements.  

     

    What I wanted was a simple open and close device that would show the current state of the device and allow you to toggle it's current state without having to actually go in to the device to see the open / close button.  

    This device has a few differences from Franks original.

     

    On the main Fibaro Devices screen it simply shows a toggle button which alters the state of the device.  I.e. if it's open it will close it, if closed it will open. When you open the Virtual device you will also get the options of open and close specifically.  During all statuses the icon is changed accordingly to reflect the current operation / status of the door / gate.

     

    The worded status of the device is shown as opened / closed or opening / closing depending on activity.

     

    To attempt to ensure you don't get a closed icon while the door / gate is opening, pushing a button immediately changes to the appropriate icon and wording then waits a preset amount of time before it checks the sensor again to set the worded and icon status as opened / closed.  To attempt to ensure it doesn't check to often, it firstly checks when the relay that controls the door was last activated, then it waits a preset amount of time after the relay activation before it checks the sensor status to confirm it's completed it's operation.  Due to some doors / gates taking longer / shorter time to fully open / close, you can of course alter this time.  

     

     

    Rather than have the virtual device turn the relays on then off again a few seconds later to replicate a button press, my devices are set to do this automatically via there parameters.  I found this more reliable than having the virtual device to turn them on, wait a second or two then turn them off, it's also less traffic across the network with less likely hood of a single getting lost telling the device to turn off.

     

    Pretty simple in all and suits my purpose perfectly.  Hopefully it will be useful to others too :)

     

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0
    1 hour ago, AutoFrank said:

    Thanks @CelticWebs

     

    That's a very nice modification - I might borrow that back :-)

     

     

     

    Please do, I only got this far from your help so I'd be very happy if it gave you something useful back.  the code could probably do with some tweaking to tidy it up a little, it is after all, my very first attempt at any LUA coding on the HC2 :)

    Edited by CelticWebs
    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...