coupling reCamera n8n Telegram
Introduction
Among various IoT application scenarios, the information exchange and automatic processing among devices often demonstrate the system's value more than the mere recognition capability. reCamera offers stable local AI visual recognition capabilities, while n8n provides a flexible visual orchestration platform for data processing and process automation. When the two are combined, the detection information is no longer limited to the local devices, but can become an event source that can be further utilized.
This tutorial introduces a simple and efficient integration method: the recognition results of reCamera are pushed in text form to n8n, and then n8n automatically sends them to the user-built Telegram personal Bot via API. Through this link, any recognition event can be immediately pushed to the mobile device, thus building a lightweight notification system that spans multiple devices and platforms. The entire process does not require writing complex code; it only requires completing the necessary node configuration to quickly achieve the goal.
Hardware Preparation
One reCamera (it can be any of the 2002 series, HQ POE version, or pan-tilt version, but note that the POE version does not have WiFi functionality and requires a switch with POE function to be connected in the same network segment)
one computer (A virtual machine configured with Ubuntu 22.04, used for installing n8n)
| reCamera 2002 Series | reCamera Gimbal | reCamera HQ POE |
|---|---|---|
![]() | ![]() | ![]() |
1. Install n8n (in virtual machine)
(1) Install Docker
sudo apt update
sudo apt install -y docker.io
After the installation is complete, enable and set the boot
sudo systemctl enable docker
sudo systemctl start docker
Verify that the installation was successful:
docker --version
If you see something like:
Docker version 28.2.2, build ...
(2) Let the current user use docker directly (without sudo every time)
sudo usermod -aG docker $USER
Then exit the current terminal and log in again.
docker ps
(3) Run n8n container
sudo docker run -it --rm \
--name n8n \
--network host \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n
The first run will automatically pull n8n image, about several hundred MB, a little long
(4) Access n8n
Open a Firefox browser in the virtual machine and enter:
http://localhost:5678
You can enter the n8n interface to create an account.
2. Configure n8n
(1) Create a "Webhook" node to receive ReCamera data
Click Personal-Create workflow

Click the plus sign-search box to enter "webhook"-click the first "Webhook" node

Now we have entered the configuration interface. Here we need to modify two places. First, select "HTTP Method" as "POST". Then, modify "Path" as any name. Here I will take "recamera_detect" as an example.

After this step, he has automatically saved it. At this time, click "Back to canvas" in the upper left corner to return to the main interface and prepare to create the next node.

(2) Create "Code" node to process received data
Click the plus sign-enter "code" in the search box-click the first "Code" node

Then select "Code in JavaScript"

Replace the original content with the following code:
const payload = $json.body?.payload || $json.payload || "";
const matches = payload.match(/number\s*:?\s*(\d+)/i);
const peopleCount = matches ? parseInt(matches[1]) : 0;
return [{ json: { peopleCount, raw: payload } }];

Click "Back to canvas" in the upper left corner to return to the main interface
3. Configure Telegram
(1) Create a Telegram Bot and get its API
Open the Telegram and search for "BotFather"

Create your Bot, fill in the robot name and user name, and then click "CREATE BOT"

Then this interface will appear. After the keychain icon, there is a string of particle effects, which is the API of the Bot you created. Click "Copy" and you will use it later.

(2) Search userinfobot to get your personal Chat ID

After clicking to enter, click "Start" in the upper right corner. At this time, it returns a message containing your ID. Remember this ID, which will be used later.

(3) continue to configure n8n and add a third node
Click the plus sign-search box to enter "telegram"-click the first "Telegram" node

After clicking, continue to enter "message" and select "Send a text message"

After entering the node, select "Create new credentila"

Then copy the API of your Bot just copied to "Access Token" and click "Save" in the upper right corner"

After clicking "Save", the system will verify whether the API exists. If everything is correct, the words "Connection tested successfully" will appear. At this time, click Exit in the upper right corner.

Then fill in the personal Chat ID you obtained before.

Then fill in "Text":
当前人数:{{ $json["peopleCount"] }}

Click "Back to canvas" in the upper left corner to return to the main interface
4. Configure Node-Red
First, open the n8n interface of the virtual machine, double-click the "Webhook" node you configured earlier, enter the configuration interface of the Webhook node, and then click "Production URL" to copy the following "POST" address

The previous configuration steps are the same as the Home Assistant, only when configuring the "http request" node, the URL address needs to be modified, that is, the POST address you just copied in the virtual machine, and then modify the localhost to the IP address of your virtual machine

View Virtual Machine IP
ifconfig
Please remember! Make sure to connect Recamera to the network!!! Otherwise, communication will not be possible.
5. Open Active and enter the Executions interface to view the message
Click the "Inactive" switch in the upper right corner to turn it into green Active, then click "Executions"

At this time, you will see that there are many timestamps on the left that have been refreshing. If you see that the timestamps have been refreshing, it means that your reCamera data has been connected to the n8n platform!

Then check your Telegram, there should be a lot of message reminders, at this time, you have successfully pushed the reCamera message to the Telegram!!!

If you want to view the detection content of a certain time, you can double-click that timestamp, and then double-click "Code in JavaScript" to view the OUTPUT on the right.

Tech Support & Product Discussion
Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.


