Cetis / intelligent-campus

6 stars 0 forks source link

Sensor event - measurement type? #10

Open ghost opened 5 years ago

ghost commented 5 years ago

Just noticed (I'm a little slow! :-)) that the sensor measurement event doesn't include a "type". Method is there but it might be handy to have type just in case the same method is used multiple times e.g. in a device the records high and low temperatures.

    "measurement": {
        "id": 129,
    "method": "thermometer",
        **"type": "temperature",**
    "scale_name": "Celsius",
        "value": 27.5
    }, ...
    "measurement": {
        "id": 129,
    "method": "thermometer",
        **"type": "high_temp_last_hour",**
    "scale_name": "Celsius",
        "value": 27.5
    },

Might be worth considering a taxonomy of known types too.

What do you think?

alanepaull commented 5 years ago

measurement.type exists; measurement_taxonomy revised for clarity. Above example can be handled in current implementation, though we would need to enable extension to the taxonomy. I suspect that we need to permit on-the-fly types here, owing to the variety of stuff out there.

Should I revise the taxonomy to suggest that this can be extended by locally determined values if required? Then, the listed ones are simply there to map to, if appropriate, or as examples, but not prescriptive.

ghost commented 5 years ago

Should I revise the taxonomy to suggest that this can be extended by locally determined values if required?

Yes - I think we have to allow for that.