-
Notifications
You must be signed in to change notification settings - Fork 5.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
fix(inputs.knx_listener): Ignore GroupValueRead requests #15007
Conversation
Thanks so much for the pull request! |
!signed-cla |
I tested some more DPTs. Yes only DPT1.xxx have this problem |
Yes, that's because unpacking GroupValueRead data for other DPTs fail at
so they have never get to be forwarded anyway. |
Interesting But anyway there is no need for saving GroupValue_Read Messages because there is no valid data in this messages. What did u change? Does it now ignore all Read messages? |
Yes, as it says in the PR description. |
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.
@farmio thanks for your contribution! Your code looks good but I do have two comments/concerns:
- Your current code will spam the log-file as you generate an entry every time a group-read arrives. Please change the logic to only log each address once? Some lines below you can see an example for how to do it...
- For some applications it might be advantageous to also log DPT1.xxx events. Could we just log a fixed value if the datagram does not contain any? Like a zero value or similar?
@srebhan Hi 👋! Ad 1: Depending on the log-level, current implementation will reduce logs, as the new GroupValueRead-log is Ad 2: DPT 1.x (Boolean value) write and response telegrams are still logged like they have been before. Only the read telegrams are filtered out. I can not think of an application needing to log a read telegram as constant value (without the possibility to distinguish it from writes/responses - which would be possible by eg. adding an additional tag). |
I moved the match for the message command behind the test for the group address. |
@farmio thanks for your explanation! So just to be sure I got it right, your PR filters the group-read-request but not the response!?!? If this is correct, I would not log anything and just go on. Please also add a small comment to the code on why this is required... If you really want to log a debug message, you should really only log it once for a GA as some people run Telegraf in debug mode in production environments and we would log this every single time we see a group-read request otherwise. |
You are exactly right. We ignore the read request (that doesn't carry valuable data), but still process the responses (that do carry data). And of course we still process the normal write requests. Removed the logging and added a comment explaining why GroupValueRead requests are ignored. |
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 👍 This pull request doesn't change the Telegraf binary size 📦 Click here to get additional PR build artifactsArtifact URLs |
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.
Awesome. Thanks a lot @farmio for the fix and your explanation!
(cherry picked from commit a0cf90b)
Summary
Ignore KNX GroupValueRead requests as they don't contain any value. Yet DPT 1 typed requests are treated as telegrams with
0
value.These are my first lines of Go, so please be patient with me 😬
Checklist
Related issues
resolves #15006