home-assistant / ui-schema

A schema to define a user interface for Home Assistant.
Apache License 2.0
41 stars 6 forks source link

Order of entities in History-graph (Lovelace) #213

Closed ghost closed 5 years ago

ghost commented 5 years ago

move[bot] commented on Dec 10, 2018, 1:47 PM UTC:

mgiako commented on Dec 10, 2018, 12:01 PM UTC:

Home Assistant release with the issue:

0.82.1

Last working Home Assistant release (if known): no one

Operating environment (Hass.io/Docker/Windows/etc.):

Hass.io

Component/platform:

history-graph in Lovelace

Description of problem: In a Lovelace card I have a history-graph composed of 10 sensors. I would like to change the order as I enter them, but these always appear in alphabetical order:

      - type: history-graph
        hours_to_show: 8
        entities:
          - entity: binary_sensor.mauro_a_casa
            name: MauroIF
          - entity: device_tracker.mgiako_mauro
            name: MauroOwn
          - entity: device_tracker.cellmauro
            name: MauroHA
          - entity: binary_sensor.maurocasa
            name: Mauro a Casa
          - entity: binary_sensor.nest_a_casa
            name: Nest
          - entity: binary_sensor.elena_a_casa
            name: ElenaIF
          - entity: device_tracker.mgiako_elena
            name: ElenaOwn
          - entity: device_tracker.cellelena
            name: ElenaHA
          - entity: binary_sensor.elenacasa
            name: Elena a Casa
          - entity: binary_sensor.gpio10_garage
            name: Garage

image

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

Traceback (if applicable):

Additional information:

This issue was moved by cgarwood from home-assistant/home-assistant#19164.

This issue was moved by iantrich from home-assistant/home-assistant-polymer#2250.

chvancooten commented 5 years ago

I'm facing the same issue, apparently the order for history-graph is not even alphabetical, see below example.

    - type: history-graph 
      title: Climate history  
      entities:   
      - entity: sensor.climatesensor_temperature
        name: Inside temperature
      - entity: sensor.buienradar_temperature
        name: Outside temperature
      - entity: sensor.climatesensor_pressure
        name: Inside pressure
      - entity: sensor.buienradar_pressure
        name: Outside pressure
      - entity: sensor.climatesensor_humidity
        name: Inside humidity
      - entity: sensor.buienradar_humidity
        name: Outside humidity

Results in the following: image

keniji commented 5 years ago

Also encounter this issue and the order is also not alphabetical..

djfjeff commented 5 years ago

On my side, they seems to be ordered in alphabetical order of the entity name (not the friendly name).

rzolau commented 5 years ago

Actually, the order is random, and changes between HA restarts. I think there is some sort of race condition and depending which entity is grabbed from the database first, it is plotted first. I am not sure if this is bug or feature...

DominikPalo commented 5 years ago

I have the same issue...

starwolf73 commented 5 years ago

Same here. Wish HA had a vote request system to log in those kind of feature request.

radinsky commented 5 years ago

Is there anything new on this?

rzolau commented 5 years ago

Unfortunately, I think this issue is quite obscure and does not get much attention :-(

kbahey commented 5 years ago

I came here to report the same problem.

Entities in history graphs has to be sorted in the same order they appear in the card, not any other order.

carlmes commented 5 years ago

I have the same problem, my history-graph cards seem to randomly load elements without a sort order:

image

Here's my card configurations:

Pink Orchid:

entities:
  - entity: sensor.pink_orchid_light_intensity
    name: Light Intensity
  - entity: sensor.pink_orchid_temperature
    name: Temperature
title: Pink Orchid Graph
type: history-graph

Purple Orchid:

entities:
  - entity: sensor.purple_orchid_light_intensity
    name: Light Intensity
  - entity: sensor.purple_orchid_temperature
    name: Temperature
title: Purple Orchid Graph
type: history-graph

White Orchid:

entities:
  - entity: sensor.white_orchid_light_intensity
    name: Light Intensity
  - entity: sensor.white_orchid_temperature
    name: Temperature
title: White Orchid Graph
type: history-graph

Also, I've noticed that the temperature sensor is being displayed twice, once as C and once as F even though the sensor is only returning valid F values. Where is the C entity coming from?

And for reference, here's my sensor configurations:

# Sensors
sensor:
  # Weather prediction
  - platform: yr

  # https://khaz.me/getting-xiaomi-mi-flora-plant-sensors-working-on-hassio/

  # Miflora Bluetooth LE
  - platform: miflora
    mac: 'C4:7C:8D:63:EC:05'
    name: Pink Orchid
    force_update: true
    scan_interval: 1200
    #median: 3
    monitored_conditions:
      - moisture
      - light
      - temperature
      - conductivity
      - battery

  # Miflora Bluetooth LE
  - platform: miflora
    mac: 'C4:7C:8D:63:FA:B4'
    name: Purple Orchid
    force_update: true
    scan_interval: 1200
    #median: 3
    monitored_conditions:
      - moisture
      - light
      - temperature
      - conductivity
      - battery

  # Miflora Bluetooth LE
  - platform: miflora
    mac: 'C4:7C:8D:63:FA:C8'
    name: White Orchid
    force_update: true
    scan_interval: 1200
    #median: 3
    monitored_conditions:
      - moisture
      - light
      - temperature
      - conductivity
      - battery

plant:
  Pink Orchid:
    sensors:
      moisture: sensor.pink_orchid_moisture
      brightness: sensor.pink_orchid_light_intensity
      temperature: sensor.pink_orchid_temperature
      conductivity: sensor.pink_orchid_conductivity
      battery: sensor.pink_orchid_battery
    min_moisture: 5

  Purple Orchid:
    sensors:
      moisture: sensor.purple_orchid_moisture
      brightness: sensor.purple_orchid_light_intensity
      temperature: sensor.purple_orchid_temperature
      conductivity: sensor.purple_orchid_conductivity
      battery: sensor.purple_orchid_battery
    min_moisture: 5

  White Orchid:
    sensors:
      moisture: sensor.white_orchid_moisture
      brightness: sensor.white_orchid_light_intensity
      temperature: sensor.white_orchid_temperature
      conductivity: sensor.white_orchid_conductivity
      battery: sensor.white_orchid_battery
    min_moisture: 5

My customize.yaml and groups.yaml files are empty (no customization).