Centurion D5 simple integration with Home Assistant

I always wanted to integrate my gate-motor with HA and now that I have a few days off, I made the time.

What I wanted to achieve:

1: Open the gate remotely and allow it to “Auto-close”
2: Open the gate and keep it open till I manually close it again.
(For those who have a Centurion Gate-motor and not know this, if you press and hold the remote button for 5 seconds, or till the gate pauses while opening, the gate will remain open till you manually close it)
3: Open the gate for pedestrians only.
4: Lock the gate so no remote or any other “Integration/Device” can open it. (This will be interlocked with my Alarm System. when the alarm is “Armed”, gate operation will be blocked)
5: See the “Status LED” to be aware of any fault conditions. (Low Battery, gate open ext… )

Gate Control

I used a D1, linear voltage regulator and a 4 Relay Board.

May add the following:

1: Battery Voltage
2: Open / Close limits to indicate gate Position.

My simple code, nothing smart just to make it work.

esphome:
  name: gate_d1
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "your_wifi_network_name"
  password: "your_wifi_password"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Gate D1 Fallback Hotspot"
    password: "system_created_password"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "chose_your_password"
   

ota:
  password: "chose_your_password"

# Open Gate - Gate Will Autoclose
switch:
  - platform: gpio
    pin: D1
    inverted: yes
    id: relay1
  - platform: template  
    name: "Open Gate - Auto Close"
    icon: "mdi:gate"      
    turn_on_action:
    - switch.turn_on: relay1
    - delay: 3s
    - switch.turn_off: relay1
# Open gate - Gate must be closed manually    
  - platform: gpio
    pin: D2
    inverted: yes
    id: relay2 
  - platform: template  
    name: "Open Gate - Manual Close"
    icon: "mdi:gate"      
    turn_on_action:
    - switch.turn_on: relay2
    - delay: 6s
    - switch.turn_off: relay2
# Open gate Pedestrian only
  - platform: gpio
    pin: D3
    inverted: yes
    id: relay3 
  - platform: template  
    name: "Open Gate - Pedestrian"
    icon: "mdi:gate"      
    turn_on_action:
    - switch.turn_on: relay3
    - delay: 2s
    - switch.turn_off: relay3
# Lock Gate at night    
  - platform: gpio
    pin: D4
    inverted: yes
    id: relay4
    name: "Lock Gate"
# Status LED 
binary_sensor:
  - platform: gpio
    pin:
      number: D0
      mode: INPUT_PULLUP
      inverted: no
    name: "Status LED"
9 Likes

Hi Jaco,

Do you have pics of the hookup inside your gate motor too? I know there’s a LOT of people online that want to do this.

Last, did you keep the original remote up and running too?

I have so many wires in there, intercom, remotes, Ac, passing through a picture wont be to clear.

Hope this quick drawing will help… All the components I have used.

I did, we have family with remotes, so I need to keep the receiver for them.

1 Like

At one stage I had something similar going but for some reason ( and I suspect I used the wrong IO port on a D1) the open trigger would trigger every time the board restarted. At that stage the Wifi was also not great so if the Wemos lost connection tasmota would restart the board and the gate would open not a good thing at all if you are not at home. Maybe I must revisit the setup again :slight_smile:

I was also considering to solder some leads into one of the remotes I have. Then run them through the relay , that way I don’t have to fiddle too much with the gate controls them self and have a bunch of wires in there.

@JacoDeJongh, what is the chances that you might do some home automation instead of solar work next time you are in Cape Town? :grimacing:

I mean, with home assistant it is possible to just code it all up at home and then just roll it out (on the software side) and then you just do the hardware.

What you have done with your gate is really nice. I love the “lock” function. Especially since my receiver broke and then caused the gate to open. Saw the gate just standing open the morning when I went to give the dogs water. Replaced the receiver, but I really do not appreciate that it isn’t “lockable” or just automatically locked when the alarm is set.

2 Likes

Now THAT is a very good brain fart if ever I heard one!!! :smile:
Take orders, build the parts needed, go and install them OR make them plug and play …
99% of my hesitation lies in the FACT that I blow shiite up.

Like I’m contemplating to remotely control 3 geysers … with Geyserwise having a SWAMBO override.
Dishwasher and dryer remotely switched on.
Thinking of linking the Paradox alarm system … that I can see what’s potting.
Slowly re-introduce camera’s that activate on human bodies i.e. have some AI built in.

And with all that is linked to HA, if HA server is off for whatever reason, default to their default states.

1 Like

