home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.34k stars 30.28k forks source link

All History graphs shows the same data #11904

Closed dimagoltsman closed 5 years ago

dimagoltsman commented 6 years ago

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version): 0.60.1

Python release (python3 --version): 3.5.3

Component/platform: history graph

Description of problem: all graphs changing after half second to the first one. i have 3 different graphs but when i open the tab, all of them are becoming the first one. i do see the correct ones for about half a second

Expected: to be correct graphs

Problem-relevant configuration.yaml entries and steps to reproduce:

history_graph.yaml

current:
  name: Current
  refresh: 0
  hours_to_show: 8
  entities:
    - sensor.current_graph
voltage:
  refresh: 0
  name: Voltage
  hours_to_show: 8
  entities:
    - sensor.voltage_graph
power:
  name: Power
  hours_to_show: 8
  refresh: 0
  entities:
    - sensor.power_graph

sensor.yaml

- platform: command_line
  name: Voltage Graph
  command: curl -s http://127.0.0.1:63080/last | jq ".[0].Voltage.L1" | xargs printf "%.2f\n"
  scan_interval: 120
  unit_of_measurement: Volts

- platform: command_line
  name: Current Graph
  command: curl -s http://127.0.0.1:63080/last | jq ".[0].Current.L1" | xargs printf "%.2f\n"
  scan_interval: 120
  unit_of_measurement: Ampere

- platform: command_line
  name: Power Graph
  command: p=$(curl -s http://127.0.0.1:63080/last | jq ".[0].Power.L1")  ; echo "$p  / 1000" | bc -l | xargs printf "%.2f\n"
  scan_interval: 120
  unit_of_measurement: KW

Traceback (if applicable):

Additional info: screenshot: https://imgur.com/2bLzqbp

mattlward commented 6 years ago

I am seeing the same thing, but mine take longer to revert to correct values. I am running 61.1 on Hassio. This started immediately after an upgrade from 60.1 to 61.1.

sensors.yaml

- platform: mqtt
  name: "Temperature1"
  state_topic: "sensor/temp1"
  qos: 0
  unit_of_measurement: "°F"

- platform: mqtt
  name: "BR_Temp"
  state_topic: "/ESP_Easy/Env/Temperature"
  qos: 0
  unit_of_measurement: "°F"
  value_template: '{{ value | round(1) }}'

- platform: mqtt
  name: "Humidity1"
  state_topic: "sensor/hum1"
  qos: 0
  unit_of_measurement: "%"

- platform: mqtt
  name: "BR_Hum"
  state_topic: "/ESP_Easy/Env/Humidity"
  qos: 0
  unit_of_measurement: "%"

- platform: mqtt
  name: "switch1"
  state_topic: "/ESP_Easy1/switch1/Switch"

- platform: mqtt
  name: "temp5"
  state_topic: "/ESP_Easy/SHT30/Temperature"
  qos: 0
  unit_of_measurement: "°F"

- platform: mqtt
  name: "humidity5"
  state_topic: "/ESP_Easy/SHT30/Humidity"
  qos: 0
  unit_of_measurement: "%"

- platform: mqtt
  name: "truck_temp"
  state_topic: "/ESP_Easy3/Env/Temperature"
  qos: 0
  unit_of_measurement: "°F"
  value_template: '{{ value | round(1) }}'

- platform: mqtt
  name: "truck_hum"
  state_topic: "/ESP_Easy3/Env/Humidity"
  qos: 0
  unit_of_measurement: "%"

Relevant part of configuration.yaml

history_graph:
  gr1:
    name: DR Temperature
    entities:
      - sensor.tankpi_temp
    hours_to_show: 48
    refresh: 60
  gr2:
    name: LR Temperature
    entities:
      - sensor.lr_temp
    hours_to_show: 48
    refresh: 60
  gr3:
    name: MBR Temperature
    entities:
      - sensor.temperature1
      - sensor.humidity1
    hours_to_show: 48
    refresh: 60
  gr4:
    name: Bath Temperature
    entities:
      - sensor.br_temp
      - sensor.br_hum
    hours_to_show: 48
    refresh: 60

  gr5:
    name: Work Temperature
    entities:
      - sensor.temp5
      - sensor.humidity5
    hours_to_show: 48
    refresh: 60

  gr6:
    name: Truck Temperature
    entities:
      - sensor.truck_temp
      - sensor.truck_hum
    hours_to_show: 48
    refresh: 60
eeepsylon commented 6 years ago

The History Graphs correct themselves if the page is resized. So it's a frontend issue rather than configuration.

mattlward commented 6 years ago

That could be, on my I7 I get a CPU spike when it tries to render graphs. On my cell it just never corrects the graphs. I also get a non-responsive script error on my phone and it will not render...

Where do we go from here? Does this need to be reported somewhere else? It appears that the first report is on a native home assistant machine and my issue is on home assistant with hassio.

mattlward commented 6 years ago

I have noticed that this is a log result of a graph page load... Timer got out of sync. Resetting 9:12 PM core.py (ERROR) Error handling request 9:12 PM /usr/lib/python3.6/site-packages/aiohttp/web_protocol.py (ERROR) Slowing down the Pi to generate graphs?

balloobbot commented 6 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

mattlward commented 6 years ago

Graphs still load very slowly and sometimes I have to refresh the page. I am on the latest version as well. It feels to me like it is a graphics problem, generating the page.

balloobbot commented 5 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

dimagoltsman commented 5 years ago

Solved after few versions.