Serial communication ESP32-Rpi for alarm system

Hi, this is my first post and I’ve been searching about this topic without luck yet. I hope it’s not duplicated elsewhere.

A while ago I started building a (wired) alarm system for my house in HA. First I tried with the GPIO pins of the Rpi, but it was a disaster because of false alarms or simply not detecting binary sensors correctly. After that I moved to my current setup: an ESP32 cia MQTT, but I’m concerned about the stability of the system if someone tries to jam the wifi signal.

What I would like to do is build a backup using something like serial communication between the ESP32 and the Rpi, as they will be only a couple inches away in their final location, to trigger the alarm if opening (state change) is detected wia MQTT or serial. Is there a way to do this?

I think I’m quite lost yet, but what I’ve done so far is to add uart to the ESP32 at in the EspHome dashboard and configuration.yaml.

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 115200
  - platform: serial
    name: serial sensor
    serial_port: /dev/ttyACM0
    baudrate: 115200

But I don’t know how to retrive the sensor information: value_template or Json maybe?

Any ideas on how to achieve this?

Thanks!

Why not use an esp32 with a wired ethernet connection?

Or simpler still, use an arduino.

Thanks! Currently my Rpi is hooked up to the router via ethernet, s that’s not an option (or is it?) :wink:

Arduino? Could be, but I’d like to avoid remembering C++

Of course it is possible. You surely don’t think there can only be two devices on a network?

Hi Eduardo!

Is there any update on this? I would do some similiar thing with esp32 via rpi and hass.io. I wolud convert 5ch analogue temp sensor data to digital.
I dont need wifi, as the rpi is next to the analogue sensor wires, and i
ant it to be as stable as it can.

UART communication?

Thx,
Viktor