esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
417 stars 26 forks source link

ESPHome for wired interconnection (e.g. via PJON) #2236

Open mkaiser opened 1 year ago

mkaiser commented 1 year ago

Describe the problem you have/What new integration you would like

I like to start a discussion on wired interconnection of ESPHome sensors.

Please describe your use case for this integration and alternatives you've tried:

ESPHome is lacking support for wired-interconnected devices. I used MySensors in the past, but the ESPHome approach with integrated OTA and security features is much more powerful.

See illustrations below for current / wished architectures.

Additional context

Hello fellow ESPHome'ians and HomeAssistant'ians,

I like to start a discussion on wired interconnection of ESPHome sensors.

Some time ago, there were some issues (https://github.com/esphome/feature-requests/issues/1655 and https://github.com/esphome/feature-requests/issues/1288) related to this, but there was not much activity and no follow-ups.

I drew a sketch, abstracting my current home automation:

Architecture_Wired_MySensors drawio

For several reasons, I like to migrate to ESPHome. This is my dream setup:

Architecture_Wired_ESPHome drawio

I am working as a researcher in hardware design (especially FPGAs). So I know hardware and software stuff ;) For several weeks I started to dig into the ESPHome sources, but still, I could not figure out what has to be done to make ESPHome more "wired"

Central question: Can the underlying ESPHome interconnection system be re-routed to not using TCP but first passed to a Gateway and then routed via TCP to Home Assistant?

If it is possible. Could you point me to some code, so I could work on some more detailed architecture?

Actually, I don't care much about the underlying protocol (e.g., CAN, RS485, PJON(https://github.com/gioblu/PJON) ) as long as it is capable of driving ~30 physical sensor nodes with ~500m wire (Build a house and have several YSTY-0.8 with at least 4 wires basically in every room ;) ). Throughput is not critical. Let's assume < 1kbit/s sensor.

Happy to provide you with more details and looking forward to some discussion!

~ Martin

Draw.io image source here: https://github.com/esphome/feature-requests/assets/29856783/2a9aad30-a897-4fc9-86ed-82eb350e6b96

mkaiser commented 1 year ago

I am not sure, if this is the right place to start a discussion. Should I start a thread in the HA community, too?

nagyrobi commented 1 year ago

Open a thread on Discord...

raintonr commented 7 months ago

Kindof similar to #708? Ie. if you could place a number of client ESP devices on Modbus that could achieve the OP's goal.

Although PJON looks kindof interesting too as it looks like this could be implemented without transceiver modules for the physical RS485 layer... obviously without the benefits of RS485.

jowgn commented 6 months ago

Im curious, @mkaiser did you have an luck to build something like this? I'm building a rather complex central heating system that would highly benefit form some solution like yours. I am mainly interested in communicating sensors data, statuses and so on via wire to feed the local logic on the esphome instances. The sensor data could still be provided to Home assistant the 'normal' way via WiFi from each node.

mkaiser commented 6 months ago

hey raintonr and jowgn,

I am more going into the CAN direction: Use CAN transceivers for the physical interconnection (which comes with collision detection / avoidance/ re-transmit etc.) by design.

Additionally I made some successfull tests with the CANopen software stack, which was ported to ESPHome by a very competent, friendly and helpful guy here: https://github.com/mrk-its/esphome-canopen Discord: https://discord.gg/VXjUSnUWsd

The maintainer mrk-its made some progess in terms of over the wire "OWT" updates. So this approach comes quiet close to my "wishes" in my first thread :)