esphome / esphome/feature-requests
Stream server component (serial-over-wifi)
- Dominant language
- No language data
- Stars
- 450
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the problem you have/What new integration you would like**
A server that allows bidirectional communication with a serial port over WiFi. Now, I know this has been requested and rejected before (#213, #415, #619, #638), but I disagree with the given reasoning (and I have a patch :)):
* Re [#638](https://github.com/esphome/feature-requests/issues/638#issuecomment-599139055): Plenty of HA integrations communicate over a serial port, and can be used with such a server to control remote devices. E.g. `acer_projector`, `alarmdecoder`, `arduino`, `aurora_abb_powerone`, `dsmr`, `edl21`, `elv`, `enocean`, etc.
* Re [#415](https://github.com/esphome/feature-requests/issues/415): I've taken a quick look at some HA integrations using serial ports, and pretty much all of them just send some messages back and forth over the serial port. Nothing more fancy such as control sequences or hardware flow control. So I think 95% of the use cases can be captured with a quite simple implementation, and if it's made extensible the rest can use a custom component.
* Re [#213](https://github.com/esphome/feature-requests/issues/213): I agree that its frontend and backend should be separated - but luckily ESPHome already has a `Stream` abstraction implemented by the UART interface. Thus, the backend is already there, and we only need a frontend to expose a Stream over TCP.
* One other major benefit of integrating a serial-over-wifi bridge is that it'd allow a single ESP to be used as a serial bridge and for sensors. For example, I have an ESP with OpenTherm GW next to my central heating installation, but I also want to hookup some sensors to monitor power consumption.
**Please describe your use case for this integration and alternatives you've tried:**
See above. I want to hookup both a serial port and some other sensors (or switches, etc) to a single ESP integrated in Home Assistant.
Alternatives are various different ESP firmwares (ESPEasy, ESPLink); but neither of those allows me to easily integrate a sensor in HA.
**External component**
For now I've implemented this as a external component, which is available [here](https://github.com/oxan/esphome-stream-server). It creates a TCP server listening on port 6638, and relays all data between the connected clients and the serial port. It doesn't support any control sequences, telnet options or RFC 2217, just raw data (I don't think the fancy stuff is actually useful, very few devices require it and they aren't actually wired on the common ESP modules).
However, I think it'd be nice if this was available in ESPHome by default. I can create a PR to rework my custom component to integrate it in ESPHome itself (including configuration etc.) if you agree to accept this functionality.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.