Centurion D5 simple integration with Home Assistant

At first I used D0 for Status LED and D1-4 for Relay 1-4.
I switched it to D1, D2, D5, D6 for Relays 1-4 and D7 for the Status LED, but got the same result where the relays trigger when the Wemos D1 mini gets power. I tried adding restore_mode: ALWAYS_OFF, but doesn’t seem to do much.

# Open Gate - Gate Will Autoclose
switch:
  - platform: gpio
    pin: D1 # GPIO5 I2C SCL
    inverted: yes
    restore_mode: ALWAYS_OFF
    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 # GPIO4 I2C SCA
    inverted: yes
    restore_mode: ALWAYS_OFF
    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: D5 # GPIO14 SPI CLK D3
    inverted: yes
    restore_mode: ALWAYS_OFF
    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: D6 # GPIO12 SPI MISO D4
    inverted: yes
    restore_mode: ALWAYS_OFF
    id: relay4
    name: "Lock Gate"
# Status LED 
binary_sensor:
  - platform: gpio
    pin:
      number: D7 # GPIO13 SPI MOSI D0 
      # mode: INPUT_PULLUP
      # inverted: no
    name: "Status LED"

What program/platfom do you use on the wemos?
The code seems to be HA interface

1 Like

Yes, ESPHome yaml for use with Home Assistant. It shows up fine in HA, but relays trigger when rebooting the Wemos, opening the gate.
I also need to figure out how to process the pulse from the Status LED to be qble to detect the different states (Open, Closed, Opening, No Mains etc)

Certain pins are pulled high as part of the bootup and selecting bootup mode for the esp8266, avoid those pins. I would say use D5 D6 D7 D8

If you are using inverted mode and pull everything low you might be pulling it high… just something to consider.

I used a reed switch to know if the gate is open/closed.
I also made my own pedestrian mode by using delays. Trigger wait 3s. trigger. wait 10s. trigger. opens for 3s…stops. 10s remins open. closes.

I guess I got the inverted properties wrong before. Eventually figured out that only the LCK relay should be inverted.

I ended up using a different board. Here’s the ESP Home firmware.
Added a Status sensor so I don’t need to remember what the LED blinks mean.

1 Like

On the topic of the D5. Slightly OT in all other ways :slight_smile:

My D5 Evo would ram full speed into the stop ends, and then go into collision mode. Recalibration worked for only a few minutes at best. I eventually managed to get it to sort-of close, because we were away for a few days.

I found the problem though. It has a thing they call a DOSS sensor. It’s essentially an optical sensor that counts the slots in an encoder wheel so it knows how far the gate has moved. You can find this sensor by looking in the middle of the chassis, it usually has a warning sticker on it that says never to put in oil, and it is connected to the same harness as the origin sensor, and wired to the “encoder” input on the control board.

The sensor itself was fine. The encoder wheel was dirty in my case, and also a little wet. After cleaning up the encoder wheel, the gate returned to normal working order.

Maybe this post helps someone one day.

3 Likes

being electronically challenged when me and the wife settle in at around dusk i insert a piece of bloudraad to lock it… good excuse for getting some fresh air :upside_down_face:

I think I have the exact same problem. Every now and then it slams into the stops. Was told it needs a reconditioning or replacement by one guy who showed me the encoder wheel was dirty (he claimed oil). Another guy (who had no idea what the encoder wheel existed and insisted that only the magnet is used to detect the distance) told me the first one is taking me for a ride amd that it needs reprogramming (and quoting me for it amongst other work I need done to garage doors). I didn’t make use of either of their services. Reprogrammed the thing using the wizard after he left and no problems so far. Maybe I wiped some of the dirt away while checking for “oil”.
There’s a place to put special oil for the gearbox under the battery.

To clean the encoder wheel, I pushed the tip of a clean rag down there, with a small screw driver to hold it against the wheel. I had the gearbox disengaged and could move the gate by hand. By moving the gate, the encoder wheel would then spin against the rag, and so I cleaned it.

What I think happens, is a bit of oiliness does “sweat” out into that area, but also water. If there is a drop of water on that wheel, it is enough to deflect some of the light and cause it to misread one of the slots.

Reviving an old thread.

I’m years away from Home Assistant stuff and Node Red.

Looking for something simple to open and close my gate remotely. Are there any plug and play type modules for a gate motor that will connect it to your wifi and which I can control with an app?

I have the D5 Evo but their module is crazy expensive (R3K) and also being a GSM unit which requires a sim card - and you dial your gate open or closed.

There must be something better than that.

I see Sonoff has something like that with an app, but hoping to hear from members here what they have and what works, potential pitfalls etc.

I have a garden gate. The camera bell on it has now failed 5 times.

You know those garage door openers, the blue one? Got one like that with a relay to trigger the lock on the gate at a fraction of the cost.

Now to get a camera there, the next move.

Is it something that works wireless? Picture please?

Will something like this work?

This: ET-Blu Mix 1 Button Remote - SecurityKing

With this: https://www.security-store.co.za/product/et-blu-receiver/

No App, just the remote where it is convenient, to activate the remote receiver, wirelessly, to do something.

One idea.

I want to be able to open my Pretoria house gate from Cape Town. We have loads of remotes.

This should do it for you, as long as its connected to the WiFi network and you have an internet connection in Cape Town, you should be able to open the gate from your phone.

R200.00 is not going to break the bank.

Think I’m going to order one and see if I can get this up and running.

I see Makro also stocks the Sonoff. I’ll try them first.

https://www.makro.co.za/electronics-computers/wifi-networking/accessories/accessories/sonoff-1channel-inching-self-locking-wifi-switch-5v-12v-7-32v---open-and-close-gate-from-app-alexa-google/p/0c41d171-6f50-4953-bf79-32caf400f02e?gclid=Cj0KCQjwtJKqBhCaARIsAN_yS_n87O7qeIf6_HHRPIt2s7so8bHTEDqgzYkLQJ_dxZKNCrQgqIo4xeIaAnNEEALw_wcB

Sonoff has a 12V board called the Sonoff SV. It’s essentially the same as the AC type units, except it has no AC power supply. You can flash Tasmota on it, or use Ewelink if you prefer.

Does need to be within Wi-Fi range. My gate motor is at the edge of my Wi-Fi reach, so I am better off with something RF-based.

Yes, 12V directly from the battery and the Ewelink looks user friendly enough.

Been wanting to do this for a long time.

Added a Shelly Uni to my D5 motor today. I can now see if the gate is closed, whether the beam is broken and can trigger the main gate and pedestrian opening, all from the comfort of my phone. Technology is wonderful.

2 Likes