-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Proposed Interface Specification for data output #827
Conversation
Purpose is to remove some ambiguity and achieve some commonality across different sensors to improve machine readability and ease integration with third party software.
+1! I suggest having a Maybe also a |
I do not think it is really feasible to add a |
I see your point, but you could classify the sensors you mentioned as type “weather”. But what you say is true, so it may not be necessary. |
@vestom we could add a bit field with what sensors a device has. Not sure it would be worth it though. It's obvious from the parameters types. Anyway Temperature_F can be present also if the native representation is that. |
I wanted to present TPMS as a good case for |
Maybe we should give up on typing the devices and instead just provide unit measures? |
But then again it would help users identify/classify things which is nice and maybe really user friendly. |
IF we want to add a "type", I think it would be best to add it in a separate field and keep it orthogonal to the "model" field. The primary purpose of the "model" field is to identify/recognize the device, whereas a "type" field would supposedly be some form of "class" or "template" telling something about the data fields you can expect from the sensor and maybe how to interpret them. I have no strong feelings about it, other than I will recommend to define clearly what the different types signify and what you can expect from a given type :-) Regarding Temperature_F, the big decision is, whether we still want to allow all kinds of units, or we want to standardize to a limited set? If we do not want to standardize, I will change the proposal to reflect the status quo. However. The main purpose of the proposal is to define some rules for the "model" field, to make this mandatory field a bit more uniform. Hopefully we can agree upon something about this starting point and then later evolve the spec to include possible new changes or additions? |
I'd say we need good examples of "types" to narrow the idea. |
I think ultimately it would be nice if the output had enough information to be automatically consumable by things like Home Assistant. I’ve noticed that there are certain temperature sensors that aren’t weather sensors (e.g. freezer temperature), so looking at the presence of a temperature field wouldn’t be enough to determine that. Perhaps there should be a “subtype” field to put more specific information? So type would be more of a category. Also should there be a separate “manufacturer” and “model” field? This might make it easier to represent decoders that work for multiple models. |
While some sensors have a clear purpose, the placement and usage is not easily discoverable. (Some of my Temp./Hum. sensors are outdoor, indoor or even in a fridge) The protocol is not enough to determine the sensor manufacturer or usage also. There are too many clones with sometimes different purpose, sadly. |
@vestom I'd like it to default to si-units. But decoders should output the native values. |
Prefer native sensor data units
Regarding converting units - The problem has been rounding errors that creep in when doing multiple conversions. This is due to pretty printing going on even for what's intended to be machine readable output like JSON. At some appropriate point, I think we should stop rounding some of these values to 1 or 2 decimal places. |
DATA_FORMAT.md
Outdated
## Common Device Data | ||
Various data fields, which are common across devices of different types | ||
|
||
* **battery** (string) (Optional) |
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.
This is a case where if we are writing a specification we should attempt to set a standard we want everything to follow.
I propose
battery
(with no units) should be considered deprecated.battery_low
orbattery_ok
should be added as a boolean (or an int is essentially a boolean).
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.
This is a hot topic. The idea is clear, "low battery" is an "event" thus "1" anything else is default and disregarded, hence "0".
The opposite reasoning is:
- devices that report a voltage or known steps should use
battery_mV
- other devices should report a level between 0 (empty) and 1 (full)
- if only a flag is available this degrades to quasi-bool 0/1
As far as I see pretty printing is only for KV and CSV. Specifically JSON disregards DATA_FORMAT. I'd say we don't need a default conversion. Users (and packages) can preset options using config files soon. |
* Secondary device identification. For devices with more than one identification value | ||
(e.g. both an internal value and a switch). | ||
|
||
* **mic** (string) (Optional) |
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.
In terms of a data architecture, MIC as currently defined is redundant data.
- It will never change between messages on the same device. So there is no point in sending and storing it on every message.
- It isn't an attribute of the message., It's an attribute of the device/the decoder.
The use case of disabling devices that don't meet the specified level seems like a runtime option for rtl_433.
Alternatively rtl_433 should output (on start up) a machine readable message about what devices are enabled, and their attributes like MIC.
On a related note, rtl_433 should output some version information at startup in case consumers need to make some decisions based on protocol/messaging changes.
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.
The idea is that the consumer can add more trust to a message if mic is present. I get your point but in a blind scanning scenario when you pickup unknown transmitters it is much more user friendly to directly see that the protocol has an integrity check.
These fields are the primary data fields containing the most basic message data and used to identify the specific device. | ||
For some devices these are the *only* fields contained in the message, as the message itself consitutes an event from this | ||
particular device model. | ||
|
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.
Proposal: add an rtl_433 message type indicator to allow other message types to be added and easily differentiated from decoded device data.
0 - decoded device data
1 - rtl_433 periodic statistics
2 - rtl_433 invocation information (rtl_433 Version, start time, frequency, sdr identification (id/serial), ...
3 - rtl_433 device/protocol info.
Two more points to discuss: Hideki and Acurite (at least) have 16 wind direction values, i.e. increments of 22.5 degrees. Should we recommend to round these or just switch the specification to double? The current situation with rain fall measurements is:
Perhaps a recommendation of |
Adjust "rainfall" to "rain". Add imperial unit examples. Add "rain_rate".
Simplify "battery" status indication. Correct F for Fahrenheit.
Use mps for meters per second
DATA_FORMAT.md
Outdated
|
||
* **model** (string) (Required) | ||
* Device model. Human readable string concisely describing the device by manufacturer name | ||
and manufacturers model designation according to the following syntax: `"<Manufacturer>, <Model>"`. |
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.
Can you change this to read "<Manufacturer>-<Model>"
?
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.
Regarding units, I suggest changing from using 'p' as division ('per') to underscore '_':
Examples:
m_s (meters per second)
mi_h (miles per hour)
in_h (inches per hour)
The reason is to avoid ambiguity like the common "mph" (miles or meters?) and "kmh" (kilometer*hour or kilometer/hour?)
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.
How many keys would that concern? At a glance I only see acurite, and hideki, 3 keys total. Worth the change.
Change model delimiter from comma to dash
af2fd65
to
44a5c13
Compare
Purpose is to remove some ambiguity and achieve some commonality across different sensors to improve machine readability and ease integration with third party software.
This is sure to spark some discussion :-)