But I’d like to sort this bar chart, so the switches that used the most kWh are displayed at the top, and descending. I tried to play with the sort feature but couldn’t get this sorted. Can someone help me here ?
here is the Flux query I’m currently using :
from(bucket: "homeassistant")
|> range(start: -24h)
|> filter(fn: (r) => r["_measurement"] == "kWh")
|> filter(fn: (r) => r["_field"] == "value")
|> filter(fn: (r) => r["domain"] == "sensor")
|> filter(fn: (r) => r["entity_id"] == "cuisine_toaster_etc_daily" or r["entity_id"] == "cave_boucle_sanitaire_daily" or r["entity_id"] == "cave_congelateur_etc_daily" or r["entity_id"] == "cave_chaudiere_daily" or r["entity_id"] == "cave_seche_linge_prise_meross_daily" or r["entity_id"] == "cave_modems_serveur_unraid_et_co_daily" or r["entity_id"] == "cave_seche_linge_prise_meross_daily" or r["entity_id"] == "guestroom_consoles_etc_daily" or r["entity_id"] == "guestroom_projecteur_daily" or r["entity_id"] == "chambre_raph_et_cel_tv_etc_daily" or r["entity_id"] == "chambre_raph_et_cel_tables_de_nuit_daily" or r["entity_id"] == "cuisine_fours_daily" or r["entity_id"] == "cuisine_frigo_daily" or r["entity_id"] == "cuisine_lave_vaisselle_daily" or r["entity_id"] == "cuisine_machine_cafe_etc_daily" or r["entity_id"] == "cuisine_tablette_modem_rpi_plexamp_etc_daily" or r["entity_id"] == "salle_a_manger_alexa_daily" or r["entity_id"] == "salle_a_manger_arcade_daily" or r["entity_id"] == "salle_a_manger_lampe_varmblixt_ikea_halo_daily" or r["entity_id"] == "salle_a_manger_prise_humidificateur_derriere_siege_emmanuel_daily" or r["entity_id"] == "salle_a_manger_rpi_plexamp_salle_a_manger_daily" or r["entity_id"] == "salle_de_bain_enceinte_petite_lampe_etc_daily" or r["entity_id"] == "salle_de_bain_radiateur_elec_daily" or r["entity_id"] == "salon_aspi_cendres_daily" or r["entity_id"] == "salon_barre_son_etc_daily" or r["entity_id"] == "salon_prise_logia_lampe_togo_daily" or r["entity_id"] == "salon_tv_etc_daily" or r["entity_id"] == "lampes_consommation_globale_daily")
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "last")