Skip to content
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

Provide unique id of SHC in public information #39

Closed
tschamm opened this issue Oct 27, 2020 · 9 comments
Closed

Provide unique id of SHC in public information #39

tschamm opened this issue Oct 27, 2020 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@tschamm
Copy link

tschamm commented Oct 27, 2020

It would be great if it would be possible to provide a unique id (e.g. mac address or serial number) of the SHC via an API call, e.g. using "smarthome/public/information". This would allow other applications to identify the SHC, even if the IP has changed.

@hxmelab
Copy link

hxmelab commented Nov 6, 2020

Via a multicast DNS (mDNS) you get the ip and mac address and in case the ip changes you could repeat mDNS, search for the mac address and you will find your SHC in your local network. Check this line of code for the mDNS message, all SHCs are responding to:
https://github.com/hxmelab/node-red-contrib-bosch-shc/blob/13fd565f083dc597c8e2f2e8b63d8324d6b1d402/nodes/shc-config.js#L165

@tschamm
Copy link
Author

tschamm commented Nov 8, 2020

Thanks hxmelab for pointing out using mDNS discovery.
I will use this for my implementation, but gathering unique information via the API would still be more straight forward. Maybe this is not such a big deal to support in the future.

@tschamm
Copy link
Author

tschamm commented Dec 5, 2020

Using mDNS discovery fails in some network. I have implemented a fallback to retrieve the mac_address via the given ip, but that may be still error prone depending on the network configuration. Considering robustness, providing unique information (e.g. mac_address or serial_number) via the API is still missing.

@sebastianharder sebastianharder added the enhancement New feature or request label Jan 19, 2021
@sebastianharder sebastianharder self-assigned this Jan 19, 2021
@sebastianharder
Copy link
Contributor

@tschamm when the IP of the SHC has changed, how would you call the API? Do you have another mechanism than mDNS to discover the new IP address?

@tschamm
Copy link
Author

tschamm commented Jan 21, 2021

Of course that's correct. Either mDNS works in your network, or you already know the IP of the SHC to call the API. But if the IP changes over time, how can I know that it is the same SHC I'm talking to. This is why a unique ID via API makes sense. If mDNS is working, the mac address is available. But if mDNS is not working, I'm lost without additional information.

@sebastianharder
Copy link
Contributor

@tschamm do you use multiple SHCs in the same network? If you have paired with one SHC, you will notice that it's a different one when the TLS handshake fails.

Nonetheless, we are considering this enhancement at the moment.

@tschamm
Copy link
Author

tschamm commented Jan 24, 2021

@sebastianharder Thanks for considering this as enhancement.
I do not use multiple SHCs in one network, and I guess that is currently not intended by the way the Smart Home App is designed. Just out of curiousity: Would a TLS handshake really fails, if I would have registered the same keypair on both SHCs?

@sebastianharder
Copy link
Contributor

@tschamm good news! Version 10.0 of the Smart Home Controller firmware will include a field macAddress in the /smarthome/public/information REST resource. It is supposed to be rolled out in May.

@tschamm
Copy link
Author

tschamm commented Mar 26, 2021

@sebastianharder That's very good news, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants