Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Native support for climate entities #245

Closed
mouth4war opened this issue Jan 18, 2020 · 18 comments
Closed

Feature Request: Native support for climate entities #245

mouth4war opened this issue Jan 18, 2020 · 18 comments

Comments

@mouth4war
Copy link

mouth4war commented Jan 18, 2020

This component is great but lacks one important feature - taking a climate entity and displaying the three sensors from it - target temperature, current temperature and climate state (hvac action idle/heat/cool).

Its currently possible to define template sensors for target temperature and current temperature to use in mini-graph but not climate state. History-graph shows climate state active (heating or cooling) as shaded area under the line graph.

Native support would be perfect.

@kalkih kalkih added the feature request New feature or request label Jan 18, 2020
@maxwroc
Copy link
Contributor

maxwroc commented Apr 16, 2020

If I understand the problem correctly you can use state_map feature to render the climate state (as it is a string value right?)

@reefland
Copy link

reefland commented May 23, 2020

A state map allows you to take current state and show it as "auto, heat, cool. off" for example. However I think the ask, is to be able to get at the attributes associated with the climate entity.

For example, My climate entity climate.living_room_thermostat has the current state of cool and the following attributes:

hvac_modes: auto, heat, cool, off
min_temp: 45
max_temp: 95
fan_modes: on, auto
preset_modes: none, eco
current_temperature: 74
temperature: 77
target_temp_high: null
target_temp_low: null
current_humidity: 55
fan_mode: auto
hvac_action: idle
preset_mode: none
friendly_name: Living Room Thermostat
supported_features: 27
icon: mdi:thermometer

I've been trying to use "mini-graph-card" to plot current_temperature, temperature (the target temperature) and show when heating and cooling have been on.

This would effectively be a replacement of the ugly climate history graph card:
climate_history_graph

That could look really nice as a mini-graph-card if it could get at the attributes.

Granted you can get at some of that using other sensors, but I've not seen anything expose the target temperature or green bar (or red for heat) which would allow me to overlay temperature based on when the AC (or heat) was actually on.

@maxwroc
Copy link
Contributor

maxwroc commented May 23, 2020

Ok I got it now, make sense

@kalkih
Copy link
Owner

kalkih commented May 23, 2020

@reefland

That could look really nice as a mini-graph-card if it could get at the attributes.

Granted you can get at some of that using other sensors, but I've not seen anything expose the target temperature or green bar (or red for heat) which would allow me to overlay temperature based on when the AC (or heat) was actually on.

You could already do that by creating template sensors based on the climate entity attributes and use those sensors in the mini-graph-card as OP described, and now you could even show the state with the state_map option as Max suggested. The request as I understand it is to streamline this process and let the card populate all data automatically without the need of template sensors.

@golles
Copy link

golles commented Oct 4, 2020

I also want to join the club for this request. I think making a template sensors for each climate entity attribute is too much.
Maybe it could be achieved easier. Instead of passing entities to the card, have an option to pass an attribute of an entity. Similar to the standard entity card: https://www.home-assistant.io/lovelace/entities/#attribute

@bensuffolk
Copy link

Ok,

So in my attempt to get something working I have made 2 template sensors:

- platform: template
    front_bedroom_target_temperature:
      friendly_name: Front Bedroom Target Temperature
      unit_of_measurement: '°C'
      value_template: "{{ state_attr('climate.front_bedroom', 'temperature') }}"

    front_bedroom_heating_state:
      friendly_name: Front Bedroom Heating State
      value_template: >
        {% if is_state_attr ('climate.front_bedroom','hvac_action', 'heating') %}
        {{ state_attr('climate.front_bedroom', 'temperature') }}
        {% else %}
        0
        {% endif %}

Which along with an existing sensor..front_bedroom_temperature gives me the 3 separate sensors I'm going to need.

