-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[miele] Fix mDNS issue where hub repeatedly disappears from, resp. reappears in, the Inbox. #11834
Conversation
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg - I can create an issue for the issue specific to the Miele XGW 3000 gateway. |
bundles/org.openhab.binding.miele/src/main/resources/OH-INF/binding/binding.xml
Outdated
Show resolved
Hide resolved
I have tested this PR in combination with openhab/openhab-core#2635 on a fresh 3.3 snapshot installation, and it works correctly. Previously the gateway would be removed from the inbox every two minutes and readded shortly after. Now: Restarted openHAB, manually removed thing from inbox: Was discovered again: Then 5-6 minutes of silence (normally it's removed and readded every two minutes). Unplugged network cable from gateway: And plugged in again: |
bundles/org.openhab.binding.miele/src/main/resources/OH-INF/binding/binding.xml
Outdated
Show resolved
Hide resolved
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
...rc/main/java/org/openhab/binding/miele/internal/discovery/MieleMDNSDiscoveryParticipant.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
If this is more or less a firmware bug of the XGW3000 (and I can confirm that I am seeing the same with mine), I wonder if this needs to be exposed to the user at all as a parameter - it might be rather confusing as it is highly technical. |
@kaikreuzer - I agree. I had the same thought, but was unsure about how much technical stuff is usually hidden in the binding configurations (e.g. in other bindings). I don't think the few XGW 3000 users would ever need to change this value. For me it quite consistently disappears for just a few seconds (~3 seconds) every two minutes. Do you see the same? The value could even be lowered to 15 seconds, I think - not that it matters much, only it would be removed a bit quicker when actually disconnected. |
Yes, I had just tested it with a test openHAB installation, since my production one does not create inbox entries (since I have a thing in place already). |
Hmm, I see it happening on my production installation as well even with a thing in place. Is that a known difference or bug with file-based configuration? I'm pretty sure the representation property is correct. Clarification: I see it happening in logs. In inbox it's ignored. |
@kaikreuzer many thanks for your feedback! Apparently I can't win: the code is copy/pasted from the code I wrote for the Philips Hue binding in #9985 -- where I originally wrote it with a hard coded constant, but one of your esteemed colleagues asked me to change it to a config param. But I am happy either way. :) |
Haha, it can be hard for a contributor to deal with the contradicting feedback from different maintainers. 😄 I guess you refer to this comment: #9985 (comment) Now the problem is indeed that for hue a different solution has been implemented already and I am always for consistency. So either we keep things here as they are right now (definitely the simplest solution) or we would have to also adapt the hue binding accordingly (and by this leave the path to a dedicated discovery bundle open). Happy to hear your opinions here! |
^ And after reading it again, I see now that I had mis-interpreted the suggestion of @cweitkamp concerning an entry in $OPENHAB_CONF/services/runtime.cfg and wrongly implemented a binding config param instead. (Maybe because I didn't know how to write the code to parse entries in runtime.cfg) I am quite happy to modify both this PR and also raise a new PR for the Hue in order to make them mutually compatible (note: I just did a search to check there are no other bindings who have implemented this). I would also modify the PR for the binding developer guide documentation to include a code example based on runtime.cfg. In retrospect, I think the runtime.cfg entry is probably the best one overall. => Please confirm. And if so, can you please give me a pointer how to code it? Obviously there is a small risk that changing to runtime.cfg for the Hue binding might upset an existing user who had customised a config param value different than the default. But since the default has always worked perfectly for me, I think the risk of that happening is actually quite small.
Yay! Great idea! |
Ok. I see that the properties will have been passed in the component's activate() method. |
Right, all you'd need to do is to add |
While talking about the hue binding ... I am working on support for the new Hue API v2. Some preparations e.g. moving discovery from UPnP to mDNS are done in #11842. Let me know if I should touch configuration for it in advance. |
@cweitkamp I guess it makes sense if you do that change in #11842 then - there is no urgency for it. |
@kaikreuzer shall I take this as your agreement to change the code in this PR to the runtime.cfg model? |
@andrewfg As you seem to like the idea: Yes, nothing should stop you from doing so! |
^ |
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
I just say for the hue binfong, I never encountered the problem before the parameter was added. |
50 seconds. Am I correct in understanding that this default value works just fine for you? |
As it works for me without a grace period, of course it will work with a grace period... but with a useless delay. I just checked and my parameter is set to 50. So would make sense iny case to set it to 0. My concern was just to keep the parameter for the hue binding. |
@andrewfg, @lolodomo - as much as this discussion is relevant, I believe it is mostly relevant for the Hue binding? In that case maybe continue the discussion in context of #11842. That way it will be more transparent to anyone following that PR and/or with knowledge of the specific Hue issue before UPnP grace period was introduced. For the Miele binding I think we have established that a default value of 15 seconds will be appropriate, since it seems to be a general issue with the latest (and probably last) version of the XGW 3000 firmware, 2.4.2. Both @kaikreuzer and I have observed it disappear only for a few seconds. However, since now configurable, users can quickly adapt in the unlikely event that a new firmware version would ever be released, which would change anything. Or in case of specific issues caused by some internal network problems that might need additional grace period. |
@andrewfg - would it be possible for you to make new jars available for download?
Then I will perform a (hopefully) final test with the latest version of the code. |
Ok. Done => #11842 (comment) |
|
@kaikreuzer I think this a brilliant idea, and I would be happy to contribute to it. Do you have already an Issue opened somewhere which mentions this. So I could perhaps add to the discussion. Or if there is no such Issue yet, do you mind if I create a new one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks,
@kaikreuzer What about you?
I wonder if we shouldn't also simply wipe the section in the README - if we consider it a technical bug fix, we can treat this as a "hidden" feature - mentioned in the code and available to the ones that know about it, but not officially exposing it to the users. Wdyt?
No, I haven't. I don't have any clear idea on how it could be implemented (and whether the issue should go in core or addons repo). But please feel free to open an issue yourself and start a discussion around it! |
@andrewfg - I have tested the new version and it still works. :-) I can add that 8 second grace period seems to be the sweet spot for me with a fresh and performant openHAB installation having nothing else to do. So I hope this verifies 15 seconds as a sensible value for production systems. |
From my pov a first step could be to introduce a console command extension (or a REST interface) which helps an advanced user to list all available mDNS services or UPnP devices on the local network manually. Currently I am using Linux shell |
@andrewfg & @cweitkamp I have created openhab/openhab-core#2645 for that discussion so that we don't have to go too much off-topic here. 😄 |
In general I think undocumented features are better than no features at all. And that documented features are better than undocumented features. :-) In this case I'm in doubt. It would be preferable if it would be handled centrally in core instead of all bindings having to implement this configuration option, and with that document it for all bindings having it in place. This is however not the topic for this PR. So I think we should keep the documentation, and if it evolves further, we can adapt. Probably no one will ever have to change this, but this is mostly because we presumably have so few users. For the Hue binding some users had concrete problems (with UPnP) and needed it. However, for the Hue binding it could be discovered by users by going to the binding configuration. For the new implementation where you have to add it to a configuration file, users won't have the same possibility of finding it without documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, then let's keep user docs in place.
Many thanks for the fix and your patience, @andrewfg!
…appears in, the Inbox. (openhab#11834) Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch> Signed-off-by: Nick Waterton <n.waterton@outlook.com>
…appears in, the Inbox. (openhab#11834) Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch> Signed-off-by: Michael Schmidt <mi.schmidt.83@gmail.com>
…appears in, the Inbox. (openhab#11834) Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
…appears in, the Inbox. (openhab#11834) Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
…appears in, the Inbox. (openhab#11834) Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
…appears in, the Inbox. (openhab#11834) Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
@cweitkamp - out of curiosity, did you have anything more prepared after #11842? I'm asking since @andrewfg has created #13570 so just wanted to check that nothing is lost or conflicting. |
I did ask @cweitkamp already, and he said he was rather busy at the moment, so it was Ok for me to proceed.. |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-marketing-is-lacking/149280/25 |
BACKGROUND
There is an mDNS issue where the Miele hub repeatedly disappears from, resp. reappears in, the Inbox (see issue description in openhab/openhab-core#1835). This PR resolves that issue. Fixes #11837
DEPENDENCY
This PR depends on openhab/openhab-core#2635 => so that PR must be merged prior to this one. (And for that reason the CI build process will fail until that respective core PR has been merged).
Signed-off-by: Andrew Fiddian-Green software@whitebear.ch