Hello everyone!
Today I would like to share an automation project I made a couple of months ago and I rewired and fixed it just a couple of days ago.
It’s a system interacting with a Came ZA3 control board to open/close a swing gate. It’s based on Home Assistant and ESPHome.
Long story short: with a NodeMcu (ESP8266), a couple of power rectifiers and converters, an optocoupler and a relay, I am able to open/close the gate and to know if the gate is open or closed.
The power supply comes from the Came control board (pins 10 and 11), and it’s 24V AC. It gets converted to 5V DC and it feeds the NodeMcu.
The NodeMCU drives a relay that “presses the button” to open/close the gate using pins 7 and 2 of the control board.
Then, the final part: getting to know if the gate is open or closed. If the gate is open, on pins 10 and 5 there’s a 24VAC current, that is rectified with a power converter similar to the one I use for the power supply of the NodeMcu and it feeds the optocoupler. Then the optocoupler is connected to a pin of the NodeMcu.
Now a funny thing: with the temporary red-black wires, the Came remotes stopped working. My system was generating some interference that disturbed the 433MHz band.
After rewiring with a proper multi-wire single cable, remotes started working again!
Thanks for reading! Comments and suggestions are welcome!
Hey, thanks for detailed post. I also have Came gate system ZBX7N (sliding gates) and was thinking about the same… I will probably need two optocouplers since I have two contacts one for open, one for closed (if they both are off, means the gate is half open or currently opening/closing)
Couple of questions:
I see that you are using pre-made electronics, can you post a link where you bought them?
You say that when the gate is open there is 24AC on 11 and 5 pins, but the diagram shows 10 and 5?
How does the optocoupler work? I see you have GND, VC and pin both wired to optocoupler, but the ones I saw for sale have only two connections? IN and GND?
Hi!
Glad you are interested! Here are my answers to your questions.
I bought them on Aliexpress and Banggood. I am not able to build my own components, and they are just cheap to buy. A couple of links of similar products (can’t find the original links):
You are right! I fixed the description. The diagram is correct. Thanks!
I’m not familiar with the optocouplers you are talking about… are they those? https://www.aliexpress.com/item/4000121424232.html probably they are equivalent, I’m such a beginner I can’t tell the difference…
Thanks for response I didn’t want to wait so I’ve tried to solder my own solution by just using optocoupler 4N35, diode, capacitor and couple of resistors, but oh well that does not seem to work
Hi, I have some problem with power.
Using LM7805 AC/DC8V-24V to DC5V I’m trying to power up esp32 but it looks it has less power than needed for esp32. In your photo I see that you have a different power unit to power up the nodemcu. Have you had some similar issue? Do you know which power unit you have?
When for testing I use the powerbank to power up esp32 it is working fine.
That’s super interesting! With a single device, the Shelly UNI, you are getting more or less the same result as me, while I used several components stuffed in a box.
Were you able to fit the Shelly UNI inside Came box, or did you place it in a separate box?
How is the antenna range?
Shelly uni is very small, i place it inside CAME box. It has an external antenna and my wifi router is inside my garage. It has more or less the same wifi range of your phone.
the gate detector is very practical, I have been using it for several days in my home automation scenarios. ( mqtt + nodered + IPcam + telegram/nest hub )
remark: i don t connect IN_2 to C1 ,it doesn t work. I assume it s because CAME have a pull up resistor with the 5V CAME command side (see figure below).
Made adjustments for my Came BX78. I’ve used both inputs on Shelly and now cover able not only to tell if it’s closed or opened but also opening or closing:
My wife often forgets to close gate so this automation quite usable for me:
alias: She forgot again
description: ""
trigger:
- platform: state
entity_id:
- cover.gate
from: closed
for:
hours: 0
minutes: 5
seconds: 0
action:
- service: notify.telegram_all
data:
message: Gate is open for too long
- service: media_player.play_media
data:
media_content_id: Gate is open for too long
media_content_type: text
target:
entity_id: media_player
mode: single
Curious, don’t the Came motors just have a dry contact connection you can switch with a Shelly relay to operate the gate without having to write code into them?
I’m probably being dumb ass and missing something obvious here.
Hey!
I have ZF1N one and successfully hooked shelly uni to control open/closing but can’t get states working. I’ve tried using 10 and 5 terminals as per system documentation but it seems that it doesn’t trigger relay state. I’ve used shelly app to set it up with mqtt and controlling it through that. Is there anything i’m missing? Some specific settings in app or terminals might not be working properly?
Based on the provided payload from mqtt on shellies topic I see that both inputs are always “1”