This is my graph configuration

    type: 'custom:mini-graph-card'
    entities:
      - entity: sensor.front_bedroom_temperature
      - entity: sensor.front_bedroom_target_temperature
        smoothing: false
      - entity: sensor.front_bedroom_heating_state
    group: true
    hours_to_show: 24
    points_per_hour: 60
    lower_bound: ~20
    refresh_interval: 0
    show:
      fill: false
      graph: line
      icon: false
      labels: true
      name: false
      state: false
      legend: false
      points: false
    upper_bound: ~22

My problems are, that if I want a nice looking smooth line for the actual temperature I need to have points_per_hour at the default 0.5, but then the target temperature does not have right angles as it changes, but diagonal lines. It really needs to have 60 points_per_hour, but then the current temperature is all steps.

I think the answer would be to be able to specify points_per_hour on a per entity basis as opposed to a per graph basis.

Secondly the lower bounds is nominally set to 20 but allowing it to go lower if needed, however it of course now goes all the way to 0, meaning there is a a big lot of nothing in the graph and the bit I really want to look at is all bunched up. So I think I need to be able to specify the lower bounds to limited to 2 of the entities (the lower of temperature and target_temperature) but not count the heating_state.

@bensuffolk
Copy link

I have updated my template for the heating state to

    front_bedroom_heating_state:
      friendly_name: Front Bedroom Heating State
      unit_of_measurement: '°C'
      value_template: >
        {% if is_state_attr ('climate.front_bedroom','hvac_action', 'heating') %}
        {{ state_attr('climate.front_bedroom', 'temperature') }}
        {% else %}
        {% if state_attr('climate.front_bedroom', 'temperature') > state_attr('climate.front_bedroom', 'current_temperature') %}
        {{ state_attr('climate.front_bedroom', 'current_temperature') }}
        {% else %}
        {{ state_attr('climate.front_bedroom', 'temperature') }}
        {% endif %}
        {% endif %}

Which limits the lower bound to the lower of the current_temperature or the target temperature, so that should stop the second issue I describe above. But I will need to wait a little for some data to find out if it works...

There is probably a better way to do the min value rather than an if statement, but 'm not really up to speed with these templates!

@makuser
Copy link

makuser commented Dec 30, 2020

+1

Is there anything we can do to help? I am also looking for such a feature, because a template sensor is no option in my case.

RomRider added a commit that referenced this issue Feb 14, 2021
* feat(attribute): Retrieve an attribute instead of the state

* Fix lint

Fixes #411, Fixes #245, Fixes #501
github-actions bot pushed a commit that referenced this issue Feb 14, 2021
# [0.11.0-dev.3](v0.11.0-dev.2...v0.11.0-dev.3) (2021-02-14)

### Features

