How To: Driveway Swing Gate Automation (Shelly + BFT) - Working Perfectly with states!

Hey Curtis,

Great write up! I was excited to read this, as I was considering buying BFT’s expensive wifi module for my BFT DEIMOS BT A400 motor. It seems to have all the same terminals you used as well. So I bought myself two Shelly Plus 1’s, and I’ve hooked one up to my garage door opener, which supplies 12v and works fine to control it.

I’ve now tried to get the Shelly Plus 1 working with the BFT motor, however it doesn’t seem to want to work with the 24v DC terminals. It doesn’t power up at all (no access point published). I’ve confirmed with a multimeter that power is running in to the Shelly (25.7v to be exact). I’ve also confirmed the same Shelly works on 12v and 240v. Is this the same problem you were having with your unit???

BFT400 Manual

Cheers,
David

Thanks Curtis,

Very helpful. I’d been looking at solutions for my BFT Ultra Ares 1500 for a while but hadn’t realised you could get the state from AUX3 as well.

I’ve set this up with the configuration you describe using a Z-Wave Fibaro Implant FBGS 222. I tried to be a bit too smart and took the power off the expansion port on the Ultra board (but I realised two issues - firstly I’d chosen the wrong pins and killed the gate controller board (an expensive error). The second issue is the output of ~34V DC (rectified from the transformer output of 24V AC RMS) was higher than the max for the Fibaro implant. (9-30V).

When using the Fibaro Implant you need to change the Local Protection State to NoOperationPossible this disconnects the output from the input.

I set one of the outputs from the Fibaro to open the gate fully and the second to operate the pedestrian mode. Let me know if you want more detail

All working well now. Can do Full open or Pedestrian, and the Input for the Fibaro is set as a Normal Open Alarm Input. Hence I see Home Security - Intrusion goes from Safe to Unsafe when opening and open and flashing between Safe and Unsafe as it closes.

One downside with AUX3 set to Mode 1, you can no longer use the second button on the remote control to activate Pedestrian mode.

Nex step is to copy some of the Lovelace stuff you used, and also setup some geolocation triggers to open the gate as you are ~200 meters away (and driving not walking).

One other issue I’ve found with the Fibaro Implants that are power from another power source (rather than the circuit you are connecting to) is that it is important to figure out if there are any ground connections when using the Inputs, and you need to make sure you use the ground on the Fibaro to connect to the ground on the other board you are controlling, otherwise you get unreliable inputs.

sos_nz tnks 4 sharing. maybe we could buy a shelly 1 + add on and read current bft status (open/closed) from addon wired to terminals #26 and 27 (or #20 and 21) ?


(https://www.shellyitalia.com/sensore-di-temperatura-addon-promo/?gclid=CjwKCAjwloCSBhAeEiwA3hVo_QGEIttekxt9vOCzNTzdwFIgy9nGHVHk1usiDokYDYZHoGVLlUuuixoC7fMQAvD_BwE )

I think I’ve answered my own question about this. I’ve re-measure the output from the 24v AUX terminals and it is AC not DC! So now I’ll look in to a small enough AC/DC converter or see if it’s possible to tap in to the 240v terminals.

Thank you @sos_nz for the great project! I adopted it and did some improvements:

  1. I used Shelly Uni instead of Shelly 1 - it has 2 outputs, 2 switch inputs and sensor inputs. The main benefit is you can have separate Open and Close actions - instead of single button, when you never can be sure of the current action (eg. after reset, activating safety). It also has an external antenna, which is great for a gate usually far from home. And it works off 24V. And is even smaller than the 1. And is just as cheap. The full package.
  2. Output 1 wired to terminal #61 (+#60 COM) - logic set to IC=2 : Open
  3. Output 2 wired to terminal #62 (+#60 COM) - logic set to IC=3 : Close
  4. Input 1 wired to terminal #20-21. Logic Aux=6. Normally I have a warning light attached here, which signals that the gate is moving. I can’t change it - but it’s actually very useful to read it, because I have information “gate is moving”. This is easier than detecting signal that goes on-off-on-off with Aux=1 logic.
  5. Input 2 wired to terminal #26-27. Logic Aux=8 - contact closed if gate is closed. So actually I have a reed sensor. But I’m experimenting with other options ATM.
  6. As a bonus, you can attach a temperature sensor to one of the dedicated inputs, eg. to detect frost.
    Below is how the module looks.

    Thanks again @sos_nz, I did all of this thanks to your post :smile:
5 Likes

As another way to skin a cat with HA. I use a mimolite with my Z-Wave network. Posted about it here: Swing Gate sensor - #2 by Markus99

This has been working great for me for a few years now.

Doesn’t require any soldering either. Just a couple of jumper cables into my gate ‘motherboard’, battery and open/close sensor.

Hi,

I am a software engineer and a bit uninformed regarding electrical circuits!

I am try to connect my BFT ultra sliding gate to Shelly uni!

First question.
@Khar how do you power your Shelly uni?

Second question.
@Khar you mentioned that you connect Shelly’s input 1 to BFT board AUX0 (20-21). Input 1 has only one wire connection, but connect two input pins on BFT board ? Where does the second one come from ? Is it the L pin on shelly uni?

Hi Curtis,

Thanks for sharing your great project! would be very useful if we can make it working…

I’ve got Shelly 1 and BFT and planning to replicate your project. Port 51 of my BFT board doesn’t have +24V, so when I check the voltage difference between Terminal# 51 and Terminal# 60 (COM), it shows almost -24V, that’s also the same with the voltage difference between 50 and 60. Did you face with the same issue that you decided to use AC to 12V DC converter?
Would you please share your wiring diagram? My concern is connecting SW to Terminal #27 and L(-) to Terminal #26. I need to make sure I’m wiring the Ground (or COM) correctly to L(-) so I don’t burn my BFT Control board.
Thanks!

I’ll try to help @vh13294.

how do you power your Shelly uni?

Terminals #50-51, it’s DC 24V. Shelly’s L (pin 1) goes to 24V+, shelly’s N (pin 2) goes to 24V-. Please double-check, you shouldn’t mix + and - when operating on DC, it can potentially damage the device.

you mentioned that you connect Shelly’s input 1 to BFT board AUX0 (20-21). Input 1 has only one wire connection, but connect two input pins on BFT board ? Where does the second one come from ? Is it the L pin on shelly uni?

You only connect one input wire of Shelly to terminal #20. It will be High/On when the contact is closed, Low/Off, when the contact is open.

Please note that while terminal #20-21 has its own power, terminal #26-27 is a “dry contact” - if you plan to use #26-27 as well, you have to:

  1. connect terminal #27 to #51 to get power (just get any short wire)
  2. connect shelly’s input wire to terminal #26

If you have any more questions, pls. let me know.

1 Like

Thanks! @Khar, you are a life saver!

Sorry to bother you with more questions.

  • My 24V pins are already connected to two photocells, is it enough to power the Shelly uni as well ?

  • For the output pins of Shelly uni, does the order of +/- matter? Since it is powered by DC, the output must be DC as well?
    But I can’t determine which output terminal is +/-. Is it the one that label N / GND = Negative ?

  • Would you mind sharing me your yaml config ?

Yes, there will be enough power.
For shelly’s outputs the order doesn’t matter - they are “dry contacts”, meaning they are not connected to any power. When they close they just create a short between 2 wires. Actually, you can understand how it works with a simple test - take a paperclip and try connecting terminals 61-60 or 62-60, it should give the appropriate command to gate.
Sorry, can’t share the YAML with you because I decided to reprogram the Shelly with ESPHome, so there is no YAML in HA, but all logic is inside my program. I’m still not happy about it, I need more time to get finished - basically it works for simple open / close / monitor current position based on time. But scenarios when somebody uses remote externally during operation are tricky. I have to move to generic cover component, which means writing a lot of code in C++ (lambdas). In turn, this is not my strongest point, I’m much better at electronics :slight_smile:
Good luck @vh13294! If you need more info, just ask.

Hi. I grabbed a Shelly Uni also to try instead of an ACDC converter for the Shelly 1. I got the unit device and just tried to do a simple power load test to see if I could get a access point published.

I have a BFT Deimos Merak control board also, that outputs 24VAC from terminals 50-51, so I just connected the Shelly Uni Pin 1 and 2. (51 > 1, 50 > 2) while turned off.

When I powered the motor on, the Shelly Uni capacitor was smoking, and an led was blinking on it. I even briefly saw the access point appear. I powered off the gate, but when I powered it on again, the Shelly Uni was dead. Fried. So I’m back to the drawing board again. Hopefully someone with more electrical knowledge can tell me why this might have happened.

Hey @sos_nz.

Coming across this thread in May 2022, is there anything you’d change if you did it again? I’m looking to automate my twin driveway gates here (UK) and have a remotely accessible and very stable HA that I’d like to use. I’m happy enough making devices with ESP8266 and relays, so might go ESPHome rather than Shelly, but am not decided. I have power at the gate, but the motors and control board the previous owner of this house fitted are no longer happy. I’m not sure they’ve ever worked, so will buy the Kustos if you still rate it.

I have wifi reception down at the gatepost (so says my phone), but haven’t checked it with a Shelly inside an enclosure. Am feeling like @vh13294’s advice re the Shelly Uni might be an idea for its size, power and external antenna.

With your setup, do you just have access to the ‘open/closed’ state, or can you also see ‘moving’?
I’ve rigged my garage doors up with a SONOFF 4ch and they just show me ‘open’ as soon as the rollers start to lift, which is ok but could be improved.

Oh, and incase it changes things, I’ll probably add a video doorbell in the future.

Cheers for any advice you can give.

Hey @Andy_Allsopp, I did it using ESPHome. For device I used Shelly Uni - it’s very convenient, already powered by 24V, 2 inputs, 2 dry contact relays, external antenna already attached, protected from environment - see my posts above.

1 Like

Got you. Thanks for this. Am thinking I may want to read the photo sensors to flag to HA that it’s obstructed, so I’m thinking perhaps I need more inputs.

Also, I may be getting a Roger solution, with an Edge controller, so some different circuits to play with.

1 Like

With my BFT-Thalia I used this:

Shelly 1 v3 + addon

  • Shelly 1 v3: #1 and #0 from Shelly 1 to BFT Thalia’s case terminals #60 (COM) and #61 (IC 1)
  • AddonShelly: #black and yellow from Shelly to BFT Thalia’s case terminals #26 and #27

it works :slight_smile:
Cattura

Looks like I’ll be getting the Roger Edge1 controller. I’m waiting on the vendor to check that terminal 19->20 gives me a signal all the time that its open. Not quite sure whether this is night hours only, or turns off after x mins, etc.

Looks like I’ll be able to connect across 33 and 34 to open or close, though I’m wondering whether I need a 3rd switchable contact to open the ped gate.

I might also want read the ‘obstructed’ signal back from the photocells, as I can imagine that might be quite useful when triggering automations. The Shelly gives me a spare input, so it could be that I can detect a change here. Again, not sure whether they’re powered all the time, or only when the gate is being bothered.

Lots to explore. Might have to just buy the kit and find out how it works :slight_smile:

I might also want read the ‘obstructed’ signal back from the photocells, as I can imagine that might be quite useful when triggering automations.

Aren’t you overcomplicating this? I also have a tendency to ignore simple solutions, but I learned the hard way the KISS principle.
In reality, gate operation can be interrupted by a number of reasons - not just photocell, also other safeties like too high load when something gets in the way. Or somebody else using a remote. Or some kind of a fault. There are too many options, too much time to program all possibilities in the world.
I managed to read: (a) if the gate is open (b) if the gate is moving. From this you can easily figure out that your command didn’t complete successfully. This is simple to code and gives you pretty good information. Then you can act - e.g. try again. Or display camera view.
Just my advice from spending too much time on this exact project :slightly_smiling_face:

1 Like

Possibly…. I was coming more from the “leaving the gates open because we are expecting guests but also getting a chime in the house when they drive/stroll through the gap” use case, vs detecting a failed operation.

As you rightly say, the latter is easily done with a script that calls the operation, waits for 30 secs, checks the status and sends a notify if it doesn’t match the target.

Nice informations about the BFT and the shelly.

I’m using shelly1 on my bft, and it’s working well.
I don’t have the #26 and #27

If I want to get the status of the gate, do I have to connect only the SW to the #20 or #21 ?

My shelly is connected to the 220V, on 24VAC it’s not working well.