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
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
-- code to write the state table
jS.driveway.gateState = 0
jSonosTable = json.encode(jS)
fibaro:setGlobal("StateTable", jSonosTable)
This sets the icon
fibaro:call(device, "setProperty", "currentIcon", 1954)
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
Garage_Control(1).vfib
Gate_Control(1).vfib