* **attribute:** Retrieve an attribute instead of the state ([#564](#564)) ([3caafdb](3caafdb)), closes [#411](#411) [#245](#245) [#501](#501)
@github-actions
Copy link

🎉 This issue has been resolved in version 0.11.0-dev.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@mouth4war
Copy link
Author

mouth4war commented Mar 25, 2021

Not quite native support but okay.

It doesn't work for me, for some reason. Has anyone got this to work?

entities:
  - entity: climate.bedroom_ac
    attribute: current_temperature
hours_to_show: 24
refresh_interval: 0
type: 'custom:mini-graph-card'

@pvprodk
Copy link

pvprodk commented Apr 12, 2021

It doesn't work for me, for some reason. Has anyone got this to work?

Not working for me either on version 0.11.0-dev3 or 0.11.0-dev4

@kzaoaai
Copy link

kzaoaai commented Jun 30, 2021

it worked for me. All lowercase and underscores instead of spaces (like mouth4war's example).

@thecem
Copy link

thecem commented Aug 23, 2021

Following with the second line is not working and shows NaN. Even when you change current_humidity to current_temperature it show NaN. current_humidity in the first entity show the humidity.

So I think there is a problem with the second (after the first entry) graph, value.

Recorder is on....

entities:
  - entity: climate.bad
    attribute: current_temperature
    unit: °C
    state_adaptive_color: true
  - entity: climate.bad
    attribute: current_humidity
    unit: '%'
    show_state: true
    state_adaptive_color: true
    y_axis: secondary
hour24: true
points_per_hour: 1
name: Thermo
show:
  extrema: false
  fill: false
  legend: false
  name: false
  icon: false
font_size: 80
type: custom:mini-graph-card

grafik

@thecem
Copy link

thecem commented Aug 23, 2021

If you need more logs let me know... installed ist dev4

@Depechie
Copy link

Depechie commented Dec 5, 2021

it worked for me. All lowercase and underscores instead of spaces (like mouth4war's example).

@mouth4war did you figure this out? I'm still getting NaN for my climate current_temperature...

@Corneloues
Copy link

@reefland

That could look really nice as a mini-graph-card if it could get at the attributes.
Granted you can get at some of that using other sensors, but I've not seen anything expose the target temperature or green bar (or red for heat) which would allow me to overlay temperature based on when the AC (or heat) was actually on.

You could already do that by creating template sensors based on the climate entity attributes and use those sensors in the mini-graph-card as OP described, and now you could even show the state with the state_map option as Max suggested. The request as I understand it is to streamline this process and let the card populate all data automatically without the need of template sensors.

I have 10 TRV's, plus the thermostat itself. So you expect me to create 33 template sensors?

jlsjonas pushed a commit that referenced this issue Jan 22, 2022
# [0.11.0-dev.3](v0.11.0-dev.2...v0.11.0-dev.3) (2021-02-14)

### Features

* **attribute:** Retrieve an attribute instead of the state ([#564](#564)) ([3caafdb](3caafdb)), closes [#411](#411) [#245](#245) [#501](#501)
github-actions bot pushed a commit that referenced this issue Jan 22, 2022
# [0.11.0](v0.10.0...v0.11.0) (2022-01-22)

### Bug Fixes

* **config:** Remove entity config error [#592](#592) ([#593](#593)) ([53d923a](53d923a))
* display a warning if entity is not available ([#545](#545)) ([a334b84](a334b84)), closes [#487](#487)
* Fix undefined variable introduced by [#545](#545) ([9e923f5](9e923f5))
* Support for `fire-dom-event` ([c29f55f](c29f55f)), closes [#563](#563)
* **log:** color_thresholds render incorectly with logaritmic on ([#542](#542)) ([b704885](b704885)), closes [#531](#531)
* icon will properly follow entity's device_class [[#484](#484)] ([2f9e0a7](2f9e0a7))
* Time would sometime display 24:xx instead of 00:xx [[#536](#536)] ([7c7d921](7c7d921))

### Features

* Interpolate color threshold stops ([#596](#596)) ([3826c0d](3826c0d))
* **attribute:** Retrieve an attribute instead of the state ([#564](#564)) ([708bfde](708bfde)), closes [#411](#411) [#245](#245) [#501](#501)
* **graph:** Add median aggregate function ([#521](#521)) ([57219bd](57219bd))
* Format numbers according to selected language [[#495](#495) [#509](#509)] ([5785bd8](5785bd8))
@github-actions
Copy link

🎉 This issue has been resolved in version 0.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@fhaust
Copy link

fhaust commented Feb 2, 2023

Just to put my 2 cents in: I too think that this is not really solved by adding a template sensor for each climate entry.

github-actions bot pushed a commit to Malow/mini-graph-card that referenced this issue Nov 18, 2023
# 1.0.0 (2023-11-18)

### Bug Fixes

* **config:** Remove entity config error [kalkih#592](https://github.com/malow/mini-graph-card/issues/592) ([kalkih#593](https://github.com/malow/mini-graph-card/issues/593)) ([53d923a](53d923a))
* **stalebot:** issues should also use exemptLabels ([4d74c1f](4d74c1f))
* display a warning if entity is not available ([kalkih#545](https://github.com/malow/mini-graph-card/issues/545)) ([a334b84](a334b84)), closes [kalkih#487](https://github.com/malow/mini-graph-card/issues/487)
* Fix undefined variable introduced by [kalkih#545](https://github.com/malow/mini-graph-card/issues/545) ([9e923f5](9e923f5))
* Support for `fire-dom-event` ([c29f55f](c29f55f)), closes [kalkih#563](https://github.com/malow/mini-graph-card/issues/563)
* **log:** color_thresholds render incorectly with logaritmic on ([kalkih#542](https://github.com/malow/mini-graph-card/issues/542)) ([b704885](b704885)), closes [kalkih#531](https://github.com/malow/mini-graph-card/issues/531)
* icon will properly follow entity's device_class [[kalkih#484](https://github.com/malow/mini-graph-card/issues/484)] ([2f9e0a7](2f9e0a7))
* Time would sometime display 24:xx instead of 00:xx [[kalkih#536](https://github.com/malow/mini-graph-card/issues/536)] ([7c7d921](7c7d921))

### Features

* Interpolate color threshold stops ([kalkih#596](https://github.com/malow/mini-graph-card/issues/596)) ([3826c0d](3826c0d))
* **attribute:** Retrieve an attribute instead of the state ([kalkih#564](https://github.com/malow/mini-graph-card/issues/564)) ([708bfde](708bfde)), closes [kalkih#411](https://github.com/malow/mini-graph-card/issues/411) [kalkih#245](https://github.com/malow/mini-graph-card/issues/245) [kalkih#501](https://github.com/malow/mini-graph-card/issues/501)
* **graph:** Add median aggregate function ([kalkih#521](https://github.com/malow/mini-graph-card/issues/521)) ([57219bd](57219bd))
* Format numbers according to selected language [[kalkih#495](https://github.com/malow/mini-graph-card/issues/495) [kalkih#509](https://github.com/malow/mini-graph-card/issues/509)] ([5785bd8](5785bd8))
github-actions bot pushed a commit to Malow/mini-graph-card that referenced this issue Nov 18, 2023
# 1.0.0 (2023-11-18)

### Bug Fixes

* **config:** Remove entity config error [kalkih#592](https://github.com/malow/mini-graph-card/issues/592) ([kalkih#593](https://github.com/malow/mini-graph-card/issues/593)) ([53d923a](53d923a))
* **stalebot:** issues should also use exemptLabels ([4d74c1f](4d74c1f))
* display a warning if entity is not available ([kalkih#545](https://github.com/malow/mini-graph-card/issues/545)) ([a334b84](a334b84)), closes [kalkih#487](https://github.com/malow/mini-graph-card/issues/487)
* Fix undefined variable introduced by [kalkih#545](https://github.com/malow/mini-graph-card/issues/545) ([9e923f5](9e923f5))
* Support for `fire-dom-event` ([c29f55f](c29f55f)), closes [kalkih#563](https://github.com/malow/mini-graph-card/issues/563)
* **log:** color_thresholds render incorectly with logaritmic on ([kalkih#542](https://github.com/malow/mini-graph-card/issues/542)) ([b704885](b704885)), closes [kalkih#531](https://github.com/malow/mini-graph-card/issues/531)
* icon will properly follow entity's device_class [[kalkih#484](https://github.com/malow/mini-graph-card/issues/484)] ([2f9e0a7](2f9e0a7))
* Time would sometime display 24:xx instead of 00:xx [[kalkih#536](https://github.com/malow/mini-graph-card/issues/536)] ([7c7d921](7c7d921))

### Features

* Interpolate color threshold stops ([kalkih#596](https://github.com/malow/mini-graph-card/issues/596)) ([3826c0d](3826c0d))
* **attribute:** Retrieve an attribute instead of the state ([kalkih#564](https://github.com/malow/mini-graph-card/issues/564)) ([708bfde](708bfde)), closes [kalkih#411](https://github.com/malow/mini-graph-card/issues/411) [kalkih#245](https://github.com/malow/mini-graph-card/issues/245) [kalkih#501](https://github.com/malow/mini-graph-card/issues/501)
* **graph:** Add median aggregate function ([kalkih#521](https://github.com/malow/mini-graph-card/issues/521)) ([57219bd](57219bd))
* Format numbers according to selected language [[kalkih#495](https://github.com/malow/mini-graph-card/issues/495) [kalkih#509](https://github.com/malow/mini-graph-card/issues/509)] ([5785bd8](5785bd8))
github-actions bot pushed a commit to Malow/mini-graph-card that referenced this issue Nov 18, 2023
# 1.0.0 (2023-11-18)

### Bug Fixes

* **config:** Remove entity config error [kalkih#592](https://github.com/malow/mini-graph-card/issues/592) ([kalkih#593](https://github.com/malow/mini-graph-card/issues/593)) ([53d923a](53d923a))
* **stalebot:** issues should also use exemptLabels ([4d74c1f](4d74c1f))
* display a warning if entity is not available ([kalkih#545](https://github.com/malow/mini-graph-card/issues/545)) ([a334b84](a334b84)), closes [kalkih#487](https://github.com/malow/mini-graph-card/issues/487)
* Fix undefined variable introduced by [kalkih#545](https://github.com/malow/mini-graph-card/issues/545) ([9e923f5](9e923f5))
* Support for `fire-dom-event` ([c29f55f](c29f55f)), closes [kalkih#563](https://github.com/malow/mini-graph-card/issues/563)
* **log:** color_thresholds render incorectly with logaritmic on ([kalkih#542](https://github.com/malow/mini-graph-card/issues/542)) ([b704885](b704885)), closes [kalkih#531](https://github.com/malow/mini-graph-card/issues/531)
* icon will properly follow entity's device_class [[kalkih#484](https://github.com/malow/mini-graph-card/issues/484)] ([2f9e0a7](2f9e0a7))
* Time would sometime display 24:xx instead of 00:xx [[kalkih#536](https://github.com/malow/mini-graph-card/issues/536)] ([7c7d921](7c7d921))

### Features

* Interpolate color threshold stops ([kalkih#596](https://github.com/malow/mini-graph-card/issues/596)) ([3826c0d](3826c0d))
* **attribute:** Retrieve an attribute instead of the state ([kalkih#564](https://github.com/malow/mini-graph-card/issues/564)) ([708bfde](708bfde)), closes [kalkih#411](https://github.com/malow/mini-graph-card/issues/411) [kalkih#245](https://github.com/malow/mini-graph-card/issues/245) [kalkih#501](https://github.com/malow/mini-graph-card/issues/501)
* **graph:** Add median aggregate function ([kalkih#521](https://github.com/malow/mini-graph-card/issues/521)) ([57219bd](57219bd))
* Format numbers according to selected language [[kalkih#495](https://github.com/malow/mini-graph-card/issues/495) [kalkih#509](https://github.com/malow/mini-graph-card/issues/509)] ([5785bd8](5785bd8))
github-actions bot pushed a commit to motorlatitude/mini-graph-card that referenced this issue Dec 15, 2024
# 1.0.0 (2024-12-15)

### Bug Fixes

* add first datapoint tooltip for line graph ([kalkih#882](https://github.com/motorlatitude/mini-graph-card/issues/882)) ([7576fe6](7576fe6))
* allow zero tooltip ([057a395](057a395)), closes [kalkih#805](https://github.com/motorlatitude/mini-graph-card/issues/805)
* cards would always assume icon_image was set ([kalkih#957](https://github.com/motorlatitude/mini-graph-card/issues/957)) ([f376732](f376732))
* display a warning if entity is not available ([kalkih#545](https://github.com/motorlatitude/mini-graph-card/issues/545)) ([a334b84](a334b84)), closes [kalkih#487](https://github.com/motorlatitude/mini-graph-card/issues/487)
* drop out-of-bound coords in reducer ([kalkih#881](https://github.com/motorlatitude/mini-graph-card/issues/881)) ([527f005](527f005)), closes [kalkih#251](https://github.com/motorlatitude/mini-graph-card/issues/251)
* Fix undefined variable introduced by [kalkih#545](https://github.com/motorlatitude/mini-graph-card/issues/545) ([9e923f5](9e923f5))
* icon will properly follow entity's device_class [[kalkih#484](https://github.com/motorlatitude/mini-graph-card/issues/484)] ([2f9e0a7](2f9e0a7))
* retain the last out-of-bounds state ([kalkih#961](https://github.com/motorlatitude/mini-graph-card/issues/961)) ([8ebe173](8ebe173)), closes [kalkih#881](https://github.com/motorlatitude/mini-graph-card/issues/881) [kalkih#960](https://github.com/motorlatitude/mini-graph-card/issues/960)
* Support for `fire-dom-event` ([c29f55f](c29f55f)), closes [kalkih#563](https://github.com/motorlatitude/mini-graph-card/issues/563)
* tooltip interval start could be after end ([kalkih#1065](https://github.com/motorlatitude/mini-graph-card/issues/1065)) ([930ee39](930ee39)), closes [kalkih#181](https://github.com/motorlatitude/mini-graph-card/issues/181)
* **config:** Remove entity config error [kalkih#592](https://github.com/motorlatitude/mini-graph-card/issues/592) ([kalkih#593](https://github.com/motorlatitude/mini-graph-card/issues/593)) ([53d923a](53d923a))
* **documentation:** enquote html color ([dbdeab8](dbdeab8)), closes [kalkih#872](https://github.com/motorlatitude/mini-graph-card/issues/872)
* **log:** color_thresholds render incorectly with logaritmic on ([kalkih#542](https://github.com/motorlatitude/mini-graph-card/issues/542)) ([b704885](b704885)), closes [kalkih#531](https://github.com/motorlatitude/mini-graph-card/issues/531)
* **stalebot:** issues should also use exemptLabels ([4d74c1f](4d74c1f))
* **workflows:** remove invalid description field ([e755e24](e755e24))
* Time would sometime display 24:xx instead of 00:xx [[kalkih#536](https://github.com/motorlatitude/mini-graph-card/issues/536)] ([7c7d921](7c7d921))

### Features

* Add support of attribute tree when available ([kalkih#996](https://github.com/motorlatitude/mini-graph-card/issues/996)) ([9c1c31e](9c1c31e))
* Interpolate color threshold stops ([kalkih#596](https://github.com/motorlatitude/mini-graph-card/issues/596)) ([3826c0d](3826c0d))
* pull two years worth of changes into release channel ([f5fb98d](f5fb98d)), closes [kalkih#1059](https://github.com/motorlatitude/mini-graph-card/issues/1059)
* **attribute:** Retrieve an attribute instead of the state ([kalkih#564](https://github.com/motorlatitude/mini-graph-card/issues/564)) ([708bfde](708bfde)), closes [kalkih#411](https://github.com/motorlatitude/mini-graph-card/issues/411) [kalkih#245](https://github.com/motorlatitude/mini-graph-card/issues/245) [kalkih#501](https://github.com/motorlatitude/mini-graph-card/issues/501)
* **graph:** Add median aggregate function ([kalkih#521](https://github.com/motorlatitude/mini-graph-card/issues/521)) ([57219bd](57219bd))
* **option:** override icon with an image URL ([kalkih#789](https://github.com/motorlatitude/mini-graph-card/issues/789)) ([2860a09](2860a09))
* Format numbers according to selected language [[kalkih#495](https://github.com/motorlatitude/mini-graph-card/issues/495) [kalkih#509](https://github.com/motorlatitude/mini-graph-card/issues/509)] ([5785bd8](5785bd8))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests