-
Notifications
You must be signed in to change notification settings - Fork 61
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
Property class and conversion attributes #38
Comments
Answer by @marvinroger
|
Regarding property classes: I'll give an example from the openHAB world. A temperature "Item" (openHAB Items are nothing other than Homie properties) in my setup has a "fancy name", format (float) and a unit. So far so good! The Item furthermore has a "thermometer" icon and is part of the "ActualTemperatures" management/status group. I've got a rule in my setup checking all "ActualTemperatures" Items against a certain threshold to warn in case of frost. Similar things apply to other abstract categorizations of Items i.e. property classes. In openHAB/ESH a similar idea is addresses in Channel Categories. I'll leave this question open for others to think about. @marvinroger @Kwave @euphi Regarding property conversion: Besides, the conversion argument should of course be an optional one. It will not hurt to define the option for use cases where a conversion is needed and 95% of potential users can simply ignore it. |
Well, indeed, it doesn't hurt |
Too many ideas and todos, too little time 😅 |
@marvinroger for the sake of other improvements, let's not have this one in 2.1.0. |
Agreed. |
Because there is $type for nodes, I have extended the idea in #92. Would also help with the ESH implementation where the UI interprets channel hints like |
I seesome pro's having a conversion parameter. One can implement fixed-point values this way. Have an integer Number (e.g. coming directly from an ADC) + a conversion factor, gives a fixed-point number. You will not loose precision, if converted a second time (because you just use a different conversion number). This, of course, works only for linear conversion, basically for scaling. If you want to allow more complex conversions, then a whole formula needs to be defined. Basically all values produced by measuring (digital) devices are integer or fixed-point values. I can hardly think of a real floating point measurement value... And: linear conversion is the most common case: Have an offset plus a factor. |
I am going to close this so we can keep all discussion in this thread. |
From #27 (comment)
Hey guys, great progress so far!
I did a little brainstorming with a colleague today and we found room for two improvements I'd like to discuss with you:
Property class/category: A property is a distinct reading or characteristic value produced by a node of a device. The other side of the network, the discovering entity, needs to know about the nature of this value (e.g. to show a thermometer in a GUI). We are already providing attributes to characterize its unit, range, pretty name and "set'ability" but not a clear type.
A not-settable property with the unit "°C" does at best imply that the property is a temperature reading of a thermometer, not e.g. a thermostat or a nominal temperature. The discovering entity should not have to resort to guessing and interpreting of the other attributes.
I propose a counted number of property classes to characterize the nature of a property. The
$class
or$category
attribute is required but can be "Unspecified"/"Other"/"" for special non-trivial properties. The classes list can be extended over time and the discovering entity is allowed to ignore the provided class if unknown.Conversion Attribute: When working with embedded systems or low-energy micro controllers, we can not expect the device to be capable to convert a raw sensor reading into a final human-comprehendible value. An example would be a temperature sensor reading between [0..255] which would map onto a degree Celcius value with decimal places.
I propose the introduction of a
$conversion
property attribute. The published String value is either "x"/"" for no conversion or the right hand of anf(x)
formula, e.g.x / 255 * 50 - 20
.Both points are of course open for discussion. What do you think?
The text was updated successfully, but these errors were encountered: