Skip to content
Get started

UDP Packet Interface

The udp Packet Interface platform sends and receives packets over the network using the UDP component. Each packet is sent as one UDP datagram to every address configured in the udp component, and every datagram received on the listen port is passed on as one packet.

The interface enables both sending and receiving on the udp component it uses.

When the udp component sends to one IPv4 address that is not a broadcast or multicast address, the interface accepts packets only from that address. It then joins exactly two devices, so no addressing layer is needed, and one cannot be configured. An address ending in .255 is taken as a broadcast address; set point_to_point when that guess is wrong for your subnet. A point-to-point link logs a warning, at most once a minute, when it drops a packet from another sender; set point_to_point: false to accept packets from every sender, as earlier versions did.

When the udp component sends to a broadcast or multicast address, or to several addresses, every packet received is accepted, and an addressing layer can tell the devices apart. The reliability and session layers, and the rolling code, work between two devices only, so on that kind of link they need an addressing layer with a destination.

# Example configuration entry
udp:
addresses: 192.168.1.255
packet_interface:
- platform: udp
id: network_link
  • udp_id (Optional, ID): The ID of the UDP component to use. Required only if more than one udp component is configured.
  • max_packet_size (Optional, int): The largest packet, in bytes, that a user of this interface may send. A larger packet received is dropped. Range is 16 to 508, the largest packet the udp component can receive. Defaults to 508.
  • point_to_point (Optional, boolean): Whether the one IPv4 address of the udp component is a single device. Set it to false for a broadcast address on a subnet smaller than /24, such as 192.168.1.127 on a /25, and to true for a device whose address ends in .255, which is possible on a subnet larger than /24. By default, an address ending in .255 is taken as a broadcast address. true is rejected unless the udp component sends to one unicast IPv4 address.
  • id (Optional, ID): Manually specify the ID used for code generation.