Very nice.
I’ve done similar, the one thing I added was one of those magnetic door/window sensors to confirm that the gate is closed.
If the gate is open for more than 90s, then I get a notification on my phone, with a pic from the CCTV, and an option to close it. Been very useful with people staying here over Christmas.


(Ignore the fact that the gate was closed in the pic, I was testing my NodeRed flow)

2 Likes

Brilliantly done Jaco. I agree with other comments – by actually using the PEDESTRIAN feature and the lock feature you’ve made it one step safer :slight_smile:

I do agree with MongooseMan too – having a sensor to indicate that your gate is actually closed is a good idea. It would be great to tap into that part from the gate’s logic board itself, but I’ve yet to see somebody figure out how.

This was one of the first things I did in home automation – because I used to sit on the remote all the time and open the gate, with kids / dogs running out only for me to discover it an hour later.

In my mind this is the time to take away their remotes, create some users in Home Assistant and create a new dashboard linked to their user with only the gate setup. Much safer (since they can lose their remotes or have it stolen).

1 Like

For me the LED does the job for now, till I install the Limits. If the LED is on permanently the gate is open, flashing continuously, the gate is moving and flashing “codes”, there is some kind of error. Off means the gate is closed, but theoretically its unsafe as a broken wire can also be seen as a closed gate.

Oh man. I had family over who live in a very upmarket estate up in Centurion. They leave doors and gates open. All the time. So one starts with this careful ramp of first gently telling them that home invasions is an occasional thing, remarking out loud a few times that clearly the guests live in a security estate, escalating into passive-aggresively slamming gates a few times… none of which made any difference :slight_smile:

4 Likes

Then you did it wrong. :smile:

1 Like

My brother in law is a good engineer, but I’m not sure he’s very good at reading people. Evidenced by making jokes about my wife’s favourite shop (an ice-cream shop, and no, it isn’t her favourite) while he should know that the majority of women out there are extremely sensitive to any comment that may remotely suggest that they are fat…

Nope, most are not as we have one in the family too … and he is so totally unaware. :face_with_head_bandage:

After I have had to listen to a few complaints, I asked: “So why are you “guys” not telling him when he offends?”
“Ag, he’s a nice guy.” “they” said.
“Then what’s the problem?” I asked.
Now I’m the problem for not “understanding” see. (cwl)

2 Likes

I also have family in upmarket Centurion (Southdowns), and they do the exact same thing grrrrr.

Door and windows always open, never locked, not even vehicles. They really think they’re untouchable in their little “fortress”.

Yes. That one.

hi hi all. seen some nice old faces…

And the first thread i see after joining is this one, right after I spoke to Jaco.

Did a very similar setup the last 2 weeks, simple sonoff SV and a magnetic switch at the gate, the sensor/mag switch tells me if gate is open and the sonoff is configured as a dry contact that toggles the gate. and then all show/controlled via HA.
Like the idea that the gate gets locked if the alarm is armed, need to see if my D5 has that feature, can then “lock/unlock” it via the Sonoff SV and some NodeRed flow’s.

and then also went and connected all my outside security lights with sonoff basic’s, configured into HA, and then integrated with my Paradox alarm system, if it senses any motion, then it switches the relevant lights on.

fun and games.

G

1 Like

Think we chatted re some of this on MYBroadband ?

I’ve jsut done allot of Paradox (via PAI) integration with HA.

For the Geysers, Pool and Stove I used a sonoff 4ch and some contractors, so that way I can switch more than the 10Amps that the 4ch can handle, all the 4ch does is trigger the contractor.
and then I control the 4ch from HA.

G

hmmm, need to see how i can do something like this “flashing” to indicate the gate is in motion, and get that feed back onto the Sonoff SV and back into HA.

G

I’ve done the “gate is closed” via a mag switch fitted to the gate, that feeds back as a switch via gpio14 on the sonoff SV.

G

curious guys.

I got a Sonoff SV connected as per DrZzzz’s example to my gate, using the contractor (configured as a dry contact) to “trigger” the gate open and closed, and then a cheap magnetic alarm reed switch to tell me if the gate is open/close. Discovered my gate also have a “lock/unlock” (went looking at the control board after nothing Jaco’s comments above and it’s also a D5) function, also works on a simple trigger. any ideas. I got 2 sets of gpis pins open, best I can figure out is to connect a relay to them, and then have the relay do the trigger onto the /lock/unlock, there is a pedestrian trigger on the D5 also, might use the last pair of contacts on the Sonoff SV via a 2nd relay to trigger that,

comment.

G