Discussion:
[influxdb] Modelling enumerations as Fields or Tags
s***@fireoak.co
2016-04-12 06:52:39 UTC
Permalink
Hi Influxdb team,

I'm considering using InfluxDB for a heating system related project aggregating stats from multiple devices.

Most of the schema properties naturally fit into a field or a tag based on things I've read. However I'm struggling with a property which indicates the state of a heating system - possible values being "heating", "cooling", "off".

- I will definitely want to plot the heating state as a 1 or 0 as an overlay on graphs of other values e.g. internal temperature - Grafana et al don't seem to like string fields. I know I can do "select [another field] * 0 + 1 from mymeasure where state = 'heating'" but that feels wrong and Grafana is not enjoying the non continous data set regardless of fill or connection settings.

- I will also probably want to use state as a series name for example so I can plot the actual temperature for points with a state of 'heating' to change the colour of the actual temp line when state was heating.

I'm currently looking at denormalising the enum (as there are only 3 values) to separate "isHeating", "isCooling" fields AND leave the enum as a tag.

Any best practice recommendations appreciated?

Thanks,
Shaun
--
Remember to include the InfluxDB version number with all issue reports
---
You received this message because you are subscribed to the Google Groups "InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/c1a3ad23-de99-4456-b8d5-bd298964162d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Shaun Barriball
2017-05-24 20:25:20 UTC
Permalink
Hi Stefan,

It was a while back now but from memory I ended up denormalising the values
into both fields & tags to satisfy both display and query. Not ideal but
satisfied my needs.

Regards,
Shaun
Did you find a solution?
Regards
Stefan
Post by s***@fireoak.co
Hi Influxdb team,
I'm considering using InfluxDB for a heating system related project
aggregating stats from multiple devices.
Post by s***@fireoak.co
Most of the schema properties naturally fit into a field or a tag based
on things I've read. However I'm struggling with a property which indicates
the state of a heating system - possible values being "heating", "cooling",
"off".
Post by s***@fireoak.co
- I will definitely want to plot the heating state as a 1 or 0 as an
overlay on graphs of other values e.g. internal temperature - Grafana et al
don't seem to like string fields. I know I can do "select [another field] *
0 + 1 from mymeasure where state = 'heating'" but that feels wrong and
Grafana is not enjoying the non continous data set regardless of fill or
connection settings.
Post by s***@fireoak.co
- I will also probably want to use state as a series name for example
so I can plot the actual temperature for points with a state of 'heating'
to change the colour of the actual temp line when state was heating.
Post by s***@fireoak.co
I'm currently looking at denormalising the enum (as there are only 3
values) to separate "isHeating", "isCooling" fields AND leave the enum as a
tag.
Post by s***@fireoak.co
Any best practice recommendations appreciated?
Thanks,
Shaun
--
Regards,
Shaun

Shaun Barriball
*Founder*



Phone: +44 (7866) 416 133

Email: <***@quark.com>***@fireoak.co

fireoak.co
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/CAFPFRGRAKUMZ%2Biw2mFj07ZzbdujV1rL5AvSrOfuYPOZOrSPGEQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...