Skip to content
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

A different measure? #4

Open
ghost opened this issue Apr 5, 2019 · 5 comments
Open

A different measure? #4

ghost opened this issue Apr 5, 2019 · 5 comments
Assignees

Comments

@ghost
Copy link

ghost commented Apr 5, 2019

Measures are defined as numeric values. This is useful and works well for measures like "temperature", etc.

However, we may also see situations where devices return something other than a number - e.g. "bin_full: true", "status: needs_tuning", "room: free", "room: occupied" - I want to call these "higher order measures" because I can't think of anything better. The hardware sensor may have returned number (or lots) but the device has interpreted that to return a value.

Do you think this is a real possibility and if so how do we handle it?

@alanepaull
Copy link
Contributor

I agree.

We could have an extensible taxonomy for measurement, using key/value pairs. Project Haystack has a good example, I think: https://project-haystack.org/tag

I've started a new file to give an example of how this might look: https://github.com/Cetis/intelligent-campus/blob/master/sensors/measurement_taxonomy.md

We wouldn't necessarily have to prescribe the scale, though I think standards here might help implementation.

@ghost
Copy link
Author

ghost commented Jun 24, 2019

Just been thinking about how we put the measurement API together and have:

Device -> Measurements
-> Aggregations

which then got me wondering about the third category (Room occupied) and wondered about adding "Observations" next to "Measurements" - and observations are fairly unstructured JSON:

Observation:
{
'from: ...,
'to': ...,
type: 'room occupancy',
result: 'occupied'
}

Just wanted to note that here so I don't forget it.

@alanepaull
Copy link
Contributor

alanepaull commented Jun 24, 2019 via email

@alanepaull alanepaull self-assigned this Jul 2, 2019
alanepaull added a commit that referenced this issue Jul 2, 2019
@alanepaull
Copy link
Contributor

Following the measurement_taxonomy, this example:

"measurement": {
        "id": 129,
        "type": “occupied”,
        "value": “false”
	},
	"sensor": {
		"id": "15"
	}

shows a space that is not occupied.

Typically, this will have a context showing an ID (Room_id) for the space.

The context timestamp will show when the measurement was taken. In our appreciation of timestamp, this could be interpreted as a a pre-determined time range; for example, it might be the mid-point of a particular hour.

For Lone Rooftop: "Isempty: true" would convert to

        "type": “occupied”,
        "value": “false”

@ghost
Copy link
Author

ghost commented Jul 3, 2019

This sounds good. There will have to be a bit of work handling this kind of data in our API - e.g. currently you can request time series values for display on a chart as timestamp/value pairs and the value is a Float. Should be OK though - either convert to a Float on the way in/out or return some other type based on the measurement type/scale_name - scale_name of Boolean e.g.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant