-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Change all uv fields to uvi, BREAKING change to UV sensors #3131
Open
zuckschwerdt
wants to merge
1
commit into
master
Choose a base branch
from
fix-uvi
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I guess this is changing a field called 'uv' to be called value vs index, to unconfuse it with the index.
But what is this field? Is it "some random thing in a decoder we think is related to uv"? Or does it have more semantics? I can see some sort of radiometric measurement that means something, before converting to index, but I really doubt that's what is going on.
I wonder then if we should rename it something that indicates that it is unclear, or how many drivers generate it. But I get it that unconfusing is a positive step, even if confusion remains, so this is not an objection.
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.
As I have this on my station I have to say I really don't know what kind of UV related value this might be, but with consumer stations generally having UVA only photodiodes I assume it is the raw diode value from which the eventual UV Index value is being calculated!?!
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.
That could be. What I don't like is reporting a bunch of such values from different kinds of manufacturers/hardware using the same name, implying they are the same thing. Perhaps if we rename it UV Raw, and adopt a convention that "Foo Raw" means e.g. some unprocessed ADC value that we believe is related to Foo, and that while people might want to e.g. transmit it to Home Assistant and log/graph it, there's no reason to expect a Foo Raw from device A to mean the same thing as Foo Raw from device B. This is different from things like temperature, illuminance, station pressure, UV index.
I worked on the Ford TPMS decoder a while ago, and it had values that were in odd units (0.25 psi), and we didn't and don't put those values in the output. Generally, once mapped to real units, the upstream data isn't useful or interesting.
In this case, though, it sounds like in the over-the-air format there is both a "UV Raw" and a "UV Index"? If so, I guess that's ok. But if rtl_433 is calculating UV Index, then I would lean to suppressing the Raw in the output.
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.
As you suspect it's a mapping from a roughly linear raw(?) value.
rtl_433/src/devices/fineoffset.c
Lines 268 to 285 in bf7f9b7
This raw value has a resolution of about 400 units per Index step. Perhaps a case for a 0.01 UV Index here :)
We could drop this, possibly raw, value if we represent all useful information from it in a standard way.
We could then also debate to use
uv
as the UV Index key and thus hit less devices with a breaking change. I have a feeling that "UVI" is more of a known term then "UV" alone.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.
I feel that UVI is better than UV, but if we (rtl_433) decide that a field named UV means "UV index", that's fine. There would then be a different change, to rename all fields that are UV that are not UV index, to something else.
Given that fineoffset code, I'd say just output the index, and not the raw. And make uv index have 2 places, if not 3. The point is that with 3, you can back out the raw if you want, or you can see the structure in how it changes, and that removes the last "but I want the info in the raw, even if just to see if it makes sense".