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

[denonmarantz] Improve discovery #16692

Merged
merged 1 commit into from Apr 29, 2024

Conversation

jlaur
Copy link
Contributor

@jlaur jlaur commented Apr 27, 2024

This contains a few discovery improvements:

  • Older Denon receivers can now be discovered through UPnP.
  • The false assumption about relation between MAC address and brand name (Denon/Marantz) has been replaced by string matching of the am property. This fixes the vendor property being set to Marantz for Denon receivers.
  • Label is shortened, i.e. "Denon AVC-X4800H" rather than "Denon AVC-X4800H (Marantz Denon AVC-X4800H)".

The UPnP discovery is now in sync with the suggestion add-on definition (see #16035):

<discovery-method>
<service-type>upnp</service-type>
<match-properties>
<match-property>
<name>manufacturer</name>
<regex>(?i)DENON</regex>
</match-property>
</match-properties>
</discovery-method>

I have only been able to test this with a very old and very new Denon receiver. If the new assumption about brand string (Denon/Marantz) being part of the model name does not hold for all receivers, the vendor property may not be set.

The mDNS name used for the label should be safe as already described as containing both vendor and model ("Marantz SR5008"):

/**
* Match the serial number, vendor and model of the discovered AVR.
* Input is like "0006781D58B1@Marantz SR5008._raop._tcp.local."
* A Denon AVR serial (MAC address) starts with 0005CD
* A Marantz AVR serial (MAC address) starts with 000678
*/
private static final Pattern DENON_MARANTZ_PATTERN = Pattern
.compile("^((?:0005CD|000678)[A-Z0-9]+)@(.+)\\._raop\\._tcp\\.local\\.$");

Discovery results for my receivers (first is mDNS, second is UPnP):

image

Resolves #16690

@jlaur jlaur added the enhancement An enhancement or new feature for an existing add-on label Apr 27, 2024
@jlaur jlaur force-pushed the 16690-denonmarantz-discovery branch from 960918d to 17c844d Compare April 27, 2024 16:07
@jlaur jlaur marked this pull request as ready for review April 27, 2024 16:08
@jlaur jlaur requested a review from jwveldhuis as a code owner April 27, 2024 16:08
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, i'll wait some days for @jwveldhuis to respond.

@jlaur jlaur force-pushed the 16690-denonmarantz-discovery branch from 17c844d to 5db336e Compare April 28, 2024 11:49
@jlaur jlaur marked this pull request as draft April 29, 2024 19:29
Resolves openhab#16690

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur force-pushed the 16690-denonmarantz-discovery branch from 5db336e to d38de53 Compare April 29, 2024 20:32
@jlaur jlaur marked this pull request as ready for review April 29, 2024 20:33
@jlaur
Copy link
Contributor Author

jlaur commented Apr 29, 2024

I found and fixed some issues when discovering newer receivers through UPnP. Also noticed a problem which I think is within JUPnP and needs further investigation:

image

Logged:

2024-04-29 22:28:08.464 [DEBUG] [DenonMarantzUpnpDiscoveryParticipant] - Discovered Denon AVC-X4800H, but base URL is missing
2024-04-29 22:28:08.465 [DEBUG] [DenonMarantzUpnpDiscoveryParticipant] - Discovered DENON AVR- 3808
2024-04-29 22:28:08.466 [DEBUG] [DenonMarantzUpnpDiscoveryParticipant] - Discovered Denon AVC-X4800H Aios 6.0V, but base URL is missing

So the AVC-X4800H is not discovered through UPnP even though it seems to me it should be. In UPnP Explorer I see four nodes with everything needed combined, but createResult is only called twice, and in both cases without Base URL and Serial Number.

For this PR it doesn't matter since this receiver is already discovered through mDNS, and the discovery of my old receiver works fine. However, I'm curious why it doesn't fully work as expected and might dig further into this later.

@lsiepel lsiepel merged commit 3baaeb6 into openhab:main Apr 29, 2024
5 checks passed
@lsiepel lsiepel added this to the 4.2 milestone Apr 29, 2024
@jlaur jlaur deleted the 16690-denonmarantz-discovery branch April 30, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[denonmarantz] Wrong brand is set in vendor property
2 participants