Hello everyone,
Following the closure of GitHub issue #18 (« let’s discuss this on the forum »), I propose the feature here.
The Need
External integrations run in an isolated container that does not have access to USB serial ports.
Today, the manifest allows requesting only these hardware classes: coral-usb, coral-pcie, gpu, video. And only for sub-containers (containers[]), not for the main integration container.
Result: impossible to directly read a serial USB key.
Affected Integrations
I have developed two integrations that need this:
But the need is broader: Zigbee, Z-Wave, EnOcean keys, modems, etc.
Current Solution (Not Ideal)
Going through ser2net (or socat) on the host machine, which exposes the serial port as TCP.
The problems:
- You have to install and configure ser2net manually via SSH → not suitable for Gladys users.
- It opens an unauthenticated network port on the local network.
- Another brick to maintain that can fail.
What I Propose
Adding a serial class, which follows exactly the same rules as existing classes:
- Requested in the manifest:
"devices": ["serial"], also for the main container. - Authorized by the user in the interface (switch during installation, removable at any time).
- Mounted only if present on the machine.
A few additional ideas:
- The user chooses the key from a list of detected serial ports (only one device is mounted, not all
/dev). - Use the stable path
/dev/serial/by-id/...so it still works after a reboot or USB port change. - Optional filter in the manifest (USB vendor/product ID or a label) to only offer compatible keys.
- Never a free
/devpath in the manifest, like for other classes.
Open Questions
- What to do if two integrations (or a native integration like Zigbee2mqtt) want the same key?
- How to handle the key unplugged and then replugged on the fly?
- One serial port per integration, or multiple?
Related GitHub Issues
- Gladys Core (device mounting): External integrations: allow access to a USB serial device · Issue #3194 · GladysAssistant/Gladys · GitHub
- Integration store (manifest schema): External integrations: allow access to a USB serial device · Issue #18 · GladysAssistant/integration-store · GitHub
- JS SDK: External integrations: allow access to a USB serial device · Issue #39 · GladysAssistant/integration-sdk-js · GitHub
As soon as the class exists, I will update my two integrations to remove ser2net.
What do you think? If you’re interested, don’t hesitate to vote for this topic ![]()