Open RoadXY opened 1 year ago
If I understand how it works, mDNS name can be used if in the first place we use mDNS discovery. However, it must be possible for the user to switch back to a static IP address, just in case his network change.
No, not quite. 😉 Let me give you 3 possible ways to add a ESPhome device to Homey.
Using mDNS Service Discovery
Using mDNS
Using IP address
Ok I see, even if mDNS discovery is blocked, mDNS name should still work. IP address would be a last chance solution
I was thinking to handle mDNS at the same time as BLE ... but I do not have BLE devices, need money :)
Ok I see, even if mDNS discovery is blocked, mDNS name should still work. IP address would be a last chance solution
I think mDNS SD and mDNS are tight together and most of the time both will either work or wont. But theoretically it could be possible that mDNS SD isn't working while mDNS is.
I was thinking to handle mDNS at the same time as BLE ... but I do not have BLE devices, need money :)
I understand. This is an feature request so no rush.
By BLE you mean https://esphome.io/components/bluetooth_proxy.html ?
So thinking about it, you listed the initial use case in a previous post, but need to consider the hackward use cases :) I have a device connected through IP address/port, I want to switch it to mDNS ... things like that.
My Driver is a Wizard, ... Wizards should be capable of everything ...
Ok so I think:
New physical device page will start in discovery mode
It will offer a "discover" button And list the discored devices if any If a device is selected in the list, it switch to mDNS mode
Edit physical device page will start throught the mDNS or IP/port mode
It depends of the current state of the physical device
The user can choose at any moment to switch to any mode:
The related fields of each mode will appear as needed
The discovery mode doesn't allow to "apply"
Only the mDNS and IP/port modes allows it (if all fields are valid as usual)
That's about it ...
I have no idea how encryptionKey or password apply to discovery, need to dig that point a little
I have no idea how encryptionKey or password apply to discovery, need to dig that point a little
mDNS is jsut about providing a "stable name" that match an "unstable ipAddress/port".
In the end the connection to the physical device is still based on the ipAddress/port and so encryptionKey and password apply.
In Homey, I understand that the mDNS discovery service will run in the background constantly (from the application start). Physical devices for which the mDNS name will be used will be dependant of the discovery to find the ipAddress / port. Only after that, we will be able to connect to the physical device using the low level API.
It also means that if the result from the discovery change, ie. a physical device restart and change IP (and/or port), then we need to force reconnect the physical device.
https://apps.developer.homey.app/wireless/wi-fi/discovery https://apps-sdk-v3.developer.homey.app/DiscoveryResultMDNSSD.html
First estimation: about 15h of dev, probably 5h of test and same for debug. => 25h ...
Describe the solution you'd like Be able to use the mDNS name instead of the IP address of the device. This has the added benefit that Homey is able to connect to the device when the IP address changes.