Hi guys,
I’d been enjoying a temperature history graph since really getting into HA over the past few weeks but after an upgrade to 0.86.3 and/or the lovelace UI, the history graph just appears like this:
It’s weird because if i remove the history graph from the UI and attempt to re-add it, it looks like this:
But as soon as I save the layout and refresh the page, it goes back to Unknown .
This is the code I’m using for sensors (plus the Nest one):
- platform: scrape
resource: http://192.168.1.171/weewx
name: Outside
select: ".main .card td:nth-of-type(2)"
value_template: '{{ value.split("°")[0] }}'
unit_of_measurement: °C
- platform: scrape
resource: http://192.168.1.171/weewx
name: Study
select: ".main .card tr:nth-of-type(10) td:nth-of-type(2)"
value_template: '{{ value.split("°")[0] }}'
unit_of_measurement: °C
history_graph:
gr1:
name: Temp History
entities:
- sensor.outside
- sensor.nest_thermostat_home_temperature
- sensor.study
From the dev page - the data looks good:
So I’m not sure what to do! If i click on the little “up arrow” next to the history_graph from the dev page, it shows me the graph. I’ve tried deleting the .db file in case there was some corruption and also tried sticking device_class: temperature under the study / outside sensors to match the Nest one but it doesn’t show up in the dev page.
Cheers!
tom_l
January 28, 2019, 8:26pm
2
Don’t use history_graph as the the entities in the history_graph card. Use your actual sensors. e.g.
type: history-graph
entities:
- sensor.outside
- sensor.nest_thermostat_home_temperature
- sensor.study
2 Likes
PK_MO
(Pete)
February 4, 2019, 1:16am
4
ideasman69:
This is the code I’m using for sensors (plus the Nest one):
- platform: scrape
resource: http://192.168.1.171/weewx
name: Outside
select: ".main .card td:nth-of-type(2)"
value_template: '{{ value.split("°")[0] }}'
unit_of_measurement: °C
- platform: scrape
resource: http://192.168.1.171/weewx
name: Study
select: ".main .card tr:nth-of-type(10) td:nth-of-type(2)"
value_template: '{{ value.split("°")[0] }}'
unit_of_measurement: °C
history_graph:
gr1:
name: Temp History
entities:
- sensor.outside
- sensor.nest_thermostat_home_temperature
- sensor.study
Can you please show your config.yaml for the sensors? Also, perhaps your ui-lovelace for the history graph?
For some reason, I’m getting 2 graphs! I very much would like my two temperatures as well as the outside temp on one graph.
I’m fighting the “loft sensor” which is transmitted over MQTT as a string but, I may have that corrected.,
tom_l
February 4, 2019, 1:28am
5
One of your sensors uses F as units the other uses °F . That’s why you have two graphs. make th units the same and they will both plot on the one graph.
damn it @tom_l ! i could’ve actually answered that one!!
1 Like
PK_MO
(Pete)
February 4, 2019, 1:41am
7
I’m a bit confused as to how to do this.
In my config.yaml, I have 2 DHT sensors providing temperature. The “loft” sensor is sending information using ESP8266 / MQTT as a string. The “main level” is a DHT plugged directly into the RPi. I’ve played with the value template without success.
platform: mqtt
name: “Loft_Temperature”
state_topic: “Loft_Temperature”
unit_of_measurement: “°F”
value_template: ‘{{ float(value_json.Loft_Temperature) }}’
platform: mqtt
name: “Loft_Humidity”
state_topic: “Loft_Humidity”
value_template: ‘{{ float(value_json.Loft_Humidity) }}’
platform: dht
name: “Main Level”
sensor: DHT22
pin: 11
temperature_offset: 1.58
humidity_offset: 3.4
monitored_conditions:
Here is my ui-lovelace.yaml:
- type: history-graph
title: 'Temperature'
entities:
- sensor.loft_temperature
- sensor.main_level_temperature
unit_of_mesure: '°F'
i think the unit of measurement needs to be in your sensors.
what do the sensors say in your dev page?
PK_MO
(Pete)
February 4, 2019, 1:52am
9
Both showing °F - though I warn that my loft sensor is a DIY project & I’ve defined the units in the config.yaml.
The main level DHT sensor was achieved in this way: https://www.home-assistant.io/components/sensor.dht/
PK_MO
(Pete)
February 4, 2019, 2:36am
11
Indeed- I tried both the correct spelling of measure as well as unit_of_measurement: “°F” in ui-lovelaace.yaml.
I should note- I added a second graph for humidity which appears to work:
it definitely has something to do with your units like @tom_l mentioned. The top one is °F whereas the bottom one is just F
Another option is to try mini-graph-card
PK_MO
(Pete)
February 5, 2019, 1:58am
13
You won’t believe me… but I came back to this 24 hours later and the history graph is behaving. Can’t explain that.
i wonder if it had old data with the F only unit which has now expired (graphs are 24 hours by default?)
1 Like