Udp is implemented for both, but there are some differences.
Anyway, udp.write is valid syntax, you will find it if you dig into the library files.
So you likely have some other error on your code.
You appear to be using an older version of ESPHome, the format of this block is no longer valid and if you are using a recent version would have given you an error.
Maybe you are using a version without UDP support (or at least an earlier version of the UDP platform).
Hi,
I’ve deinstalled and reinstalled python, pip and esphome. After some small changes in the source-code …
All works fine!
Thanks for your help!
During installation I’ve got an error:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
gflanguages 0.7.1 requires protobuf<4,>=3.7.0, but you have protobuf 7.34.1 which is incompatible.
Successfully installed MarkupSafe-3.0.3 PyYAML-6.0.3 aioesphomeapi-44.6.2 annotated-types-0.7.0 bleak-2.1.1 cbor2-5.9.0 cffi-2.0.0 click-8.3.1 crcmod-1.7 cryptography-46.0.5 esphome-2026.3.3 esphome-dashboard-20260210.0 esphome-glyphsets-0.2.0 esptool-5.2.0 jinja2-3.1.6 markdown-it-py-4.0.0 mdurl-0.1.2 pillow-12.1.1 platformio-6.1.19 protobuf-7.34.1 puremagic-1.30 pydantic-2.12.5 pydantic-core-2.41.5 pygments-2.20.0 requests-2.32.5 resvg-py-0.2.6 rich-14.3.3 rich_click-1.9.7 ruamel.yaml-0.19.1 ruamel.yaml.clib-0.2.15 smp-4.0.2 smpclient-6.0.0 tornado-6.5.5 typing-extensions-4.15.0 typing-inspection-0.4.2 tzlocal-5.3.1 voluptuous-0.16.0 winrt-Windows.Devices.Bluetooth-3.2.1 winrt-Windows.Devices.Bluetooth.Advertisement-3.2.1 winrt-Windows.Devices.Bluetooth.GenericAttributeProfile-3.2.1 winrt-Windows.Devices.Enumeration-3.2.1 winrt-Windows.Devices.Radios-3.2.1 winrt-Windows.Foundation-3.2.1 winrt-Windows.Foundation.Collections-3.2.1 winrt-Windows.Storage.Streams-3.2.1 winrt-runtime-3.2.1 zeroconf-0.148.0
Hi Daryl, I’am also not affraid about the dependencies …
Now my program works well with one UDP-sender (this is a industrial produced part, no chance for any change).
I receive the UDP-message and send the correct answer.
But I need to handle many of these parts. The only difference between the UDP-senders is the IP-address. But unfortunatelly there is no access from the UDP-component in ESPHome to get the address …
I see only three options:
play Man-In-The-Middle with another µC and change the content of the UDP-messages (e.g. add an information about the IP-address)
dive into the source-code to get the IP-address inside ESPHome from anywhere