Beginner's question on line graph

Hello everyone,
I have setup a new system with InfluxDB and would love to use the dashboard properly.

I setup a few graphs that display the data I want, but right now not the way I want it.
Here is an example:

SELECT mean("value") AS "mean_value" FROM "homeassistant"."autogen"."W" WHERE time > :dashboardTime: AND time < :upperDashboardTime: AND ("entity_id"='ambient_light_dr_power' OR "entity_id"='ambient_light_l_dr_power' OR "entity_id"='ambient_light_lr_power' OR "entity_id"='ambient_light_r_dr_power' OR "entity_id"='boiler_1_power' OR "entity_id"='boiler_2_power' OR "entity_id"='boiler_3_power' OR "entity_id"='fridge_energy_power' OR "entity_id"='main_light_dr_power' OR "entity_id"='main_light_lr_power' OR "entity_id"='naim_audio_av2_energy_power' OR "entity_id"='plasma_energy_power' OR "entity_id"='sony_kd75xf9005_energy_power' OR "entity_id"='travel_energy_power') GROUP BY time(:interval:) FILL(null)

The Problems:

  1. All sensors are displayed as a total. I am guessing this is due to the standard selection as mean(“value”) AS “mean_value” but what would be the correct syntax? Or is it because they are listed as OR rather than AND statements?
    I also considered creating multiple queries, but that would be 20 times the work. With one query I can just click the 20 entities in one go.

  2. How can I adjust the default relative time in the dashboard? And will it always overried the time interval defined in the respective graphs? I set a value per graph but when I open the dashboard, they all use the dashboard value.

I tried searching through Explore data using InfluxQL | InfluxDB OSS 1.8 Documentation but I got lost and couldn’t get my problem solved :frowning:

Sorry for my newbieness :frowning:

Best regards
Alex

Hi

  1. You get one big total because you are not grouping by “entity_id”.
  2. Looks like you are using chronograf (from the placeholders I see in the query), it should have a drop down to select the time range, the range/time you select will be injected into the query, also the time grouping (ie: 1m|2m|10m etc) will be detected to plot an optimal chart.

I’ve almost never used Chronograf, so I’m not sure about where to find all the settings etc, but you may find useful the template variables, in order to don’t have your sensor names hard-coded in the query, see: