Standardizing - NON Standard UDP Discovery Methods #970
Replies: 3 comments 10 replies
-
What you are describing is ssdp... |
Beta Was this translation helpful? Give feedback.
-
On the one hand I'd like this (it would be useful for my aircon and maybe fan). On the other hand we probably don't want HA sending UDP packets for hundreds (or even tens) of random vendors that a user will never have? |
Beta Was this translation helpful? Give feedback.
-
Switcher also uses UDP based discovery but not as described in this post, devices are using broadcast and it is enough just to listen to a port. I would like to suggest a different solution which can cover multiple integrations and provide better flexibility. Since this is fragile and can slow down HA, there should be rules to limit the impact on the system. The discovery method should be limited to a small method, maybe limited by a short timeout and what is allowed and not allowed and maybe run it after HA has fully started. |
Beta Was this translation helpful? Give feedback.
-
A Standard for Non-Standard discovery
The current auto-discovery methods are ZeroConf, DHCP and SSDP. Various devices often support what I will call "Standard" "non-standardized" methods for discovery. What I mean is they use a common "flow" to discovery devices.
Existing Options: vol.Optional
Goal
Proposed Solution
Off the top of my head it would be nice to have some standardized functions which could perhaps help with this:
The first would be something like this:
which would allow an integration to send out a Discovery Payload/Packet on a specific set of Ports
And then we could use a listener function like this
to register some sort of DiscoveryCallback to process any incoming messages in a given timeout to discovery devices. In the case of Automatic Broadcast we would only need this function I would think
Automating Discovery
Addressing @thecode - some sort of function could also be defined - which potentially could use the perviouslly defined
async_listen_for_broadcast
andasync_send_discovery_broadcast
functions if they were implemented..Examples and Flows
I've gathered a few examples of various integrations that use these types of flows. The two types of flows I see here are an automatic broadcast flow and a call & response flow.
Gree Climate
This is not my Integration so I'm just looking at the source code
Gree uses a Call & Response type of flow.
{"t":"scan"}
on port7000
IP
from the packet will point to the deviceIntelliFire
IntelliFire uses a Call & Response type of flow.
IFT-search
on port3785
55555
for incoming messages of the format:Switcher
This is not my Integration so I'm just looking at the source code
20002
10001
20003
10003
It would appear Switcher Devices broadcast status every 4 seconds
Weatherflow
Tempest Weatherflow stations use an Automatic Broadcast flow
50222
for 10 secondsAn example packet looks like:
Beta Was this translation helpful? Give feedback.
All reactions