tj1816
(TJ )
January 26, 2022, 4:29pm
1
I’m just starting to use templates so maybe I’m doing something wrong…
I’m trying to graph outside and inside temperature with a History Graph card.
I had to make a template for the sensors using weather.home (outside temp) and climate.thermostat (inside temp)
- platform: template
sensors:
current_outside_temperature:
friendly_name: Current Outside Temperature
value_template: "{{ state_attr('weather.home','temperature') }}"
unit_of_measurement: "°F"
current_inside_temperature:
friendly_name: Current Inside Temperature
value_template: "{{ state_attr('climate.thermostat','current_temperature') }}"
unit_of_measurement: "°F"
Both units are in °F but when I graph them, the Inside Temperature is using % and Outside Temperature is using °F.
When I originally made the template I think I accidentally had the unit for Inside Temperature as % (I had copied the code from a humidity sensor), but I have since fixed it and restarted HA.
Any ideas?
Nick4
(Nick)
January 27, 2022, 12:45am
2
Try this:
- platform: template
sensors:
current_outside_temperature:
friendly_name: Current Outside Temperature
value_template: "{{ state_attr('weather.home','temperature') }}"
unit_of_measurement: "°F"
- platform: template
sensors:
current_inside_temperature:
friendly_name: Current Inside Temperature
value_template: "{{ state_attr('climate.thermostat','current_temperature') }}"
unit_of_measurement: "°F"
nickrout
(Nick Rout)
January 27, 2022, 1:09am
3
For the one showing %, it is probably the first entries in your database use %, and applies it to any graph.
You can delete them via sql, or wait for them to drop out of the database after your purge_keep_days
expires.
zoogara
(Daryl)
January 27, 2022, 3:20am
4
I also find I have more control over my graphs using this:
Hi folks,
I’ve built a new card to display some graphs in Lovelace . It is in its early stage and is not meant to replace the mini-graph-card at all.
It gives some new possibilities to display data in Home-Assistant and has some extensive customizability.
It is based on ApexChartsJS , and you’ll find all kind of examples of what you could build over here
[Image]
Usage
stable releases documentation can be found here
beta/dev releases documentation ca…
nickrout
(Nick Rout)
January 27, 2022, 3:56am
5
That will not solve the problem.