New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change voice assistant to use fixed ports #107406
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fiatguy85
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Hey there @OttoWinter, @jesserockz, @kbx81, @bdraco, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
IIRC, the reason this wasn't done was because, if multiple VAs happen to be working at the same time, they all break... |
I see, that does make sense. To limit the port to a range of ports, you would need to generate a random number within a range and potentially ensure it was not one of the last one or the last few assigned? |
Is the change to |
No, that was a mistake, I was trying to ensure nothing from my copied config directory got pulled in. |
c569fe7
to
29e7072
Compare
Ok, I have now updated this to use a small range of random ports, which avoids the conflict of multiple VAs working at the same time, but allows the user to only open a set number of ports. |
This should fix #105106 |
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Unsure if relevant or not: I am using this PR and it works. I cloned this fork, build the image and forwarded 10500-10520/udp into the container without network_mode: host. |
Adding that using this PR fixes my problem. I'm actually using the HA container with network_mode=host, and still can't receive the random UDP ports without disabling UFW. |
I am going to close this as we are currently working to send and receive the audio via the ESPHome API to make UDP not required. |
Proposed change
Change voice assistant to use a fixed port, rather than a random one. This way, only a fixed port needs to be opened for a device streaming to the voice assistant, rather than the whole range of UDP Ports.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: